R
fn

applyStep

tested

Apply a single step to a document, returning the next document and the exact inverse step (so undo is correct by construction). Pure: never mutates input. If the addressed block is missing the step is a no-op (defends against remote steps referencing concurrently-removed blocks).

Signature

ts
export function applyStep(doc: EditorDocument, step: Step, schema: Schema): StepResult{ ... }

Parameters

ParameterTypeDescription
docEditorDocument
stepStep
schemaSchema

Returns

StepResult