Editor
interface Editor {
children: Node[]
selection: Range | null
operations: Operation[]
marks: Omit<Text, 'text'> | null
// Schema-specific node behaviors.
isInline: (element: Element) => boolean
isVoid: (element: Element) => boolean
markableVoid: (element: Element) => boolean
normalizeNode: (entry: NodeEntry) => void
onChange: (options?: { operation?: Operation }) => void
// Overrideable core actions.
addMark: (key: string, value: any) => void
apply: (operation: Operation) => void
deleteBackward: (unit: 'character' | 'word' | 'line' | 'block') => void
deleteForward: (unit: 'character' | 'word' | 'line' | 'block') => void
deleteFragment: () => void
insertBreak: () => void
insertFragment: (fragment: Node[]) => void
insertNode: (node: Node) => void
insertText: (text: string) => void
removeMark: (key: string) => void
}Instantiation methods
createEditor() => Editor
createEditor() => EditorStatic methods
Retrieval methods
Editor.above<T extends Ancestor>(editor: Editor, options?) => NodeEntry<T> | undefined
Editor.above<T extends Ancestor>(editor: Editor, options?) => NodeEntry<T> | undefinedEditor.after(editor: Editor, at: Location, options?) => Point | undefined
Editor.after(editor: Editor, at: Location, options?) => Point | undefinedEditor.before(editor: Editor, at: Location, options?) => Point | undefined
Editor.before(editor: Editor, at: Location, options?) => Point | undefinedEditor.edges(editor: Editor, at: Location) => [Point, Point]
Editor.edges(editor: Editor, at: Location) => [Point, Point]Editor.end(editor: Editor, at: Location) => Point
Editor.end(editor: Editor, at: Location) => PointEditor.first(editor: Editor, at: Location) => NodeEntry
Editor.first(editor: Editor, at: Location) => NodeEntryEditor.fragment(editor: Editor, at: Location) => Descendant[]
Editor.fragment(editor: Editor, at: Location) => Descendant[]Editor.last(editor: Editor, at: Location) => NodeEntry
Editor.last(editor: Editor, at: Location) => NodeEntryEditor.leaf(editor: Editor, at: Location, options?) => NodeEntry
Editor.leaf(editor: Editor, at: Location, options?) => NodeEntryEditor.levels<T extends Node>(editor: Editor, options?) => Generator<NodeEntry<T>, void, undefined>
Editor.levels<T extends Node>(editor: Editor, options?) => Generator<NodeEntry<T>, void, undefined>Editor.marks(editor: Editor) => Omit<Text, 'text'> | null
Editor.marks(editor: Editor) => Omit<Text, 'text'> | nullEditor.next<T extends Descendant>(editor: Editor, options?) => NodeEntry<T> | undefined
Editor.next<T extends Descendant>(editor: Editor, options?) => NodeEntry<T> | undefinedEditor.node(editor: Editor, at: Location, options?) => NodeEntry
Editor.node(editor: Editor, at: Location, options?) => NodeEntryEditor.nodes<T extends Node>(editor: Editor, options?) => Generator<NodeEntry<T>, void, undefined>
Editor.nodes<T extends Node>(editor: Editor, options?) => Generator<NodeEntry<T>, void, undefined>Editor.parent(editor: Editor, at: Location, options?) => NodeEntry<Ancestor>
Editor.parent(editor: Editor, at: Location, options?) => NodeEntry<Ancestor>Editor.path(editor: Editor, at: Location, options?) => Path
Editor.path(editor: Editor, at: Location, options?) => PathEditor.point(editor: Editor, at: Location, options?) => Point
Editor.point(editor: Editor, at: Location, options?) => PointEditor.positions(editor: Editor, options?) => Generator<Point, void, undefined>
Editor.positions(editor: Editor, options?) => Generator<Point, void, undefined>Editor.previous<T extends Node>(editor: Editor, options?) => NodeEntry<T> | undefined
Editor.previous<T extends Node>(editor: Editor, options?) => NodeEntry<T> | undefinedEditor.range(editor: Editor, at: Location, to?: Location) => Range
Editor.range(editor: Editor, at: Location, to?: Location) => RangeEditor.start(editor: Editor, at: Location) => Point
Editor.start(editor: Editor, at: Location) => PointEditor.string(editor: Editor, at: Location, options?) => string
Editor.string(editor: Editor, at: Location, options?) => stringEditor.void(editor: Editor, options?) => NodeEntry<Element> | undefined
Editor.void(editor: Editor, options?) => NodeEntry<Element> | undefinedManipulation methods
Editor.addMark(editor: Editor, key: string, value: any) => void
Editor.addMark(editor: Editor, key: string, value: any) => voidEditor.deleteBackward(editor: Editor, options?) => void
Editor.deleteBackward(editor: Editor, options?) => voidEditor.deleteForward(editor: Editor, options?) => void
Editor.deleteForward(editor: Editor, options?) => voidEditor.deleteFragment(editor: Editor) => void
Editor.deleteFragment(editor: Editor) => voidEditor.insertBreak(editor: Editor) => void
Editor.insertBreak(editor: Editor) => voidEditor.insertSoftBreak(editor: Editor) => void
Editor.insertSoftBreak(editor: Editor) => voidEditor.insertFragment(editor: Editor, fragment: Node[], options?) => void
Editor.insertFragment(editor: Editor, fragment: Node[], options?) => voidEditor.insertNode(editor: Editor, node: Node, options?) => void
Editor.insertNode(editor: Editor, node: Node, options?) => voidEditor.insertText(editor: Editor, text: string, options?) => void
Editor.insertText(editor: Editor, text: string, options?) => voidEditor.removeMark(editor: Editor, key: string) => void
Editor.removeMark(editor: Editor, key: string) => voidEditor.unhangRange(editor: Editor, range: Range, options?) => Range
Editor.unhangRange(editor: Editor, range: Range, options?) => RangeCheck methods
Editor.hasBlocks(editor: Editor, element: Element) => boolean
Editor.hasBlocks(editor: Editor, element: Element) => booleanEditor.hasInlines(editor: Editor, element: Element) => boolean
Editor.hasInlines(editor: Editor, element: Element) => booleanEditor.hasTexts(editor: Editor, element: Element) => boolean
Editor.hasTexts(editor: Editor, element: Element) => booleanEditor.isBlock(editor: Editor, value: any) => value is Element
Editor.isBlock(editor: Editor, value: any) => value is ElementEditor.isEditor(value: any) => value is Editor
Editor.isEditor(value: any) => value is EditorEditor.isEnd(editor: Editor, point: Point, at: Location) => boolean
Editor.isEnd(editor: Editor, point: Point, at: Location) => booleanEditor.isEdge(editor: Editor, point: Point, at: Location) => boolean
Editor.isEdge(editor: Editor, point: Point, at: Location) => booleanEditor.isEmpty(editor: Editor, element: Element) => boolean
Editor.isEmpty(editor: Editor, element: Element) => booleanEditor.isInline(editor: Editor, value: any) => value is Element
Editor.isInline(editor: Editor, value: any) => value is ElementEditor.isNormalizing(editor: Editor) => boolean
Editor.isNormalizing(editor: Editor) => booleanEditor.isStart(editor: Editor, point: Point, at: Location) => boolean
Editor.isStart(editor: Editor, point: Point, at: Location) => booleanEditor.isVoid(editor: Editor, value: any) => value is Element
Editor.isVoid(editor: Editor, value: any) => value is ElementNormalization methods
Editor.normalize(editor: Editor, options?) => void
Editor.normalize(editor: Editor, options?) => voidEditor.withoutNormalizing(editor: Editor, fn: () => void) => void
Editor.withoutNormalizing(editor: Editor, fn: () => void) => voidRef Methods
Editor.pathRef(editor: Editor, path: Path, options?) => PathRef
Editor.pathRef(editor: Editor, path: Path, options?) => PathRefEditor.pathRefs(editor: Editor) => Set<PathRef>
Editor.pathRefs(editor: Editor) => Set<PathRef>Editor.pointRef(editor: Editor, point: Point, options?) => PointRef
Editor.pointRef(editor: Editor, point: Point, options?) => PointRefEditor.pointRefs(editor: Editor) => Set<PointRef>
Editor.pointRefs(editor: Editor) => Set<PointRef>Editor.rangeRef(editor: Editor, range: Range, options?) => RangeRef
Editor.rangeRef(editor: Editor, range: Range, options?) => RangeRefEditor.rangeRefs(editor: Editor) => Set<RangeRef>
Editor.rangeRefs(editor: Editor) => Set<RangeRef>Instance Methods
Schema-specific instance methods to override
Element type methods
isInline(element: Element) => boolean
isInline(element: Element) => booleanisVoid(element: Element) => boolean
isVoid(element: Element) => booleanNormalize methods
normalizeNode(entry: NodeEntry, { operation, fallbackElement }) => void
normalizeNode(entry: NodeEntry, { operation, fallbackElement }) => voidshouldNormalize: (options) => boolean
shouldNormalize: (options) => booleanCallback method
onChange(options?: { operation?: Operation }) => void
onChange(options?: { operation?: Operation }) => voidMark methods
markableVoid: (element: Element) => boolean
markableVoid: (element: Element) => booleanaddMark(key: string, value: any) => void
addMark(key: string, value: any) => voidremoveMark(key: string) => void
removeMark(key: string) => voidgetFragment method
getFragment() => Descendant[]
getFragment() => Descendant[]Delete methods
deleteBackward(options?: {unit?: 'character' | 'word' | 'line' | 'block'}) => void
deleteBackward(options?: {unit?: 'character' | 'word' | 'line' | 'block'}) => voiddeleteForward(options?: {unit?: 'character' | 'word' | 'line' | 'block'}) => void
deleteForward(options?: {unit?: 'character' | 'word' | 'line' | 'block'}) => voiddeleteFragment() => void
deleteFragment() => voidInsert methods
insertFragment(fragment: Node[]) => void
insertFragment(fragment: Node[]) => voidinsertBreak() => void
insertBreak() => voidinsertSoftBreak() => void
insertSoftBreak() => voidinsertNode(node: Node) => void
insertNode(node: Node) => voidinsertText(text: string) => void
insertText(text: string) => voidOperation handling method
apply(operation: Operation) => void
apply(operation: Operation) => voidLast updated