TextbufferEngine
Text lives only in the piece table. Runs compress implicit right-child chains.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TextbufferEngine(
buffer?):TextbufferEngine
Bootstrap accepts a fresh, identity-enabled snapshot with one contiguous ID run.
Parameters
Section titled “Parameters”buffer?
Section titled “buffer?”PieceTableTreeSnapshot
Returns
Section titled “Returns”TextbufferEngine
Methods
Section titled “Methods”apply()
Section titled “apply()”apply(
envelope):void
Applies text edits and atomic effect states, retaining provenance in snapshots.
Parameters
Section titled “Parameters”envelope
Section titled “envelope”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”author()
Section titled “author()”author(
edit,context):Envelope
Author against the current projection, reserve IDs once, and leave text unchanged.
Parameters
Section titled “Parameters”context
Section titled “context”Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”changesBetween()
Section titled “changesBetween()”changesBetween(
snapshot):PieceTableEdit[]
Parameters
Section titled “Parameters”snapshot
Section titled “snapshot”Returns
Section titled “Returns”PieceTableEdit[]
Implementation of
Section titled “Implementation of”characters()
Section titled “characters()”characters(): readonly
CharacterIdentity[]
Diagnostic inventory sorted by bunch/counter; hidden IDs retain their visible gap.
Returns
Section titled “Returns”readonly CharacterIdentity[]
Implementation of
Section titled “Implementation of”effectActive()
Section titled “effectActive()”effectActive(
id):boolean
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
origins()
Section titled “origins()”origins(
offset):object
Parameters
Section titled “Parameters”offset
Section titled “offset”number
Returns
Section titled “Returns”object
originLeft
Section titled “originLeft”
readonlyoriginLeft:LeftOrigin
originRight
Section titled “originRight”
readonlyoriginRight:RightOrigin
projectEffects()
Section titled “projectEffects()”projectEffects(
effects):TextbufferSnapshot
A local review snapshot with selected effect states; the live engine and log stay unchanged.
Parameters
Section titled “Parameters”effects
Section titled “effects”readonly Effect[]
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”restore()
Section titled “restore()”restore(
snapshot):void
Parameters
Section titled “Parameters”snapshot
Section titled “snapshot”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”snapshot()
Section titled “snapshot()”snapshot():
TextbufferSnapshot
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”text()
Section titled “text()”text():
string
Returns
Section titled “Returns”string
Implementation of
Section titled “Implementation of”visibleOffset()
Section titled “visibleOffset()”visibleOffset(
id):number|null
Parameters
Section titled “Parameters”Returns
Section titled “Returns”number | null