fn

createWritekitState

tested

Build the initial writekit state: normalize the document against the schema and ensure it has at least one editable block to place the caret in.

Signature

ts
export function createWritekitState(options: CreateWritekitStateOptions): WritekitState{ ... }

Parameters

ParameterTypeDescription
optionsCreateWritekitStateOptions

Returns

WritekitState
PropertyTypeDescription
docWritekitDocument
selectionSelection
schemaSchema
registryRegistry
storedMarksMarks | nullMarks to apply to the next typed character (toggle-before-type).