Skip to content

Editor

Editor = object

Defined in: packages/editor/src/editor.ts:38

dom: EditorDom

Defined in: packages/editor/src/editor.ts:39


getSnapshot: () => EditorSnapshot

Defined in: packages/editor/src/editor.ts:40

EditorSnapshot


on: ActorRef<Snapshot<unknown>, EventObject, EditorEmittedEvent>["on"]

Defined in: packages/editor/src/editor.ts:73


registerBehavior: (config) => () => void

Defined in: packages/editor/src/editor.ts:44

Behavior

(): void

void


registerContainer: (container) => () => void

Defined in: packages/editor/src/editor.ts:54

Register an editable container by _type, marking the array field named in childField as editable child content. Optional of carries nested registrations that override how immediate children of this container render. Returns a function that unregisters the container when called.

Container

(): void

void


registerLeaf: (leaf) => () => void

Defined in: packages/editor/src/editor.ts:62

Register a leaf renderer for a span, inline object, or void block object by _type. Returns a function that unregisters the leaf when called.

Leaf

(): void

void


registerTextBlock: (textBlock) => () => void

Defined in: packages/editor/src/editor.ts:71

Register a text-block renderer. There is one text-block type per editor ('block'); registering replaces the engine’s default text-block wrapper with consumer-provided JSX. Returns a function that unregisters the text-block when called.

TextBlock

(): void

void


send: (event) => void

Defined in: packages/editor/src/editor.ts:72

EditorEvent

void

subscribe(observer): object

Defined in: packages/editor/src/editor.ts:84

Subscribe to editor state changes. The observer’s next callback fires with the current EditorSnapshot on every relevant transition (selection updates, content mutations, behavior dispatch, configuration changes).

The editor has no terminal state and no error path, so error and complete are part of the observable contract but never fire. They are kept for structural compatibility with useSyncExternalStore, @xstate/react’s useSelector, and other observer-shaped consumers.

() => void

(err) => void

(snapshot) => void

object

unsubscribe: () => void

void