Trevixal API
    Preparing search index...

    Class Transaction

    An ordered list of steps applied to a document, plus selection, stored marks and metadata. Build one via state.tr, then dispatch it.

    Implements

    Index
    docs: EditorNode[] = []

    The document before each step, parallel to steps.

    steps: Step[] = []
    time: number = ...

    Creation time, used by the undo history for grouping.

    • get docChanged(): boolean

      Returns boolean

    • get selection(): Selection

      The selection after this transaction: the explicitly set one (remapped through any later steps), or the input selection mapped through all steps.

      Returns Selection

    • get storedMarks(): readonly Mark[] | null

      Returns readonly Mark[] | null

    • Parameters

      • key: string

      Returns unknown

    • Apply a step; returns false (leaving the transaction untouched) on failure.

      Parameters

      Returns boolean

    • Every metadata key set on this transaction, in the order it was set.

      For the one caller that has to hand a transaction's whole provenance on: a dispatch transform that replaces a transaction with a different one (suggestion mode rewriting an edit, say) drops every key the original carried unless it copies them, and the keys it does not know about are exactly the ones it cannot afford to guess at. A replay guard silently lost is an editing loop.

      Returns readonly string[]

    • Parameters

      • key: string
      • value: unknown

      Returns this

    • Parameters

      Returns this

    • Parameters

      • marks: readonly Mark[] | null

      Returns this

    • Apply a step; throws on failure.

      Parameters

      Returns this