mdz_stream_state.svelte.ts

Reactive state for the mdz streaming renderer.

Maintains a reactive tree of MdzStreamNode objects that Svelte 5 can efficiently update. Opcodes from MdzStreamParser are applied via apply() or apply_batch(), mutating the tree in place.

Declarations
#

2 declarations

view source

MdzStreamNode
#

mdz_stream_state.svelte.ts view source

import {MdzStreamNode} from '@fuzdev/fuz_ui/mdz_stream_state.svelte.js';

A reactive node in the stream renderer tree. Fields are $state so Svelte re-renders only what changes.

id

type MdzNodeId

type

type MdzNodeType

content

type string

$state

children

type Array<MdzStreamNode>

$state

level?

type number

reference?

type string

$state

link_type?

type string

$state

name?

type string

lang?

type string | null

heading_id?

type string

$state

constructor

type new (id: number, type: MdzNodeType): MdzStreamNode

id

type number

type

MdzStreamState
#

mdz_stream_state.svelte.ts view source

import {MdzStreamState} from '@fuzdev/fuz_ui/mdz_stream_state.svelte.js';

Reactive state manager for streaming mdz content. Apply opcodes to incrementally build and update the render tree.

root

type Array<MdzStreamNode>

$state

apply

Apply a single opcode.

type (opcode: MdzOpcode): void

opcode

returns void

apply_batch

Apply a batch of opcodes.

type (opcodes: MdzOpcode[]): void

opcodes

type MdzOpcode[]
returns void

Depends on
#

Imported by
#