slate-vue3 0.0.1

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.
@@ -0,0 +1,2825 @@
1
+ import { ComponentOptionsMixin } from 'vue';
2
+ import { ComponentProvideOptions } from 'vue';
3
+ import { ComputedRef } from 'vue';
4
+ import { CSSProperties } from 'vue';
5
+ import { DefineComponent } from 'vue';
6
+ import { HTMLAttributes } from 'vue';
7
+ import { JSX } from 'vue/jsx-runtime';
8
+ import { PublicProps } from 'vue';
9
+ import { Ref } from 'vue';
10
+ import { RendererElement } from 'vue';
11
+ import { RendererNode } from 'vue';
12
+ import { VNode } from 'vue';
13
+ import { VNodeRef } from 'vue';
14
+
15
+ export declare const above: EditorInterface['above'];
16
+
17
+ declare type Action = {
18
+ at?: Point | Range_2;
19
+ run: () => void;
20
+ };
21
+
22
+ export declare const addMark: EditorInterface['addMark'];
23
+
24
+ export declare const after: EditorInterface['after'];
25
+
26
+ /**
27
+ * The `Ancestor` union type represents nodes that are ancestors in the tree.
28
+ * It is returned as a convenience in certain cases to narrow a value further
29
+ * than the more generic `Node` union.
30
+ */
31
+ export declare type Ancestor = Editor | Element_2;
32
+
33
+ export declare const apply: WithEditorFirstArg<Editor['apply']>;
34
+
35
+ export declare function applyStringDiff(text: string, ...diffs: StringDiff[]): string;
36
+
37
+ /**
38
+ * The `Editor` interface stores all the state of a Slate editor. It is extended
39
+ * by plugins that wish to add their own helpers and implement new behaviors.
40
+ */
41
+ export declare interface BaseEditor {
42
+ children: Descendant[];
43
+ selection: Selection_2;
44
+ operations: Operation[];
45
+ marks: EditorMarks | null;
46
+ apply: (operation: Operation) => void;
47
+ getDirtyPaths: (operation: Operation) => Path[];
48
+ getFragment: () => Descendant[];
49
+ isElementReadOnly: (element: Element_2) => boolean;
50
+ isSelectable: (element: Element_2) => boolean;
51
+ markableVoid: (element: Element_2) => boolean;
52
+ normalizeNode: (entry: NodeEntry, options?: {
53
+ operation?: Operation;
54
+ }) => void;
55
+ onChange: (options?: {
56
+ operation?: Operation;
57
+ }) => void;
58
+ shouldNormalize: ({ iteration, dirtyPaths, operation, }: {
59
+ iteration: number;
60
+ initialDirtyPathsLength: number;
61
+ dirtyPaths: Path[];
62
+ operation?: Operation;
63
+ }) => boolean;
64
+ addMark: OmitFirstArg<typeof Editor.addMark>;
65
+ collapse: OmitFirstArg<typeof Transforms.collapse>;
66
+ delete: OmitFirstArg<typeof Transforms.delete>;
67
+ deleteBackward: (unit: TextUnit) => void;
68
+ deleteForward: (unit: TextUnit) => void;
69
+ deleteFragment: OmitFirstArg<typeof Editor.deleteFragment>;
70
+ deselect: OmitFirstArg<typeof Transforms.deselect>;
71
+ insertBreak: OmitFirstArg<typeof Editor.insertBreak>;
72
+ insertFragment: OmitFirstArg<typeof Transforms.insertFragment>;
73
+ insertNode: OmitFirstArg<typeof Editor.insertNode>;
74
+ insertNodes: OmitFirstArg<typeof Transforms.insertNodes>;
75
+ insertSoftBreak: OmitFirstArg<typeof Editor.insertSoftBreak>;
76
+ insertText: OmitFirstArg<typeof Transforms.insertText>;
77
+ liftNodes: OmitFirstArg<typeof Transforms.liftNodes>;
78
+ mergeNodes: OmitFirstArg<typeof Transforms.mergeNodes>;
79
+ move: OmitFirstArg<typeof Transforms.move>;
80
+ moveNodes: OmitFirstArg<typeof Transforms.moveNodes>;
81
+ normalize: OmitFirstArg<typeof Editor.normalize>;
82
+ removeMark: OmitFirstArg<typeof Editor.removeMark>;
83
+ removeNodes: OmitFirstArg<typeof Transforms.removeNodes>;
84
+ select: OmitFirstArg<typeof Transforms.select>;
85
+ setNodes: <T extends Node_2>(props: Partial<T>, options?: {
86
+ at?: Location_2;
87
+ match?: NodeMatch<T>;
88
+ mode?: MaximizeMode;
89
+ hanging?: boolean;
90
+ split?: boolean;
91
+ voids?: boolean;
92
+ compare?: PropsCompare;
93
+ merge?: PropsMerge;
94
+ }) => void;
95
+ setNormalizing: OmitFirstArg<typeof Editor.setNormalizing>;
96
+ setPoint: OmitFirstArg<typeof Transforms.setPoint>;
97
+ setSelection: OmitFirstArg<typeof Transforms.setSelection>;
98
+ splitNodes: OmitFirstArg<typeof Transforms.splitNodes>;
99
+ unsetNodes: OmitFirstArg<typeof Transforms.unsetNodes>;
100
+ unwrapNodes: OmitFirstArg<typeof Transforms.unwrapNodes>;
101
+ withoutNormalizing: OmitFirstArg<typeof Editor.withoutNormalizing>;
102
+ wrapNodes: OmitFirstArg<typeof Transforms.wrapNodes>;
103
+ above: <T extends Ancestor>(options?: EditorAboveOptions<T>) => NodeEntry<T> | undefined;
104
+ after: OmitFirstArg<typeof Editor.after>;
105
+ before: OmitFirstArg<typeof Editor.before>;
106
+ edges: OmitFirstArg<typeof Editor.edges>;
107
+ elementReadOnly: OmitFirstArg<typeof Editor.elementReadOnly>;
108
+ end: OmitFirstArg<typeof Editor.end>;
109
+ first: OmitFirstArg<typeof Editor.first>;
110
+ fragment: OmitFirstArg<typeof Editor.fragment>;
111
+ getMarks: OmitFirstArg<typeof Editor.marks>;
112
+ hasBlocks: OmitFirstArg<typeof Editor.hasBlocks>;
113
+ hasInlines: OmitFirstArg<typeof Editor.hasInlines>;
114
+ hasPath: OmitFirstArg<typeof Editor.hasPath>;
115
+ hasTexts: OmitFirstArg<typeof Editor.hasTexts>;
116
+ isBlock: OmitFirstArg<typeof Editor.isBlock>;
117
+ isEdge: OmitFirstArg<typeof Editor.isEdge>;
118
+ isEmpty: OmitFirstArg<typeof Editor.isEmpty>;
119
+ isEnd: OmitFirstArg<typeof Editor.isEnd>;
120
+ isInline: OmitFirstArg<typeof Editor.isInline>;
121
+ isNormalizing: OmitFirstArg<typeof Editor.isNormalizing>;
122
+ isStart: OmitFirstArg<typeof Editor.isStart>;
123
+ isVoid: OmitFirstArg<typeof Editor.isVoid>;
124
+ last: OmitFirstArg<typeof Editor.last>;
125
+ leaf: OmitFirstArg<typeof Editor.leaf>;
126
+ levels: <T extends Node_2>(options?: EditorLevelsOptions<T>) => Generator<NodeEntry<T>, void, undefined>;
127
+ next: <T extends Descendant>(options?: EditorNextOptions<T>) => NodeEntry<T> | undefined;
128
+ node: OmitFirstArg<typeof Editor.node>;
129
+ nodes: <T extends Node_2>(options?: EditorNodesOptions<T>) => Generator<NodeEntry<T>, void, undefined>;
130
+ parent: OmitFirstArg<typeof Editor.parent>;
131
+ path: OmitFirstArg<typeof Editor.path>;
132
+ pathRef: OmitFirstArg<typeof Editor.pathRef>;
133
+ pathRefs: OmitFirstArg<typeof Editor.pathRefs>;
134
+ point: OmitFirstArg<typeof Editor.point>;
135
+ pointRef: OmitFirstArg<typeof Editor.pointRef>;
136
+ pointRefs: OmitFirstArg<typeof Editor.pointRefs>;
137
+ positions: OmitFirstArg<typeof Editor.positions>;
138
+ previous: <T extends Node_2>(options?: EditorPreviousOptions<T>) => NodeEntry<T> | undefined;
139
+ range: OmitFirstArg<typeof Editor.range>;
140
+ rangeRef: OmitFirstArg<typeof Editor.rangeRef>;
141
+ rangeRefs: OmitFirstArg<typeof Editor.rangeRefs>;
142
+ start: OmitFirstArg<typeof Editor.start>;
143
+ string: OmitFirstArg<typeof Editor.string>;
144
+ unhangRange: OmitFirstArg<typeof Editor.unhangRange>;
145
+ void: OmitFirstArg<typeof Editor.void>;
146
+ shouldMergeNodesRemovePrevNode: OmitFirstArg<typeof Editor.shouldMergeNodesRemovePrevNode>;
147
+ }
148
+
149
+ /**
150
+ * `Element` objects are a type of node in a Slate document that contain other
151
+ * element nodes or text nodes. They can be either "blocks" or "inlines"
152
+ * depending on the Slate editor's configuration.
153
+ */
154
+ export declare interface BaseElement {
155
+ children: Descendant[];
156
+ }
157
+
158
+ export declare type BaseInsertNodeOperation = {
159
+ type: 'insert_node';
160
+ path: Path;
161
+ node: Node_2;
162
+ };
163
+
164
+ export declare type BaseInsertTextOperation = {
165
+ type: 'insert_text';
166
+ path: Path;
167
+ offset: number;
168
+ text: string;
169
+ };
170
+
171
+ export declare type BaseMergeNodeOperation = {
172
+ type: 'merge_node';
173
+ path: Path;
174
+ position: number;
175
+ properties: Partial<Node_2>;
176
+ };
177
+
178
+ export declare type BaseMoveNodeOperation = {
179
+ type: 'move_node';
180
+ path: Path;
181
+ newPath: Path;
182
+ };
183
+
184
+ /**
185
+ * The `Node` union type represents all of the different types of nodes that
186
+ * occur in a Slate document tree.
187
+ */
188
+ export declare type BaseNode = Editor | Element_2 | Text_2;
189
+
190
+ /**
191
+ * `Operation` objects define the low-level instructions that Slate editors use
192
+ * to apply changes to their internal state. Representing all changes as
193
+ * operations is what allows Slate editors to easily implement history,
194
+ * collaboration, and other features.
195
+ */
196
+ export declare type BaseOperation = NodeOperation | SelectionOperation | TextOperation;
197
+
198
+ /**
199
+ * `Point` objects refer to a specific location in a text node in a Slate
200
+ * document. Its path refers to the location of the node in the tree, and its
201
+ * offset refers to the distance into the node's string of text. Points can
202
+ * only refer to `Text` nodes.
203
+ */
204
+ export declare interface BasePoint {
205
+ path: Path;
206
+ offset: number;
207
+ }
208
+
209
+ /**
210
+ * `Range` objects are a set of points that refer to a specific span of a Slate
211
+ * document. They can define a span inside a single node or a can span across
212
+ * multiple nodes.
213
+ */
214
+ export declare interface BaseRange {
215
+ anchor: Point;
216
+ focus: Point;
217
+ }
218
+
219
+ export declare type BaseRemoveNodeOperation = {
220
+ type: 'remove_node';
221
+ path: Path;
222
+ node: Node_2;
223
+ };
224
+
225
+ export declare type BaseRemoveTextOperation = {
226
+ type: 'remove_text';
227
+ path: Path;
228
+ offset: number;
229
+ text: string;
230
+ };
231
+
232
+ export declare type BaseSelection = Range_2 | null;
233
+
234
+ export declare type BaseSetNodeOperation = {
235
+ type: 'set_node';
236
+ path: Path;
237
+ properties: Partial<Node_2>;
238
+ newProperties: Partial<Node_2>;
239
+ };
240
+
241
+ export declare type BaseSetSelectionOperation = {
242
+ type: 'set_selection';
243
+ properties: null;
244
+ newProperties: Range_2;
245
+ } | {
246
+ type: 'set_selection';
247
+ properties: Partial<Range_2>;
248
+ newProperties: Partial<Range_2>;
249
+ } | {
250
+ type: 'set_selection';
251
+ properties: Range_2;
252
+ newProperties: null;
253
+ };
254
+
255
+ export declare type BaseSplitNodeOperation = {
256
+ type: 'split_node';
257
+ path: Path;
258
+ position: number;
259
+ properties: Partial<Node_2>;
260
+ };
261
+
262
+ /**
263
+ * `Text` objects represent the nodes that contain the actual text content of a
264
+ * Slate document along with any formatting properties. They are always leaf
265
+ * nodes in the document tree as they cannot contain any children.
266
+ */
267
+ export declare interface BaseText {
268
+ text: string;
269
+ }
270
+
271
+ export declare const before: EditorInterface['before'];
272
+
273
+ export declare const CAN_USE_DOM: boolean;
274
+
275
+ export declare const collapse: SelectionTransforms['collapse'];
276
+
277
+ /**
278
+ * Create a new Slate `Editor` object.
279
+ */
280
+ export declare const createEditor: (children: Descendant[]) => Editor;
281
+
282
+ export declare interface CustomTypes {
283
+ [key: string]: unknown;
284
+ }
285
+
286
+ export declare type DecoratedRange = Range_2 & {
287
+ /**
288
+ * Customize how another decoration is merged into a text node. If not specified, `Object.assign` would be used.
289
+ * It is useful for overlapping decorations with the same key but different values.
290
+ */
291
+ merge?: (leaf: Text_2, decoration: object) => void;
292
+ };
293
+
294
+ export declare const defaultRenderLeaf: ({ attributes, children, }: RenderLeafProps) => VNode<RendererNode, RendererElement, {
295
+ [key: string]: any;
296
+ }>;
297
+
298
+ export declare const defaultRenderPlaceHolder: ({ attributes, children }: RenderPlaceholderProps) => VNode<RendererNode, RendererElement, {
299
+ [key: string]: any;
300
+ }>;
301
+
302
+ export declare const deleteBackward: WithEditorFirstArg<Editor['deleteBackward']>;
303
+
304
+ export declare const deleteForward: WithEditorFirstArg<Editor['deleteForward']>;
305
+
306
+ export declare const deleteFragment: EditorInterface['deleteFragment'];
307
+
308
+ export declare const deleteText: TextTransforms['delete'];
309
+
310
+ /**
311
+ * The `Descendant` union type represents nodes that are descendants in the
312
+ * tree. It is returned as a convenience in certain cases to narrow a value
313
+ * further than the more generic `Node` union.
314
+ */
315
+ export declare type Descendant = Element_2 | Text_2;
316
+
317
+ export declare const deselect: SelectionTransforms['deselect'];
318
+
319
+ /**
320
+ * A DOM-specific version of the `Editor` interface.
321
+ */
322
+ export declare interface DOMEditor extends BaseEditor {
323
+ hasEditableTarget: (editor: DOMEditor, target: EventTarget | null) => target is DOMNode_2;
324
+ hasRange: (editor: DOMEditor, range: Range_2) => boolean;
325
+ hasSelectableTarget: (editor: DOMEditor, target: EventTarget | null) => boolean;
326
+ hasTarget: (editor: DOMEditor, target: EventTarget | null) => target is DOMNode_2;
327
+ insertData: (data: DataTransfer) => void;
328
+ insertFragmentData: (data: DataTransfer) => boolean;
329
+ insertTextData: (data: DataTransfer) => boolean;
330
+ isTargetInsideNonReadonlyVoid: (editor: DOMEditor, target: EventTarget | null) => boolean;
331
+ setFragmentData: (data: DataTransfer, originEvent?: 'drag' | 'copy' | 'cut') => void;
332
+ }
333
+
334
+ export declare const DOMEditor: DOMEditorInterface;
335
+
336
+ export declare interface DOMEditorInterface {
337
+ /**
338
+ * Experimental and android specific: Get pending diffs
339
+ */
340
+ androidPendingDiffs: (editor: Editor) => TextDiff[] | undefined;
341
+ /**
342
+ * Experimental and android specific: Flush all pending diffs and cancel composition at the next possible time.
343
+ */
344
+ androidScheduleFlush: (editor: Editor) => void;
345
+ /**
346
+ * Blur the editor.
347
+ */
348
+ blur: (editor: DOMEditor) => void;
349
+ /**
350
+ * Deselect the editor.
351
+ */
352
+ deselect: (editor: DOMEditor) => void;
353
+ /**
354
+ * Find the DOM node that implements DocumentOrShadowRoot for the editor.
355
+ */
356
+ findDocumentOrShadowRoot: (editor: DOMEditor) => Document | ShadowRoot;
357
+ /**
358
+ * Get the target range from a DOM `event`.
359
+ */
360
+ findEventRange: (editor: DOMEditor, event: any) => Range_2;
361
+ /**
362
+ * Find a key for a Slate node.
363
+ */
364
+ findKey: (editor: DOMEditor, node: Node_2) => Key;
365
+ /**
366
+ * Find the path of Slate node.
367
+ */
368
+ findPath: (editor: DOMEditor, node: Node_2) => Path;
369
+ /**
370
+ * Focus the editor.
371
+ */
372
+ focus: (editor: DOMEditor, options?: {
373
+ retries: number;
374
+ }) => void;
375
+ /**
376
+ * Return the host window of the current editor.
377
+ */
378
+ getWindow: (editor: DOMEditor) => Window;
379
+ /**
380
+ * Check if a DOM node is within the editor.
381
+ */
382
+ hasDOMNode: (editor: DOMEditor, target: DOMNode_2, options?: {
383
+ editable?: boolean;
384
+ }) => boolean;
385
+ /**
386
+ * Check if the target is editable and in the editor.
387
+ */
388
+ hasEditableTarget: (editor: DOMEditor, target: EventTarget | null) => target is DOMNode_2;
389
+ /**
390
+ *
391
+ */
392
+ hasRange: (editor: DOMEditor, range: Range_2) => boolean;
393
+ /**
394
+ * Check if the target can be selectable
395
+ */
396
+ hasSelectableTarget: (editor: DOMEditor, target: EventTarget | null) => boolean;
397
+ /**
398
+ * Check if the target is in the editor.
399
+ */
400
+ hasTarget: (editor: DOMEditor, target: EventTarget | null) => target is DOMNode_2;
401
+ /**
402
+ * Insert data from a `DataTransfer` into the editor.
403
+ */
404
+ insertData: (editor: DOMEditor, data: DataTransfer) => void;
405
+ /**
406
+ * Insert fragment data from a `DataTransfer` into the editor.
407
+ */
408
+ insertFragmentData: (editor: DOMEditor, data: DataTransfer) => boolean;
409
+ /**
410
+ * Insert text data from a `DataTransfer` into the editor.
411
+ */
412
+ insertTextData: (editor: DOMEditor, data: DataTransfer) => boolean;
413
+ /**
414
+ * Check if the user is currently composing inside the editor.
415
+ */
416
+ isComposing: (editor: DOMEditor) => boolean;
417
+ /**
418
+ * Check if the editor is focused.
419
+ */
420
+ isFocused: (editor: DOMEditor) => boolean;
421
+ /**
422
+ * Check if the editor is in read-only mode.
423
+ */
424
+ isReadOnly: (editor: DOMEditor) => boolean;
425
+ /**
426
+ * Check if the target is inside void and in an non-readonly editor.
427
+ */
428
+ isTargetInsideNonReadonlyVoid: (editor: DOMEditor, target: EventTarget | null) => boolean;
429
+ /**
430
+ * Sets data from the currently selected fragment on a `DataTransfer`.
431
+ */
432
+ setFragmentData: (editor: DOMEditor, data: DataTransfer, originEvent?: 'drag' | 'copy' | 'cut') => void;
433
+ /**
434
+ * Find the native DOM element from a Slate node.
435
+ */
436
+ toDOMNode: (editor: DOMEditor, node: Node_2) => HTMLElement;
437
+ /**
438
+ * Find a native DOM selection point from a Slate point.
439
+ */
440
+ toDOMPoint: (editor: DOMEditor, point: Point) => DOMPoint_2;
441
+ /**
442
+ * Find a native DOM range from a Slate `range`.
443
+ *
444
+ * Notice: the returned range will always be ordinal regardless of the direction of Slate `range` due to DOM API limit.
445
+ *
446
+ * there is no way to create a reverse DOM Range using Range.setStart/setEnd
447
+ * according to https://dom.spec.whatwg.org/#concept-range-bp-set.
448
+ */
449
+ toDOMRange: (editor: DOMEditor, range: Range_2) => DOMRange_2;
450
+ /**
451
+ * Find a Slate node from a native DOM `element`.
452
+ */
453
+ toSlateNode: (editor: DOMEditor, domNode: DOMNode_2) => Node_2;
454
+ /**
455
+ * Find a Slate point from a DOM selection's `domNode` and `domOffset`.
456
+ */
457
+ toSlatePoint: <T extends boolean>(editor: DOMEditor, domPoint: DOMPoint_2, options: {
458
+ exactMatch: boolean;
459
+ suppressThrow: T;
460
+ /**
461
+ * The direction to search for Slate leaf nodes if `domPoint` is
462
+ * non-editable and non-void.
463
+ */
464
+ searchDirection?: 'forward' | 'backward';
465
+ }) => T extends true ? Point | null : Point;
466
+ /**
467
+ * Find a Slate range from a DOM range or selection.
468
+ */
469
+ toSlateRange: <T extends boolean>(editor: DOMEditor, domRange: DOMRange_2 | DOMStaticRange_2 | DOMSelection_2, options: {
470
+ exactMatch: boolean;
471
+ suppressThrow: T;
472
+ }) => T extends true ? Range_2 | null : Range_2;
473
+ }
474
+
475
+ export declare type DOMElement = globalThis.Element;
476
+
477
+ declare type DOMElement_2 = globalThis.Element;
478
+
479
+ export declare type DOMNode = globalThis.Node;
480
+
481
+ declare type DOMNode_2 = globalThis.Node;
482
+
483
+ /**
484
+ * Types.
485
+ */
486
+ declare type DOMNode_3 = globalThis.Node;
487
+
488
+ declare type DOMPoint_2 = [Node, number];
489
+ export { DOMPoint_2 as DOMPoint }
490
+
491
+ export declare type DOMRange = globalThis.Range;
492
+
493
+ declare type DOMRange_2 = globalThis.Range;
494
+
495
+ export declare type DOMSelection = globalThis.Selection;
496
+
497
+ declare type DOMSelection_2 = globalThis.Selection;
498
+
499
+ declare type DOMSelection_3 = globalThis.Selection;
500
+
501
+ export declare type DOMStaticRange = globalThis.StaticRange;
502
+
503
+ declare type DOMStaticRange_2 = globalThis.StaticRange;
504
+
505
+ export declare type DOMText = globalThis.Text;
506
+
507
+ export declare const edges: EditorInterface['edges'];
508
+
509
+ /**
510
+ * Editable.
511
+ */
512
+ export declare const Editable: DefineComponent< {
513
+ onDOMBeforeInput?: ((event: InputEvent) => void) | undefined;
514
+ role?: string | undefined;
515
+ readOnly: boolean;
516
+ placeholder?: string | undefined;
517
+ style?: CSSProperties | undefined;
518
+ scrollSelectionIntoView: (editor: DOMEditor, domRange: globalThis.Range) => void;
519
+ is: string;
520
+ innerHTML?: string | undefined;
521
+ class?: any;
522
+ accesskey?: string | undefined;
523
+ contenteditable?: ((boolean | "false" | "true") | "inherit" | "plaintext-only") | undefined;
524
+ contextmenu?: string | undefined;
525
+ dir?: string | undefined;
526
+ draggable?: (boolean | "false" | "true") | undefined;
527
+ hidden?: ((boolean | "false" | "true") | "" | "hidden" | "until-found") | undefined;
528
+ id?: string | undefined;
529
+ inert?: (boolean | "false" | "true") | undefined;
530
+ lang?: string | undefined;
531
+ spellcheck?: (boolean | "false" | "true") | undefined;
532
+ tabindex?: (string | number) | undefined;
533
+ title?: string | undefined;
534
+ translate?: "yes" | "no" | undefined;
535
+ radiogroup?: string | undefined;
536
+ about?: string | undefined;
537
+ datatype?: string | undefined;
538
+ inlist?: any;
539
+ prefix?: string | undefined;
540
+ property?: string | undefined;
541
+ resource?: string | undefined;
542
+ typeof?: string | undefined;
543
+ vocab?: string | undefined;
544
+ autocapitalize?: string | undefined;
545
+ autocorrect?: string | undefined;
546
+ autosave?: string | undefined;
547
+ color?: string | undefined;
548
+ itemprop?: string | undefined;
549
+ itemscope?: (boolean | "false" | "true") | undefined;
550
+ itemtype?: string | undefined;
551
+ itemid?: string | undefined;
552
+ itemref?: string | undefined;
553
+ results?: (string | number) | undefined;
554
+ security?: string | undefined;
555
+ unselectable?: "on" | "off" | undefined;
556
+ inputmode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
557
+ 'aria-activedescendant'?: string | undefined;
558
+ 'aria-atomic'?: (boolean | "false" | "true") | undefined;
559
+ 'aria-autocomplete'?: "none" | "inline" | "list" | "both" | undefined;
560
+ 'aria-busy'?: (boolean | "false" | "true") | undefined;
561
+ 'aria-checked'?: ((boolean | "false" | "true") | "mixed") | undefined;
562
+ 'aria-colcount'?: (string | number) | undefined;
563
+ 'aria-colindex'?: (string | number) | undefined;
564
+ 'aria-colspan'?: (string | number) | undefined;
565
+ 'aria-controls'?: string | undefined;
566
+ 'aria-current'?: ((boolean | "false" | "true") | "page" | "step" | "location" | "date" | "time") | undefined;
567
+ 'aria-describedby'?: string | undefined;
568
+ 'aria-details'?: string | undefined;
569
+ 'aria-disabled'?: (boolean | "false" | "true") | undefined;
570
+ 'aria-dropeffect'?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
571
+ 'aria-errormessage'?: string | undefined;
572
+ 'aria-expanded'?: (boolean | "false" | "true") | undefined;
573
+ 'aria-flowto'?: string | undefined;
574
+ 'aria-grabbed'?: (boolean | "false" | "true") | undefined;
575
+ 'aria-haspopup'?: ((boolean | "false" | "true") | "menu" | "listbox" | "tree" | "grid" | "dialog") | undefined;
576
+ 'aria-hidden'?: (boolean | "false" | "true") | undefined;
577
+ 'aria-invalid'?: ((boolean | "false" | "true") | "grammar" | "spelling") | undefined;
578
+ 'aria-keyshortcuts'?: string | undefined;
579
+ 'aria-label'?: string | undefined;
580
+ 'aria-labelledby'?: string | undefined;
581
+ 'aria-level'?: (string | number) | undefined;
582
+ 'aria-live'?: "off" | "assertive" | "polite" | undefined;
583
+ 'aria-modal'?: (boolean | "false" | "true") | undefined;
584
+ 'aria-multiline'?: (boolean | "false" | "true") | undefined;
585
+ 'aria-multiselectable'?: (boolean | "false" | "true") | undefined;
586
+ 'aria-orientation'?: "horizontal" | "vertical" | undefined;
587
+ 'aria-owns'?: string | undefined;
588
+ 'aria-placeholder'?: string | undefined;
589
+ 'aria-posinset'?: (string | number) | undefined;
590
+ 'aria-pressed'?: ((boolean | "false" | "true") | "mixed") | undefined;
591
+ 'aria-readonly'?: (boolean | "false" | "true") | undefined;
592
+ 'aria-relevant'?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
593
+ 'aria-required'?: (boolean | "false" | "true") | undefined;
594
+ 'aria-roledescription'?: string | undefined;
595
+ 'aria-rowcount'?: (string | number) | undefined;
596
+ 'aria-rowindex'?: (string | number) | undefined;
597
+ 'aria-rowspan'?: (string | number) | undefined;
598
+ 'aria-selected'?: (boolean | "false" | "true") | undefined;
599
+ 'aria-setsize'?: (string | number) | undefined;
600
+ 'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
601
+ 'aria-valuemax'?: (string | number) | undefined;
602
+ 'aria-valuemin'?: (string | number) | undefined;
603
+ 'aria-valuenow'?: (string | number) | undefined;
604
+ 'aria-valuetext'?: string | undefined;
605
+ onCopy?: ((payload: ClipboardEvent) => void) | undefined;
606
+ onCut?: ((payload: ClipboardEvent) => void) | undefined;
607
+ onPaste?: ((payload: ClipboardEvent) => void) | undefined;
608
+ onCompositionend?: ((payload: CompositionEvent) => void) | undefined;
609
+ onCompositionstart?: ((payload: CompositionEvent) => void) | undefined;
610
+ onCompositionupdate?: ((payload: CompositionEvent) => void) | undefined;
611
+ onDrag?: ((payload: DragEvent) => void) | undefined;
612
+ onDragend?: ((payload: DragEvent) => void) | undefined;
613
+ onDragenter?: ((payload: DragEvent) => void) | undefined;
614
+ onDragexit?: ((payload: DragEvent) => void) | undefined;
615
+ onDragleave?: ((payload: DragEvent) => void) | undefined;
616
+ onDragover?: ((payload: DragEvent) => void) | undefined;
617
+ onDragstart?: ((payload: DragEvent) => void) | undefined;
618
+ onDrop?: ((payload: DragEvent) => void) | undefined;
619
+ onFocus?: ((payload: FocusEvent) => void) | undefined;
620
+ onFocusin?: ((payload: FocusEvent) => void) | undefined;
621
+ onFocusout?: ((payload: FocusEvent) => void) | undefined;
622
+ onBlur?: ((payload: FocusEvent) => void) | undefined;
623
+ onChange?: ((payload: Event) => void) | undefined;
624
+ onBeforeinput?: ((payload: Event) => void) | undefined;
625
+ onInput?: ((payload: Event) => void) | undefined;
626
+ onReset?: ((payload: Event) => void) | undefined;
627
+ onSubmit?: ((payload: Event) => void) | undefined;
628
+ onInvalid?: ((payload: Event) => void) | undefined;
629
+ onLoad?: ((payload: Event) => void) | undefined;
630
+ onError?: ((payload: Event) => void) | undefined;
631
+ onKeydown?: ((payload: KeyboardEvent) => void) | undefined;
632
+ onKeypress?: ((payload: KeyboardEvent) => void) | undefined;
633
+ onKeyup?: ((payload: KeyboardEvent) => void) | undefined;
634
+ onAuxclick?: ((payload: MouseEvent) => void) | undefined;
635
+ onClick?: ((payload: MouseEvent) => void) | undefined;
636
+ onContextmenu?: ((payload: MouseEvent) => void) | undefined;
637
+ onDblclick?: ((payload: MouseEvent) => void) | undefined;
638
+ onMousedown?: ((payload: MouseEvent) => void) | undefined;
639
+ onMouseenter?: ((payload: MouseEvent) => void) | undefined;
640
+ onMouseleave?: ((payload: MouseEvent) => void) | undefined;
641
+ onMousemove?: ((payload: MouseEvent) => void) | undefined;
642
+ onMouseout?: ((payload: MouseEvent) => void) | undefined;
643
+ onMouseover?: ((payload: MouseEvent) => void) | undefined;
644
+ onMouseup?: ((payload: MouseEvent) => void) | undefined;
645
+ onAbort?: ((payload: Event) => void) | undefined;
646
+ onCanplay?: ((payload: Event) => void) | undefined;
647
+ onCanplaythrough?: ((payload: Event) => void) | undefined;
648
+ onDurationchange?: ((payload: Event) => void) | undefined;
649
+ onEmptied?: ((payload: Event) => void) | undefined;
650
+ onEncrypted?: ((payload: Event) => void) | undefined;
651
+ onEnded?: ((payload: Event) => void) | undefined;
652
+ onLoadeddata?: ((payload: Event) => void) | undefined;
653
+ onLoadedmetadata?: ((payload: Event) => void) | undefined;
654
+ onLoadstart?: ((payload: Event) => void) | undefined;
655
+ onPause?: ((payload: Event) => void) | undefined;
656
+ onPlay?: ((payload: Event) => void) | undefined;
657
+ onPlaying?: ((payload: Event) => void) | undefined;
658
+ onProgress?: ((payload: Event) => void) | undefined;
659
+ onRatechange?: ((payload: Event) => void) | undefined;
660
+ onSeeked?: ((payload: Event) => void) | undefined;
661
+ onSeeking?: ((payload: Event) => void) | undefined;
662
+ onStalled?: ((payload: Event) => void) | undefined;
663
+ onSuspend?: ((payload: Event) => void) | undefined;
664
+ onTimeupdate?: ((payload: Event) => void) | undefined;
665
+ onVolumechange?: ((payload: Event) => void) | undefined;
666
+ onWaiting?: ((payload: Event) => void) | undefined;
667
+ onSelect?: ((payload: Event) => void) | undefined;
668
+ onScroll?: ((payload: Event) => void) | undefined;
669
+ onScrollend?: ((payload: Event) => void) | undefined;
670
+ onTouchcancel?: ((payload: TouchEvent) => void) | undefined;
671
+ onTouchend?: ((payload: TouchEvent) => void) | undefined;
672
+ onTouchmove?: ((payload: TouchEvent) => void) | undefined;
673
+ onTouchstart?: ((payload: TouchEvent) => void) | undefined;
674
+ onPointerdown?: ((payload: PointerEvent) => void) | undefined;
675
+ onPointermove?: ((payload: PointerEvent) => void) | undefined;
676
+ onPointerup?: ((payload: PointerEvent) => void) | undefined;
677
+ onPointercancel?: ((payload: PointerEvent) => void) | undefined;
678
+ onPointerenter?: ((payload: PointerEvent) => void) | undefined;
679
+ onPointerleave?: ((payload: PointerEvent) => void) | undefined;
680
+ onPointerover?: ((payload: PointerEvent) => void) | undefined;
681
+ onPointerout?: ((payload: PointerEvent) => void) | undefined;
682
+ onWheel?: ((payload: WheelEvent) => void) | undefined;
683
+ onAnimationstart?: ((payload: AnimationEvent) => void) | undefined;
684
+ onAnimationend?: ((payload: AnimationEvent) => void) | undefined;
685
+ onAnimationiteration?: ((payload: AnimationEvent) => void) | undefined;
686
+ onTransitionend?: ((payload: TransitionEvent) => void) | undefined;
687
+ onTransitionstart?: ((payload: TransitionEvent) => void) | undefined;
688
+ }, () => JSX.Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
689
+ onDOMBeforeInput?: ((event: InputEvent) => void) | undefined;
690
+ role?: string | undefined;
691
+ readOnly: boolean;
692
+ placeholder?: string | undefined;
693
+ style?: CSSProperties | undefined;
694
+ scrollSelectionIntoView: (editor: DOMEditor, domRange: globalThis.Range) => void;
695
+ is: string;
696
+ innerHTML?: string | undefined;
697
+ class?: any;
698
+ accesskey?: string | undefined;
699
+ contenteditable?: ((boolean | "false" | "true") | "inherit" | "plaintext-only") | undefined;
700
+ contextmenu?: string | undefined;
701
+ dir?: string | undefined;
702
+ draggable?: (boolean | "false" | "true") | undefined;
703
+ hidden?: ((boolean | "false" | "true") | "" | "hidden" | "until-found") | undefined;
704
+ id?: string | undefined;
705
+ inert?: (boolean | "false" | "true") | undefined;
706
+ lang?: string | undefined;
707
+ spellcheck?: (boolean | "false" | "true") | undefined;
708
+ tabindex?: (string | number) | undefined;
709
+ title?: string | undefined;
710
+ translate?: "yes" | "no" | undefined;
711
+ radiogroup?: string | undefined;
712
+ about?: string | undefined;
713
+ datatype?: string | undefined;
714
+ inlist?: any;
715
+ prefix?: string | undefined;
716
+ property?: string | undefined;
717
+ resource?: string | undefined;
718
+ typeof?: string | undefined;
719
+ vocab?: string | undefined;
720
+ autocapitalize?: string | undefined;
721
+ autocorrect?: string | undefined;
722
+ autosave?: string | undefined;
723
+ color?: string | undefined;
724
+ itemprop?: string | undefined;
725
+ itemscope?: (boolean | "false" | "true") | undefined;
726
+ itemtype?: string | undefined;
727
+ itemid?: string | undefined;
728
+ itemref?: string | undefined;
729
+ results?: (string | number) | undefined;
730
+ security?: string | undefined;
731
+ unselectable?: "on" | "off" | undefined;
732
+ inputmode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
733
+ 'aria-activedescendant'?: string | undefined;
734
+ 'aria-atomic'?: (boolean | "false" | "true") | undefined;
735
+ 'aria-autocomplete'?: "none" | "inline" | "list" | "both" | undefined;
736
+ 'aria-busy'?: (boolean | "false" | "true") | undefined;
737
+ 'aria-checked'?: ((boolean | "false" | "true") | "mixed") | undefined;
738
+ 'aria-colcount'?: (string | number) | undefined;
739
+ 'aria-colindex'?: (string | number) | undefined;
740
+ 'aria-colspan'?: (string | number) | undefined;
741
+ 'aria-controls'?: string | undefined;
742
+ 'aria-current'?: ((boolean | "false" | "true") | "page" | "step" | "location" | "date" | "time") | undefined;
743
+ 'aria-describedby'?: string | undefined;
744
+ 'aria-details'?: string | undefined;
745
+ 'aria-disabled'?: (boolean | "false" | "true") | undefined;
746
+ 'aria-dropeffect'?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
747
+ 'aria-errormessage'?: string | undefined;
748
+ 'aria-expanded'?: (boolean | "false" | "true") | undefined;
749
+ 'aria-flowto'?: string | undefined;
750
+ 'aria-grabbed'?: (boolean | "false" | "true") | undefined;
751
+ 'aria-haspopup'?: ((boolean | "false" | "true") | "menu" | "listbox" | "tree" | "grid" | "dialog") | undefined;
752
+ 'aria-hidden'?: (boolean | "false" | "true") | undefined;
753
+ 'aria-invalid'?: ((boolean | "false" | "true") | "grammar" | "spelling") | undefined;
754
+ 'aria-keyshortcuts'?: string | undefined;
755
+ 'aria-label'?: string | undefined;
756
+ 'aria-labelledby'?: string | undefined;
757
+ 'aria-level'?: (string | number) | undefined;
758
+ 'aria-live'?: "off" | "assertive" | "polite" | undefined;
759
+ 'aria-modal'?: (boolean | "false" | "true") | undefined;
760
+ 'aria-multiline'?: (boolean | "false" | "true") | undefined;
761
+ 'aria-multiselectable'?: (boolean | "false" | "true") | undefined;
762
+ 'aria-orientation'?: "horizontal" | "vertical" | undefined;
763
+ 'aria-owns'?: string | undefined;
764
+ 'aria-placeholder'?: string | undefined;
765
+ 'aria-posinset'?: (string | number) | undefined;
766
+ 'aria-pressed'?: ((boolean | "false" | "true") | "mixed") | undefined;
767
+ 'aria-readonly'?: (boolean | "false" | "true") | undefined;
768
+ 'aria-relevant'?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
769
+ 'aria-required'?: (boolean | "false" | "true") | undefined;
770
+ 'aria-roledescription'?: string | undefined;
771
+ 'aria-rowcount'?: (string | number) | undefined;
772
+ 'aria-rowindex'?: (string | number) | undefined;
773
+ 'aria-rowspan'?: (string | number) | undefined;
774
+ 'aria-selected'?: (boolean | "false" | "true") | undefined;
775
+ 'aria-setsize'?: (string | number) | undefined;
776
+ 'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
777
+ 'aria-valuemax'?: (string | number) | undefined;
778
+ 'aria-valuemin'?: (string | number) | undefined;
779
+ 'aria-valuenow'?: (string | number) | undefined;
780
+ 'aria-valuetext'?: string | undefined;
781
+ onCopy?: ((payload: ClipboardEvent) => void) | undefined;
782
+ onCut?: ((payload: ClipboardEvent) => void) | undefined;
783
+ onPaste?: ((payload: ClipboardEvent) => void) | undefined;
784
+ onCompositionend?: ((payload: CompositionEvent) => void) | undefined;
785
+ onCompositionstart?: ((payload: CompositionEvent) => void) | undefined;
786
+ onCompositionupdate?: ((payload: CompositionEvent) => void) | undefined;
787
+ onDrag?: ((payload: DragEvent) => void) | undefined;
788
+ onDragend?: ((payload: DragEvent) => void) | undefined;
789
+ onDragenter?: ((payload: DragEvent) => void) | undefined;
790
+ onDragexit?: ((payload: DragEvent) => void) | undefined;
791
+ onDragleave?: ((payload: DragEvent) => void) | undefined;
792
+ onDragover?: ((payload: DragEvent) => void) | undefined;
793
+ onDragstart?: ((payload: DragEvent) => void) | undefined;
794
+ onDrop?: ((payload: DragEvent) => void) | undefined;
795
+ onFocus?: ((payload: FocusEvent) => void) | undefined;
796
+ onFocusin?: ((payload: FocusEvent) => void) | undefined;
797
+ onFocusout?: ((payload: FocusEvent) => void) | undefined;
798
+ onBlur?: ((payload: FocusEvent) => void) | undefined;
799
+ onChange?: ((payload: Event) => void) | undefined;
800
+ onBeforeinput?: ((payload: Event) => void) | undefined;
801
+ onInput?: ((payload: Event) => void) | undefined;
802
+ onReset?: ((payload: Event) => void) | undefined;
803
+ onSubmit?: ((payload: Event) => void) | undefined;
804
+ onInvalid?: ((payload: Event) => void) | undefined;
805
+ onLoad?: ((payload: Event) => void) | undefined;
806
+ onError?: ((payload: Event) => void) | undefined;
807
+ onKeydown?: ((payload: KeyboardEvent) => void) | undefined;
808
+ onKeypress?: ((payload: KeyboardEvent) => void) | undefined;
809
+ onKeyup?: ((payload: KeyboardEvent) => void) | undefined;
810
+ onAuxclick?: ((payload: MouseEvent) => void) | undefined;
811
+ onClick?: ((payload: MouseEvent) => void) | undefined;
812
+ onContextmenu?: ((payload: MouseEvent) => void) | undefined;
813
+ onDblclick?: ((payload: MouseEvent) => void) | undefined;
814
+ onMousedown?: ((payload: MouseEvent) => void) | undefined;
815
+ onMouseenter?: ((payload: MouseEvent) => void) | undefined;
816
+ onMouseleave?: ((payload: MouseEvent) => void) | undefined;
817
+ onMousemove?: ((payload: MouseEvent) => void) | undefined;
818
+ onMouseout?: ((payload: MouseEvent) => void) | undefined;
819
+ onMouseover?: ((payload: MouseEvent) => void) | undefined;
820
+ onMouseup?: ((payload: MouseEvent) => void) | undefined;
821
+ onAbort?: ((payload: Event) => void) | undefined;
822
+ onCanplay?: ((payload: Event) => void) | undefined;
823
+ onCanplaythrough?: ((payload: Event) => void) | undefined;
824
+ onDurationchange?: ((payload: Event) => void) | undefined;
825
+ onEmptied?: ((payload: Event) => void) | undefined;
826
+ onEncrypted?: ((payload: Event) => void) | undefined;
827
+ onEnded?: ((payload: Event) => void) | undefined;
828
+ onLoadeddata?: ((payload: Event) => void) | undefined;
829
+ onLoadedmetadata?: ((payload: Event) => void) | undefined;
830
+ onLoadstart?: ((payload: Event) => void) | undefined;
831
+ onPause?: ((payload: Event) => void) | undefined;
832
+ onPlay?: ((payload: Event) => void) | undefined;
833
+ onPlaying?: ((payload: Event) => void) | undefined;
834
+ onProgress?: ((payload: Event) => void) | undefined;
835
+ onRatechange?: ((payload: Event) => void) | undefined;
836
+ onSeeked?: ((payload: Event) => void) | undefined;
837
+ onSeeking?: ((payload: Event) => void) | undefined;
838
+ onStalled?: ((payload: Event) => void) | undefined;
839
+ onSuspend?: ((payload: Event) => void) | undefined;
840
+ onTimeupdate?: ((payload: Event) => void) | undefined;
841
+ onVolumechange?: ((payload: Event) => void) | undefined;
842
+ onWaiting?: ((payload: Event) => void) | undefined;
843
+ onSelect?: ((payload: Event) => void) | undefined;
844
+ onScroll?: ((payload: Event) => void) | undefined;
845
+ onScrollend?: ((payload: Event) => void) | undefined;
846
+ onTouchcancel?: ((payload: TouchEvent) => void) | undefined;
847
+ onTouchend?: ((payload: TouchEvent) => void) | undefined;
848
+ onTouchmove?: ((payload: TouchEvent) => void) | undefined;
849
+ onTouchstart?: ((payload: TouchEvent) => void) | undefined;
850
+ onPointerdown?: ((payload: PointerEvent) => void) | undefined;
851
+ onPointermove?: ((payload: PointerEvent) => void) | undefined;
852
+ onPointerup?: ((payload: PointerEvent) => void) | undefined;
853
+ onPointercancel?: ((payload: PointerEvent) => void) | undefined;
854
+ onPointerenter?: ((payload: PointerEvent) => void) | undefined;
855
+ onPointerleave?: ((payload: PointerEvent) => void) | undefined;
856
+ onPointerover?: ((payload: PointerEvent) => void) | undefined;
857
+ onPointerout?: ((payload: PointerEvent) => void) | undefined;
858
+ onWheel?: ((payload: WheelEvent) => void) | undefined;
859
+ onAnimationstart?: ((payload: AnimationEvent) => void) | undefined;
860
+ onAnimationend?: ((payload: AnimationEvent) => void) | undefined;
861
+ onAnimationiteration?: ((payload: AnimationEvent) => void) | undefined;
862
+ onTransitionend?: ((payload: TransitionEvent) => void) | undefined;
863
+ onTransitionstart?: ((payload: TransitionEvent) => void) | undefined;
864
+ }> & Readonly<{}>, {
865
+ style: Record<string, any>;
866
+ is: string;
867
+ scrollSelectionIntoView: Function;
868
+ readOnly: boolean;
869
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
870
+
871
+ export declare type Editor = ExtendedType<'Editor', BaseEditor>;
872
+
873
+ export declare const Editor: EditorInterface;
874
+
875
+ export declare const EDITOR_TO_ELEMENT: toRawWeakMap<Editor, HTMLElement>;
876
+
877
+ export declare const EDITOR_TO_FORCE_RENDER: toRawWeakMap<Editor, () => void>;
878
+
879
+ export declare const EDITOR_TO_KEY_TO_ELEMENT: toRawWeakMap<Editor, toRawWeakMap<Key, HTMLElement>>;
880
+
881
+ /**
882
+ * Weak map for associating the context `onChange` context with the plugin.
883
+ */
884
+ export declare const EDITOR_TO_ON_CHANGE: toRawWeakMap<DOMEditor, (options?: {
885
+ operation?: Operation;
886
+ }) => void>;
887
+
888
+ export declare const EDITOR_TO_PENDING_ACTION: toRawWeakMap<Editor, Action | null>;
889
+
890
+ /**
891
+ * Android input handling specific weak-maps
892
+ */
893
+ export declare const EDITOR_TO_PENDING_DIFFS: toRawWeakMap<Editor, TextDiff[]>;
894
+
895
+ export declare const EDITOR_TO_PENDING_INSERTION_MARKS: toRawWeakMap<Editor, Partial<Text_2> | null>;
896
+
897
+ export declare const EDITOR_TO_PENDING_SELECTION: toRawWeakMap<Editor, Range_2 | null>;
898
+
899
+ export declare const EDITOR_TO_PLACEHOLDER_ELEMENT: toRawWeakMap<Editor, HTMLElement>;
900
+
901
+ /**
902
+ * Weak maps for saving pending state on composition stage.
903
+ */
904
+ export declare const EDITOR_TO_SCHEDULE_FLUSH: toRawWeakMap<Editor, () => void>;
905
+
906
+ export declare const EDITOR_TO_USER_MARKS: toRawWeakMap<Editor, Partial<Text_2> | null>;
907
+
908
+ export declare const EDITOR_TO_USER_SELECTION: toRawWeakMap<Editor, RangeRef | null>;
909
+
910
+ /**
911
+ * Weak maps that allow us to go between Slate nodes and DOM nodes. These
912
+ * are used to resolve DOM event-related logic into Slate actions.
913
+ */
914
+ export declare const EDITOR_TO_WINDOW: toRawWeakMap<Editor, Window>;
915
+
916
+ export declare interface EditorAboveOptions<T extends Ancestor> {
917
+ at?: Location_2;
918
+ match?: NodeMatch<T>;
919
+ mode?: MaximizeMode;
920
+ voids?: boolean;
921
+ }
922
+
923
+ export declare interface EditorAfterOptions {
924
+ distance?: number;
925
+ unit?: TextUnitAdjustment;
926
+ voids?: boolean;
927
+ }
928
+
929
+ export declare interface EditorBeforeOptions {
930
+ distance?: number;
931
+ unit?: TextUnitAdjustment;
932
+ voids?: boolean;
933
+ }
934
+
935
+ export declare interface EditorDirectedDeletionOptions {
936
+ unit?: TextUnit;
937
+ }
938
+
939
+ export declare interface EditorElementReadOnlyOptions {
940
+ at?: Location_2;
941
+ mode?: MaximizeMode;
942
+ voids?: boolean;
943
+ }
944
+
945
+ export declare interface EditorFragmentDeletionOptions {
946
+ direction?: TextDirection;
947
+ }
948
+
949
+ export declare interface EditorInterface {
950
+ /**
951
+ * Get the ancestor above a location in the document.
952
+ */
953
+ above: <T extends Ancestor>(editor: Editor, options?: EditorAboveOptions<T>) => NodeEntry<T> | undefined;
954
+ /**
955
+ * Add a custom property to the leaf text nodes in the current selection.
956
+ *
957
+ * If the selection is currently collapsed, the marks will be added to the
958
+ * `editor.marks` property instead, and applied when text is inserted next.
959
+ */
960
+ addMark: (editor: Editor, key: string, value: any) => void;
961
+ /**
962
+ * Get the point after a location.
963
+ */
964
+ after: (editor: Editor, at: Location_2, options?: EditorAfterOptions) => Point | undefined;
965
+ /**
966
+ * Get the point before a location.
967
+ */
968
+ before: (editor: Editor, at: Location_2, options?: EditorBeforeOptions) => Point | undefined;
969
+ /**
970
+ * Delete content in the editor backward from the current selection.
971
+ */
972
+ deleteBackward: (editor: Editor, options?: EditorDirectedDeletionOptions) => void;
973
+ /**
974
+ * Delete content in the editor forward from the current selection.
975
+ */
976
+ deleteForward: (editor: Editor, options?: EditorDirectedDeletionOptions) => void;
977
+ /**
978
+ * Delete the content in the current selection.
979
+ */
980
+ deleteFragment: (editor: Editor, options?: EditorFragmentDeletionOptions) => void;
981
+ /**
982
+ * Get the start and end points of a location.
983
+ */
984
+ edges: (editor: Editor, at: Location_2) => [Point, Point];
985
+ /**
986
+ * Match a read-only element in the current branch of the editor.
987
+ */
988
+ elementReadOnly: (editor: Editor, options?: EditorElementReadOnlyOptions) => NodeEntry<Element_2> | undefined;
989
+ /**
990
+ * Get the end point of a location.
991
+ */
992
+ end: (editor: Editor, at: Location_2) => Point;
993
+ /**
994
+ * Get the first node at a location.
995
+ */
996
+ first: (editor: Editor, at: Location_2) => NodeEntry;
997
+ /**
998
+ * Get the fragment at a location.
999
+ */
1000
+ fragment: (editor: Editor, at: Location_2) => Descendant[];
1001
+ /**
1002
+ * Check if a node has block children.
1003
+ */
1004
+ hasBlocks: (editor: Editor, element: Element_2) => boolean;
1005
+ /**
1006
+ * Check if a node has inline and text children.
1007
+ */
1008
+ hasInlines: (editor: Editor, element: Element_2) => boolean;
1009
+ hasPath: (editor: Editor, path: Path) => boolean;
1010
+ /**
1011
+ * Check if a node has text children.
1012
+ */
1013
+ hasTexts: (editor: Editor, element: Element_2) => boolean;
1014
+ /**
1015
+ * Insert a block break at the current selection.
1016
+ *
1017
+ * If the selection is currently expanded, it will be deleted first.
1018
+ */
1019
+ insertBreak: (editor: Editor) => void;
1020
+ /**
1021
+ * Inserts a fragment
1022
+ * at the specified location or (if not defined) the current selection or (if not defined) the end of the document.
1023
+ */
1024
+ insertFragment: (editor: Editor, fragment: Node_2[], options?: TextInsertFragmentOptions) => void;
1025
+ /**
1026
+ * Atomically inserts `nodes`
1027
+ * at the specified location or (if not defined) the current selection or (if not defined) the end of the document.
1028
+ */
1029
+ insertNode: <T extends Node_2>(editor: Editor, node: Node_2, options?: NodeInsertNodesOptions<T>) => void;
1030
+ /**
1031
+ * Insert a soft break at the current selection.
1032
+ *
1033
+ * If the selection is currently expanded, it will be deleted first.
1034
+ */
1035
+ insertSoftBreak: (editor: Editor) => void;
1036
+ /**
1037
+ * Insert a string of text
1038
+ * at the specified location or (if not defined) the current selection or (if not defined) the end of the document.
1039
+ */
1040
+ insertText: (editor: Editor, text: string, options?: TextInsertTextOptions) => void;
1041
+ /**
1042
+ * Check if a value is a block `Element` object.
1043
+ */
1044
+ isBlock: (editor: Editor, value: Element_2) => boolean;
1045
+ /**
1046
+ * Check if a point is an edge of a location.
1047
+ */
1048
+ isEdge: (editor: Editor, point: Point, at: Location_2) => boolean;
1049
+ /**
1050
+ * Check if a value is an `Editor` object.
1051
+ */
1052
+ isEditor: (value: any) => value is Editor;
1053
+ /**
1054
+ * Check if a value is a read-only `Element` object.
1055
+ */
1056
+ isElementReadOnly: (editor: Editor, element: Element_2) => boolean;
1057
+ /**
1058
+ * Check if an element is empty, accounting for void nodes.
1059
+ */
1060
+ isEmpty: (editor: Editor, element: Element_2) => boolean;
1061
+ /**
1062
+ * Check if a point is the end point of a location.
1063
+ */
1064
+ isEnd: (editor: Editor, point: Point, at: Location_2) => boolean;
1065
+ /**
1066
+ * Check if a value is an inline `Element` object.
1067
+ */
1068
+ isInline: (editor: Editor, value: Element_2) => boolean;
1069
+ /**
1070
+ * Check if the editor is currently normalizing after each operation.
1071
+ */
1072
+ isNormalizing: (editor: Editor) => boolean;
1073
+ /**
1074
+ * Check if a value is a selectable `Element` object.
1075
+ */
1076
+ isSelectable: (editor: Editor, element: Element_2) => boolean;
1077
+ /**
1078
+ * Check if a point is the start point of a location.
1079
+ */
1080
+ isStart: (editor: Editor, point: Point, at: Location_2) => boolean;
1081
+ /**
1082
+ * Check if a value is a void `Element` object.
1083
+ */
1084
+ isVoid: (editor: Editor, value: Element_2) => boolean;
1085
+ /**
1086
+ * Get the last node at a location.
1087
+ */
1088
+ last: (editor: Editor, at: Location_2) => NodeEntry;
1089
+ /**
1090
+ * Get the leaf text node at a location.
1091
+ */
1092
+ leaf: (editor: Editor, at: Location_2, options?: EditorLeafOptions) => NodeEntry<Text_2>;
1093
+ /**
1094
+ * Iterate through all of the levels at a location.
1095
+ */
1096
+ levels: <T extends Node_2>(editor: Editor, options?: EditorLevelsOptions<T>) => Generator<NodeEntry<T>, void, undefined>;
1097
+ /**
1098
+ * Get the marks that would be added to text at the current selection.
1099
+ */
1100
+ marks: (editor: Editor) => Omit<Text_2, 'text'> | null;
1101
+ /**
1102
+ * Get the matching node in the branch of the document after a location.
1103
+ */
1104
+ next: <T extends Descendant>(editor: Editor, options?: EditorNextOptions<T>) => NodeEntry<T> | undefined;
1105
+ /**
1106
+ * Get the node at a location.
1107
+ */
1108
+ node: (editor: Editor, at: Location_2, options?: EditorNodeOptions) => NodeEntry;
1109
+ /**
1110
+ * Iterate through all of the nodes in the Editor.
1111
+ */
1112
+ nodes: <T extends Node_2>(editor: Editor, options?: EditorNodesOptions<T>) => Generator<NodeEntry<T>, void, undefined>;
1113
+ /**
1114
+ * Normalize any dirty objects in the editor.
1115
+ */
1116
+ normalize: (editor: Editor, options?: EditorNormalizeOptions) => void;
1117
+ /**
1118
+ * Get the parent node of a location.
1119
+ */
1120
+ parent: (editor: Editor, at: Location_2, options?: EditorParentOptions) => NodeEntry<Ancestor>;
1121
+ /**
1122
+ * Get the path of a location.
1123
+ */
1124
+ path: (editor: Editor, at: Location_2, options?: EditorPathOptions) => Path;
1125
+ /**
1126
+ * Create a mutable ref for a `Path` object, which will stay in sync as new
1127
+ * operations are applied to the editor.
1128
+ */
1129
+ pathRef: (editor: Editor, path: Path, options?: EditorPathRefOptions) => PathRef;
1130
+ /**
1131
+ * Get the set of currently tracked path refs of the editor.
1132
+ */
1133
+ pathRefs: (editor: Editor) => Set<PathRef>;
1134
+ /**
1135
+ * Get the start or end point of a location.
1136
+ */
1137
+ point: (editor: Editor, at: Location_2, options?: EditorPointOptions) => Point;
1138
+ /**
1139
+ * Create a mutable ref for a `Point` object, which will stay in sync as new
1140
+ * operations are applied to the editor.
1141
+ */
1142
+ pointRef: (editor: Editor, point: Point, options?: EditorPointRefOptions) => PointRef;
1143
+ /**
1144
+ * Get the set of currently tracked point refs of the editor.
1145
+ */
1146
+ pointRefs: (editor: Editor) => Set<PointRef>;
1147
+ /**
1148
+ * Return all the positions in `at` range where a `Point` can be placed.
1149
+ *
1150
+ * By default, moves forward by individual offsets at a time, but
1151
+ * the `unit` option can be used to to move by character, word, line, or block.
1152
+ *
1153
+ * The `reverse` option can be used to change iteration direction.
1154
+ *
1155
+ * Note: By default void nodes are treated as a single point and iteration
1156
+ * will not happen inside their content unless you pass in true for the
1157
+ * `voids` option, then iteration will occur.
1158
+ */
1159
+ positions: (editor: Editor, options?: EditorPositionsOptions) => Generator<Point, void, undefined>;
1160
+ /**
1161
+ * Get the matching node in the branch of the document before a location.
1162
+ */
1163
+ previous: <T extends Node_2>(editor: Editor, options?: EditorPreviousOptions<T>) => NodeEntry<T> | undefined;
1164
+ /**
1165
+ * Get a range of a location.
1166
+ */
1167
+ range: (editor: Editor, at: Location_2, to?: Location_2) => Range_2;
1168
+ /**
1169
+ * Create a mutable ref for a `Range` object, which will stay in sync as new
1170
+ * operations are applied to the editor.
1171
+ */
1172
+ rangeRef: (editor: Editor, range: Range_2, options?: EditorRangeRefOptions) => RangeRef;
1173
+ /**
1174
+ * Get the set of currently tracked range refs of the editor.
1175
+ */
1176
+ rangeRefs: (editor: Editor) => Set<RangeRef>;
1177
+ /**
1178
+ * Remove a custom property from all of the leaf text nodes in the current
1179
+ * selection.
1180
+ *
1181
+ * If the selection is currently collapsed, the removal will be stored on
1182
+ * `editor.marks` and applied to the text inserted next.
1183
+ */
1184
+ removeMark: (editor: Editor, key: string) => void;
1185
+ /**
1186
+ * Manually set if the editor should currently be normalizing.
1187
+ *
1188
+ * Note: Using this incorrectly can leave the editor in an invalid state.
1189
+ *
1190
+ */
1191
+ setNormalizing: (editor: Editor, isNormalizing: boolean) => void;
1192
+ /**
1193
+ * Get the start point of a location.
1194
+ */
1195
+ start: (editor: Editor, at: Location_2) => Point;
1196
+ /**
1197
+ * Get the text string content of a location.
1198
+ *
1199
+ * Note: by default the text of void nodes is considered to be an empty
1200
+ * string, regardless of content, unless you pass in true for the voids option
1201
+ */
1202
+ string: (editor: Editor, at: Location_2, options?: EditorStringOptions) => string;
1203
+ /**
1204
+ * Convert a range into a non-hanging one.
1205
+ */
1206
+ unhangRange: (editor: Editor, range: Range_2, options?: EditorUnhangRangeOptions) => Range_2;
1207
+ /**
1208
+ * Match a void node in the current branch of the editor.
1209
+ */
1210
+ void: (editor: Editor, options?: EditorVoidOptions) => NodeEntry<Element_2> | undefined;
1211
+ /**
1212
+ * Call a function, deferring normalization until after it completes.
1213
+ */
1214
+ withoutNormalizing: (editor: Editor, fn: () => void) => void;
1215
+ /**
1216
+ * Call a function, Determine whether or not remove the previous node when merge.
1217
+ */
1218
+ shouldMergeNodesRemovePrevNode: (editor: Editor, prevNodeEntry: NodeEntry, curNodeEntry: NodeEntry) => boolean;
1219
+ }
1220
+
1221
+ export declare interface EditorLeafOptions {
1222
+ depth?: number;
1223
+ edge?: LeafEdge;
1224
+ }
1225
+
1226
+ export declare interface EditorLevelsOptions<T extends Node_2> {
1227
+ at?: Location_2;
1228
+ match?: NodeMatch<T>;
1229
+ reverse?: boolean;
1230
+ voids?: boolean;
1231
+ }
1232
+
1233
+ export declare type EditorMarks = Omit<Text_2, 'text'>;
1234
+
1235
+ export declare interface EditorNextOptions<T extends Descendant> {
1236
+ at?: Location_2;
1237
+ match?: NodeMatch<T>;
1238
+ mode?: SelectionMode_2;
1239
+ voids?: boolean;
1240
+ }
1241
+
1242
+ export declare interface EditorNodeOptions {
1243
+ depth?: number;
1244
+ edge?: LeafEdge;
1245
+ }
1246
+
1247
+ export declare interface EditorNodesOptions<T extends Node_2> {
1248
+ at?: Location_2 | Span;
1249
+ match?: NodeMatch<T>;
1250
+ mode?: SelectionMode_2;
1251
+ universal?: boolean;
1252
+ reverse?: boolean;
1253
+ voids?: boolean;
1254
+ ignoreNonSelectable?: boolean;
1255
+ }
1256
+
1257
+ export declare interface EditorNormalizeOptions {
1258
+ force?: boolean;
1259
+ operation?: Operation;
1260
+ }
1261
+
1262
+ export declare interface EditorParentOptions {
1263
+ depth?: number;
1264
+ edge?: LeafEdge;
1265
+ }
1266
+
1267
+ export declare interface EditorPathOptions {
1268
+ depth?: number;
1269
+ edge?: LeafEdge;
1270
+ }
1271
+
1272
+ export declare interface EditorPathRefOptions {
1273
+ affinity?: TextDirection | null;
1274
+ }
1275
+
1276
+ export declare interface EditorPointOptions {
1277
+ edge?: LeafEdge;
1278
+ }
1279
+
1280
+ export declare interface EditorPointRefOptions {
1281
+ affinity?: TextDirection | null;
1282
+ }
1283
+
1284
+ export declare interface EditorPositionsOptions {
1285
+ at?: Location_2;
1286
+ unit?: TextUnitAdjustment;
1287
+ reverse?: boolean;
1288
+ voids?: boolean;
1289
+ ignoreNonSelectable?: boolean;
1290
+ }
1291
+
1292
+ export declare interface EditorPreviousOptions<T extends Node_2> {
1293
+ at?: Location_2;
1294
+ match?: NodeMatch<T>;
1295
+ mode?: SelectionMode_2;
1296
+ voids?: boolean;
1297
+ }
1298
+
1299
+ export declare interface EditorRangeRefOptions {
1300
+ affinity?: RangeDirection | null;
1301
+ }
1302
+
1303
+ export declare interface EditorStringOptions {
1304
+ voids?: boolean;
1305
+ }
1306
+
1307
+ export declare interface EditorUnhangRangeOptions {
1308
+ voids?: boolean;
1309
+ }
1310
+
1311
+ export declare interface EditorVoidOptions {
1312
+ at?: Location_2;
1313
+ mode?: MaximizeMode;
1314
+ voids?: boolean;
1315
+ }
1316
+
1317
+ declare type Element_2 = ExtendedType<'Element', BaseElement>;
1318
+
1319
+ declare const Element_2: ElementInterface;
1320
+ export { Element_2 as Element }
1321
+
1322
+ export declare const ELEMENT_TO_NODE: toRawWeakMap<HTMLElement, Node_2>;
1323
+
1324
+ /**
1325
+ * `ElementEntry` objects refer to an `Element` and the `Path` where it can be
1326
+ * found inside a root node.
1327
+ */
1328
+ export declare type ElementEntry = [Element_2, Path];
1329
+
1330
+ export declare interface ElementInterface {
1331
+ /**
1332
+ * Check if a value implements the 'Ancestor' interface.
1333
+ */
1334
+ isAncestor: (value: any) => value is Ancestor;
1335
+ /**
1336
+ * Check if a value implements the `Element` interface.
1337
+ */
1338
+ isElement: (value: any) => value is Element_2;
1339
+ /**
1340
+ * Check if a value is an array of `Element` objects.
1341
+ */
1342
+ isElementList: (value: any) => value is Element_2[];
1343
+ /**
1344
+ * Check if a set of props is a partial of Element.
1345
+ */
1346
+ isElementProps: (props: any) => props is Partial<Element_2>;
1347
+ /**
1348
+ * Check if a value implements the `Element` interface and has elementKey with selected value.
1349
+ * Default it check to `type` key value
1350
+ */
1351
+ isElementType: <T extends Element_2>(value: any, elementVal: string, elementKey?: string) => value is T;
1352
+ /**
1353
+ * Check if an element matches set of properties.
1354
+ *
1355
+ * Note: this checks custom properties, and it does not ensure that any
1356
+ * children are equivalent.
1357
+ */
1358
+ matches: (element: Element_2, props: Partial<Element_2>) => boolean;
1359
+ }
1360
+
1361
+ export declare const elementReadOnly: EditorInterface['elementReadOnly'];
1362
+
1363
+ export declare const end: EditorInterface['end'];
1364
+
1365
+ /**
1366
+ * Extendable Custom Types Interface
1367
+ */
1368
+ declare type ExtendableTypes = 'Editor' | 'Element' | 'Text' | 'Selection' | 'Range' | 'Point' | 'Operation' | 'InsertNodeOperation' | 'InsertTextOperation' | 'MergeNodeOperation' | 'MoveNodeOperation' | 'RemoveNodeOperation' | 'RemoveTextOperation' | 'SetNodeOperation' | 'SetSelectionOperation' | 'SplitNodeOperation';
1369
+
1370
+ export declare type ExtendedType<K extends ExtendableTypes, B> = unknown extends CustomTypes[K] ? B : CustomTypes[K];
1371
+
1372
+ export declare const first: EditorInterface['first'];
1373
+
1374
+ export declare const fragment: EditorInterface['fragment'];
1375
+
1376
+ declare interface GeneralTransforms {
1377
+ /**
1378
+ * Transform the editor by an operation.
1379
+ */
1380
+ transform: (editor: Editor, op: Operation) => void;
1381
+ }
1382
+
1383
+ declare const GeneralTransforms: GeneralTransforms;
1384
+
1385
+ /**
1386
+ * Retrieves the deepest active element in the DOM, considering nested shadow DOMs.
1387
+ */
1388
+ export declare const getActiveElement: () => Element | null;
1389
+
1390
+ /**
1391
+ * Returns the host window of a DOM node
1392
+ */
1393
+ export declare const getDefaultView: (value: any) => Window | null;
1394
+
1395
+ /**
1396
+ * Get the "dirty" paths generated from an operation.
1397
+ */
1398
+ export declare const getDirtyPaths: WithEditorFirstArg<Editor['getDirtyPaths']>;
1399
+
1400
+ export declare const getFragment: WithEditorFirstArg<Editor['getFragment']>;
1401
+
1402
+ /**
1403
+ * Get the dom selection from Shadow Root if possible, otherwise from the document
1404
+ */
1405
+ declare const getSelection_2: (root: Document | ShadowRoot) => Selection | null;
1406
+ export { getSelection_2 as getSelection }
1407
+
1408
+ export declare const getVoid: EditorInterface['void'];
1409
+
1410
+ export declare const HAS_BEFORE_INPUT_SUPPORT: boolean;
1411
+
1412
+ export declare const hasBlocks: EditorInterface['hasBlocks'];
1413
+
1414
+ export declare const hasInlines: EditorInterface['hasInlines'];
1415
+
1416
+ export declare const hasPath: EditorInterface['hasPath'];
1417
+
1418
+ /**
1419
+ * Determines whether the active element is nested within a shadowRoot
1420
+ */
1421
+ export declare const hasShadowRoot: (node: Node | null) => boolean;
1422
+
1423
+ export declare const hasTexts: EditorInterface['hasTexts'];
1424
+
1425
+ /**
1426
+ * Hotkeys.
1427
+ */
1428
+ export declare const Hotkeys: {
1429
+ isBold: (event: KeyboardEvent) => boolean;
1430
+ isCompose: (event: KeyboardEvent) => boolean;
1431
+ isMoveBackward: (event: KeyboardEvent) => boolean;
1432
+ isMoveForward: (event: KeyboardEvent) => boolean;
1433
+ isDeleteBackward: (event: KeyboardEvent) => boolean;
1434
+ isDeleteForward: (event: KeyboardEvent) => boolean;
1435
+ isDeleteLineBackward: (event: KeyboardEvent) => boolean;
1436
+ isDeleteLineForward: (event: KeyboardEvent) => boolean;
1437
+ isDeleteWordBackward: (event: KeyboardEvent) => boolean;
1438
+ isDeleteWordForward: (event: KeyboardEvent) => boolean;
1439
+ isExtendBackward: (event: KeyboardEvent) => boolean;
1440
+ isExtendForward: (event: KeyboardEvent) => boolean;
1441
+ isExtendLineBackward: (event: KeyboardEvent) => boolean;
1442
+ isExtendLineForward: (event: KeyboardEvent) => boolean;
1443
+ isItalic: (event: KeyboardEvent) => boolean;
1444
+ isMoveLineBackward: (event: KeyboardEvent) => boolean;
1445
+ isMoveLineForward: (event: KeyboardEvent) => boolean;
1446
+ isMoveWordBackward: (event: KeyboardEvent) => boolean;
1447
+ isMoveWordForward: (event: KeyboardEvent) => boolean;
1448
+ isRedo: (event: KeyboardEvent) => boolean;
1449
+ isSoftBreak: (event: KeyboardEvent) => boolean;
1450
+ isSplitBlock: (event: KeyboardEvent) => boolean;
1451
+ isTransposeCharacter: (event: KeyboardEvent) => boolean;
1452
+ isUndo: (event: KeyboardEvent) => boolean;
1453
+ };
1454
+
1455
+ export declare const insertBreak: EditorInterface['insertBreak'];
1456
+
1457
+ export declare const insertFragment: TextTransforms['insertFragment'];
1458
+
1459
+ export declare const insertNode: EditorInterface['insertNode'];
1460
+
1461
+ export declare type InsertNodeOperation = ExtendedType<'InsertNodeOperation', BaseInsertNodeOperation>;
1462
+
1463
+ export declare const insertNodes: NodeTransforms['insertNodes'];
1464
+
1465
+ export declare const insertSoftBreak: EditorInterface['insertSoftBreak'];
1466
+
1467
+ export declare const insertText: EditorInterface['insertText'];
1468
+
1469
+ export declare type InsertTextOperation = ExtendedType<'InsertTextOperation', BaseInsertTextOperation>;
1470
+
1471
+ export declare const IS_ANDROID: boolean;
1472
+
1473
+ export declare const IS_CHROME: boolean;
1474
+
1475
+ export declare const IS_COMPOSING: toRawWeakMap<Editor, boolean>;
1476
+
1477
+ export declare const IS_FIREFOX: boolean;
1478
+
1479
+ export declare const IS_FIREFOX_LEGACY: boolean;
1480
+
1481
+ export declare const IS_FOCUSED: toRawWeakMap<Editor, boolean>;
1482
+
1483
+ export declare const IS_IOS: boolean;
1484
+
1485
+ /**
1486
+ * Two weak maps that allow us rebuild a path given a node. They are populated
1487
+ * at render time such that after a render occurs we can always backtrack.
1488
+ */
1489
+ export declare const IS_NODE_MAP_DIRTY: toRawWeakMap<Editor, boolean>;
1490
+
1491
+ /**
1492
+ * Weak maps for storing editor-related state.
1493
+ */
1494
+ export declare const IS_READ_ONLY: toRawWeakMap<Editor, boolean>;
1495
+
1496
+ export declare const IS_UC_MOBILE: boolean;
1497
+
1498
+ export declare const IS_WEBKIT: boolean;
1499
+
1500
+ export declare const IS_WECHATBROWSER: boolean;
1501
+
1502
+ /**
1503
+ * @returns `true` if `otherNode` is after `node` in the document; otherwise, `false`.
1504
+ */
1505
+ export declare const isAfter: (node: DOMNode_3, otherNode: DOMNode_3) => boolean;
1506
+
1507
+ /**
1508
+ * @returns `true` if `otherNode` is before `node` in the document; otherwise, `false`.
1509
+ */
1510
+ export declare const isBefore: (node: DOMNode_3, otherNode: DOMNode_3) => boolean;
1511
+
1512
+ export declare const isBlock: EditorInterface['isBlock'];
1513
+
1514
+ /**
1515
+ * Check if a DOM node is an element node.
1516
+ */
1517
+ export declare const isDOMElement: (value: any) => value is DOMElement_2;
1518
+
1519
+ /**
1520
+ * Check if a value is a DOM node.
1521
+ */
1522
+ export declare const isDOMNode: (value: any) => value is DOMNode_3;
1523
+
1524
+ /**
1525
+ * Check if a value is a DOM selection.
1526
+ */
1527
+ export declare const isDOMSelection: (value: any) => value is DOMSelection_3;
1528
+
1529
+ export declare const isEdge: EditorInterface['isEdge'];
1530
+
1531
+ export declare const isEditor: EditorInterface['isEditor'];
1532
+
1533
+ /**
1534
+ * Check if a list of decorator ranges are equal to another.
1535
+ *
1536
+ * PERF: this requires the two lists to also have the ranges inside them in the
1537
+ * same order, but this is an okay constraint for us since decorations are
1538
+ * kept in order, and the odd case where they aren't is okay to re-render for.
1539
+ */
1540
+ export declare const isElementDecorationsEqual: (list: Range_2[], another: Range_2[]) => boolean;
1541
+
1542
+ export declare const isEmpty: EditorInterface['isEmpty'];
1543
+
1544
+ export declare const isEnd: EditorInterface['isEnd'];
1545
+
1546
+ export declare const isNormalizing: EditorInterface['isNormalizing'];
1547
+
1548
+ /**
1549
+ * Checks whether a paste event is a plaintext-only event.
1550
+ */
1551
+ export declare const isPlainTextOnlyPaste: (event: ClipboardEvent) => boolean | null;
1552
+
1553
+ export declare const isStart: EditorInterface['isStart'];
1554
+
1555
+ /**
1556
+ * Check if a list of decorator ranges are equal to another.
1557
+ *
1558
+ * PERF: this requires the two lists to also have the ranges inside them in the
1559
+ * same order, but this is an okay constraint for us since decorations are
1560
+ * kept in order, and the odd case where they aren't is okay to re-render for.
1561
+ */
1562
+ export declare const isTextDecorationsEqual: (list: Range_2[], another: Range_2[]) => boolean;
1563
+
1564
+ /**
1565
+ * Check whether a mutation originates from a editable element inside the editor.
1566
+ */
1567
+ export declare const isTrackedMutation: (editor: DOMEditor, mutation: MutationRecord, batch: MutationRecord[]) => boolean;
1568
+
1569
+ /**
1570
+ * An auto-incrementing identifier for keys.
1571
+ */
1572
+ /**
1573
+ * A class that keeps track of a key string. We use a full class here because we
1574
+ * want to be able to use them as keys in `WeakMap` objects.
1575
+ */
1576
+ export declare class Key {
1577
+ id: string;
1578
+ constructor();
1579
+ }
1580
+
1581
+ export declare const last: EditorInterface['last'];
1582
+
1583
+ export declare const leaf: EditorInterface['leaf'];
1584
+
1585
+ export declare type LeafEdge = 'start' | 'end';
1586
+
1587
+ export declare function levels<T extends Node_2>(editor: Editor, options?: EditorLevelsOptions<T>): Generator<NodeEntry<T>, void, undefined>;
1588
+
1589
+ export declare const liftNodes: NodeTransforms['liftNodes'];
1590
+
1591
+ /**
1592
+ * The `Location` interface is a union of the ways to refer to a specific
1593
+ * location in a Slate document: paths, points or ranges.
1594
+ *
1595
+ * Methods will often accept a `Location` instead of requiring only a `Path`,
1596
+ * `Point` or `Range`. This eliminates the need for developers to manage
1597
+ * converting between the different interfaces in their own code base.
1598
+ */
1599
+ declare type Location_2 = Path | Point | Range_2;
1600
+
1601
+ declare const Location_2: LocationInterface;
1602
+ export { Location_2 as Location }
1603
+
1604
+ export declare interface LocationInterface {
1605
+ /**
1606
+ * Check if a value implements the `Location` interface.
1607
+ */
1608
+ isLocation: (value: any) => value is Location_2;
1609
+ }
1610
+
1611
+ export declare const MARK_PLACEHOLDER_SYMBOL: string;
1612
+
1613
+ export declare const marks: EditorInterface['marks'];
1614
+
1615
+ export declare type MaximizeMode = RangeMode | 'all';
1616
+
1617
+ export declare type MergeNodeOperation = ExtendedType<'MergeNodeOperation', BaseMergeNodeOperation>;
1618
+
1619
+ export declare const mergeNodes: NodeTransforms['mergeNodes'];
1620
+
1621
+ /**
1622
+ * Return a string diff that is equivalent to applying b after a spanning the range of
1623
+ * both changes
1624
+ */
1625
+ export declare function mergeStringDiffs(targetText: string, a: StringDiff, b: StringDiff): StringDiff | null;
1626
+
1627
+ export declare const move: SelectionTransforms['move'];
1628
+
1629
+ export declare type MoveNodeOperation = ExtendedType<'MoveNodeOperation', BaseMoveNodeOperation>;
1630
+
1631
+ export declare const moveNodes: NodeTransforms['moveNodes'];
1632
+
1633
+ export declare type MoveUnit = 'offset' | 'character' | 'word' | 'line';
1634
+
1635
+ export declare const next: EditorInterface['next'];
1636
+
1637
+ export declare const node: EditorInterface['node'];
1638
+
1639
+ declare type Node_2 = Editor | Element_2 | Text_2;
1640
+
1641
+ declare const Node_2: NodeInterface;
1642
+ export { Node_2 as Node }
1643
+
1644
+ export declare const NODE_TO_ELEMENT: toRawWeakMap<Node_2, HTMLElement>;
1645
+
1646
+ export declare const NODE_TO_INDEX: toRawWeakMap<Node_2, number>;
1647
+
1648
+ export declare const NODE_TO_KEY: toRawWeakMap<Node_2, Key>;
1649
+
1650
+ export declare const NODE_TO_PARENT: toRawWeakMap<Node_2, Ancestor>;
1651
+
1652
+ export declare interface NodeAncestorsOptions {
1653
+ reverse?: boolean;
1654
+ }
1655
+
1656
+ export declare interface NodeChildrenOptions {
1657
+ reverse?: boolean;
1658
+ }
1659
+
1660
+ export declare interface NodeDescendantsOptions {
1661
+ from?: Path;
1662
+ to?: Path;
1663
+ reverse?: boolean;
1664
+ pass?: (node: NodeEntry) => boolean;
1665
+ }
1666
+
1667
+ export declare interface NodeElementsOptions {
1668
+ from?: Path;
1669
+ to?: Path;
1670
+ reverse?: boolean;
1671
+ pass?: (node: NodeEntry) => boolean;
1672
+ }
1673
+
1674
+ /**
1675
+ * `NodeEntry` objects are returned when iterating over the nodes in a Slate
1676
+ * document tree. They consist of the node and its `Path` relative to the root
1677
+ * node in the document.
1678
+ */
1679
+ export declare type NodeEntry<T extends Node_2 = Node_2> = [T, Path];
1680
+
1681
+ declare interface NodeInsertNodesOptions<T extends Node_2> {
1682
+ at?: Location_2;
1683
+ match?: NodeMatch<T>;
1684
+ mode?: RangeMode;
1685
+ hanging?: boolean;
1686
+ select?: boolean;
1687
+ voids?: boolean;
1688
+ batchDirty?: boolean;
1689
+ }
1690
+
1691
+ export declare interface NodeInterface {
1692
+ /**
1693
+ * Get the node at a specific path, asserting that it's an ancestor node.
1694
+ */
1695
+ ancestor: (root: Node_2, path: Path) => Ancestor;
1696
+ /**
1697
+ * Return a generator of all the ancestor nodes above a specific path.
1698
+ *
1699
+ * By default the order is top-down, from highest to lowest ancestor in
1700
+ * the tree, but you can pass the `reverse: true` option to go bottom-up.
1701
+ */
1702
+ ancestors: (root: Node_2, path: Path, options?: NodeAncestorsOptions) => Generator<NodeEntry<Ancestor>, void, undefined>;
1703
+ /**
1704
+ * Get the child of a node at a specific index.
1705
+ */
1706
+ child: (root: Node_2, index: number) => Descendant;
1707
+ /**
1708
+ * Iterate over the children of a node at a specific path.
1709
+ */
1710
+ children: (root: Node_2, path: Path, options?: NodeChildrenOptions) => Generator<NodeEntry<Descendant>, void, undefined>;
1711
+ /**
1712
+ * Get an entry for the common ancesetor node of two paths.
1713
+ */
1714
+ common: (root: Node_2, path: Path, another: Path) => NodeEntry;
1715
+ /**
1716
+ * Get the node at a specific path, asserting that it's a descendant node.
1717
+ */
1718
+ descendant: (root: Node_2, path: Path) => Descendant;
1719
+ /**
1720
+ * Return a generator of all the descendant node entries inside a root node.
1721
+ */
1722
+ descendants: (root: Node_2, options?: NodeDescendantsOptions) => Generator<NodeEntry<Descendant>, void, undefined>;
1723
+ /**
1724
+ * Return a generator of all the element nodes inside a root node. Each iteration
1725
+ * will return an `ElementEntry` tuple consisting of `[Element, Path]`. If the
1726
+ * root node is an element it will be included in the iteration as well.
1727
+ */
1728
+ elements: (root: Node_2, options?: NodeElementsOptions) => Generator<ElementEntry, void, undefined>;
1729
+ /**
1730
+ * Extract props from a Node.
1731
+ */
1732
+ extractProps: (node: Node_2) => NodeProps;
1733
+ /**
1734
+ * Get the first node entry in a root node from a path.
1735
+ */
1736
+ first: (root: Node_2, path: Path) => NodeEntry;
1737
+ /**
1738
+ * Get the sliced fragment represented by a range inside a root node.
1739
+ */
1740
+ fragment: (root: Node_2, range: Range_2) => Descendant[];
1741
+ /**
1742
+ * Get the descendant node referred to by a specific path. If the path is an
1743
+ * empty array, it refers to the root node itself.
1744
+ */
1745
+ get: (root: Node_2, path: Path) => Node_2;
1746
+ /**
1747
+ * Similar to get, but returns undefined if the node does not exist.
1748
+ */
1749
+ getIf: (root: Node_2, path: Path) => Node_2 | undefined;
1750
+ /**
1751
+ * Check if a descendant node exists at a specific path.
1752
+ */
1753
+ has: (root: Node_2, path: Path) => boolean;
1754
+ /**
1755
+ * Check if a value implements the `Node` interface.
1756
+ */
1757
+ isNode: (value: any) => value is Node_2;
1758
+ /**
1759
+ * Check if a value is a list of `Node` objects.
1760
+ */
1761
+ isNodeList: (value: any) => value is Node_2[];
1762
+ /**
1763
+ * Get the last node entry in a root node from a path.
1764
+ */
1765
+ last: (root: Node_2, path: Path) => NodeEntry;
1766
+ /**
1767
+ * Get the node at a specific path, ensuring it's a leaf text node.
1768
+ */
1769
+ leaf: (root: Node_2, path: Path) => Text_2;
1770
+ /**
1771
+ * Return a generator of the in a branch of the tree, from a specific path.
1772
+ *
1773
+ * By default the order is top-down, from highest to lowest node in the tree,
1774
+ * but you can pass the `reverse: true` option to go bottom-up.
1775
+ */
1776
+ levels: (root: Node_2, path: Path, options?: NodeLevelsOptions) => Generator<NodeEntry, void, undefined>;
1777
+ /**
1778
+ * Check if a node matches a set of props.
1779
+ */
1780
+ matches: (node: Node_2, props: Partial<Node_2>) => boolean;
1781
+ /**
1782
+ * Return a generator of all the node entries of a root node. Each entry is
1783
+ * returned as a `[Node, Path]` tuple, with the path referring to the node's
1784
+ * position inside the root node.
1785
+ */
1786
+ nodes: (root: Node_2, options?: NodeNodesOptions) => Generator<NodeEntry, void, undefined>;
1787
+ /**
1788
+ * Get the parent of a node at a specific path.
1789
+ */
1790
+ parent: (root: Node_2, path: Path) => Ancestor;
1791
+ /**
1792
+ * Get the concatenated text string of a node's content.
1793
+ *
1794
+ * Note that this will not include spaces or line breaks between block nodes.
1795
+ * It is not a user-facing string, but a string for performing offset-related
1796
+ * computations for a node.
1797
+ */
1798
+ string: (node: Node_2) => string;
1799
+ /**
1800
+ * Return a generator of all leaf text nodes in a root node.
1801
+ */
1802
+ texts: (root: Node_2, options?: NodeTextsOptions) => Generator<NodeEntry<Text_2>, void, undefined>;
1803
+ }
1804
+
1805
+ export declare interface NodeLevelsOptions {
1806
+ reverse?: boolean;
1807
+ }
1808
+
1809
+ /**
1810
+ * A helper type for narrowing matched nodes with a predicate.
1811
+ */
1812
+ export declare type NodeMatch<T extends Node_2> = ((node: Node_2, path: Path) => node is T) | ((node: Node_2, path: Path) => boolean);
1813
+
1814
+ export declare interface NodeNodesOptions {
1815
+ from?: Path;
1816
+ to?: Path;
1817
+ reverse?: boolean;
1818
+ pass?: (entry: NodeEntry) => boolean;
1819
+ }
1820
+
1821
+ export declare type NodeOperation = InsertNodeOperation | MergeNodeOperation | MoveNodeOperation | RemoveNodeOperation | SetNodeOperation | SplitNodeOperation;
1822
+
1823
+ /**
1824
+ * Convenience type for returning the props of a node.
1825
+ */
1826
+ export declare type NodeProps = Omit<Editor, 'children'> | Omit<Element_2, 'children'> | Omit<Text_2, 'text'>;
1827
+
1828
+ export declare function nodes<T extends Node_2>(editor: Editor, options?: EditorNodesOptions<T>): Generator<NodeEntry<T>, void, undefined>;
1829
+
1830
+ export declare interface NodeTextsOptions {
1831
+ from?: Path;
1832
+ to?: Path;
1833
+ reverse?: boolean;
1834
+ pass?: (node: NodeEntry) => boolean;
1835
+ }
1836
+
1837
+ declare interface NodeTransforms {
1838
+ /**
1839
+ * Insert nodes in the editor
1840
+ * at the specified location or (if not defined) the current selection or (if not defined) the end of the document.
1841
+ */
1842
+ insertNodes: <T extends Node_2>(editor: Editor, nodes: Node_2 | Node_2[], options?: NodeInsertNodesOptions<T>) => void;
1843
+ /**
1844
+ * Lift nodes at a specific location upwards in the document tree, splitting
1845
+ * their parent in two if necessary.
1846
+ */
1847
+ liftNodes: <T extends Node_2>(editor: Editor, options?: {
1848
+ at?: Location_2;
1849
+ match?: NodeMatch<T>;
1850
+ mode?: MaximizeMode;
1851
+ voids?: boolean;
1852
+ }) => void;
1853
+ /**
1854
+ * Merge a node at a location with the previous node of the same depth,
1855
+ * removing any empty containing nodes after the merge if necessary.
1856
+ */
1857
+ mergeNodes: <T extends Node_2>(editor: Editor, options?: {
1858
+ at?: Location_2;
1859
+ match?: NodeMatch<T>;
1860
+ mode?: RangeMode;
1861
+ hanging?: boolean;
1862
+ voids?: boolean;
1863
+ }) => void;
1864
+ /**
1865
+ * Move the nodes at a location to a new location.
1866
+ */
1867
+ moveNodes: <T extends Node_2>(editor: Editor, options: {
1868
+ at?: Location_2;
1869
+ match?: NodeMatch<T>;
1870
+ mode?: MaximizeMode;
1871
+ to: Path;
1872
+ voids?: boolean;
1873
+ }) => void;
1874
+ /**
1875
+ * Remove the nodes at a specific location in the document.
1876
+ */
1877
+ removeNodes: <T extends Node_2>(editor: Editor, options?: {
1878
+ at?: Location_2;
1879
+ match?: NodeMatch<T>;
1880
+ mode?: RangeMode;
1881
+ hanging?: boolean;
1882
+ voids?: boolean;
1883
+ }) => void;
1884
+ /**
1885
+ * Set new properties on the nodes at a location.
1886
+ */
1887
+ setNodes: <T extends Node_2>(editor: Editor, props: Partial<T>, options?: {
1888
+ at?: Location_2;
1889
+ match?: NodeMatch<T>;
1890
+ mode?: MaximizeMode;
1891
+ hanging?: boolean;
1892
+ split?: boolean;
1893
+ voids?: boolean;
1894
+ compare?: PropsCompare;
1895
+ merge?: PropsMerge;
1896
+ }) => void;
1897
+ /**
1898
+ * Split the nodes at a specific location.
1899
+ */
1900
+ splitNodes: <T extends Node_2>(editor: Editor, options?: {
1901
+ at?: Location_2;
1902
+ match?: NodeMatch<T>;
1903
+ mode?: RangeMode;
1904
+ always?: boolean;
1905
+ height?: number;
1906
+ voids?: boolean;
1907
+ }) => void;
1908
+ /**
1909
+ * Unset properties on the nodes at a location.
1910
+ */
1911
+ unsetNodes: <T extends Node_2>(editor: Editor, props: string | string[], options?: {
1912
+ at?: Location_2;
1913
+ match?: NodeMatch<T>;
1914
+ mode?: MaximizeMode;
1915
+ hanging?: boolean;
1916
+ split?: boolean;
1917
+ voids?: boolean;
1918
+ }) => void;
1919
+ /**
1920
+ * Unwrap the nodes at a location from a parent node, splitting the parent if
1921
+ * necessary to ensure that only the content in the range is unwrapped.
1922
+ */
1923
+ unwrapNodes: <T extends Node_2>(editor: Editor, options?: {
1924
+ at?: Location_2;
1925
+ match?: NodeMatch<T>;
1926
+ mode?: MaximizeMode;
1927
+ split?: boolean;
1928
+ voids?: boolean;
1929
+ }) => void;
1930
+ /**
1931
+ * Wrap the nodes at a location in a new container node, splitting the edges
1932
+ * of the range first to ensure that only the content in the range is wrapped.
1933
+ */
1934
+ wrapNodes: <T extends Node_2>(editor: Editor, element: Element_2, options?: {
1935
+ at?: Location_2;
1936
+ match?: NodeMatch<T>;
1937
+ mode?: MaximizeMode;
1938
+ split?: boolean;
1939
+ voids?: boolean;
1940
+ }) => void;
1941
+ }
1942
+
1943
+ declare const NodeTransforms: NodeTransforms;
1944
+
1945
+ export declare const normalize: EditorInterface['normalize'];
1946
+
1947
+ /**
1948
+ * Normalize a DOM point so that it always refers to a text node.
1949
+ */
1950
+ export declare const normalizeDOMPoint: (domPoint: DOMPoint_2) => DOMPoint_2;
1951
+
1952
+ export declare const normalizeNode: WithEditorFirstArg<Editor['normalizeNode']>;
1953
+
1954
+ /**
1955
+ * Normalize a 'pending point' a.k.a a point based on the dom state before applying
1956
+ * the pending diffs. Since the pending diffs might have been inserted with different
1957
+ * marks we have to 'walk' the offset from the starting position to ensure we still
1958
+ * have a valid point inside the document
1959
+ */
1960
+ export declare function normalizePoint(editor: Editor, point: Point): Point | null;
1961
+
1962
+ /**
1963
+ * Normalize a 'pending selection' to ensure it's valid in the current document state.
1964
+ */
1965
+ export declare function normalizeRange(editor: Editor, range: Range_2): Range_2 | null;
1966
+
1967
+ /**
1968
+ * Remove redundant changes from the diff so that it spans the minimal possible range
1969
+ */
1970
+ export declare function normalizeStringDiff(targetText: string, diff: StringDiff): StringDiff | null;
1971
+
1972
+ declare type OmitFirstArg<F> = F extends (x: any, ...args: infer P) => infer R ? (...args: P) => R : never;
1973
+
1974
+ export declare type Operation = ExtendedType<'Operation', BaseOperation>;
1975
+
1976
+ export declare const Operation: OperationInterface;
1977
+
1978
+ export declare interface OperationInterface {
1979
+ /**
1980
+ * Check if a value is a `NodeOperation` object.
1981
+ */
1982
+ isNodeOperation: (value: any) => value is NodeOperation;
1983
+ /**
1984
+ * Check if a value is an `Operation` object.
1985
+ */
1986
+ isOperation: (value: any) => value is Operation;
1987
+ /**
1988
+ * Check if a value is a list of `Operation` objects.
1989
+ */
1990
+ isOperationList: (value: any) => value is Operation[];
1991
+ /**
1992
+ * Check if a value is a `SelectionOperation` object.
1993
+ */
1994
+ isSelectionOperation: (value: any) => value is SelectionOperation;
1995
+ /**
1996
+ * Check if a value is a `TextOperation` object.
1997
+ */
1998
+ isTextOperation: (value: any) => value is TextOperation;
1999
+ /**
2000
+ * Invert an operation, returning a new operation that will exactly undo the
2001
+ * original when applied.
2002
+ */
2003
+ inverse: (op: Operation) => Operation;
2004
+ }
2005
+
2006
+ declare const parent_2: EditorInterface['parent'];
2007
+ export { parent_2 as parent }
2008
+
2009
+ /**
2010
+ * `Path` arrays are a list of indexes that describe a node's exact position in
2011
+ * a Slate node tree. Although they are usually relative to the root `Editor`
2012
+ * object, they can be relative to any `Node` object.
2013
+ */
2014
+ export declare type Path = number[];
2015
+
2016
+ export declare const Path: PathInterface;
2017
+
2018
+ export declare const path: EditorInterface['path'];
2019
+
2020
+ export declare interface PathAncestorsOptions {
2021
+ reverse?: boolean;
2022
+ }
2023
+
2024
+ export declare interface PathInterface {
2025
+ /**
2026
+ * Get a list of ancestor paths for a given path.
2027
+ *
2028
+ * The paths are sorted from shallowest to deepest ancestor. However, if the
2029
+ * `reverse: true` option is passed, they are reversed.
2030
+ */
2031
+ ancestors: (path: Path, options?: PathAncestorsOptions) => Path[];
2032
+ /**
2033
+ * Get the common ancestor path of two paths.
2034
+ */
2035
+ common: (path: Path, another: Path) => Path;
2036
+ /**
2037
+ * Compare a path to another, returning an integer indicating whether the path
2038
+ * was before, at, or after the other.
2039
+ *
2040
+ * Note: Two paths of unequal length can still receive a `0` result if one is
2041
+ * directly above or below the other. If you want exact matching, use
2042
+ * [[Path.equals]] instead.
2043
+ */
2044
+ compare: (path: Path, another: Path) => -1 | 0 | 1;
2045
+ /**
2046
+ * Check if a path ends after one of the indexes in another.
2047
+ */
2048
+ endsAfter: (path: Path, another: Path) => boolean;
2049
+ /**
2050
+ * Check if a path ends at one of the indexes in another.
2051
+ */
2052
+ endsAt: (path: Path, another: Path) => boolean;
2053
+ /**
2054
+ * Check if a path ends before one of the indexes in another.
2055
+ */
2056
+ endsBefore: (path: Path, another: Path) => boolean;
2057
+ /**
2058
+ * Check if a path is exactly equal to another.
2059
+ */
2060
+ equals: (path: Path, another: Path) => boolean;
2061
+ /**
2062
+ * Check if the path of previous sibling node exists
2063
+ */
2064
+ hasPrevious: (path: Path) => boolean;
2065
+ /**
2066
+ * Check if a path is after another.
2067
+ */
2068
+ isAfter: (path: Path, another: Path) => boolean;
2069
+ /**
2070
+ * Check if a path is an ancestor of another.
2071
+ */
2072
+ isAncestor: (path: Path, another: Path) => boolean;
2073
+ /**
2074
+ * Check if a path is before another.
2075
+ */
2076
+ isBefore: (path: Path, another: Path) => boolean;
2077
+ /**
2078
+ * Check if a path is a child of another.
2079
+ */
2080
+ isChild: (path: Path, another: Path) => boolean;
2081
+ /**
2082
+ * Check if a path is equal to or an ancestor of another.
2083
+ */
2084
+ isCommon: (path: Path, another: Path) => boolean;
2085
+ /**
2086
+ * Check if a path is a descendant of another.
2087
+ */
2088
+ isDescendant: (path: Path, another: Path) => boolean;
2089
+ /**
2090
+ * Check if a path is the parent of another.
2091
+ */
2092
+ isParent: (path: Path, another: Path) => boolean;
2093
+ /**
2094
+ * Check is a value implements the `Path` interface.
2095
+ */
2096
+ isPath: (value: any) => value is Path;
2097
+ /**
2098
+ * Check if a path is a sibling of another.
2099
+ */
2100
+ isSibling: (path: Path, another: Path) => boolean;
2101
+ /**
2102
+ * Get a list of paths at every level down to a path. Note: this is the same
2103
+ * as `Path.ancestors`, but including the path itself.
2104
+ *
2105
+ * The paths are sorted from shallowest to deepest. However, if the `reverse:
2106
+ * true` option is passed, they are reversed.
2107
+ */
2108
+ levels: (path: Path, options?: PathLevelsOptions) => Path[];
2109
+ /**
2110
+ * Given a path, get the path to the next sibling node.
2111
+ */
2112
+ next: (path: Path) => Path;
2113
+ /**
2114
+ * Returns whether this operation can affect paths or not. Used as an
2115
+ * optimization when updating dirty paths during normalization
2116
+ *
2117
+ * NOTE: This *must* be kept in sync with the implementation of 'transform'
2118
+ * below
2119
+ */
2120
+ operationCanTransformPath: (operation: Operation) => operation is InsertNodeOperation | RemoveNodeOperation | MergeNodeOperation | SplitNodeOperation | MoveNodeOperation;
2121
+ /**
2122
+ * Given a path, return a new path referring to the parent node above it.
2123
+ */
2124
+ parent: (path: Path) => Path;
2125
+ /**
2126
+ * Given a path, get the path to the previous sibling node.
2127
+ */
2128
+ previous: (path: Path) => Path;
2129
+ /**
2130
+ * Get a path relative to an ancestor.
2131
+ */
2132
+ relative: (path: Path, ancestor: Path) => Path;
2133
+ /**
2134
+ * Transform a path by an operation.
2135
+ */
2136
+ transform: (path: Path, operation: Operation, options?: PathTransformOptions) => Path | null;
2137
+ }
2138
+
2139
+ export declare interface PathLevelsOptions {
2140
+ reverse?: boolean;
2141
+ }
2142
+
2143
+ /**
2144
+ * `PathRef` objects keep a specific path in a document synced over time as new
2145
+ * operations are applied to the editor. You can access their `current` property
2146
+ * at any time for the up-to-date path value.
2147
+ */
2148
+ export declare interface PathRef {
2149
+ current: Path | null;
2150
+ affinity: 'forward' | 'backward' | null;
2151
+ unref(): Path | null;
2152
+ }
2153
+
2154
+ export declare const PathRef: PathRefInterface;
2155
+
2156
+ export declare const pathRef: EditorInterface['pathRef'];
2157
+
2158
+ export declare interface PathRefInterface {
2159
+ /**
2160
+ * Transform the path ref's current value by an operation.
2161
+ */
2162
+ transform: (ref: PathRef, op: Operation) => void;
2163
+ }
2164
+
2165
+ export declare const pathRefs: EditorInterface['pathRefs'];
2166
+
2167
+ export declare interface PathTransformOptions {
2168
+ affinity?: TextDirection | null;
2169
+ }
2170
+
2171
+ /**
2172
+ * Symbols.
2173
+ */
2174
+ export declare const PLACEHOLDER_SYMBOL: string;
2175
+
2176
+ export declare type Point = ExtendedType<'Point', BasePoint>;
2177
+
2178
+ export declare const Point: PointInterface;
2179
+
2180
+ export declare const point: EditorInterface['point'];
2181
+
2182
+ /**
2183
+ * `PointEntry` objects are returned when iterating over `Point` objects that
2184
+ * belong to a range.
2185
+ */
2186
+ export declare type PointEntry = [Point, 'anchor' | 'focus'];
2187
+
2188
+ export declare interface PointInterface {
2189
+ /**
2190
+ * Compare a point to another, returning an integer indicating whether the
2191
+ * point was before, at, or after the other.
2192
+ */
2193
+ compare: (point: Point, another: Point) => -1 | 0 | 1;
2194
+ /**
2195
+ * Check if a point is after another.
2196
+ */
2197
+ isAfter: (point: Point, another: Point) => boolean;
2198
+ /**
2199
+ * Check if a point is before another.
2200
+ */
2201
+ isBefore: (point: Point, another: Point) => boolean;
2202
+ /**
2203
+ * Check if a point is exactly equal to another.
2204
+ */
2205
+ equals: (point: Point, another: Point) => boolean;
2206
+ /**
2207
+ * Check if a value implements the `Point` interface.
2208
+ */
2209
+ isPoint: (value: any) => value is Point;
2210
+ /**
2211
+ * Transform a point by an operation.
2212
+ */
2213
+ transform: (point: Point, op: Operation, options?: PointTransformOptions) => Point | null;
2214
+ }
2215
+
2216
+ /**
2217
+ * `PointRef` objects keep a specific point in a document synced over time as new
2218
+ * operations are applied to the editor. You can access their `current` property
2219
+ * at any time for the up-to-date point value.
2220
+ */
2221
+ export declare interface PointRef {
2222
+ current: Point | null;
2223
+ affinity: TextDirection | null;
2224
+ unref(): Point | null;
2225
+ }
2226
+
2227
+ export declare const PointRef: PointRefInterface;
2228
+
2229
+ export declare const pointRef: EditorInterface['pointRef'];
2230
+
2231
+ export declare interface PointRefInterface {
2232
+ /**
2233
+ * Transform the point ref's current value by an operation.
2234
+ */
2235
+ transform: (ref: PointRef, op: Operation) => void;
2236
+ }
2237
+
2238
+ export declare const pointRefs: EditorInterface['pointRefs'];
2239
+
2240
+ export declare interface PointTransformOptions {
2241
+ affinity?: TextDirection | null;
2242
+ }
2243
+
2244
+ export declare function positions(editor: Editor, options?: EditorPositionsOptions): Generator<Point, void, undefined>;
2245
+
2246
+ export declare const previous: EditorInterface['previous'];
2247
+
2248
+ export declare type PropsCompare = (prop: Partial<Node_2>, node: Partial<Node_2>) => boolean;
2249
+
2250
+ export declare type PropsMerge = (prop: Partial<Node_2>, node: Partial<Node_2>) => object;
2251
+
2252
+ export declare const range: EditorInterface['range'];
2253
+
2254
+ declare type Range_2 = ExtendedType<'Range', BaseRange>;
2255
+
2256
+ declare const Range_2: RangeInterface;
2257
+ export { Range_2 as Range }
2258
+
2259
+ export declare type RangeDirection = TextDirection | 'outward' | 'inward';
2260
+
2261
+ export declare interface RangeEdgesOptions {
2262
+ reverse?: boolean;
2263
+ }
2264
+
2265
+ export declare interface RangeInterface {
2266
+ /**
2267
+ * Get the start and end points of a range, in the order in which they appear
2268
+ * in the document.
2269
+ */
2270
+ edges: (range: Range_2, options?: RangeEdgesOptions) => [Point, Point];
2271
+ /**
2272
+ * Get the end point of a range.
2273
+ */
2274
+ end: (range: Range_2) => Point;
2275
+ /**
2276
+ * Check if a range is exactly equal to another.
2277
+ */
2278
+ equals: (range: Range_2, another: Range_2) => boolean;
2279
+ /**
2280
+ * Check if a range includes a path, a point or part of another range.
2281
+ */
2282
+ includes: (range: Range_2, target: Path | Point | Range_2) => boolean;
2283
+ /**
2284
+ * Check if a range includes another range.
2285
+ */
2286
+ surrounds: (range: Range_2, target: Range_2) => boolean;
2287
+ /**
2288
+ * Get the intersection of a range with another.
2289
+ */
2290
+ intersection: (range: Range_2, another: Range_2) => Range_2 | null;
2291
+ /**
2292
+ * Check if a range is backward, meaning that its anchor point appears in the
2293
+ * document _after_ its focus point.
2294
+ */
2295
+ isBackward: (range: Range_2) => boolean;
2296
+ /**
2297
+ * Check if a range is collapsed, meaning that both its anchor and focus
2298
+ * points refer to the exact same position in the document.
2299
+ */
2300
+ isCollapsed: (range: Range_2) => boolean;
2301
+ /**
2302
+ * Check if a range is expanded.
2303
+ *
2304
+ * This is the opposite of [[Range.isCollapsed]] and is provided for legibility.
2305
+ */
2306
+ isExpanded: (range: Range_2) => boolean;
2307
+ /**
2308
+ * Check if a range is forward.
2309
+ *
2310
+ * This is the opposite of [[Range.isBackward]] and is provided for legibility.
2311
+ */
2312
+ isForward: (range: Range_2) => boolean;
2313
+ /**
2314
+ * Check if a value implements the [[Range]] interface.
2315
+ */
2316
+ isRange: (value: any) => value is Range_2;
2317
+ /**
2318
+ * Iterate through all of the point entries in a range.
2319
+ */
2320
+ points: (range: Range_2) => Generator<PointEntry, void, undefined>;
2321
+ /**
2322
+ * Get the start point of a range.
2323
+ */
2324
+ start: (range: Range_2) => Point;
2325
+ /**
2326
+ * Transform a range by an operation.
2327
+ */
2328
+ transform: (range: Range_2, op: Operation, options?: RangeTransformOptions) => Range_2 | null;
2329
+ }
2330
+
2331
+ export declare type RangeMode = 'highest' | 'lowest';
2332
+
2333
+ /**
2334
+ * `RangeRef` objects keep a specific range in a document synced over time as new
2335
+ * operations are applied to the editor. You can access their `current` property
2336
+ * at any time for the up-to-date range value.
2337
+ */
2338
+ export declare interface RangeRef {
2339
+ current: Range_2 | null;
2340
+ affinity: 'forward' | 'backward' | 'outward' | 'inward' | null;
2341
+ unref(): Range_2 | null;
2342
+ }
2343
+
2344
+ export declare const RangeRef: RangeRefInterface;
2345
+
2346
+ export declare const rangeRef: EditorInterface['rangeRef'];
2347
+
2348
+ export declare interface RangeRefInterface {
2349
+ /**
2350
+ * Transform the range ref's current value by an operation.
2351
+ */
2352
+ transform: (ref: RangeRef, op: Operation) => void;
2353
+ }
2354
+
2355
+ export declare const rangeRefs: EditorInterface['rangeRefs'];
2356
+
2357
+ export declare interface RangeTransformOptions {
2358
+ affinity?: RangeDirection | null;
2359
+ }
2360
+
2361
+ export declare const removeMark: EditorInterface['removeMark'];
2362
+
2363
+ export declare type RemoveNodeOperation = ExtendedType<'RemoveNodeOperation', BaseRemoveNodeOperation>;
2364
+
2365
+ export declare const removeNodes: NodeTransforms['removeNodes'];
2366
+
2367
+ export declare type RemoveTextOperation = ExtendedType<'RemoveTextOperation', BaseRemoveTextOperation>;
2368
+
2369
+ /**
2370
+ * `RenderElementProps` are passed to the `renderElement` handler.
2371
+ */
2372
+ export declare interface RenderElementProps {
2373
+ children: VNode;
2374
+ element: Element_2;
2375
+ attributes: HTMLAttributes & {
2376
+ "data-slate-node": "element";
2377
+ "data-slate-inline"?: true;
2378
+ "data-slate-void"?: true;
2379
+ dir?: "rtl";
2380
+ ref: any;
2381
+ };
2382
+ }
2383
+
2384
+ /**
2385
+ * `RenderLeafProps` are passed to the `renderLeaf` handler.
2386
+ */
2387
+ export declare interface RenderLeafProps {
2388
+ children: VNode;
2389
+ leaf: Text_2;
2390
+ text: Text_2;
2391
+ attributes: HTMLAttributes & {
2392
+ "data-slate-leaf": true;
2393
+ };
2394
+ }
2395
+
2396
+ /**
2397
+ * The props that get passed to renderPlaceholder
2398
+ */
2399
+ export declare interface RenderPlaceholderProps {
2400
+ children?: string;
2401
+ attributes: {
2402
+ "data-slate-placeholder": boolean;
2403
+ dir?: "rtl";
2404
+ contentEditable: boolean;
2405
+ ref: VNodeRef;
2406
+ style: CSSProperties;
2407
+ };
2408
+ }
2409
+
2410
+ export declare type Scrubber = (key: string, value: unknown) => unknown;
2411
+
2412
+ /**
2413
+ * This interface implements a stringify() function, which is used by Slate
2414
+ * internally when generating exceptions containing end user data. Developers
2415
+ * using Slate may call Scrubber.setScrubber() to alter the behavior of this
2416
+ * stringify() function.
2417
+ *
2418
+ * For example, to prevent the cleartext logging of 'text' fields within Nodes:
2419
+ *
2420
+ * import { Scrubber } from 'slate';
2421
+ * Scrubber.setScrubber((key, val) => {
2422
+ * if (key === 'text') return '...scrubbed...'
2423
+ * return val
2424
+ * });
2425
+ *
2426
+ */
2427
+ export declare const Scrubber: ScrubberInterface;
2428
+
2429
+ export declare interface ScrubberInterface {
2430
+ setScrubber(scrubber: Scrubber | undefined): void;
2431
+ stringify(value: any): string;
2432
+ }
2433
+
2434
+ export declare const select: SelectionTransforms['select'];
2435
+
2436
+ declare type Selection_2 = ExtendedType<'Selection', BaseSelection>;
2437
+ export { Selection_2 as Selection }
2438
+
2439
+ declare interface SelectionCollapseOptions {
2440
+ edge?: SelectionEdge;
2441
+ }
2442
+
2443
+ export declare type SelectionEdge = 'anchor' | 'focus' | 'start' | 'end';
2444
+
2445
+ declare type SelectionMode_2 = 'all' | 'highest' | 'lowest';
2446
+ export { SelectionMode_2 as SelectionMode }
2447
+
2448
+ declare interface SelectionMoveOptions {
2449
+ distance?: number;
2450
+ unit?: MoveUnit;
2451
+ reverse?: boolean;
2452
+ edge?: SelectionEdge;
2453
+ }
2454
+
2455
+ export declare type SelectionOperation = SetSelectionOperation;
2456
+
2457
+ declare interface SelectionSetPointOptions {
2458
+ edge?: SelectionEdge;
2459
+ }
2460
+
2461
+ declare interface SelectionTransforms {
2462
+ /**
2463
+ * Collapse the selection.
2464
+ */
2465
+ collapse: (editor: Editor, options?: SelectionCollapseOptions) => void;
2466
+ /**
2467
+ * Unset the selection.
2468
+ */
2469
+ deselect: (editor: Editor) => void;
2470
+ /**
2471
+ * Move the selection's point forward or backward.
2472
+ */
2473
+ move: (editor: Editor, options?: SelectionMoveOptions) => void;
2474
+ /**
2475
+ * Set the selection to a new value.
2476
+ */
2477
+ select: (editor: Editor, target: Location_2) => void;
2478
+ /**
2479
+ * Set new properties on one of the selection's points.
2480
+ */
2481
+ setPoint: (editor: Editor, props: Partial<Point>, options?: SelectionSetPointOptions) => void;
2482
+ /**
2483
+ * Set new properties on the selection.
2484
+ */
2485
+ setSelection: (editor: Editor, props: Partial<Range_2>) => void;
2486
+ }
2487
+
2488
+ declare const SelectionTransforms: SelectionTransforms;
2489
+
2490
+ export declare type SetNodeOperation = ExtendedType<'SetNodeOperation', BaseSetNodeOperation>;
2491
+
2492
+ export declare const setNodes: NodeTransforms['setNodes'];
2493
+
2494
+ export declare const setNormalizing: EditorInterface['setNormalizing'];
2495
+
2496
+ export declare const setPoint: SelectionTransforms['setPoint'];
2497
+
2498
+ export declare const setSelection: SelectionTransforms['setSelection'];
2499
+
2500
+ export declare type SetSelectionOperation = ExtendedType<'SetSelectionOperation', BaseSetSelectionOperation>;
2501
+
2502
+ export declare const shouldMergeNodesRemovePrevNode: EditorInterface['shouldMergeNodesRemovePrevNode'];
2503
+
2504
+ export declare const shouldNormalize: WithEditorFirstArg<Editor['shouldNormalize']>;
2505
+
2506
+ export declare const Slate: DefineComponent< {
2507
+ editor: DOMEditor;
2508
+ decorate: (entry: NodeEntry) => DecoratedRange[];
2509
+ renderElement: (props: RenderElementProps) => VNode;
2510
+ renderLeaf: (props: RenderLeafProps) => VNode;
2511
+ renderPlaceholder: (props: RenderPlaceholderProps) => JSX.Element;
2512
+ }, () => VNode<RendererNode, RendererElement, {
2513
+ [key: string]: any;
2514
+ }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
2515
+ editor: DOMEditor;
2516
+ decorate: (entry: NodeEntry) => DecoratedRange[];
2517
+ renderElement: (props: RenderElementProps) => VNode;
2518
+ renderLeaf: (props: RenderLeafProps) => VNode;
2519
+ renderPlaceholder: (props: RenderPlaceholderProps) => JSX.Element;
2520
+ }> & Readonly<{}>, {
2521
+ decorate: Function;
2522
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
2523
+
2524
+ /**
2525
+ * The `Span` interface is a low-level way to refer to locations in nodes
2526
+ * without using `Point` which requires leaf text nodes to be present.
2527
+ */
2528
+ export declare type Span = [Path, Path];
2529
+
2530
+ export declare const Span: SpanInterface;
2531
+
2532
+ export declare interface SpanInterface {
2533
+ /**
2534
+ * Check if a value implements the `Span` interface.
2535
+ */
2536
+ isSpan: (value: any) => value is Span;
2537
+ }
2538
+
2539
+ export declare type SplitNodeOperation = ExtendedType<'SplitNodeOperation', BaseSplitNodeOperation>;
2540
+
2541
+ export declare const splitNodes: NodeTransforms['splitNodes'];
2542
+
2543
+ export declare const start: EditorInterface['start'];
2544
+
2545
+ export declare const string: EditorInterface['string'];
2546
+
2547
+ export declare type StringDiff = {
2548
+ start: number;
2549
+ end: number;
2550
+ text: string;
2551
+ };
2552
+
2553
+ /**
2554
+ * Get the slate range the text diff spans.
2555
+ */
2556
+ export declare function targetRange(textDiff: TextDiff): Range_2;
2557
+
2558
+ declare type Text_2 = ExtendedType<'Text', BaseText>;
2559
+
2560
+ declare const Text_2: TextInterface;
2561
+ export { Text_2 as Text }
2562
+
2563
+ declare interface TextDeleteOptions {
2564
+ at?: Location_2;
2565
+ distance?: number;
2566
+ unit?: TextUnit;
2567
+ reverse?: boolean;
2568
+ hanging?: boolean;
2569
+ voids?: boolean;
2570
+ }
2571
+
2572
+ export declare type TextDiff = {
2573
+ id: number;
2574
+ path: Path;
2575
+ diff: StringDiff;
2576
+ };
2577
+
2578
+ export declare type TextDirection = 'forward' | 'backward';
2579
+
2580
+ export declare interface TextEqualsOptions {
2581
+ loose?: boolean;
2582
+ }
2583
+
2584
+ declare interface TextInsertFragmentOptions {
2585
+ at?: Location_2;
2586
+ hanging?: boolean;
2587
+ voids?: boolean;
2588
+ batchDirty?: boolean;
2589
+ }
2590
+
2591
+ declare interface TextInsertTextOptions {
2592
+ at?: Location_2;
2593
+ voids?: boolean;
2594
+ }
2595
+
2596
+ export declare interface TextInterface {
2597
+ /**
2598
+ * Check if two text nodes are equal.
2599
+ *
2600
+ * When loose is set, the text is not compared. This is
2601
+ * used to check whether sibling text nodes can be merged.
2602
+ */
2603
+ equals: (text: Text_2, another: Text_2, options?: TextEqualsOptions) => boolean;
2604
+ /**
2605
+ * Check if a value implements the `Text` interface.
2606
+ */
2607
+ isText: (value: any) => value is Text_2;
2608
+ /**
2609
+ * Check if a value is a list of `Text` objects.
2610
+ */
2611
+ isTextList: (value: any) => value is Text_2[];
2612
+ /**
2613
+ * Check if some props are a partial of Text.
2614
+ */
2615
+ isTextProps: (props: any) => props is Partial<Text_2>;
2616
+ /**
2617
+ * Check if an text matches set of properties.
2618
+ *
2619
+ * Note: this is for matching custom properties, and it does not ensure that
2620
+ * the `text` property are two nodes equal.
2621
+ */
2622
+ matches: (text: Text_2, props: Partial<Text_2>) => boolean;
2623
+ /**
2624
+ * Get the leaves for a text node given decorations.
2625
+ */
2626
+ decorations: (node: Text_2, decorations: DecoratedRange[]) => Text_2[];
2627
+ }
2628
+
2629
+ export declare type TextOperation = InsertTextOperation | RemoveTextOperation;
2630
+
2631
+ declare interface TextTransforms {
2632
+ /**
2633
+ * Delete content in the editor.
2634
+ */
2635
+ delete: (editor: Editor, options?: TextDeleteOptions) => void;
2636
+ /**
2637
+ * Insert a fragment in the editor
2638
+ * at the specified location or (if not defined) the current selection or (if not defined) the end of the document.
2639
+ */
2640
+ insertFragment: (editor: Editor, fragment: Node_2[], options?: TextInsertFragmentOptions) => void;
2641
+ /**
2642
+ * Insert a string of text in the editor
2643
+ * at the specified location or (if not defined) the current selection or (if not defined) the end of the document.
2644
+ */
2645
+ insertText: (editor: Editor, text: string, options?: TextInsertTextOptions) => void;
2646
+ }
2647
+
2648
+ declare const TextTransforms: TextTransforms;
2649
+
2650
+ export declare type TextUnit = 'character' | 'word' | 'line' | 'block';
2651
+
2652
+ export declare type TextUnitAdjustment = TextUnit | 'offset';
2653
+
2654
+ declare class toRawWeakMap<K extends WeakKey, V> {
2655
+ private weak;
2656
+ constructor();
2657
+ /**
2658
+ * Removes the specified element from the toRawWeakMap.
2659
+ * @returns true if the element was successfully removed, or false if it was not present.
2660
+ */
2661
+ delete(key: K): boolean;
2662
+ /**
2663
+ * @returns a specified element.
2664
+ */
2665
+ get(key: K): V | undefined;
2666
+ /**
2667
+ * @returns a boolean indicating whether an element with the specified key exists or not.
2668
+ */
2669
+ has(key: K): boolean;
2670
+ /**
2671
+ * Adds a new element with a specified key and value.
2672
+ * @param key Must be an object or symbol.
2673
+ */
2674
+ set(key: K, value: V): WeakMap<K, V>;
2675
+ }
2676
+
2677
+ export declare const Transforms: GeneralTransforms & NodeTransforms & SelectionTransforms & TextTransforms;
2678
+
2679
+ export declare const TRIPLE_CLICK = 3;
2680
+
2681
+ export declare const unhangRange: EditorInterface['unhangRange'];
2682
+
2683
+ export declare const unsetNodes: NodeTransforms['unsetNodes'];
2684
+
2685
+ export declare const unwrapNodes: NodeTransforms['unwrapNodes'];
2686
+
2687
+ /**
2688
+ * Get the current `composing` state of the editor.
2689
+ */
2690
+ export declare const useComposing: () => Ref<boolean, boolean>;
2691
+
2692
+ /**
2693
+ * Get the current editor object from the React context.
2694
+ */
2695
+ export declare const useEditor: () => DOMEditor;
2696
+
2697
+ /**
2698
+ * Get the current `focused` state of the editor.
2699
+ */
2700
+ export declare const useFocused: () => Ref<boolean, boolean>;
2701
+
2702
+ /**
2703
+ * Get the current `readOnly` state of the editor.
2704
+ */
2705
+ export declare const useReadOnly: () => Ref<boolean, boolean>;
2706
+
2707
+ /**
2708
+ * Get the current `selected` state of an element.
2709
+ */
2710
+ export declare const useSelected: () => ComputedRef<boolean>;
2711
+
2712
+ /**
2713
+ * Get the current slate selection.
2714
+ * Only triggers a rerender when the selection actually changes
2715
+ */
2716
+ export declare const useSelection: () => ComputedRef<BaseSelection>;
2717
+
2718
+ /**
2719
+ * Check whether a text diff was applied in a way we can perform the pending action on /
2720
+ * recover the pending selection.
2721
+ */
2722
+ export declare function verifyDiffState(editor: Editor, textDiff: TextDiff): boolean;
2723
+
2724
+ /**
2725
+ * `withDOM` adds DOM specific behaviors to the editor.
2726
+ *
2727
+ * If you are using TypeScript, you must extend Slate's CustomTypes to use
2728
+ * this plugin.
2729
+ *
2730
+ * See https://docs.slatejs.org/concepts/11-typescript to learn how.
2731
+ */
2732
+ export declare const withDOM: <T extends BaseEditor>(editor: T, clipboardFormatKey?: string) => T & DOMEditor;
2733
+
2734
+ declare type WithEditorFirstArg<T extends (...args: any) => any> = (editor: Editor, ...args: Parameters<T>) => ReturnType<T>;
2735
+
2736
+ export declare const withoutNormalizing: EditorInterface['withoutNormalizing'];
2737
+
2738
+ export declare const wrapNodes: NodeTransforms['wrapNodes'];
2739
+
2740
+ export { }
2741
+
2742
+
2743
+ declare global {
2744
+ interface Window {
2745
+ Selection: (typeof Selection)['constructor'];
2746
+ DataTransfer: (typeof DataTransfer)['constructor'];
2747
+ Node: (typeof Node)['constructor'];
2748
+ }
2749
+ }
2750
+
2751
+
2752
+ declare module 'slate' {
2753
+ interface CustomTypes {
2754
+ Editor: DOMEditor;
2755
+ Text: BaseText & {
2756
+ placeholder?: string;
2757
+ onPlaceholderResize?: (node: HTMLElement | null) => void;
2758
+ [key: string]: unknown;
2759
+ };
2760
+ Range: BaseRange & {
2761
+ placeholder?: string;
2762
+ onPlaceholderResize?: (node: HTMLElement | null) => void;
2763
+ [key: string]: unknown;
2764
+ };
2765
+ }
2766
+ }
2767
+
2768
+
2769
+ declare global {
2770
+ interface Window {
2771
+ MSStream: boolean;
2772
+ }
2773
+ interface DocumentOrShadowRoot {
2774
+ getSelection(): Selection | null;
2775
+ }
2776
+ interface CaretPosition {
2777
+ readonly offsetNode: Node;
2778
+ readonly offset: number;
2779
+ getClientRect(): DOMRect | null;
2780
+ }
2781
+ interface Document {
2782
+ caretPositionFromPoint(x: number, y: number): CaretPosition | null;
2783
+ }
2784
+ interface Node {
2785
+ getRootNode(options?: GetRootNodeOptions): Document | ShadowRoot;
2786
+ }
2787
+ }
2788
+
2789
+
2790
+ declare module 'slate' {
2791
+ interface CustomTypes {
2792
+ Editor: DOMEditor;
2793
+ Text: BaseText & {
2794
+ placeholder?: string;
2795
+ onPlaceholderResize?: (node: HTMLElement | null) => void;
2796
+ [key: string]: unknown;
2797
+ };
2798
+ Range: BaseRange & {
2799
+ placeholder?: string;
2800
+ onPlaceholderResize?: (node: HTMLElement | null) => void;
2801
+ [key: string]: unknown;
2802
+ };
2803
+ }
2804
+ }
2805
+
2806
+
2807
+ declare global {
2808
+ interface Window {
2809
+ MSStream: boolean;
2810
+ }
2811
+ interface DocumentOrShadowRoot {
2812
+ getSelection(): Selection | null;
2813
+ }
2814
+ interface CaretPosition {
2815
+ readonly offsetNode: Node;
2816
+ readonly offset: number;
2817
+ getClientRect(): DOMRect | null;
2818
+ }
2819
+ interface Document {
2820
+ caretPositionFromPoint(x: number, y: number): CaretPosition | null;
2821
+ }
2822
+ interface Node {
2823
+ getRootNode(options?: GetRootNodeOptions): Document | ShadowRoot;
2824
+ }
2825
+ }