Module: lexical
Classes
- DEPRECATED_GridCellNode
- DEPRECATED_GridNode
- DEPRECATED_GridRowNode
- DecoratorNode
- EditorState
- ElementNode
- GridSelection
- LexicalEditor
- LexicalNode
- LineBreakNode
- NodeSelection
- ParagraphNode
- Point
- RangeSelection
- RootNode
- TabNode
- TextNode
Interfaces
Type Aliases
CommandListener
Ƭ CommandListener<P
>: (payload
: P
, editor
: LexicalEditor
) => boolean
Type parameters
Name |
---|
P |
Type declaration
▸ (payload
, editor
): boolean
Parameters
Name | Type |
---|---|
payload | P |
editor | LexicalEditor |
Returns
boolean
Defined in
lexical/src/LexicalEditor.ts:231
CommandListenerPriority
Ƭ CommandListenerPriority: 0
| 1
| 2
| 3
| 4
Defined in
lexical/src/LexicalEditor.ts:235
CommandPayloadType
Ƭ CommandPayloadType<TCommand
>: TCommand
extends LexicalCommand
<infer TPayload> ? TPayload
: never
Type helper for extracting the payload type from a command.
Example
const MY_COMMAND = createCommand<SomeType>();
// ...
editor.registerCommand(MY_COMMAND, payload => {
// Type of `payload` is inferred here. But lets say we want to extract a function to delegate to
handleMyCommand(editor, payload);
return true;
});
function handleMyCommand(editor: LexicalEditor, payload: CommandPayloadType<typeof MY_COMMAND>) {
// `payload` is of type `SomeType`, extracted from the command.
}
Type parameters
Name | Type |
---|---|
TCommand | extends LexicalCommand <unknown > |
Defined in
lexical/src/LexicalEditor.ts:268
CreateEditorArgs
Ƭ CreateEditorArgs: Object
Type declaration
Name | Type |
---|---|
disableEvents? | boolean |
editable? | boolean |
editorState? | EditorState |
html? | HTMLConfig |
namespace? | string |
nodes? | ReadonlyArray <Klass <LexicalNode > | LexicalNodeReplacement > |
onError? | ErrorHandler |
parentEditor? | LexicalEditor |
theme? | EditorThemeClasses |
Defined in
lexical/src/LexicalEditor.ts:167
DOMChildConversion
Ƭ DOMChildConversion: (lexicalNode
: LexicalNode
, parentLexicalNode
: LexicalNode
| null
| undefined
) => LexicalNode
| null
| undefined
Type declaration
▸ (lexicalNode
, parentLexicalNode
): LexicalNode
| null
| undefined
Parameters
Name | Type |
---|---|
lexicalNode | LexicalNode |
parentLexicalNode | LexicalNode | null | undefined |
Returns
LexicalNode
| null
| undefined
Defined in
lexical/src/LexicalNode.ts:135
DOMConversion
Ƭ DOMConversion<T
>: Object
Type parameters
Name | Type |
---|---|
T | extends HTMLElement = HTMLElement |
Type declaration
Name | Type |
---|---|
conversion | DOMConversionFn <T > |
priority | 0 | 1 | 2 | 3 | 4 |
Defined in
lexical/src/LexicalNode.ts:126
DOMConversionFn
Ƭ DOMConversionFn<T
>: (element
: T
) => DOMConversionOutput
| null
Type parameters
Name | Type |
---|---|
T | extends HTMLElement = HTMLElement |
Type declaration
▸ (element
): DOMConversionOutput
| null
Parameters
Name | Type |
---|---|
element | T |
Returns
DOMConversionOutput
| null
Defined in
lexical/src/LexicalNode.ts:131
DOMConversionMap
Ƭ DOMConversionMap<T
>: Record
<NodeName
, (node
: T
) => DOMConversion
<T
> | null
>
Type parameters
Name | Type |
---|---|
T | extends HTMLElement = HTMLElement |
Defined in
lexical/src/LexicalNode.ts:140
DOMConversionOutput
Ƭ DOMConversionOutput: Object
Type declaration
Name | Type |
---|---|
after? | (childLexicalNodes : LexicalNode []) => LexicalNode [] |
forChild? | DOMChildConversion |
node | null | LexicalNode | LexicalNode [] |
Defined in
lexical/src/LexicalNode.ts:146
DOMExportOutput
Ƭ DOMExportOutput: Object
Type declaration
Name | Type |
---|---|
after? | (generatedElement : HTMLElement | Text | null | undefined ) => HTMLElement | Text | null | undefined |
element | HTMLElement | Text | null |
Defined in
lexical/src/LexicalNode.ts:152
EditableListener
Ƭ EditableListener: (editable
: boolean
) => void
Type declaration
▸ (editable
): void
Parameters
Name | Type |
---|---|
editable | boolean |
Returns
void
Defined in
lexical/src/LexicalEditor.ts:233
EditorConfig
Ƭ EditorConfig: Object
Type declaration
Name | Type |
---|---|
disableEvents? | boolean |
namespace | string |
theme | EditorThemeClasses |
Defined in
lexical/src/LexicalEditor.ts:144
EditorThemeClasses
Ƭ EditorThemeClasses: Object
Index signature
▪ [key: string
]: any
Type declaration
Name | Type |
---|---|
blockCursor? | EditorThemeClassName |
characterLimit? | EditorThemeClassName |
code? | EditorThemeClassName |
codeHighlight? | Record <string , EditorThemeClassName > |
embedBlock? | { base? : EditorThemeClassName ; focus? : EditorThemeClassName } |
embedBlock.base? | EditorThemeClassName |
embedBlock.focus? | EditorThemeClassName |
hashtag? | EditorThemeClassName |
heading? | { h1? : EditorThemeClassName ; h2? : EditorThemeClassName ; h3? : EditorThemeClassName ; h4? : EditorThemeClassName ; h5? : EditorThemeClassName ; h6? : EditorThemeClassName } |
heading.h1? | EditorThemeClassName |
heading.h2? | EditorThemeClassName |
heading.h3? | EditorThemeClassName |
heading.h4? | EditorThemeClassName |
heading.h5? | EditorThemeClassName |
heading.h6? | EditorThemeClassName |
image? | EditorThemeClassName |
indent? | EditorThemeClassName |
link? | EditorThemeClassName |
list? | { listitem? : EditorThemeClassName ; listitemChecked? : EditorThemeClassName ; listitemUnchecked? : EditorThemeClassName ; nested? : { list? : EditorThemeClassName ; listitem? : EditorThemeClassName } ; ol? : EditorThemeClassName ; olDepth? : EditorThemeClassName [] ; ul? : EditorThemeClassName ; ulDepth? : EditorThemeClassName [] } |
list.listitem? | EditorThemeClassName |
list.listitemChecked? | EditorThemeClassName |
list.listitemUnchecked? | EditorThemeClassName |
list.nested? | { list? : EditorThemeClassName ; listitem? : EditorThemeClassName } |
list.nested.list? | EditorThemeClassName |
list.nested.listitem? | EditorThemeClassName |
list.ol? | EditorThemeClassName |
list.olDepth? | EditorThemeClassName [] |
list.ul? | EditorThemeClassName |
list.ulDepth? | EditorThemeClassName [] |
ltr? | EditorThemeClassName |
mark? | EditorThemeClassName |
markOverlap? | EditorThemeClassName |
paragraph? | EditorThemeClassName |
quote? | EditorThemeClassName |
root? | EditorThemeClassName |
rtl? | EditorThemeClassName |
table? | EditorThemeClassName |
tableAddColumns? | EditorThemeClassName |
tableAddRows? | EditorThemeClassName |
tableCell? | EditorThemeClassName |
tableCellActionButton? | EditorThemeClassName |
tableCellActionButtonContainer? | EditorThemeClassName |
tableCellEditing? | EditorThemeClassName |
tableCellHeader? | EditorThemeClassName |
tableCellPrimarySelected? | EditorThemeClassName |
tableCellResizer? | EditorThemeClassName |
tableCellSelected? | EditorThemeClassName |
tableCellSortedIndicator? | EditorThemeClassName |
tableResizeRuler? | EditorThemeClassName |
tableRow? | EditorThemeClassName |
tableSelected? | EditorThemeClassName |
text? | TextNodeThemeClasses |
Defined in
lexical/src/LexicalEditor.ts:83
ElementFormatType
Ƭ ElementFormatType: "left"
| "start"
| "center"
| "right"
| "end"
| "justify"
| ""
Defined in
lexical/src/nodes/LexicalElementNode.ts:52
ElementPoint
Ƭ ElementPoint: Object
Type declaration
Name | Type |
---|---|
_selection | RangeSelection | GridSelection |
getNode | () => ElementNode |
is | (point : PointType ) => boolean |
isBefore | (point : PointType ) => boolean |
key | NodeKey |
offset | number |
set | (key : NodeKey , offset : number , type : "text" | "element" ) => void |
type | "element" |
Defined in
lexical/src/LexicalSelection.ts:88
EventHandler
Ƭ EventHandler: (event
: Event
, editor
: LexicalEditor
) => void
Type declaration
▸ (event
, editor
): void
Parameters
Name | Type |
---|---|
event | Event |
editor | LexicalEditor |
Returns
void
Defined in
lexical/src/LexicalEvents.ts:1141
GridMapType
Ƭ GridMapType: GridMapValueType
[][]
Defined in
lexical/src/LexicalSelection.ts:106
GridMapValueType
Ƭ GridMapValueType: Object
Type declaration
Name | Type |
---|---|
cell | DEPRECATED_GridCellNode |
startColumn | number |
startRow | number |
Defined in
lexical/src/LexicalSelection.ts:101
GridSelectionShape
Ƭ GridSelectionShape: Object
Type declaration
Name | Type |
---|---|
fromX | number |
fromY | number |
toX | number |
toY | number |
Defined in
lexical/src/LexicalSelection.ts:387
HTMLConfig
Ƭ HTMLConfig: Object
Type declaration
Name | Type |
---|---|
export? | Map <Klass <LexicalNode >, (editor : LexicalEditor , target : LexicalNode ) => DOMExportOutput > |
import? | DOMConversionMap |
Defined in
lexical/src/LexicalEditor.ts:159
Klass
Ƭ Klass<T
>: (...args
: any
[]) => T
& Omit
<LexicalNode
, "constructor"
>
Type parameters
Name | Type |
---|---|
T | extends LexicalNode |
Defined in
lexical/src/LexicalEditor.ts:48
LexicalCommand
Ƭ LexicalCommand<TPayload
>: Object
Type parameters
Name |
---|
TPayload |
Type declaration
Name | Type |
---|---|
type? | string |
Defined in
lexical/src/LexicalEditor.ts:244
LexicalNodeReplacement
Ƭ LexicalNodeReplacement: Object
Type declaration
Name | Type |
---|---|
replace | Klass <LexicalNode > |
with | <T>(node : InstanceType <T >) => LexicalNode |
withKlass? | Klass <LexicalNode > |
Defined in
lexical/src/LexicalEditor.ts:150
MutationListener
Ƭ MutationListener: (nodes
: Map
<NodeKey
, NodeMutation
>, payload
: { dirtyLeaves
: Set
<string
> ; prevEditorState
: EditorState
; updateTags
: Set
<string
> }) => void
Type declaration
▸ (nodes
, payload
): void
Parameters
Name | Type |
---|---|
nodes | Map <NodeKey , NodeMutation > |
payload | Object |
payload.dirtyLeaves | Set <string > |
payload.prevEditorState | EditorState |
payload.updateTags | Set <string > |
Returns
void
Defined in
lexical/src/LexicalEditor.ts:222
NodeKey
Ƭ NodeKey: string
Defined in
lexical/src/LexicalNode.ts:159
NodeMap
Ƭ NodeMap: Map
<NodeKey
, LexicalNode
>
Defined in
lexical/src/LexicalNode.ts:53
NodeMutation
Ƭ NodeMutation: "created"
| "updated"
| "destroyed"
Defined in
lexical/src/LexicalEditor.ts:200
PasteCommandType
Ƭ PasteCommandType: ClipboardEvent
| InputEvent
| KeyboardEvent
Defined in
lexical/src/LexicalCommands.ts:11
SerializedEditor
Ƭ SerializedEditor: Object
Type declaration
Name | Type |
---|---|
editorState | SerializedEditorState |
Defined in
lexical/src/LexicalEditor.ts:309
SerializedElementNode
Ƭ SerializedElementNode<T
>: Spread
<{ children
: T
[] ; direction
: "ltr"
| "rtl"
| null
; format
: ElementFormatType
; indent
: number
}, SerializedLexicalNode
>
Type parameters
Name | Type |
---|---|
T | extends SerializedLexicalNode = SerializedLexicalNode |
Defined in
lexical/src/nodes/LexicalElementNode.ts:40
SerializedGridCellNode
Ƭ SerializedGridCellNode: Spread
<{ colSpan?
: number
; rowSpan?
: number
}, SerializedElementNode
>
Defined in
lexical/src/nodes/LexicalGridCellNode.ts:18
SerializedLexicalNode
Ƭ SerializedLexicalNode: Object
Type declaration
Name | Type |
---|---|
type | string |
version | number |
Defined in
lexical/src/LexicalNode.ts:55
SerializedLineBreakNode
Ƭ SerializedLineBreakNode: SerializedLexicalNode
Defined in
lexical/src/nodes/LexicalLineBreakNode.ts:20
SerializedParagraphNode
Ƭ SerializedParagraphNode: SerializedElementNode
Defined in
lexical/src/nodes/LexicalParagraphNode.ts:30
SerializedRootNode
Ƭ SerializedRootNode<T
>: SerializedElementNode
<T
>
Type parameters
Name | Type |
---|---|
T | extends SerializedLexicalNode = SerializedLexicalNode |
Defined in
lexical/src/nodes/LexicalRootNode.ts:20
SerializedTabNode
Ƭ SerializedTabNode: SerializedTextNode
Defined in
lexical/src/nodes/LexicalTabNode.ts:23
SerializedTextNode
Ƭ SerializedTextNode: Spread
<{ detail
: number
; format
: number
; mode
: TextModeType
; style
: string
; text
: string
}, SerializedLexicalNode
>
Defined in
lexical/src/nodes/LexicalTextNode.ts:73
Spread
Ƭ Spread<T1
, T2
>: Omit
<T2
, keyof T1
> & T1
Type parameters
Name |
---|
T1 |
T2 |
Defined in
lexical/src/LexicalEditor.ts:46
TextFormatType
Ƭ TextFormatType: "bold"
| "underline"
| "strikethrough"
| "italic"
| "highlight"
| "code"
| "subscript"
| "superscript"
Defined in
lexical/src/nodes/LexicalTextNode.ts:86
TextModeType
Ƭ TextModeType: "normal"
| "token"
| "segmented"
Defined in
lexical/src/nodes/LexicalTextNode.ts:96
TextPoint
Ƭ TextPoint: Object
Type declaration
Name | Type |
---|---|
_selection | RangeSelection | GridSelection |
getNode | () => TextNode |
is | (point : PointType ) => boolean |
isBefore | (point : PointType ) => boolean |
key | NodeKey |
offset | number |
set | (key : NodeKey , offset : number , type : "text" | "element" ) => void |
type | "text" |
Defined in
lexical/src/LexicalSelection.ts:77
Variables
BLUR_COMMAND
• Const
BLUR_COMMAND: LexicalCommand
<FocusEvent
>
Defined in
lexical/src/LexicalCommands.ts:112
CAN_REDO_COMMAND
• Const
CAN_REDO_COMMAND: LexicalCommand
<boolean
>
Defined in
lexical/src/LexicalCommands.ts:106
CAN_UNDO_COMMAND
• Const
CAN_UNDO_COMMAND: LexicalCommand
<boolean
>
Defined in
lexical/src/LexicalCommands.ts:108
CLEAR_EDITOR_COMMAND
• Const
CLEAR_EDITOR_COMMAND: LexicalCommand
<void
>
Defined in
lexical/src/LexicalCommands.ts:100
CLEAR_HISTORY_COMMAND
• Const
CLEAR_HISTORY_COMMAND: LexicalCommand
<void
>
Defined in
lexical/src/LexicalCommands.ts:103
CLICK_COMMAND
• Const
CLICK_COMMAND: LexicalCommand
<MouseEvent
>
Defined in
lexical/src/LexicalCommands.ts:20
COMMAND_PRIORITY_CRITICAL
• Const
COMMAND_PRIORITY_CRITICAL: 4
Defined in
lexical/src/LexicalEditor.ts:241
COMMAND_PRIORITY_EDITOR
• Const
COMMAND_PRIORITY_EDITOR: 0
Defined in
lexical/src/LexicalEditor.ts:237
COMMAND_PRIORITY_HIGH
• Const
COMMAND_PRIORITY_HIGH: 3
Defined in
lexical/src/LexicalEditor.ts:240
COMMAND_PRIORITY_LOW
• Const
COMMAND_PRIORITY_LOW: 1
Defined in
lexical/src/LexicalEditor.ts:238
COMMAND_PRIORITY_NORMAL
• Const
COMMAND_PRIORITY_NORMAL: 2
Defined in
lexical/src/LexicalEditor.ts:239
CONTROLLED_TEXT_INSERTION_COMMAND
• Const
CONTROLLED_TEXT_INSERTION_COMMAND: LexicalCommand
<InputEvent
| string
>
Defined in
lexical/src/LexicalCommands.ts:31
COPY_COMMAND
• Const
COPY_COMMAND: LexicalCommand
<ClipboardEvent
| KeyboardEvent
| null
>
Defined in
lexical/src/LexicalCommands.ts:92
CUT_COMMAND
• Const
CUT_COMMAND: LexicalCommand
<ClipboardEvent
| KeyboardEvent
| null
>
Defined in
lexical/src/LexicalCommands.ts:95
DELETE_CHARACTER_COMMAND
• Const
DELETE_CHARACTER_COMMAND: LexicalCommand
<boolean
>
Defined in
lexical/src/LexicalCommands.ts:22
DELETE_LINE_COMMAND
• Const
DELETE_LINE_COMMAND: LexicalCommand
<boolean
>
Defined in
lexical/src/LexicalCommands.ts:41
DELETE_WORD_COMMAND
• Const
DELETE_WORD_COMMAND: LexicalCommand
<boolean
>
Defined in
lexical/src/LexicalCommands.ts:38
DRAGEND_COMMAND
• Const
DRAGEND_COMMAND: LexicalCommand
<DragEvent
>
Defined in
lexical/src/LexicalCommands.ts:90
DRAGOVER_COMMAND
• Const
DRAGOVER_COMMAND: LexicalCommand
<DragEvent
>
Defined in
lexical/src/LexicalCommands.ts:88
DRAGSTART_COMMAND
• Const
DRAGSTART_COMMAND: LexicalCommand
<DragEvent
>
Defined in
lexical/src/LexicalCommands.ts:86
DROP_COMMAND
• Const
DROP_COMMAND: LexicalCommand
<DragEvent
>
Defined in
lexical/src/LexicalCommands.ts:82
FOCUS_COMMAND
• Const
FOCUS_COMMAND: LexicalCommand
<FocusEvent
>
Defined in
lexical/src/LexicalCommands.ts:110
FORMAT_ELEMENT_COMMAND
• Const
FORMAT_ELEMENT_COMMAND: LexicalCommand
<ElementFormatType
>
Defined in
lexical/src/LexicalCommands.ts:84
FORMAT_TEXT_COMMAND
• Const
FORMAT_TEXT_COMMAND: LexicalCommand
<TextFormatType
>
Defined in
lexical/src/LexicalCommands.ts:44
INDENT_CONTENT_COMMAND
• Const
INDENT_CONTENT_COMMAND: LexicalCommand
<void
>
Defined in
lexical/src/LexicalCommands.ts:76
INSERT_LINE_BREAK_COMMAND
• Const
INSERT_LINE_BREAK_COMMAND: LexicalCommand
<boolean
>
Defined in
lexical/src/LexicalCommands.ts:25
INSERT_PARAGRAPH_COMMAND
• Const
INSERT_PARAGRAPH_COMMAND: LexicalCommand
<void
>
Defined in
lexical/src/LexicalCommands.ts:28
INSERT_TAB_COMMAND
• Const
INSERT_TAB_COMMAND: LexicalCommand
<void
>
Defined in
lexical/src/LexicalCommands.ts:74
KEY_ARROW_DOWN_COMMAND
• Const
KEY_ARROW_DOWN_COMMAND: LexicalCommand
<KeyboardEvent
>
Defined in
lexical/src/LexicalCommands.ts:60
KEY_ARROW_LEFT_COMMAND
• Const
KEY_ARROW_LEFT_COMMAND: LexicalCommand
<KeyboardEvent
>
Defined in
lexical/src/LexicalCommands.ts:54
KEY_ARROW_RIGHT_COMMAND
• Const
KEY_ARROW_RIGHT_COMMAND: LexicalCommand
<KeyboardEvent
>
Defined in
lexical/src/LexicalCommands.ts:50
KEY_ARROW_UP_COMMAND
• Const
KEY_ARROW_UP_COMMAND: LexicalCommand
<KeyboardEvent
>
Defined in
lexical/src/LexicalCommands.ts:58
KEY_BACKSPACE_COMMAND
• Const
KEY_BACKSPACE_COMMAND: LexicalCommand
<KeyboardEvent
>
Defined in
lexical/src/LexicalCommands.ts:66
KEY_DELETE_COMMAND
• Const
KEY_DELETE_COMMAND: LexicalCommand
<KeyboardEvent
>
Defined in
lexical/src/LexicalCommands.ts:70
KEY_DOWN_COMMAND
• Const
KEY_DOWN_COMMAND: LexicalCommand
<KeyboardEvent
>
Defined in
lexical/src/LexicalCommands.ts:48
KEY_ENTER_COMMAND
• Const
KEY_ENTER_COMMAND: LexicalCommand
<KeyboardEvent
| null
>
Defined in
lexical/src/LexicalCommands.ts:62
KEY_ESCAPE_COMMAND
• Const
KEY_ESCAPE_COMMAND: LexicalCommand
<KeyboardEvent
>
Defined in
lexical/src/LexicalCommands.ts:68
KEY_MODIFIER_COMMAND
• Const
KEY_MODIFIER_COMMAND: LexicalCommand
<KeyboardEvent
>
Defined in
lexical/src/LexicalCommands.ts:114
KEY_SPACE_COMMAND
• Const
KEY_SPACE_COMMAND: LexicalCommand
<KeyboardEvent
>
Defined in
lexical/src/LexicalCommands.ts:64
KEY_TAB_COMMAND
• Const
KEY_TAB_COMMAND: LexicalCommand
<KeyboardEvent
>
Defined in
lexical/src/LexicalCommands.ts:72
MOVE_TO_END
• Const
MOVE_TO_END: LexicalCommand
<KeyboardEvent
>
Defined in
lexical/src/LexicalCommands.ts:52
MOVE_TO_START
• Const
MOVE_TO_START: LexicalCommand
<KeyboardEvent
>
Defined in
lexical/src/LexicalCommands.ts:56
OUTDENT_CONTENT_COMMAND
• Const
OUTDENT_CONTENT_COMMAND: LexicalCommand
<void
>
Defined in
lexical/src/LexicalCommands.ts:79
PASTE_COMMAND
• Const
PASTE_COMMAND: LexicalCommand
<PasteCommandType
>
Defined in
lexical/src/LexicalCommands.ts:34
REDO_COMMAND
• Const
REDO_COMMAND: LexicalCommand
<void
>
Defined in
lexical/src/LexicalCommands.ts:47
REMOVE_TEXT_COMMAND
• Const
REMOVE_TEXT_COMMAND: LexicalCommand
<InputEvent
| null
>
Defined in
lexical/src/LexicalCommands.ts:36
SELECTION_CHANGE_COMMAND
• Const
SELECTION_CHANGE_COMMAND: LexicalCommand
<void
>
Defined in
lexical/src/LexicalCommands.ts:17
SELECT_ALL_COMMAND
• Const
SELECT_ALL_COMMAND: LexicalCommand
<KeyboardEvent
>
Defined in
lexical/src/LexicalCommands.ts:98
UNDO_COMMAND
• Const
UNDO_COMMAND: LexicalCommand
<void
>
Defined in
lexical/src/LexicalCommands.ts:46
Functions
$addUpdateTag
▸ $addUpdateTag(tag
): void
Parameters
Name | Type |
---|---|
tag | string |
Returns
void
Defined in
lexical/src/LexicalUtils.ts:1253
$applyNodeReplacement
▸ $applyNodeReplacement<N
>(node
): N
Type parameters
Name | Type |
---|---|
N | extends LexicalNode |
Parameters
Name | Type |
---|---|
node | LexicalNode |
Returns
N
Defined in
lexical/src/LexicalUtils.ts:1336
$copyNode
▸ $copyNode<T
>(node
): T
Type parameters
Name | Type |
---|---|
T | extends LexicalNode |
Parameters
Name | Type |
---|---|
node | T |
Returns
T
Defined in
lexical/src/LexicalUtils.ts:1329
$createLineBreakNode
▸ $createLineBreakNode(): LineBreakNode
Returns
Defined in
lexical/src/nodes/LexicalLineBreakNode.ts:98
$createNodeSelection
▸ $createNodeSelection(): NodeSelection
Returns
Defined in
lexical/src/LexicalSelection.ts:2494
$createParagraphNode
▸ $createParagraphNode(): ParagraphNode
Returns
Defined in
lexical/src/nodes/LexicalParagraphNode.ts:159
$createRangeSelection
▸ $createRangeSelection(): RangeSelection
Returns
Defined in
lexical/src/LexicalSelection.ts:2488
$createTabNode
▸ $createTabNode(): TabNode
Returns
Defined in
lexical/src/nodes/LexicalTabNode.ts:85
$createTextNode
▸ $createTextNode(text?
): TextNode
Parameters
Name | Type | Default value |
---|---|---|
text | string | '' |
Returns
Defined in
lexical/src/nodes/LexicalTextNode.ts:1314
$getAdjacentNode
▸ $getAdjacentNode(focus
, isBackward
): null
| LexicalNode
Parameters
Name | Type |
---|---|
focus | PointType |
isBackward | boolean |
Returns
null
| LexicalNode
Defined in
lexical/src/LexicalUtils.ts:1117
$getNearestNodeFromDOMNode
▸ $getNearestNodeFromDOMNode(startingDOM
, editorState?
): LexicalNode
| null
Parameters
Name | Type |
---|---|
startingDOM | Node |
editorState? | EditorState |
Returns
LexicalNode
| null
Defined in
lexical/src/LexicalUtils.ts:406
$getNearestRootOrShadowRoot
▸ $getNearestRootOrShadowRoot(node
): RootNode
| ElementNode
Parameters
Name | Type |
---|---|
node | LexicalNode |
Returns
Defined in
lexical/src/LexicalUtils.ts:1312
$getNodeByKey
▸ $getNodeByKey<T
>(key
, _editorState?
): T
| null
Type parameters
Name | Type |
---|---|
T | extends LexicalNode |
Parameters
Name | Type |
---|---|
key | string |
_editorState? | EditorState |
Returns
T
| null
Defined in
lexical/src/LexicalUtils.ts:381
$getPreviousSelection
▸ $getPreviousSelection(): null
| RangeSelection
| NodeSelection
| GridSelection
Returns
null
| RangeSelection
| NodeSelection
| GridSelection
Defined in
lexical/src/LexicalSelection.ts:2609
$getRoot
▸ $getRoot(): RootNode
Returns
Defined in
lexical/src/LexicalUtils.ts:460
$getSelection
▸ $getSelection(): null
| RangeSelection
| NodeSelection
| GridSelection
Returns
null
| RangeSelection
| NodeSelection
| GridSelection
Defined in
lexical/src/LexicalSelection.ts:2600
$getTextContent
▸ $getTextContent(): string
Returns
string
Defined in
lexical/src/LexicalSelection.ts:2992
$hasAncestor
▸ $hasAncestor(child
, targetNode
): boolean
Parameters
Name | Type |
---|---|
child | LexicalNode |
targetNode | LexicalNode |
Returns
boolean
Defined in
lexical/src/LexicalUtils.ts:1278
$hasUpdateTag
▸ $hasUpdateTag(tag
): boolean
Parameters
Name | Type |
---|---|
tag | string |
Returns
boolean
Defined in
lexical/src/LexicalUtils.ts:1248
$insertNodes
▸ $insertNodes(nodes
): void
Parameters
Name | Type |
---|---|
nodes | LexicalNode [] |
Returns
void
Defined in
lexical/src/LexicalSelection.ts:2983
$isBlockElementNode
▸ $isBlockElementNode(node
): node is ElementNode
Parameters
Name | Type |
---|---|
node | undefined | null | LexicalNode |
Returns
node is ElementNode
Defined in
lexical/src/LexicalSelection.ts:2458
$isDecoratorNode
▸ $isDecoratorNode<T
>(node
): node is DecoratorNode<T>
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
node | undefined | null | LexicalNode |
Returns
node is DecoratorNode<T>
Defined in
lexical/src/nodes/LexicalDecoratorNode.ts:43
$isElementNode
▸ $isElementNode(node
): node is ElementNode
Parameters
Name | Type |
---|---|
node | undefined | null | LexicalNode |
Returns
node is ElementNode
Defined in
lexical/src/nodes/LexicalElementNode.ts:589
$isInlineElementOrDecoratorNode
▸ $isInlineElementOrDecoratorNode(node
): boolean
Parameters
Name | Type |
---|---|
node | LexicalNode |
Returns
boolean
Defined in
lexical/src/LexicalUtils.ts:1305
$isLeafNode
▸ $isLeafNode(node
): node is TextNode | DecoratorNode<unknown> | LineBreakNode
Parameters
Name | Type |
---|---|
node | undefined | null | LexicalNode |
Returns
node is TextNode | DecoratorNode<unknown> | LineBreakNode
Defined in
lexical/src/LexicalUtils.ts:215
$isLineBreakNode
▸ $isLineBreakNode(node
): node is LineBreakNode
Parameters
Name | Type |
---|---|
node | undefined | null | LexicalNode |
Returns
node is LineBreakNode
Defined in
lexical/src/nodes/LexicalLineBreakNode.ts:102
$isNodeSelection
▸ $isNodeSelection(x
): x is NodeSelection
Parameters
Name | Type |
---|---|
x | unknown |
Returns
x is NodeSelection
Defined in
lexical/src/LexicalSelection.ts:2050
$isParagraphNode
▸ $isParagraphNode(node
): node is ParagraphNode
Parameters
Name | Type |
---|---|
node | undefined | null | LexicalNode |
Returns
node is ParagraphNode
Defined in
lexical/src/nodes/LexicalParagraphNode.ts:163
$isRangeSelection
▸ $isRangeSelection(x
): x is RangeSelection
Parameters
Name | Type |
---|---|
x | unknown |
Returns
x is RangeSelection
Defined in
lexical/src/LexicalSelection.ts:383
$isRootNode
▸ $isRootNode(node
): node is RootNode
Parameters
Name | Type |
---|---|
node | undefined | null | LexicalNode | RootNode |
Returns
node is RootNode
Defined in
lexical/src/nodes/LexicalRootNode.ts:128
$isRootOrShadowRoot
▸ $isRootOrShadowRoot(node
): boolean
Parameters
Name | Type |
---|---|
node | null | LexicalNode |
Returns
boolean
Defined in
lexical/src/LexicalUtils.ts:1325
$isTabNode
▸ $isTabNode(node
): node is TabNode
Parameters
Name | Type |
---|---|
node | undefined | null | LexicalNode |
Returns
node is TabNode
Defined in
lexical/src/nodes/LexicalTabNode.ts:89
$isTextNode
▸ $isTextNode(node
): node is TextNode
Parameters
Name | Type |
---|---|
node | undefined | null | LexicalNode |
Returns
node is TextNode
Defined in
lexical/src/nodes/LexicalTextNode.ts:1318
$nodesOfType
▸ $nodesOfType<T
>(klass
): T
[]
Type parameters
Name | Type |
---|---|
T | extends LexicalNode |
Parameters
Name | Type |
---|---|
klass | Klass <T > |
Returns
T
[]
Defined in
lexical/src/LexicalUtils.ts:1079
$normalizeSelection__EXPERIMENTAL
▸ $normalizeSelection__EXPERIMENTAL(selection
): RangeSelection
Parameters
Name | Type |
---|---|
selection | RangeSelection |
Returns
Defined in
lexical/src/LexicalNormalization.ts:89
$parseSerializedNode
▸ $parseSerializedNode(serializedNode
): LexicalNode
Parameters
Name | Type |
---|---|
serializedNode | SerializedLexicalNode |
Returns
Defined in
lexical/src/LexicalUpdates.ts:289
$selectAll
▸ $selectAll(): void
Returns
void
Defined in
lexical/src/LexicalUtils.ts:1014
$setCompositionKey
▸ $setCompositionKey(compositionKey
): void
Parameters
Name | Type |
---|---|
compositionKey | null | string |
Returns
void
Defined in
lexical/src/LexicalUtils.ts:352
$setSelection
▸ $setSelection(selection
): void
Parameters
Name | Type |
---|---|
selection | null | RangeSelection | NodeSelection | GridSelection |
Returns
void
Defined in
lexical/src/LexicalUtils.ts:468
$splitNode
▸ $splitNode(node
, offset
): [ElementNode
| null
, ElementNode
]
Parameters
Name | Type |
---|---|
node | ElementNode |
offset | number |
Returns
[ElementNode
| null
, ElementNode
]
Defined in
lexical/src/LexicalUtils.ts:1494
DEPRECATED_$computeGridMap
▸ DEPRECATED_$computeGridMap(grid
, cellA
, cellB
): [GridMapType
, GridMapValueType
, GridMapValueType
]
Parameters
Name | Type |
---|---|
grid | DEPRECATED_GridNode |
cellA | DEPRECATED_GridCellNode |
cellB | DEPRECATED_GridCellNode |
Returns
[GridMapType
, GridMapValueType
, GridMapValueType
]
Defined in
lexical/src/LexicalSelection.ts:3000
DEPRECATED_$createGridSelection
▸ DEPRECATED_$createGridSelection(): GridSelection
Returns
Defined in
lexical/src/LexicalSelection.ts:2498
DEPRECATED_$getGridCellNodeRect
▸ DEPRECATED_$getGridCellNodeRect(GridCellNode
): { colSpan
: number
; columnIndex
: number
; rowIndex
: number
; rowSpan
: number
} | null
Parameters
Name | Type |
---|---|
GridCellNode | DEPRECATED_GridCellNode |
Returns
{ colSpan
: number
; columnIndex
: number
; rowIndex
: number
; rowSpan
: number
} | null
Defined in
lexical/src/LexicalSelection.ts:394
DEPRECATED_$getNodeTriplet
▸ DEPRECATED_$getNodeTriplet(source
): [DEPRECATED_GridCellNode
, DEPRECATED_GridRowNode
, DEPRECATED_GridNode
]
Parameters
Name | Type |
---|---|
source | LexicalNode | PointType | DEPRECATED_GridCellNode |
Returns
[DEPRECATED_GridCellNode
, DEPRECATED_GridRowNode
, DEPRECATED_GridNode
]
Defined in
lexical/src/LexicalSelection.ts:3065
DEPRECATED_$isGridCellNode
▸ DEPRECATED_$isGridCellNode(node
): node is DEPRECATED_GridCellNode
Parameters
Name | Type |
---|---|
node | undefined | null | LexicalNode | DEPRECATED_GridCellNode |
Returns
node is DEPRECATED_GridCellNode
Defined in
lexical/src/nodes/LexicalGridCellNode.ts:65
DEPRECATED_$isGridNode
▸ DEPRECATED_$isGridNode(node
): node is DEPRECATED_GridNode
Parameters
Name | Type |
---|---|
node | undefined | null | LexicalNode |
Returns
node is DEPRECATED_GridNode
Defined in
lexical/src/nodes/LexicalGridNode.ts:15
DEPRECATED_$isGridRowNode
▸ DEPRECATED_$isGridRowNode(node
): node is DEPRECATED_GridRowNode
Parameters
Name | Type |
---|---|
node | undefined | null | LexicalNode |
Returns
node is DEPRECATED_GridRowNode
Defined in
lexical/src/nodes/LexicalGridRowNode.ts:15
DEPRECATED_$isGridSelection
▸ DEPRECATED_$isGridSelection(x
): x is GridSelection
Parameters
Name | Type |
---|---|
x | unknown |
Returns
x is GridSelection
Defined in
lexical/src/LexicalSelection.ts:744
createCommand
▸ createCommand<T
>(type?
): LexicalCommand
<T
>
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
type? | string |
Returns
Defined in
lexical/src/LexicalCommands.ts:13
createEditor
▸ createEditor(editorConfig?
): LexicalEditor
Creates a new LexicalEditor attached to a single contentEditable (provided in the config). This is the lowest-level initialization API for a LexicalEditor. If you're using React or another framework, consider using the appropriate abstractions, such as LexicalComposer
Parameters
Name | Type | Description |
---|---|---|
editorConfig? | CreateEditorArgs | the editor configuration. |
Returns
a LexicalEditor instance
Defined in
lexical/src/LexicalEditor.ts:399
getNearestEditorFromDOMNode
▸ getNearestEditorFromDOMNode(node
): LexicalEditor
| null
Parameters
Name | Type |
---|---|
node | null | Node |
Returns
LexicalEditor
| null
Defined in
lexical/src/LexicalUtils.ts:149
isHTMLAnchorElement
▸ isHTMLAnchorElement(x
): x is HTMLAnchorElement
Parameters
Name | Type | Description |
---|---|---|
x | Node | The element being tested |
Returns
x is HTMLAnchorElement
Returns true if x is an HTML anchor tag, false otherwise
Defined in
lexical/src/LexicalUtils.ts:1581
isHTMLElement
▸ isHTMLElement(x
): x is HTMLElement
Parameters
Name | Type | Description |
---|---|---|
x | EventTarget | Node | The element being testing |
Returns
x is HTMLElement
Returns true if x is an HTML element, false otherwise.
Defined in
lexical/src/LexicalUtils.ts:1589
isSelectionCapturedInDecoratorInput
▸ isSelectionCapturedInDecoratorInput(anchorDOM
): boolean
Parameters
Name | Type |
---|---|
anchorDOM | Node |
Returns
boolean
Defined in
lexical/src/LexicalUtils.ts:110
isSelectionWithinEditor
▸ isSelectionWithinEditor(editor
, anchorDOM
, focusDOM
): boolean
Parameters
Name | Type |
---|---|
editor | LexicalEditor |
anchorDOM | null | Node |
focusDOM | null | Node |
Returns
boolean
Defined in
lexical/src/LexicalUtils.ts:128