Engine
Snapshots are immutable and reusable; the engine owns their representation.
Type Parameters
Section titled “Type Parameters”Snapshot
Section titled “Snapshot”Snapshot = unknown
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
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”changesBetween()
Section titled “changesBetween()”changesBetween(
snapshot): readonlyEffectiveEdit[]
Parameters
Section titled “Parameters”snapshot
Section titled “snapshot”Snapshot
Returns
Section titled “Returns”readonly EffectiveEdit[]
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[]
projectEffects()
Section titled “projectEffects()”projectEffects(
effects):Snapshot
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”Snapshot
restore()
Section titled “restore()”restore(
snapshot):void
Parameters
Section titled “Parameters”snapshot
Section titled “snapshot”Snapshot
Returns
Section titled “Returns”void
snapshot()
Section titled “snapshot()”snapshot():
Snapshot
Returns
Section titled “Returns”Snapshot
text()
Section titled “text()”text():
string
Returns
Section titled “Returns”string