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: WritekitDocument, step: Step, schema: Schema): StepResult{ ... }

Parameters

ParameterTypeDescription
docWritekitDocument
stepStep
schemaSchema

Returns

StepResult
PropertyTypeDescription
docWritekitDocument
invertedStep