Skip to main content

Class: EditorState

lexical.EditorState

Constructors

constructor

new EditorState(nodeMap, selection?)

Parameters

NameType
nodeMapNodeMap
selection?null | BaseSelection

Defined in

packages/lexical/src/LexicalEditorState.ts:99

Properties

_flushSync

_flushSync: boolean

Defined in

packages/lexical/src/LexicalEditorState.ts:96


_nodeMap

_nodeMap: NodeMap

Defined in

packages/lexical/src/LexicalEditorState.ts:94


_readOnly

_readOnly: boolean

Defined in

packages/lexical/src/LexicalEditorState.ts:97


_selection

_selection: null | BaseSelection

Defined in

packages/lexical/src/LexicalEditorState.ts:95

Methods

clone

clone(selection?): EditorState

Parameters

NameType
selection?null | BaseSelection

Returns

EditorState

Defined in

packages/lexical/src/LexicalEditorState.ts:114


isEmpty

isEmpty(): boolean

Returns

boolean

Defined in

packages/lexical/src/LexicalEditorState.ts:106


read

read<V>(callbackFn): V

Type parameters

Name
V

Parameters

NameType
callbackFn() => V

Returns

V

Defined in

packages/lexical/src/LexicalEditorState.ts:110


toJSON

toJSON(): SerializedEditorState<SerializedLexicalNode>

Returns

SerializedEditorState<SerializedLexicalNode>

Defined in

packages/lexical/src/LexicalEditorState.ts:123