lexical 0.3.3 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Lexical.dev.js +378 -293
- package/Lexical.js.flow +15 -10
- package/Lexical.prod.js +174 -171
- package/LexicalCommands.d.ts +50 -0
- package/LexicalConstants.d.ts +43 -0
- package/LexicalEditor.d.ts +199 -0
- package/LexicalEditorState.d.ts +28 -0
- package/LexicalEvents.d.ts +14 -0
- package/LexicalGC.d.ts +12 -0
- package/LexicalMutations.d.ts +12 -0
- package/LexicalNode.d.ts +82 -0
- package/LexicalNormalization.d.ts +9 -0
- package/LexicalReconciler.d.ts +12 -0
- package/LexicalSelection.d.ts +147 -0
- package/LexicalUpdates.d.ts +25 -0
- package/LexicalUtils.d.ts +94 -0
- package/LexicalVersion.d.ts +8 -0
- package/index.d.ts +31 -0
- package/nodes/LexicalDecoratorNode.d.ts +18 -0
- package/nodes/LexicalElementNode.d.ts +71 -0
- package/nodes/LexicalGridCellNode.d.ts +18 -0
- package/nodes/LexicalGridNode.d.ts +12 -0
- package/nodes/LexicalGridRowNode.d.ts +12 -0
- package/nodes/LexicalLineBreakNode.d.ts +26 -0
- package/nodes/LexicalParagraphNode.d.ts +30 -0
- package/nodes/LexicalRootNode.d.ts +29 -0
- package/nodes/LexicalTextNode.d.ts +75 -0
- package/package.json +1 -5
- package/Lexical.d.ts +0 -853
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { ElementFormatType, LexicalCommand, TextFormatType } from 'lexical';
|
|
9
|
+
export declare function createCommand<T>(): LexicalCommand<T>;
|
|
10
|
+
export declare const SELECTION_CHANGE_COMMAND: LexicalCommand<void>;
|
|
11
|
+
export declare const CLICK_COMMAND: LexicalCommand<MouseEvent>;
|
|
12
|
+
export declare const DELETE_CHARACTER_COMMAND: LexicalCommand<boolean>;
|
|
13
|
+
export declare const INSERT_LINE_BREAK_COMMAND: LexicalCommand<boolean>;
|
|
14
|
+
export declare const INSERT_PARAGRAPH_COMMAND: LexicalCommand<void>;
|
|
15
|
+
export declare const CONTROLLED_TEXT_INSERTION_COMMAND: LexicalCommand<string>;
|
|
16
|
+
export declare const PASTE_COMMAND: LexicalCommand<ClipboardEvent>;
|
|
17
|
+
export declare const REMOVE_TEXT_COMMAND: LexicalCommand<void>;
|
|
18
|
+
export declare const DELETE_WORD_COMMAND: LexicalCommand<boolean>;
|
|
19
|
+
export declare const DELETE_LINE_COMMAND: LexicalCommand<boolean>;
|
|
20
|
+
export declare const FORMAT_TEXT_COMMAND: LexicalCommand<TextFormatType>;
|
|
21
|
+
export declare const UNDO_COMMAND: LexicalCommand<void>;
|
|
22
|
+
export declare const REDO_COMMAND: LexicalCommand<void>;
|
|
23
|
+
export declare const KEY_ARROW_RIGHT_COMMAND: LexicalCommand<KeyboardEvent>;
|
|
24
|
+
export declare const MOVE_TO_END: LexicalCommand<KeyboardEvent>;
|
|
25
|
+
export declare const KEY_ARROW_LEFT_COMMAND: LexicalCommand<KeyboardEvent>;
|
|
26
|
+
export declare const MOVE_TO_START: LexicalCommand<KeyboardEvent>;
|
|
27
|
+
export declare const KEY_ARROW_UP_COMMAND: LexicalCommand<KeyboardEvent>;
|
|
28
|
+
export declare const KEY_ARROW_DOWN_COMMAND: LexicalCommand<KeyboardEvent>;
|
|
29
|
+
export declare const KEY_ENTER_COMMAND: LexicalCommand<KeyboardEvent | null>;
|
|
30
|
+
export declare const KEY_SPACE_COMMAND: LexicalCommand<KeyboardEvent>;
|
|
31
|
+
export declare const KEY_BACKSPACE_COMMAND: LexicalCommand<KeyboardEvent>;
|
|
32
|
+
export declare const KEY_ESCAPE_COMMAND: LexicalCommand<KeyboardEvent>;
|
|
33
|
+
export declare const KEY_DELETE_COMMAND: LexicalCommand<KeyboardEvent>;
|
|
34
|
+
export declare const KEY_TAB_COMMAND: LexicalCommand<KeyboardEvent>;
|
|
35
|
+
export declare const INDENT_CONTENT_COMMAND: LexicalCommand<void>;
|
|
36
|
+
export declare const OUTDENT_CONTENT_COMMAND: LexicalCommand<void>;
|
|
37
|
+
export declare const DROP_COMMAND: LexicalCommand<DragEvent>;
|
|
38
|
+
export declare const FORMAT_ELEMENT_COMMAND: LexicalCommand<ElementFormatType>;
|
|
39
|
+
export declare const DRAGSTART_COMMAND: LexicalCommand<DragEvent>;
|
|
40
|
+
export declare const DRAGOVER_COMMAND: LexicalCommand<DragEvent>;
|
|
41
|
+
export declare const DRAGEND_COMMAND: LexicalCommand<DragEvent>;
|
|
42
|
+
export declare const COPY_COMMAND: LexicalCommand<ClipboardEvent>;
|
|
43
|
+
export declare const CUT_COMMAND: LexicalCommand<ClipboardEvent>;
|
|
44
|
+
export declare const CLEAR_EDITOR_COMMAND: LexicalCommand<void>;
|
|
45
|
+
export declare const CLEAR_HISTORY_COMMAND: LexicalCommand<void>;
|
|
46
|
+
export declare const CAN_REDO_COMMAND: LexicalCommand<boolean>;
|
|
47
|
+
export declare const CAN_UNDO_COMMAND: LexicalCommand<boolean>;
|
|
48
|
+
export declare const FOCUS_COMMAND: LexicalCommand<FocusEvent>;
|
|
49
|
+
export declare const BLUR_COMMAND: LexicalCommand<FocusEvent>;
|
|
50
|
+
export declare const KEY_MODIFIER_COMMAND: LexicalCommand<KeyboardEvent>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { ElementFormatType } from './nodes/LexicalElementNode';
|
|
9
|
+
import type { TextDetailType, TextFormatType, TextModeType } from './nodes/LexicalTextNode';
|
|
10
|
+
export declare const DOM_ELEMENT_TYPE = 1;
|
|
11
|
+
export declare const DOM_TEXT_TYPE = 3;
|
|
12
|
+
export declare const NO_DIRTY_NODES = 0;
|
|
13
|
+
export declare const HAS_DIRTY_NODES = 1;
|
|
14
|
+
export declare const FULL_RECONCILE = 2;
|
|
15
|
+
export declare const IS_NORMAL = 0;
|
|
16
|
+
export declare const IS_TOKEN = 1;
|
|
17
|
+
export declare const IS_SEGMENTED = 2;
|
|
18
|
+
export declare const IS_INERT = 3;
|
|
19
|
+
export declare const IS_BOLD = 1;
|
|
20
|
+
export declare const IS_ITALIC: number;
|
|
21
|
+
export declare const IS_STRIKETHROUGH: number;
|
|
22
|
+
export declare const IS_UNDERLINE: number;
|
|
23
|
+
export declare const IS_CODE: number;
|
|
24
|
+
export declare const IS_SUBSCRIPT: number;
|
|
25
|
+
export declare const IS_SUPERSCRIPT: number;
|
|
26
|
+
export declare const IS_DIRECTIONLESS = 1;
|
|
27
|
+
export declare const IS_UNMERGEABLE: number;
|
|
28
|
+
export declare const IS_ALIGN_LEFT = 1;
|
|
29
|
+
export declare const IS_ALIGN_CENTER = 2;
|
|
30
|
+
export declare const IS_ALIGN_RIGHT = 3;
|
|
31
|
+
export declare const IS_ALIGN_JUSTIFY = 4;
|
|
32
|
+
export declare const NON_BREAKING_SPACE = "\u00A0";
|
|
33
|
+
export declare const COMPOSITION_SUFFIX: string;
|
|
34
|
+
export declare const DOUBLE_LINE_BREAK = "\n\n";
|
|
35
|
+
export declare const COMPOSITION_START_CHAR: string;
|
|
36
|
+
export declare const RTL_REGEX: RegExp;
|
|
37
|
+
export declare const LTR_REGEX: RegExp;
|
|
38
|
+
export declare const TEXT_TYPE_TO_FORMAT: Record<TextFormatType | string, number>;
|
|
39
|
+
export declare const DETAIL_TYPE_TO_DETAIL: Record<TextDetailType | string, number>;
|
|
40
|
+
export declare const ELEMENT_TYPE_TO_FORMAT: Record<Exclude<ElementFormatType, ''>, number>;
|
|
41
|
+
export declare const ELEMENT_FORMAT_TO_TYPE: Record<number, ElementFormatType>;
|
|
42
|
+
export declare const TEXT_MODE_TO_TYPE: Record<TextModeType, 0 | 1 | 2 | 3>;
|
|
43
|
+
export declare const TEXT_TYPE_TO_MODE: Record<number, TextModeType>;
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { EditorState, SerializedEditorState } from './LexicalEditorState';
|
|
9
|
+
import type { DOMConversion, LexicalNode, NodeKey } from './LexicalNode';
|
|
10
|
+
export declare type Spread<T1, T2> = Omit<T2, keyof T1> & T1;
|
|
11
|
+
export declare type Klass<T extends LexicalNode> = {
|
|
12
|
+
new (...args: any[]): T;
|
|
13
|
+
} & Omit<LexicalNode, 'constructor'>;
|
|
14
|
+
export declare type EditorThemeClassName = string;
|
|
15
|
+
export declare type TextNodeThemeClasses = {
|
|
16
|
+
base?: EditorThemeClassName;
|
|
17
|
+
bold?: EditorThemeClassName;
|
|
18
|
+
code?: EditorThemeClassName;
|
|
19
|
+
italic?: EditorThemeClassName;
|
|
20
|
+
strikethrough?: EditorThemeClassName;
|
|
21
|
+
subscript?: EditorThemeClassName;
|
|
22
|
+
superscript?: EditorThemeClassName;
|
|
23
|
+
underline?: EditorThemeClassName;
|
|
24
|
+
underlineStrikethrough?: EditorThemeClassName;
|
|
25
|
+
};
|
|
26
|
+
export declare type EditorUpdateOptions = {
|
|
27
|
+
onUpdate?: () => void;
|
|
28
|
+
skipTransforms?: true;
|
|
29
|
+
tag?: string;
|
|
30
|
+
};
|
|
31
|
+
export declare type EditorSetOptions = {
|
|
32
|
+
tag?: string;
|
|
33
|
+
};
|
|
34
|
+
export declare type EditorThemeClasses = {
|
|
35
|
+
characterLimit?: EditorThemeClassName;
|
|
36
|
+
code?: EditorThemeClassName;
|
|
37
|
+
codeHighlight?: Record<string, EditorThemeClassName>;
|
|
38
|
+
hashtag?: EditorThemeClassName;
|
|
39
|
+
heading?: {
|
|
40
|
+
h1?: EditorThemeClassName;
|
|
41
|
+
h2?: EditorThemeClassName;
|
|
42
|
+
h3?: EditorThemeClassName;
|
|
43
|
+
h4?: EditorThemeClassName;
|
|
44
|
+
h5?: EditorThemeClassName;
|
|
45
|
+
h6?: EditorThemeClassName;
|
|
46
|
+
};
|
|
47
|
+
image?: EditorThemeClassName;
|
|
48
|
+
link?: EditorThemeClassName;
|
|
49
|
+
list?: {
|
|
50
|
+
ul?: EditorThemeClassName;
|
|
51
|
+
ulDepth?: Array<EditorThemeClassName>;
|
|
52
|
+
ol?: EditorThemeClassName;
|
|
53
|
+
olDepth?: Array<EditorThemeClassName>;
|
|
54
|
+
listitem?: EditorThemeClassName;
|
|
55
|
+
listitemChecked?: EditorThemeClassName;
|
|
56
|
+
listitemUnchecked?: EditorThemeClassName;
|
|
57
|
+
nested?: {
|
|
58
|
+
list?: EditorThemeClassName;
|
|
59
|
+
listitem?: EditorThemeClassName;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
ltr?: EditorThemeClassName;
|
|
63
|
+
mark?: EditorThemeClassName;
|
|
64
|
+
markOverlap?: EditorThemeClassName;
|
|
65
|
+
paragraph?: EditorThemeClassName;
|
|
66
|
+
quote?: EditorThemeClassName;
|
|
67
|
+
root?: EditorThemeClassName;
|
|
68
|
+
rtl?: EditorThemeClassName;
|
|
69
|
+
table?: EditorThemeClassName;
|
|
70
|
+
tableCell?: EditorThemeClassName;
|
|
71
|
+
tableCellHeader?: EditorThemeClassName;
|
|
72
|
+
tableRow?: EditorThemeClassName;
|
|
73
|
+
text?: TextNodeThemeClasses;
|
|
74
|
+
embedBlock?: {
|
|
75
|
+
base?: EditorThemeClassName;
|
|
76
|
+
focus?: EditorThemeClassName;
|
|
77
|
+
};
|
|
78
|
+
[key: string]: any;
|
|
79
|
+
};
|
|
80
|
+
export declare type EditorConfig = {
|
|
81
|
+
disableEvents?: boolean;
|
|
82
|
+
namespace: string;
|
|
83
|
+
theme: EditorThemeClasses;
|
|
84
|
+
};
|
|
85
|
+
export declare type RegisteredNodes = Map<string, RegisteredNode>;
|
|
86
|
+
export declare type RegisteredNode = {
|
|
87
|
+
klass: Klass<LexicalNode>;
|
|
88
|
+
transforms: Set<Transform<LexicalNode>>;
|
|
89
|
+
};
|
|
90
|
+
export declare type Transform<T extends LexicalNode> = (node: T) => void;
|
|
91
|
+
export declare type ErrorHandler = (error: Error) => void;
|
|
92
|
+
export declare type MutationListeners = Map<MutationListener, Klass<LexicalNode>>;
|
|
93
|
+
export declare type MutatedNodes = Map<Klass<LexicalNode>, Map<NodeKey, NodeMutation>>;
|
|
94
|
+
export declare type NodeMutation = 'created' | 'updated' | 'destroyed';
|
|
95
|
+
export declare type UpdateListener = (arg0: {
|
|
96
|
+
dirtyElements: Map<NodeKey, IntentionallyMarkedAsDirtyElement>;
|
|
97
|
+
dirtyLeaves: Set<NodeKey>;
|
|
98
|
+
editorState: EditorState;
|
|
99
|
+
normalizedNodes: Set<NodeKey>;
|
|
100
|
+
prevEditorState: EditorState;
|
|
101
|
+
tags: Set<string>;
|
|
102
|
+
}) => void;
|
|
103
|
+
export declare type DecoratorListener<T = never> = (decorator: Record<NodeKey, T>) => void;
|
|
104
|
+
export declare type RootListener = (rootElement: null | HTMLElement, prevRootElement: null | HTMLElement) => void;
|
|
105
|
+
export declare type TextContentListener = (text: string) => void;
|
|
106
|
+
export declare type MutationListener = (nodes: Map<NodeKey, NodeMutation>) => void;
|
|
107
|
+
export declare type CommandListener<P> = (payload: P, editor: LexicalEditor) => boolean;
|
|
108
|
+
export declare type ReadOnlyListener = (readOnly: boolean) => void;
|
|
109
|
+
export declare type CommandListenerPriority = 0 | 1 | 2 | 3 | 4;
|
|
110
|
+
export declare const COMMAND_PRIORITY_EDITOR = 0;
|
|
111
|
+
export declare const COMMAND_PRIORITY_LOW = 1;
|
|
112
|
+
export declare const COMMAND_PRIORITY_NORMAL = 2;
|
|
113
|
+
export declare const COMMAND_PRIORITY_HIGH = 3;
|
|
114
|
+
export declare const COMMAND_PRIORITY_CRITICAL = 4;
|
|
115
|
+
export declare type LexicalCommand<T = never> = Readonly<Record<string, unknown>>;
|
|
116
|
+
declare type Commands = Map<LexicalCommand<unknown>, Array<Set<CommandListener<unknown>>>>;
|
|
117
|
+
declare type Listeners = {
|
|
118
|
+
decorator: Set<DecoratorListener>;
|
|
119
|
+
mutation: MutationListeners;
|
|
120
|
+
readonly: Set<ReadOnlyListener>;
|
|
121
|
+
root: Set<RootListener>;
|
|
122
|
+
textcontent: Set<TextContentListener>;
|
|
123
|
+
update: Set<UpdateListener>;
|
|
124
|
+
};
|
|
125
|
+
export declare type Listener = DecoratorListener | ReadOnlyListener | MutationListener | RootListener | TextContentListener | UpdateListener;
|
|
126
|
+
export declare type ListenerType = 'update' | 'root' | 'decorator' | 'textcontent' | 'mutation' | 'readonly';
|
|
127
|
+
export declare type TransformerType = 'text' | 'decorator' | 'element' | 'root';
|
|
128
|
+
export declare type IntentionallyMarkedAsDirtyElement = boolean;
|
|
129
|
+
declare type DOMConversionCache = Map<string, Array<(node: Node) => DOMConversion | null>>;
|
|
130
|
+
export declare type SerializedEditor = {
|
|
131
|
+
editorState: SerializedEditorState;
|
|
132
|
+
};
|
|
133
|
+
export declare function resetEditor(editor: LexicalEditor, prevRootElement: null | HTMLElement, nextRootElement: null | HTMLElement, pendingEditorState: EditorState): void;
|
|
134
|
+
export declare function createEditor(editorConfig?: {
|
|
135
|
+
disableEvents?: boolean;
|
|
136
|
+
editorState?: EditorState;
|
|
137
|
+
namespace?: string;
|
|
138
|
+
nodes?: ReadonlyArray<Klass<LexicalNode>>;
|
|
139
|
+
onError?: ErrorHandler;
|
|
140
|
+
parentEditor?: LexicalEditor;
|
|
141
|
+
readOnly?: boolean;
|
|
142
|
+
theme?: EditorThemeClasses;
|
|
143
|
+
}): LexicalEditor;
|
|
144
|
+
export declare class LexicalEditor {
|
|
145
|
+
_headless: boolean;
|
|
146
|
+
_parentEditor: null | LexicalEditor;
|
|
147
|
+
_rootElement: null | HTMLElement;
|
|
148
|
+
_editorState: EditorState;
|
|
149
|
+
_pendingEditorState: null | EditorState;
|
|
150
|
+
_compositionKey: null | NodeKey;
|
|
151
|
+
_deferred: Array<() => void>;
|
|
152
|
+
_keyToDOMMap: Map<NodeKey, HTMLElement>;
|
|
153
|
+
_updates: Array<[() => void, EditorUpdateOptions | undefined]>;
|
|
154
|
+
_updating: boolean;
|
|
155
|
+
_listeners: Listeners;
|
|
156
|
+
_commands: Commands;
|
|
157
|
+
_nodes: RegisteredNodes;
|
|
158
|
+
_decorators: Record<NodeKey, unknown>;
|
|
159
|
+
_pendingDecorators: null | Record<NodeKey, unknown>;
|
|
160
|
+
_config: EditorConfig;
|
|
161
|
+
_dirtyType: 0 | 1 | 2;
|
|
162
|
+
_cloneNotNeeded: Set<NodeKey>;
|
|
163
|
+
_dirtyLeaves: Set<NodeKey>;
|
|
164
|
+
_dirtyElements: Map<NodeKey, IntentionallyMarkedAsDirtyElement>;
|
|
165
|
+
_normalizedNodes: Set<NodeKey>;
|
|
166
|
+
_updateTags: Set<string>;
|
|
167
|
+
_observer: null | MutationObserver;
|
|
168
|
+
_key: string;
|
|
169
|
+
_onError: ErrorHandler;
|
|
170
|
+
_htmlConversions: DOMConversionCache;
|
|
171
|
+
_readOnly: boolean;
|
|
172
|
+
constructor(editorState: EditorState, parentEditor: null | LexicalEditor, nodes: RegisteredNodes, config: EditorConfig, onError: ErrorHandler, htmlConversions: DOMConversionCache, readOnly: boolean);
|
|
173
|
+
isComposing(): boolean;
|
|
174
|
+
registerUpdateListener(listener: UpdateListener): () => void;
|
|
175
|
+
registerReadOnlyListener(listener: ReadOnlyListener): () => void;
|
|
176
|
+
registerDecoratorListener<T>(listener: DecoratorListener<T>): () => void;
|
|
177
|
+
registerTextContentListener(listener: TextContentListener): () => void;
|
|
178
|
+
registerRootListener(listener: RootListener): () => void;
|
|
179
|
+
registerCommand<P>(command: LexicalCommand<P>, listener: CommandListener<P>, priority: CommandListenerPriority): () => void;
|
|
180
|
+
registerMutationListener(klass: Klass<LexicalNode>, listener: MutationListener): () => void;
|
|
181
|
+
registerNodeTransform<T extends LexicalNode>(klass: Klass<T>, listener: Transform<T>): () => void;
|
|
182
|
+
hasNodes<T extends Klass<LexicalNode>>(nodes: Array<T>): boolean;
|
|
183
|
+
dispatchCommand<P>(type: LexicalCommand<P>, payload: P): boolean;
|
|
184
|
+
getDecorators<T>(): Record<NodeKey, T>;
|
|
185
|
+
getRootElement(): null | HTMLElement;
|
|
186
|
+
getKey(): string;
|
|
187
|
+
setRootElement(nextRootElement: null | HTMLElement): void;
|
|
188
|
+
getElementByKey(key: NodeKey): HTMLElement | null;
|
|
189
|
+
getEditorState(): EditorState;
|
|
190
|
+
setEditorState(editorState: EditorState, options?: EditorSetOptions): void;
|
|
191
|
+
parseEditorState(maybeStringifiedEditorState: string | SerializedEditorState, updateFn?: () => void): EditorState;
|
|
192
|
+
update(updateFn: () => void, options?: EditorUpdateOptions): void;
|
|
193
|
+
focus(callbackFn?: () => void): void;
|
|
194
|
+
blur(): void;
|
|
195
|
+
isReadOnly(): boolean;
|
|
196
|
+
setReadOnly(readOnly: boolean): void;
|
|
197
|
+
toJSON(): SerializedEditor;
|
|
198
|
+
}
|
|
199
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { LexicalEditor } from './LexicalEditor';
|
|
9
|
+
import type { NodeMap } from './LexicalNode';
|
|
10
|
+
import type { GridSelection, NodeSelection, RangeSelection } from './LexicalSelection';
|
|
11
|
+
import type { SerializedRootNode } from './nodes/LexicalRootNode';
|
|
12
|
+
export interface SerializedEditorState {
|
|
13
|
+
root: SerializedRootNode;
|
|
14
|
+
}
|
|
15
|
+
export declare function editorStateHasDirtySelection(editorState: EditorState, editor: LexicalEditor): boolean;
|
|
16
|
+
export declare function cloneEditorState(current: EditorState): EditorState;
|
|
17
|
+
export declare function createEmptyEditorState(): EditorState;
|
|
18
|
+
export declare class EditorState {
|
|
19
|
+
_nodeMap: NodeMap;
|
|
20
|
+
_selection: null | RangeSelection | NodeSelection | GridSelection;
|
|
21
|
+
_flushSync: boolean;
|
|
22
|
+
_readOnly: boolean;
|
|
23
|
+
constructor(nodeMap: NodeMap, selection?: RangeSelection | NodeSelection | GridSelection | null);
|
|
24
|
+
isEmpty(): boolean;
|
|
25
|
+
read<V>(callbackFn: () => V): V;
|
|
26
|
+
clone(selection?: RangeSelection | NodeSelection | GridSelection | null): EditorState;
|
|
27
|
+
toJSON(): SerializedEditorState;
|
|
28
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { LexicalEditor } from './LexicalEditor';
|
|
9
|
+
import type { NodeKey } from './LexicalNode';
|
|
10
|
+
export declare type EventHandler = (event: Event, editor: LexicalEditor) => void;
|
|
11
|
+
export declare function addRootElementEvents(rootElement: HTMLElement, editor: LexicalEditor): void;
|
|
12
|
+
export declare function removeRootElementEvents(rootElement: HTMLElement): void;
|
|
13
|
+
export declare function markSelectionChangeFromDOMUpdate(): void;
|
|
14
|
+
export declare function markCollapsedSelectionFormat(format: number, offset: number, key: NodeKey, timeStamp: number): void;
|
package/LexicalGC.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { IntentionallyMarkedAsDirtyElement, LexicalEditor } from './LexicalEditor';
|
|
9
|
+
import type { EditorState } from './LexicalEditorState';
|
|
10
|
+
import type { NodeKey } from './LexicalNode';
|
|
11
|
+
export declare function $garbageCollectDetachedDecorators(editor: LexicalEditor, pendingEditorState: EditorState): void;
|
|
12
|
+
export declare function $garbageCollectDetachedNodes(prevEditorState: EditorState, editorState: EditorState, dirtyLeaves: Set<NodeKey>, dirtyElements: Map<NodeKey, IntentionallyMarkedAsDirtyElement>): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { LexicalEditor } from './LexicalEditor';
|
|
9
|
+
export declare function getIsProcesssingMutations(): boolean;
|
|
10
|
+
export declare function $flushMutations(editor: LexicalEditor, mutations: Array<MutationRecord>, observer: MutationObserver): void;
|
|
11
|
+
export declare function flushRootMutations(editor: LexicalEditor): void;
|
|
12
|
+
export declare function initMutationObserver(editor: LexicalEditor): void;
|
package/LexicalNode.d.ts
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { EditorConfig, LexicalEditor } from './LexicalEditor';
|
|
9
|
+
import type { RangeSelection } from './LexicalSelection';
|
|
10
|
+
import { ElementNode } from '.';
|
|
11
|
+
export declare type NodeMap = Map<NodeKey, LexicalNode>;
|
|
12
|
+
export declare type SerializedLexicalNode = {
|
|
13
|
+
type: string;
|
|
14
|
+
version: number;
|
|
15
|
+
};
|
|
16
|
+
export declare function removeNode(nodeToRemove: LexicalNode, restoreSelection: boolean, preserveEmptyParent?: boolean): void;
|
|
17
|
+
export declare function $getNodeByKeyOrThrow<N extends LexicalNode>(key: NodeKey): N;
|
|
18
|
+
export declare type DOMConversion<T extends HTMLElement = HTMLElement> = {
|
|
19
|
+
conversion: DOMConversionFn<T>;
|
|
20
|
+
priority: 0 | 1 | 2 | 3 | 4;
|
|
21
|
+
};
|
|
22
|
+
export declare type DOMConversionFn<T extends HTMLElement = HTMLElement> = (element: T, parent?: Node) => DOMConversionOutput | null;
|
|
23
|
+
export declare type DOMChildConversion = (lexicalNode: LexicalNode, parentLexicalNode: LexicalNode | null | undefined) => LexicalNode | null | undefined;
|
|
24
|
+
export declare type DOMConversionMap<T extends HTMLElement = HTMLElement> = Record<NodeName, (node: T) => DOMConversion<T> | null>;
|
|
25
|
+
declare type NodeName = string;
|
|
26
|
+
export declare type DOMConversionOutput = {
|
|
27
|
+
after?: (childLexicalNodes: Array<LexicalNode>) => Array<LexicalNode>;
|
|
28
|
+
forChild?: DOMChildConversion;
|
|
29
|
+
node: LexicalNode | null;
|
|
30
|
+
};
|
|
31
|
+
export declare type DOMExportOutput = {
|
|
32
|
+
after?: (generatedElement: HTMLElement | null | undefined) => HTMLElement | null | undefined;
|
|
33
|
+
element: HTMLElement | null;
|
|
34
|
+
};
|
|
35
|
+
export declare type NodeKey = string;
|
|
36
|
+
export declare class LexicalNode {
|
|
37
|
+
[x: string]: any;
|
|
38
|
+
__type: string;
|
|
39
|
+
__key: string;
|
|
40
|
+
__parent: null | NodeKey;
|
|
41
|
+
static getType(): string;
|
|
42
|
+
static clone(_data: unknown): LexicalNode;
|
|
43
|
+
constructor(key?: NodeKey);
|
|
44
|
+
getType(): string;
|
|
45
|
+
isAttached(): boolean;
|
|
46
|
+
isSelected(): boolean;
|
|
47
|
+
getKey(): NodeKey;
|
|
48
|
+
getIndexWithinParent(): number;
|
|
49
|
+
getParent<T extends ElementNode>(): T | null;
|
|
50
|
+
getParentOrThrow<T extends ElementNode>(): T;
|
|
51
|
+
getTopLevelElement(): ElementNode | this | null;
|
|
52
|
+
getTopLevelElementOrThrow(): ElementNode | this;
|
|
53
|
+
getParents(): Array<ElementNode>;
|
|
54
|
+
getParentKeys(): Array<NodeKey>;
|
|
55
|
+
getPreviousSibling<T extends LexicalNode>(): T | null;
|
|
56
|
+
getPreviousSiblings<T extends LexicalNode>(): Array<T>;
|
|
57
|
+
getNextSibling<T extends LexicalNode>(): T | null;
|
|
58
|
+
getNextSiblings<T extends LexicalNode>(): Array<T>;
|
|
59
|
+
getCommonAncestor<T extends ElementNode = ElementNode>(node: LexicalNode): T | null;
|
|
60
|
+
is(object: LexicalNode | null | undefined): boolean;
|
|
61
|
+
isBefore(targetNode: LexicalNode): boolean;
|
|
62
|
+
isParentOf(targetNode: LexicalNode): boolean;
|
|
63
|
+
getNodesBetween(targetNode: LexicalNode): Array<LexicalNode>;
|
|
64
|
+
isDirty(): boolean;
|
|
65
|
+
getLatest(): this;
|
|
66
|
+
getWritable(): this;
|
|
67
|
+
getTextContent(_includeInert?: boolean, _includeDirectionless?: false): string;
|
|
68
|
+
getTextContentSize(includeInert?: boolean, includeDirectionless?: false): number;
|
|
69
|
+
createDOM(_config: EditorConfig, _editor: LexicalEditor): HTMLElement;
|
|
70
|
+
updateDOM(_prevNode: unknown, _dom: HTMLElement, _config: EditorConfig): boolean;
|
|
71
|
+
exportDOM(editor: LexicalEditor): DOMExportOutput;
|
|
72
|
+
exportJSON(): SerializedLexicalNode;
|
|
73
|
+
static importJSON(_serializedNode: SerializedLexicalNode): LexicalNode;
|
|
74
|
+
remove(preserveEmptyParent?: boolean): void;
|
|
75
|
+
replace<N extends LexicalNode>(replaceWith: N): N;
|
|
76
|
+
insertAfter(nodeToInsert: LexicalNode): LexicalNode;
|
|
77
|
+
insertBefore(nodeToInsert: LexicalNode): LexicalNode;
|
|
78
|
+
selectPrevious(anchorOffset?: number, focusOffset?: number): RangeSelection;
|
|
79
|
+
selectNext(anchorOffset?: number, focusOffset?: number): RangeSelection;
|
|
80
|
+
markDirty(): void;
|
|
81
|
+
}
|
|
82
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { TextNode } from '.';
|
|
9
|
+
export declare function $normalizeTextNode(textNode: TextNode): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { IntentionallyMarkedAsDirtyElement, LexicalEditor, MutatedNodes } from './LexicalEditor';
|
|
9
|
+
import type { NodeKey } from './LexicalNode';
|
|
10
|
+
import { EditorState } from './LexicalEditorState';
|
|
11
|
+
export declare function reconcileRoot(prevEditorState: EditorState, nextEditorState: EditorState, editor: LexicalEditor, dirtyType: 0 | 1 | 2, dirtyElements: Map<NodeKey, IntentionallyMarkedAsDirtyElement>, dirtyLeaves: Set<NodeKey>): MutatedNodes;
|
|
12
|
+
export declare function storeDOMWithKey(key: NodeKey, dom: HTMLElement, editor: LexicalEditor): void;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { LexicalEditor } from './LexicalEditor';
|
|
9
|
+
import type { EditorState } from './LexicalEditorState';
|
|
10
|
+
import type { LexicalNode, NodeKey } from './LexicalNode';
|
|
11
|
+
import type { ElementNode } from './nodes/LexicalElementNode';
|
|
12
|
+
import type { TextFormatType } from './nodes/LexicalTextNode';
|
|
13
|
+
import { TextNode } from '.';
|
|
14
|
+
export declare type TextPointType = {
|
|
15
|
+
_selection: RangeSelection | GridSelection;
|
|
16
|
+
getNode: () => TextNode;
|
|
17
|
+
is: (point: PointType) => boolean;
|
|
18
|
+
isAtNodeEnd: () => boolean;
|
|
19
|
+
isBefore: (point: PointType) => boolean;
|
|
20
|
+
key: NodeKey;
|
|
21
|
+
offset: number;
|
|
22
|
+
set: (key: NodeKey, offset: number, type: 'text' | 'element') => void;
|
|
23
|
+
type: 'text';
|
|
24
|
+
};
|
|
25
|
+
export declare type ElementPointType = {
|
|
26
|
+
_selection: RangeSelection | GridSelection;
|
|
27
|
+
getNode: () => ElementNode;
|
|
28
|
+
is: (point: PointType) => boolean;
|
|
29
|
+
isAtNodeEnd: () => boolean;
|
|
30
|
+
isBefore: (point: PointType) => boolean;
|
|
31
|
+
key: NodeKey;
|
|
32
|
+
offset: number;
|
|
33
|
+
set: (key: NodeKey, offset: number, type: 'text' | 'element') => void;
|
|
34
|
+
type: 'element';
|
|
35
|
+
};
|
|
36
|
+
export declare type PointType = TextPointType | ElementPointType;
|
|
37
|
+
export declare class Point {
|
|
38
|
+
key: NodeKey;
|
|
39
|
+
offset: number;
|
|
40
|
+
type: 'text' | 'element';
|
|
41
|
+
_selection: RangeSelection | GridSelection | null;
|
|
42
|
+
constructor(key: NodeKey, offset: number, type: 'text' | 'element');
|
|
43
|
+
is(point: PointType): boolean;
|
|
44
|
+
isBefore(b: PointType): boolean;
|
|
45
|
+
getNode(): LexicalNode;
|
|
46
|
+
set(key: NodeKey, offset: number, type: 'text' | 'element'): void;
|
|
47
|
+
}
|
|
48
|
+
export declare function $moveSelectionPointToEnd(point: PointType, node: LexicalNode): void;
|
|
49
|
+
export interface BaseSelection {
|
|
50
|
+
clone(): BaseSelection;
|
|
51
|
+
dirty: boolean;
|
|
52
|
+
extract(): Array<LexicalNode>;
|
|
53
|
+
getNodes(): Array<LexicalNode>;
|
|
54
|
+
getTextContent(): string;
|
|
55
|
+
insertRawText(text: string): void;
|
|
56
|
+
is(selection: null | RangeSelection | NodeSelection | GridSelection): boolean;
|
|
57
|
+
}
|
|
58
|
+
export declare class NodeSelection implements BaseSelection {
|
|
59
|
+
_nodes: Set<NodeKey>;
|
|
60
|
+
dirty: boolean;
|
|
61
|
+
_cachedNodes: null | Array<LexicalNode>;
|
|
62
|
+
constructor(objects: Set<NodeKey>);
|
|
63
|
+
is(selection: null | RangeSelection | NodeSelection | GridSelection): boolean;
|
|
64
|
+
add(key: NodeKey): void;
|
|
65
|
+
delete(key: NodeKey): void;
|
|
66
|
+
clear(): void;
|
|
67
|
+
has(key: NodeKey): boolean;
|
|
68
|
+
clone(): NodeSelection;
|
|
69
|
+
extract(): Array<LexicalNode>;
|
|
70
|
+
insertRawText(text: string): void;
|
|
71
|
+
insertText(): void;
|
|
72
|
+
getNodes(): Array<LexicalNode>;
|
|
73
|
+
getTextContent(): string;
|
|
74
|
+
}
|
|
75
|
+
export declare function $isRangeSelection(x: unknown): x is RangeSelection;
|
|
76
|
+
export declare type GridSelectionShape = {
|
|
77
|
+
fromX: number;
|
|
78
|
+
fromY: number;
|
|
79
|
+
toX: number;
|
|
80
|
+
toY: number;
|
|
81
|
+
};
|
|
82
|
+
export declare class GridSelection implements BaseSelection {
|
|
83
|
+
gridKey: NodeKey;
|
|
84
|
+
anchor: PointType;
|
|
85
|
+
focus: PointType;
|
|
86
|
+
dirty: boolean;
|
|
87
|
+
_cachedNodes: Array<LexicalNode> | null;
|
|
88
|
+
constructor(gridKey: NodeKey, anchor: PointType, focus: PointType);
|
|
89
|
+
is(selection: null | RangeSelection | NodeSelection | GridSelection): boolean;
|
|
90
|
+
set(gridKey: NodeKey, anchorCellKey: NodeKey, focusCellKey: NodeKey): void;
|
|
91
|
+
clone(): GridSelection;
|
|
92
|
+
isCollapsed(): boolean;
|
|
93
|
+
isBackward(): boolean;
|
|
94
|
+
getCharacterOffsets(): [number, number];
|
|
95
|
+
extract(): Array<LexicalNode>;
|
|
96
|
+
insertRawText(text: string): void;
|
|
97
|
+
insertText(): void;
|
|
98
|
+
getShape(): GridSelectionShape;
|
|
99
|
+
getNodes(): Array<LexicalNode>;
|
|
100
|
+
getTextContent(): string;
|
|
101
|
+
}
|
|
102
|
+
export declare function $isGridSelection(x: unknown): x is GridSelection;
|
|
103
|
+
export declare class RangeSelection implements BaseSelection {
|
|
104
|
+
anchor: PointType;
|
|
105
|
+
focus: PointType;
|
|
106
|
+
dirty: boolean;
|
|
107
|
+
format: number;
|
|
108
|
+
_cachedNodes: null | Array<LexicalNode>;
|
|
109
|
+
constructor(anchor: PointType, focus: PointType, format: number);
|
|
110
|
+
is(selection: null | RangeSelection | NodeSelection | GridSelection): boolean;
|
|
111
|
+
isBackward(): boolean;
|
|
112
|
+
isCollapsed(): boolean;
|
|
113
|
+
getNodes(): Array<LexicalNode>;
|
|
114
|
+
setTextNodeRange(anchorNode: TextNode, anchorOffset: number, focusNode: TextNode, focusOffset: number): void;
|
|
115
|
+
getTextContent(): string;
|
|
116
|
+
applyDOMRange(range: StaticRange): void;
|
|
117
|
+
clone(): RangeSelection;
|
|
118
|
+
toggleFormat(format: TextFormatType): void;
|
|
119
|
+
hasFormat(type: TextFormatType): boolean;
|
|
120
|
+
insertRawText(text: string): void;
|
|
121
|
+
insertText(text: string): void;
|
|
122
|
+
removeText(): void;
|
|
123
|
+
formatText(formatType: TextFormatType): void;
|
|
124
|
+
insertNodes(nodes: Array<LexicalNode>, selectStart?: boolean): boolean;
|
|
125
|
+
insertParagraph(): void;
|
|
126
|
+
insertLineBreak(selectStart?: boolean): void;
|
|
127
|
+
getCharacterOffsets(): [number, number];
|
|
128
|
+
extract(): Array<LexicalNode>;
|
|
129
|
+
modify(alter: 'move' | 'extend', isBackward: boolean, granularity: 'character' | 'word' | 'lineboundary'): void;
|
|
130
|
+
deleteCharacter(isBackward: boolean): void;
|
|
131
|
+
deleteLine(isBackward: boolean): void;
|
|
132
|
+
deleteWord(isBackward: boolean): void;
|
|
133
|
+
}
|
|
134
|
+
export declare function $isNodeSelection(x: unknown): x is NodeSelection;
|
|
135
|
+
export declare function internalMakeRangeSelection(anchorKey: NodeKey, anchorOffset: number, focusKey: NodeKey, focusOffset: number, anchorType: 'text' | 'element', focusType: 'text' | 'element'): RangeSelection;
|
|
136
|
+
export declare function $createRangeSelection(): RangeSelection;
|
|
137
|
+
export declare function $createNodeSelection(): NodeSelection;
|
|
138
|
+
export declare function $createGridSelection(): GridSelection;
|
|
139
|
+
export declare function internalCreateSelection(editor: LexicalEditor): null | RangeSelection | NodeSelection | GridSelection;
|
|
140
|
+
export declare function internalCreateRangeSelection(lastSelection: null | RangeSelection | NodeSelection | GridSelection, domSelection: Selection | null, editor: LexicalEditor): null | RangeSelection;
|
|
141
|
+
export declare function $getSelection(): null | RangeSelection | NodeSelection | GridSelection;
|
|
142
|
+
export declare function $getPreviousSelection(): null | RangeSelection | NodeSelection | GridSelection;
|
|
143
|
+
export declare function $updateElementSelectionOnCreateDeleteNode(selection: RangeSelection, parentNode: LexicalNode, nodeOffset: number, times?: number): void;
|
|
144
|
+
export declare function applySelectionTransforms(nextEditorState: EditorState, editor: LexicalEditor): void;
|
|
145
|
+
export declare function moveSelectionPointToSibling(point: PointType, node: LexicalNode, parent: ElementNode, prevSibling: LexicalNode | null, nextSibling: LexicalNode | null): void;
|
|
146
|
+
export declare function adjustPointOffsetForMergedSibling(point: PointType, isBefore: boolean, key: NodeKey, target: TextNode, textLength: number): void;
|
|
147
|
+
export declare function updateDOMSelection(prevSelection: RangeSelection | NodeSelection | GridSelection | null, nextSelection: RangeSelection | NodeSelection | GridSelection | null, editor: LexicalEditor, domSelection: Selection, tags: Set<string>, rootElement: HTMLElement): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { EditorUpdateOptions, LexicalCommand, LexicalEditor, Transform } from './LexicalEditor';
|
|
9
|
+
import type { SerializedEditorState } from './LexicalEditorState';
|
|
10
|
+
import type { LexicalNode, SerializedLexicalNode } from './LexicalNode';
|
|
11
|
+
import { EditorState } from './LexicalEditorState';
|
|
12
|
+
export declare function isCurrentlyReadOnlyMode(): boolean;
|
|
13
|
+
export declare function errorOnReadOnly(): void;
|
|
14
|
+
export declare function errorOnInfiniteTransforms(): void;
|
|
15
|
+
export declare function getActiveEditorState(): EditorState;
|
|
16
|
+
export declare function getActiveEditor(): LexicalEditor;
|
|
17
|
+
export declare function $applyTransforms(editor: LexicalEditor, node: LexicalNode, transformsCache: Map<string, Array<Transform<LexicalNode>>>): void;
|
|
18
|
+
export declare function $parseSerializedNode(serializedNode: SerializedLexicalNode): LexicalNode;
|
|
19
|
+
export declare function parseEditorState(serializedEditorState: SerializedEditorState, editor: LexicalEditor, updateFn: void | (() => void)): EditorState;
|
|
20
|
+
export declare function readEditorState<V>(editorState: EditorState, callbackFn: () => V): V;
|
|
21
|
+
export declare function commitPendingUpdates(editor: LexicalEditor): void;
|
|
22
|
+
export declare function triggerListeners(type: 'update' | 'root' | 'decorator' | 'textcontent' | 'readonly', editor: LexicalEditor, isCurrentlyEnqueuingUpdates: boolean, ...payload: unknown[]): void;
|
|
23
|
+
export declare function triggerCommandListeners<P>(editor: LexicalEditor, type: LexicalCommand<P>, payload: P): boolean;
|
|
24
|
+
export declare function updateEditor(editor: LexicalEditor, updateFn: () => void, options?: EditorUpdateOptions): void;
|
|
25
|
+
export declare function internalGetActiveEditor(): null | LexicalEditor;
|