Skip to main content

Class: EditorState

lexical.EditorState

Constructors

constructor

new EditorState(nodeMap, selection?)

Parameters

NameType
nodeMapNodeMap
selection?null | RangeSelection | NodeSelection | GridSelection

Defined in

lexical/src/LexicalEditorState.ts:79

Properties

_flushSync

_flushSync: boolean

Defined in

lexical/src/LexicalEditorState.ts:76


_nodeMap

_nodeMap: NodeMap

Defined in

lexical/src/LexicalEditorState.ts:74


_readOnly

_readOnly: boolean

Defined in

lexical/src/LexicalEditorState.ts:77


_selection

_selection: null | RangeSelection | NodeSelection | GridSelection

Defined in

lexical/src/LexicalEditorState.ts:75

Methods

clone

clone(selection?): EditorState

Parameters

NameType
selection?null | RangeSelection | NodeSelection | GridSelection

Returns

EditorState

Defined in

lexical/src/LexicalEditorState.ts:97


isEmpty

isEmpty(): boolean

Returns

boolean

Defined in

lexical/src/LexicalEditorState.ts:89


read

read<V>(callbackFn): V

Type parameters

Name
V

Parameters

NameType
callbackFn() => V

Returns

V

Defined in

lexical/src/LexicalEditorState.ts:93


toJSON

toJSON(): SerializedEditorState

Returns

SerializedEditorState

Defined in

lexical/src/LexicalEditorState.ts:108