slate-vue3 0.0.32 → 0.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.d.ts ADDED
@@ -0,0 +1,1821 @@
1
+ export declare const above: EditorInterface['above'];
2
+
3
+ export declare const addMark: EditorInterface['addMark'];
4
+
5
+ export declare const after: EditorInterface['after'];
6
+
7
+ /**
8
+ * The `Ancestor` union type represents nodes that are ancestors in the tree.
9
+ * It is returned as a convenience in certain cases to narrow a value further
10
+ * than the more generic `Node` union.
11
+ */
12
+ export declare type Ancestor = Editor | Element_2;
13
+
14
+ export declare const apply: WithEditorFirstArg<Editor['apply']>;
15
+
16
+ /**
17
+ * The `Editor` interface stores all the state of a Slate editor. It is extended
18
+ * by plugins that wish to add their own helpers and implement new behaviors.
19
+ */
20
+ export declare interface BaseEditor {
21
+ children: Descendant[];
22
+ selection: Selection_2;
23
+ operations: Operation[];
24
+ marks: EditorMarks | null;
25
+ apply: (operation: Operation) => void;
26
+ getDirtyPaths: (operation: Operation) => Path[];
27
+ getFragment: () => Descendant[];
28
+ isElementReadOnly: (element: Element_2) => boolean;
29
+ isSelectable: (element: Element_2) => boolean;
30
+ markableVoid: (element: Element_2) => boolean;
31
+ normalizeNode: (entry: NodeEntry, options?: {
32
+ operation?: Operation;
33
+ }) => void;
34
+ onChange: (options?: {
35
+ operation?: Operation;
36
+ }) => void;
37
+ shouldNormalize: ({ iteration, dirtyPaths, operation, }: {
38
+ iteration: number;
39
+ initialDirtyPathsLength: number;
40
+ dirtyPaths: Path[];
41
+ operation?: Operation;
42
+ }) => boolean;
43
+ addMark: OmitFirstArg<typeof Editor.addMark>;
44
+ collapse: OmitFirstArg<typeof Transforms.collapse>;
45
+ delete: OmitFirstArg<typeof Transforms.delete>;
46
+ deleteBackward: (unit: TextUnit) => void;
47
+ deleteForward: (unit: TextUnit) => void;
48
+ deleteFragment: OmitFirstArg<typeof Editor.deleteFragment>;
49
+ deselect: OmitFirstArg<typeof Transforms.deselect>;
50
+ insertBreak: OmitFirstArg<typeof Editor.insertBreak>;
51
+ insertFragment: OmitFirstArg<typeof Transforms.insertFragment>;
52
+ insertNode: OmitFirstArg<typeof Editor.insertNode>;
53
+ insertNodes: OmitFirstArg<typeof Transforms.insertNodes>;
54
+ insertSoftBreak: OmitFirstArg<typeof Editor.insertSoftBreak>;
55
+ insertText: OmitFirstArg<typeof Transforms.insertText>;
56
+ liftNodes: OmitFirstArg<typeof Transforms.liftNodes>;
57
+ mergeNodes: OmitFirstArg<typeof Transforms.mergeNodes>;
58
+ move: OmitFirstArg<typeof Transforms.move>;
59
+ moveNodes: OmitFirstArg<typeof Transforms.moveNodes>;
60
+ normalize: OmitFirstArg<typeof Editor.normalize>;
61
+ removeMark: OmitFirstArg<typeof Editor.removeMark>;
62
+ removeNodes: OmitFirstArg<typeof Transforms.removeNodes>;
63
+ select: OmitFirstArg<typeof Transforms.select>;
64
+ setNodes: <T extends Node_2>(props: Partial<T>, options?: {
65
+ at?: Location_2;
66
+ match?: NodeMatch<T>;
67
+ mode?: MaximizeMode;
68
+ hanging?: boolean;
69
+ split?: boolean;
70
+ voids?: boolean;
71
+ compare?: PropsCompare;
72
+ merge?: PropsMerge;
73
+ }) => void;
74
+ setNormalizing: OmitFirstArg<typeof Editor.setNormalizing>;
75
+ setPoint: OmitFirstArg<typeof Transforms.setPoint>;
76
+ setSelection: OmitFirstArg<typeof Transforms.setSelection>;
77
+ splitNodes: OmitFirstArg<typeof Transforms.splitNodes>;
78
+ unsetNodes: OmitFirstArg<typeof Transforms.unsetNodes>;
79
+ unwrapNodes: OmitFirstArg<typeof Transforms.unwrapNodes>;
80
+ withoutNormalizing: OmitFirstArg<typeof Editor.withoutNormalizing>;
81
+ wrapNodes: OmitFirstArg<typeof Transforms.wrapNodes>;
82
+ above: <T extends Ancestor>(options?: EditorAboveOptions<T>) => NodeEntry<T> | undefined;
83
+ after: OmitFirstArg<typeof Editor.after>;
84
+ before: OmitFirstArg<typeof Editor.before>;
85
+ edges: OmitFirstArg<typeof Editor.edges>;
86
+ elementReadOnly: OmitFirstArg<typeof Editor.elementReadOnly>;
87
+ end: OmitFirstArg<typeof Editor.end>;
88
+ first: OmitFirstArg<typeof Editor.first>;
89
+ fragment: OmitFirstArg<typeof Editor.fragment>;
90
+ getMarks: OmitFirstArg<typeof Editor.marks>;
91
+ hasBlocks: OmitFirstArg<typeof Editor.hasBlocks>;
92
+ hasInlines: OmitFirstArg<typeof Editor.hasInlines>;
93
+ hasPath: OmitFirstArg<typeof Editor.hasPath>;
94
+ hasTexts: OmitFirstArg<typeof Editor.hasTexts>;
95
+ isBlock: OmitFirstArg<typeof Editor.isBlock>;
96
+ isEdge: OmitFirstArg<typeof Editor.isEdge>;
97
+ isEmpty: OmitFirstArg<typeof Editor.isEmpty>;
98
+ isEnd: OmitFirstArg<typeof Editor.isEnd>;
99
+ isInline: OmitFirstArg<typeof Editor.isInline>;
100
+ isNormalizing: OmitFirstArg<typeof Editor.isNormalizing>;
101
+ isStart: OmitFirstArg<typeof Editor.isStart>;
102
+ isVoid: OmitFirstArg<typeof Editor.isVoid>;
103
+ last: OmitFirstArg<typeof Editor.last>;
104
+ leaf: OmitFirstArg<typeof Editor.leaf>;
105
+ levels: <T extends Node_2>(options?: EditorLevelsOptions<T>) => Generator<NodeEntry<T>, void, undefined>;
106
+ next: <T extends Descendant>(options?: EditorNextOptions<T>) => NodeEntry<T> | undefined;
107
+ node: OmitFirstArg<typeof Editor.node>;
108
+ nodes: <T extends Node_2>(options?: EditorNodesOptions<T>) => Generator<NodeEntry<T>, void, undefined>;
109
+ parent: OmitFirstArg<typeof Editor.parent>;
110
+ path: OmitFirstArg<typeof Editor.path>;
111
+ pathRef: OmitFirstArg<typeof Editor.pathRef>;
112
+ pathRefs: OmitFirstArg<typeof Editor.pathRefs>;
113
+ point: OmitFirstArg<typeof Editor.point>;
114
+ pointRef: OmitFirstArg<typeof Editor.pointRef>;
115
+ pointRefs: OmitFirstArg<typeof Editor.pointRefs>;
116
+ positions: OmitFirstArg<typeof Editor.positions>;
117
+ previous: <T extends Node_2>(options?: EditorPreviousOptions<T>) => NodeEntry<T> | undefined;
118
+ range: OmitFirstArg<typeof Editor.range>;
119
+ rangeRef: OmitFirstArg<typeof Editor.rangeRef>;
120
+ rangeRefs: OmitFirstArg<typeof Editor.rangeRefs>;
121
+ start: OmitFirstArg<typeof Editor.start>;
122
+ string: OmitFirstArg<typeof Editor.string>;
123
+ unhangRange: OmitFirstArg<typeof Editor.unhangRange>;
124
+ void: OmitFirstArg<typeof Editor.void>;
125
+ shouldMergeNodesRemovePrevNode: OmitFirstArg<typeof Editor.shouldMergeNodesRemovePrevNode>;
126
+ }
127
+
128
+ /**
129
+ * `Element` objects are a type of node in a Slate document that contain other
130
+ * element nodes or text nodes. They can be either "blocks" or "inlines"
131
+ * depending on the Slate editor's configuration.
132
+ */
133
+ export declare interface BaseElement {
134
+ children: Descendant[];
135
+ }
136
+
137
+ export declare type BaseInsertNodeOperation = {
138
+ type: 'insert_node';
139
+ path: Path;
140
+ node: Node_2;
141
+ };
142
+
143
+ export declare type BaseInsertTextOperation = {
144
+ type: 'insert_text';
145
+ path: Path;
146
+ offset: number;
147
+ text: string;
148
+ };
149
+
150
+ export declare type BaseMergeNodeOperation = {
151
+ type: 'merge_node';
152
+ path: Path;
153
+ position: number;
154
+ properties: Partial<Node_2>;
155
+ };
156
+
157
+ export declare type BaseMoveNodeOperation = {
158
+ type: 'move_node';
159
+ path: Path;
160
+ newPath: Path;
161
+ };
162
+
163
+ /**
164
+ * The `Node` union type represents all of the different types of nodes that
165
+ * occur in a Slate document tree.
166
+ */
167
+ export declare type BaseNode = Editor | Element_2 | Text_2;
168
+
169
+ /**
170
+ * `Operation` objects define the low-level instructions that Slate editors use
171
+ * to apply changes to their internal state. Representing all changes as
172
+ * operations is what allows Slate editors to easily implement history,
173
+ * collaboration, and other features.
174
+ */
175
+ export declare type BaseOperation = NodeOperation | SelectionOperation | TextOperation;
176
+
177
+ /**
178
+ * `Point` objects refer to a specific location in a text node in a Slate
179
+ * document. Its path refers to the location of the node in the tree, and its
180
+ * offset refers to the distance into the node's string of text. Points can
181
+ * only refer to `Text` nodes.
182
+ */
183
+ export declare interface BasePoint {
184
+ path: Path;
185
+ offset: number;
186
+ }
187
+
188
+ /**
189
+ * `Range` objects are a set of points that refer to a specific span of a Slate
190
+ * document. They can define a span inside a single node or a can span across
191
+ * multiple nodes.
192
+ */
193
+ export declare interface BaseRange {
194
+ anchor: Point;
195
+ focus: Point;
196
+ }
197
+
198
+ export declare type BaseRemoveNodeOperation = {
199
+ type: 'remove_node';
200
+ path: Path;
201
+ node: Node_2;
202
+ };
203
+
204
+ export declare type BaseRemoveTextOperation = {
205
+ type: 'remove_text';
206
+ path: Path;
207
+ offset: number;
208
+ text: string;
209
+ };
210
+
211
+ export declare type BaseSelection = Range_2 | null;
212
+
213
+ export declare type BaseSetNodeOperation = {
214
+ type: 'set_node';
215
+ path: Path;
216
+ properties: Partial<Node_2>;
217
+ newProperties: Partial<Node_2>;
218
+ };
219
+
220
+ export declare type BaseSetSelectionOperation = {
221
+ type: 'set_selection';
222
+ properties: null;
223
+ newProperties: Range_2;
224
+ } | {
225
+ type: 'set_selection';
226
+ properties: Partial<Range_2>;
227
+ newProperties: Partial<Range_2>;
228
+ } | {
229
+ type: 'set_selection';
230
+ properties: Range_2;
231
+ newProperties: null;
232
+ };
233
+
234
+ export declare type BaseSplitNodeOperation = {
235
+ type: 'split_node';
236
+ path: Path;
237
+ position: number;
238
+ properties: Partial<Node_2>;
239
+ };
240
+
241
+ /**
242
+ * `Text` objects represent the nodes that contain the actual text content of a
243
+ * Slate document along with any formatting properties. They are always leaf
244
+ * nodes in the document tree as they cannot contain any children.
245
+ */
246
+ export declare interface BaseText {
247
+ text: string;
248
+ }
249
+
250
+ export declare const before: EditorInterface['before'];
251
+
252
+ export declare const collapse: SelectionTransforms['collapse'];
253
+
254
+ /**
255
+ * Create a new Slate `Editor` object.
256
+ */
257
+ export declare const createEditor: (children: Descendant[]) => Editor;
258
+
259
+ export declare interface CustomTypes {
260
+ [key: string]: unknown;
261
+ }
262
+
263
+ export declare type DecoratedRange = Range_2 & {
264
+ /**
265
+ * Customize how another decoration is merged into a text node. If not specified, `Object.assign` would be used.
266
+ * It is useful for overlapping decorations with the same key but different values.
267
+ */
268
+ merge?: (leaf: Text_2, decoration: object) => void;
269
+ };
270
+
271
+ export declare const deleteBackward: WithEditorFirstArg<Editor['deleteBackward']>;
272
+
273
+ export declare const deleteForward: WithEditorFirstArg<Editor['deleteForward']>;
274
+
275
+ export declare const deleteFragment: EditorInterface['deleteFragment'];
276
+
277
+ export declare const deleteText: TextTransforms['delete'];
278
+
279
+ /**
280
+ * The `Descendant` union type represents nodes that are descendants in the
281
+ * tree. It is returned as a convenience in certain cases to narrow a value
282
+ * further than the more generic `Node` union.
283
+ */
284
+ export declare type Descendant = Element_2 | Text_2;
285
+
286
+ export declare const deselect: SelectionTransforms['deselect'];
287
+
288
+ export declare const edges: EditorInterface['edges'];
289
+
290
+ export declare type Editor = ExtendedType<'Editor', BaseEditor>;
291
+
292
+ export declare const Editor: EditorInterface;
293
+
294
+ export declare interface EditorAboveOptions<T extends Ancestor> {
295
+ at?: Location_2;
296
+ match?: NodeMatch<T>;
297
+ mode?: MaximizeMode;
298
+ voids?: boolean;
299
+ }
300
+
301
+ export declare interface EditorAfterOptions {
302
+ distance?: number;
303
+ unit?: TextUnitAdjustment;
304
+ voids?: boolean;
305
+ }
306
+
307
+ export declare interface EditorBeforeOptions {
308
+ distance?: number;
309
+ unit?: TextUnitAdjustment;
310
+ voids?: boolean;
311
+ }
312
+
313
+ export declare interface EditorDirectedDeletionOptions {
314
+ unit?: TextUnit;
315
+ }
316
+
317
+ export declare interface EditorElementReadOnlyOptions {
318
+ at?: Location_2;
319
+ mode?: MaximizeMode;
320
+ voids?: boolean;
321
+ }
322
+
323
+ export declare interface EditorFragmentDeletionOptions {
324
+ direction?: TextDirection;
325
+ }
326
+
327
+ export declare interface EditorInterface {
328
+ /**
329
+ * Get the ancestor above a location in the document.
330
+ */
331
+ above: <T extends Ancestor>(editor: Editor, options?: EditorAboveOptions<T>) => NodeEntry<T> | undefined;
332
+ /**
333
+ * Add a custom property to the leaf text nodes in the current selection.
334
+ *
335
+ * If the selection is currently collapsed, the marks will be added to the
336
+ * `editor.marks` property instead, and applied when text is inserted next.
337
+ */
338
+ addMark: (editor: Editor, key: string, value: any) => void;
339
+ /**
340
+ * Get the point after a location.
341
+ */
342
+ after: (editor: Editor, at: Location_2, options?: EditorAfterOptions) => Point | undefined;
343
+ /**
344
+ * Get the point before a location.
345
+ */
346
+ before: (editor: Editor, at: Location_2, options?: EditorBeforeOptions) => Point | undefined;
347
+ /**
348
+ * Delete content in the editor backward from the current selection.
349
+ */
350
+ deleteBackward: (editor: Editor, options?: EditorDirectedDeletionOptions) => void;
351
+ /**
352
+ * Delete content in the editor forward from the current selection.
353
+ */
354
+ deleteForward: (editor: Editor, options?: EditorDirectedDeletionOptions) => void;
355
+ /**
356
+ * Delete the content in the current selection.
357
+ */
358
+ deleteFragment: (editor: Editor, options?: EditorFragmentDeletionOptions) => void;
359
+ /**
360
+ * Get the start and end points of a location.
361
+ */
362
+ edges: (editor: Editor, at: Location_2) => [Point, Point];
363
+ /**
364
+ * Match a read-only element in the current branch of the editor.
365
+ */
366
+ elementReadOnly: (editor: Editor, options?: EditorElementReadOnlyOptions) => NodeEntry<Element_2> | undefined;
367
+ /**
368
+ * Get the end point of a location.
369
+ */
370
+ end: (editor: Editor, at: Location_2) => Point;
371
+ /**
372
+ * Get the first node at a location.
373
+ */
374
+ first: (editor: Editor, at: Location_2) => NodeEntry;
375
+ /**
376
+ * Get the fragment at a location.
377
+ */
378
+ fragment: (editor: Editor, at: Location_2) => Descendant[];
379
+ /**
380
+ * Check if a node has block children.
381
+ */
382
+ hasBlocks: (editor: Editor, element: Element_2) => boolean;
383
+ /**
384
+ * Check if a node has inline and text children.
385
+ */
386
+ hasInlines: (editor: Editor, element: Element_2) => boolean;
387
+ hasPath: (editor: Editor, path: Path) => boolean;
388
+ /**
389
+ * Check if a node has text children.
390
+ */
391
+ hasTexts: (editor: Editor, element: Element_2) => boolean;
392
+ /**
393
+ * Insert a block break at the current selection.
394
+ *
395
+ * If the selection is currently expanded, it will be deleted first.
396
+ */
397
+ insertBreak: (editor: Editor) => void;
398
+ /**
399
+ * Inserts a fragment
400
+ * at the specified location or (if not defined) the current selection or (if not defined) the end of the document.
401
+ */
402
+ insertFragment: (editor: Editor, fragment: Node_2[], options?: TextInsertFragmentOptions) => void;
403
+ /**
404
+ * Atomically inserts `nodes`
405
+ * at the specified location or (if not defined) the current selection or (if not defined) the end of the document.
406
+ */
407
+ insertNode: <T extends Node_2>(editor: Editor, node: Node_2, options?: NodeInsertNodesOptions<T>) => void;
408
+ /**
409
+ * Insert a soft break at the current selection.
410
+ *
411
+ * If the selection is currently expanded, it will be deleted first.
412
+ */
413
+ insertSoftBreak: (editor: Editor) => void;
414
+ /**
415
+ * Insert a string of text
416
+ * at the specified location or (if not defined) the current selection or (if not defined) the end of the document.
417
+ */
418
+ insertText: (editor: Editor, text: string, options?: TextInsertTextOptions) => void;
419
+ /**
420
+ * Check if a value is a block `Element` object.
421
+ */
422
+ isBlock: (editor: Editor, value: Element_2) => boolean;
423
+ /**
424
+ * Check if a point is an edge of a location.
425
+ */
426
+ isEdge: (editor: Editor, point: Point, at: Location_2) => boolean;
427
+ /**
428
+ * Check if a value is an `Editor` object.
429
+ */
430
+ isEditor: (value: any) => value is Editor;
431
+ /**
432
+ * Check if a value is a read-only `Element` object.
433
+ */
434
+ isElementReadOnly: (editor: Editor, element: Element_2) => boolean;
435
+ /**
436
+ * Check if an element is empty, accounting for void nodes.
437
+ */
438
+ isEmpty: (editor: Editor, element: Element_2) => boolean;
439
+ /**
440
+ * Check if a point is the end point of a location.
441
+ */
442
+ isEnd: (editor: Editor, point: Point, at: Location_2) => boolean;
443
+ /**
444
+ * Check if a value is an inline `Element` object.
445
+ */
446
+ isInline: (editor: Editor, value: Element_2) => boolean;
447
+ /**
448
+ * Check if the editor is currently normalizing after each operation.
449
+ */
450
+ isNormalizing: (editor: Editor) => boolean;
451
+ /**
452
+ * Check if a value is a selectable `Element` object.
453
+ */
454
+ isSelectable: (editor: Editor, element: Element_2) => boolean;
455
+ /**
456
+ * Check if a point is the start point of a location.
457
+ */
458
+ isStart: (editor: Editor, point: Point, at: Location_2) => boolean;
459
+ /**
460
+ * Check if a value is a void `Element` object.
461
+ */
462
+ isVoid: (editor: Editor, value: Element_2) => boolean;
463
+ /**
464
+ * Get the last node at a location.
465
+ */
466
+ last: (editor: Editor, at: Location_2) => NodeEntry;
467
+ /**
468
+ * Get the leaf text node at a location.
469
+ */
470
+ leaf: (editor: Editor, at: Location_2, options?: EditorLeafOptions) => NodeEntry<Text_2>;
471
+ /**
472
+ * Iterate through all of the levels at a location.
473
+ */
474
+ levels: <T extends Node_2>(editor: Editor, options?: EditorLevelsOptions<T>) => Generator<NodeEntry<T>, void, undefined>;
475
+ /**
476
+ * Get the marks that would be added to text at the current selection.
477
+ */
478
+ marks: (editor: Editor) => Omit<Text_2, 'text'> | null;
479
+ /**
480
+ * Get the matching node in the branch of the document after a location.
481
+ */
482
+ next: <T extends Descendant>(editor: Editor, options?: EditorNextOptions<T>) => NodeEntry<T> | undefined;
483
+ /**
484
+ * Get the node at a location.
485
+ */
486
+ node: (editor: Editor, at: Location_2, options?: EditorNodeOptions) => NodeEntry;
487
+ /**
488
+ * Iterate through all of the nodes in the Editor.
489
+ */
490
+ nodes: <T extends Node_2>(editor: Editor, options?: EditorNodesOptions<T>) => Generator<NodeEntry<T>, void, undefined>;
491
+ /**
492
+ * Normalize any dirty objects in the editor.
493
+ */
494
+ normalize: (editor: Editor, options?: EditorNormalizeOptions) => void;
495
+ /**
496
+ * Get the parent node of a location.
497
+ */
498
+ parent: (editor: Editor, at: Location_2, options?: EditorParentOptions) => NodeEntry<Ancestor>;
499
+ /**
500
+ * Get the path of a location.
501
+ */
502
+ path: (editor: Editor, at: Location_2, options?: EditorPathOptions) => Path;
503
+ /**
504
+ * Create a mutable ref for a `Path` object, which will stay in sync as new
505
+ * operations are applied to the editor.
506
+ */
507
+ pathRef: (editor: Editor, path: Path, options?: EditorPathRefOptions) => PathRef;
508
+ /**
509
+ * Get the set of currently tracked path refs of the editor.
510
+ */
511
+ pathRefs: (editor: Editor) => Set<PathRef>;
512
+ /**
513
+ * Get the start or end point of a location.
514
+ */
515
+ point: (editor: Editor, at: Location_2, options?: EditorPointOptions) => Point;
516
+ /**
517
+ * Create a mutable ref for a `Point` object, which will stay in sync as new
518
+ * operations are applied to the editor.
519
+ */
520
+ pointRef: (editor: Editor, point: Point, options?: EditorPointRefOptions) => PointRef;
521
+ /**
522
+ * Get the set of currently tracked point refs of the editor.
523
+ */
524
+ pointRefs: (editor: Editor) => Set<PointRef>;
525
+ /**
526
+ * Return all the positions in `at` range where a `Point` can be placed.
527
+ *
528
+ * By default, moves forward by individual offsets at a time, but
529
+ * the `unit` option can be used to to move by character, word, line, or block.
530
+ *
531
+ * The `reverse` option can be used to change iteration direction.
532
+ *
533
+ * Note: By default void nodes are treated as a single point and iteration
534
+ * will not happen inside their content unless you pass in true for the
535
+ * `voids` option, then iteration will occur.
536
+ */
537
+ positions: (editor: Editor, options?: EditorPositionsOptions) => Generator<Point, void, undefined>;
538
+ /**
539
+ * Get the matching node in the branch of the document before a location.
540
+ */
541
+ previous: <T extends Node_2>(editor: Editor, options?: EditorPreviousOptions<T>) => NodeEntry<T> | undefined;
542
+ /**
543
+ * Get a range of a location.
544
+ */
545
+ range: (editor: Editor, at: Location_2, to?: Location_2) => Range_2;
546
+ /**
547
+ * Create a mutable ref for a `Range` object, which will stay in sync as new
548
+ * operations are applied to the editor.
549
+ */
550
+ rangeRef: (editor: Editor, range: Range_2, options?: EditorRangeRefOptions) => RangeRef;
551
+ /**
552
+ * Get the set of currently tracked range refs of the editor.
553
+ */
554
+ rangeRefs: (editor: Editor) => Set<RangeRef>;
555
+ /**
556
+ * Remove a custom property from all of the leaf text nodes in the current
557
+ * selection.
558
+ *
559
+ * If the selection is currently collapsed, the removal will be stored on
560
+ * `editor.marks` and applied to the text inserted next.
561
+ */
562
+ removeMark: (editor: Editor, key: string) => void;
563
+ /**
564
+ * Manually set if the editor should currently be normalizing.
565
+ *
566
+ * Note: Using this incorrectly can leave the editor in an invalid state.
567
+ *
568
+ */
569
+ setNormalizing: (editor: Editor, isNormalizing: boolean) => void;
570
+ /**
571
+ * Get the start point of a location.
572
+ */
573
+ start: (editor: Editor, at: Location_2) => Point;
574
+ /**
575
+ * Get the text string content of a location.
576
+ *
577
+ * Note: by default the text of void nodes is considered to be an empty
578
+ * string, regardless of content, unless you pass in true for the voids option
579
+ */
580
+ string: (editor: Editor, at: Location_2, options?: EditorStringOptions) => string;
581
+ /**
582
+ * Convert a range into a non-hanging one.
583
+ */
584
+ unhangRange: (editor: Editor, range: Range_2, options?: EditorUnhangRangeOptions) => Range_2;
585
+ /**
586
+ * Match a void node in the current branch of the editor.
587
+ */
588
+ void: (editor: Editor, options?: EditorVoidOptions) => NodeEntry<Element_2> | undefined;
589
+ /**
590
+ * Call a function, deferring normalization until after it completes.
591
+ */
592
+ withoutNormalizing: (editor: Editor, fn: () => void) => void;
593
+ /**
594
+ * Call a function, Determine whether or not remove the previous node when merge.
595
+ */
596
+ shouldMergeNodesRemovePrevNode: (editor: Editor, prevNodeEntry: NodeEntry, curNodeEntry: NodeEntry) => boolean;
597
+ }
598
+
599
+ export declare interface EditorLeafOptions {
600
+ depth?: number;
601
+ edge?: LeafEdge;
602
+ }
603
+
604
+ export declare interface EditorLevelsOptions<T extends Node_2> {
605
+ at?: Location_2;
606
+ match?: NodeMatch<T>;
607
+ reverse?: boolean;
608
+ voids?: boolean;
609
+ }
610
+
611
+ export declare type EditorMarks = Omit<Text_2, 'text'>;
612
+
613
+ export declare interface EditorNextOptions<T extends Descendant> {
614
+ at?: Location_2;
615
+ match?: NodeMatch<T>;
616
+ mode?: SelectionMode_2;
617
+ voids?: boolean;
618
+ }
619
+
620
+ export declare interface EditorNodeOptions {
621
+ depth?: number;
622
+ edge?: LeafEdge;
623
+ }
624
+
625
+ export declare interface EditorNodesOptions<T extends Node_2> {
626
+ at?: Location_2 | Span;
627
+ match?: NodeMatch<T>;
628
+ mode?: SelectionMode_2;
629
+ universal?: boolean;
630
+ reverse?: boolean;
631
+ voids?: boolean;
632
+ ignoreNonSelectable?: boolean;
633
+ }
634
+
635
+ export declare interface EditorNormalizeOptions {
636
+ force?: boolean;
637
+ operation?: Operation;
638
+ }
639
+
640
+ export declare interface EditorParentOptions {
641
+ depth?: number;
642
+ edge?: LeafEdge;
643
+ }
644
+
645
+ export declare interface EditorPathOptions {
646
+ depth?: number;
647
+ edge?: LeafEdge;
648
+ }
649
+
650
+ export declare interface EditorPathRefOptions {
651
+ affinity?: TextDirection | null;
652
+ }
653
+
654
+ export declare interface EditorPointOptions {
655
+ edge?: LeafEdge;
656
+ }
657
+
658
+ export declare interface EditorPointRefOptions {
659
+ affinity?: TextDirection | null;
660
+ }
661
+
662
+ export declare interface EditorPositionsOptions {
663
+ at?: Location_2;
664
+ unit?: TextUnitAdjustment;
665
+ reverse?: boolean;
666
+ voids?: boolean;
667
+ ignoreNonSelectable?: boolean;
668
+ }
669
+
670
+ export declare interface EditorPreviousOptions<T extends Node_2> {
671
+ at?: Location_2;
672
+ match?: NodeMatch<T>;
673
+ mode?: SelectionMode_2;
674
+ voids?: boolean;
675
+ }
676
+
677
+ export declare interface EditorRangeRefOptions {
678
+ affinity?: RangeDirection | null;
679
+ }
680
+
681
+ export declare interface EditorStringOptions {
682
+ voids?: boolean;
683
+ }
684
+
685
+ export declare interface EditorUnhangRangeOptions {
686
+ voids?: boolean;
687
+ }
688
+
689
+ export declare interface EditorVoidOptions {
690
+ at?: Location_2;
691
+ mode?: MaximizeMode;
692
+ voids?: boolean;
693
+ }
694
+
695
+ declare type Element_2 = ExtendedType<'Element', BaseElement>;
696
+
697
+ declare const Element_2: ElementInterface;
698
+ export { Element_2 as Element }
699
+
700
+ /**
701
+ * `ElementEntry` objects refer to an `Element` and the `Path` where it can be
702
+ * found inside a root node.
703
+ */
704
+ export declare type ElementEntry = [Element_2, Path];
705
+
706
+ export declare interface ElementInterface {
707
+ /**
708
+ * Check if a value implements the 'Ancestor' interface.
709
+ */
710
+ isAncestor: (value: any) => value is Ancestor;
711
+ /**
712
+ * Check if a value implements the `Element` interface.
713
+ */
714
+ isElement: (value: any) => value is Element_2;
715
+ /**
716
+ * Check if a value is an array of `Element` objects.
717
+ */
718
+ isElementList: (value: any) => value is Element_2[];
719
+ /**
720
+ * Check if a set of props is a partial of Element.
721
+ */
722
+ isElementProps: (props: any) => props is Partial<Element_2>;
723
+ /**
724
+ * Check if a value implements the `Element` interface and has elementKey with selected value.
725
+ * Default it check to `type` key value
726
+ */
727
+ isElementType: <T extends Element_2>(value: any, elementVal: string, elementKey?: string) => value is T;
728
+ /**
729
+ * Check if an element matches set of properties.
730
+ *
731
+ * Note: this checks custom properties, and it does not ensure that any
732
+ * children are equivalent.
733
+ */
734
+ matches: (element: Element_2, props: Partial<Element_2>) => boolean;
735
+ }
736
+
737
+ export declare const elementReadOnly: EditorInterface['elementReadOnly'];
738
+
739
+ export declare const end: EditorInterface['end'];
740
+
741
+ /**
742
+ * Extendable Custom Types Interface
743
+ */
744
+ declare type ExtendableTypes = 'Editor' | 'Element' | 'Text' | 'Selection' | 'Range' | 'Point' | 'Operation' | 'InsertNodeOperation' | 'InsertTextOperation' | 'MergeNodeOperation' | 'MoveNodeOperation' | 'RemoveNodeOperation' | 'RemoveTextOperation' | 'SetNodeOperation' | 'SetSelectionOperation' | 'SplitNodeOperation';
745
+
746
+ export declare type ExtendedType<K extends ExtendableTypes, B> = unknown extends CustomTypes[K] ? B : CustomTypes[K];
747
+
748
+ export declare const first: EditorInterface['first'];
749
+
750
+ export declare const fragment: EditorInterface['fragment'];
751
+
752
+ declare interface GeneralTransforms {
753
+ /**
754
+ * Transform the editor by an operation.
755
+ */
756
+ transform: (editor: Editor, op: Operation) => void;
757
+ }
758
+
759
+ declare const GeneralTransforms: GeneralTransforms;
760
+
761
+ /**
762
+ * Get the "dirty" paths generated from an operation.
763
+ */
764
+ export declare const getDirtyPaths: WithEditorFirstArg<Editor['getDirtyPaths']>;
765
+
766
+ export declare const getFragment: WithEditorFirstArg<Editor['getFragment']>;
767
+
768
+ export declare const getVoid: EditorInterface['void'];
769
+
770
+ export declare const hasBlocks: EditorInterface['hasBlocks'];
771
+
772
+ export declare const hasInlines: EditorInterface['hasInlines'];
773
+
774
+ export declare const hasPath: EditorInterface['hasPath'];
775
+
776
+ export declare const hasTexts: EditorInterface['hasTexts'];
777
+
778
+ export declare const insertBreak: EditorInterface['insertBreak'];
779
+
780
+ export declare const insertFragment: TextTransforms['insertFragment'];
781
+
782
+ export declare const insertNode: EditorInterface['insertNode'];
783
+
784
+ export declare type InsertNodeOperation = ExtendedType<'InsertNodeOperation', BaseInsertNodeOperation>;
785
+
786
+ export declare const insertNodes: NodeTransforms['insertNodes'];
787
+
788
+ export declare const insertSoftBreak: EditorInterface['insertSoftBreak'];
789
+
790
+ export declare const insertText: EditorInterface['insertText'];
791
+
792
+ export declare type InsertTextOperation = ExtendedType<'InsertTextOperation', BaseInsertTextOperation>;
793
+
794
+ export declare const isBlock: EditorInterface['isBlock'];
795
+
796
+ export declare const isEdge: EditorInterface['isEdge'];
797
+
798
+ export declare const isEditor: EditorInterface['isEditor'];
799
+
800
+ export declare const isEmpty: EditorInterface['isEmpty'];
801
+
802
+ export declare const isEnd: EditorInterface['isEnd'];
803
+
804
+ export declare const isNormalizing: EditorInterface['isNormalizing'];
805
+
806
+ export declare const isStart: EditorInterface['isStart'];
807
+
808
+ export declare const last: EditorInterface['last'];
809
+
810
+ export declare const leaf: EditorInterface['leaf'];
811
+
812
+ export declare type LeafEdge = 'start' | 'end';
813
+
814
+ export declare function levels<T extends Node_2>(editor: Editor, options?: EditorLevelsOptions<T>): Generator<NodeEntry<T>, void, undefined>;
815
+
816
+ export declare const liftNodes: NodeTransforms['liftNodes'];
817
+
818
+ /**
819
+ * The `Location` interface is a union of the ways to refer to a specific
820
+ * location in a Slate document: paths, points or ranges.
821
+ *
822
+ * Methods will often accept a `Location` instead of requiring only a `Path`,
823
+ * `Point` or `Range`. This eliminates the need for developers to manage
824
+ * converting between the different interfaces in their own code base.
825
+ */
826
+ declare type Location_2 = Path | Point | Range_2;
827
+
828
+ declare const Location_2: LocationInterface;
829
+ export { Location_2 as Location }
830
+
831
+ export declare interface LocationInterface {
832
+ /**
833
+ * Check if a value implements the `Location` interface.
834
+ */
835
+ isLocation: (value: any) => value is Location_2;
836
+ }
837
+
838
+ export declare const marks: EditorInterface['marks'];
839
+
840
+ export declare type MaximizeMode = RangeMode | 'all';
841
+
842
+ export declare type MergeNodeOperation = ExtendedType<'MergeNodeOperation', BaseMergeNodeOperation>;
843
+
844
+ export declare const mergeNodes: NodeTransforms['mergeNodes'];
845
+
846
+ export declare const move: SelectionTransforms['move'];
847
+
848
+ export declare type MoveNodeOperation = ExtendedType<'MoveNodeOperation', BaseMoveNodeOperation>;
849
+
850
+ export declare const moveNodes: NodeTransforms['moveNodes'];
851
+
852
+ export declare type MoveUnit = 'offset' | 'character' | 'word' | 'line';
853
+
854
+ export declare const next: EditorInterface['next'];
855
+
856
+ export declare const node: EditorInterface['node'];
857
+
858
+ declare type Node_2 = Editor | Element_2 | Text_2;
859
+
860
+ declare const Node_2: NodeInterface;
861
+ export { Node_2 as Node }
862
+
863
+ export declare interface NodeAncestorsOptions {
864
+ reverse?: boolean;
865
+ }
866
+
867
+ export declare interface NodeChildrenOptions {
868
+ reverse?: boolean;
869
+ }
870
+
871
+ export declare interface NodeDescendantsOptions {
872
+ from?: Path;
873
+ to?: Path;
874
+ reverse?: boolean;
875
+ pass?: (node: NodeEntry) => boolean;
876
+ }
877
+
878
+ export declare interface NodeElementsOptions {
879
+ from?: Path;
880
+ to?: Path;
881
+ reverse?: boolean;
882
+ pass?: (node: NodeEntry) => boolean;
883
+ }
884
+
885
+ /**
886
+ * `NodeEntry` objects are returned when iterating over the nodes in a Slate
887
+ * document tree. They consist of the node and its `Path` relative to the root
888
+ * node in the document.
889
+ */
890
+ export declare type NodeEntry<T extends Node_2 = Node_2> = [T, Path];
891
+
892
+ declare interface NodeInsertNodesOptions<T extends Node_2> {
893
+ at?: Location_2;
894
+ match?: NodeMatch<T>;
895
+ mode?: RangeMode;
896
+ hanging?: boolean;
897
+ select?: boolean;
898
+ voids?: boolean;
899
+ batchDirty?: boolean;
900
+ }
901
+
902
+ export declare interface NodeInterface {
903
+ /**
904
+ * Get the node at a specific path, asserting that it's an ancestor node.
905
+ */
906
+ ancestor: (root: Node_2, path: Path) => Ancestor;
907
+ /**
908
+ * Return a generator of all the ancestor nodes above a specific path.
909
+ *
910
+ * By default the order is top-down, from highest to lowest ancestor in
911
+ * the tree, but you can pass the `reverse: true` option to go bottom-up.
912
+ */
913
+ ancestors: (root: Node_2, path: Path, options?: NodeAncestorsOptions) => Generator<NodeEntry<Ancestor>, void, undefined>;
914
+ /**
915
+ * Get the child of a node at a specific index.
916
+ */
917
+ child: (root: Node_2, index: number) => Descendant;
918
+ /**
919
+ * Iterate over the children of a node at a specific path.
920
+ */
921
+ children: (root: Node_2, path: Path, options?: NodeChildrenOptions) => Generator<NodeEntry<Descendant>, void, undefined>;
922
+ /**
923
+ * Get an entry for the common ancesetor node of two paths.
924
+ */
925
+ common: (root: Node_2, path: Path, another: Path) => NodeEntry;
926
+ /**
927
+ * Get the node at a specific path, asserting that it's a descendant node.
928
+ */
929
+ descendant: (root: Node_2, path: Path) => Descendant;
930
+ /**
931
+ * Return a generator of all the descendant node entries inside a root node.
932
+ */
933
+ descendants: (root: Node_2, options?: NodeDescendantsOptions) => Generator<NodeEntry<Descendant>, void, undefined>;
934
+ /**
935
+ * Return a generator of all the element nodes inside a root node. Each iteration
936
+ * will return an `ElementEntry` tuple consisting of `[Element, Path]`. If the
937
+ * root node is an element it will be included in the iteration as well.
938
+ */
939
+ elements: (root: Node_2, options?: NodeElementsOptions) => Generator<ElementEntry, void, undefined>;
940
+ /**
941
+ * Extract props from a Node.
942
+ */
943
+ extractProps: (node: Node_2) => NodeProps;
944
+ /**
945
+ * Get the first node entry in a root node from a path.
946
+ */
947
+ first: (root: Node_2, path: Path) => NodeEntry;
948
+ /**
949
+ * Get the sliced fragment represented by a range inside a root node.
950
+ */
951
+ fragment: (root: Node_2, range: Range_2) => Descendant[];
952
+ /**
953
+ * Get the descendant node referred to by a specific path. If the path is an
954
+ * empty array, it refers to the root node itself.
955
+ */
956
+ get: (root: Node_2, path: Path) => Node_2;
957
+ /**
958
+ * Similar to get, but returns undefined if the node does not exist.
959
+ */
960
+ getIf: (root: Node_2, path: Path) => Node_2 | undefined;
961
+ /**
962
+ * Check if a descendant node exists at a specific path.
963
+ */
964
+ has: (root: Node_2, path: Path) => boolean;
965
+ /**
966
+ * Check if a value implements the `Node` interface.
967
+ */
968
+ isNode: (value: any) => value is Node_2;
969
+ /**
970
+ * Check if a value is a list of `Node` objects.
971
+ */
972
+ isNodeList: (value: any) => value is Node_2[];
973
+ /**
974
+ * Get the last node entry in a root node from a path.
975
+ */
976
+ last: (root: Node_2, path: Path) => NodeEntry;
977
+ /**
978
+ * Get the node at a specific path, ensuring it's a leaf text node.
979
+ */
980
+ leaf: (root: Node_2, path: Path) => Text_2;
981
+ /**
982
+ * Return a generator of the in a branch of the tree, from a specific path.
983
+ *
984
+ * By default the order is top-down, from highest to lowest node in the tree,
985
+ * but you can pass the `reverse: true` option to go bottom-up.
986
+ */
987
+ levels: (root: Node_2, path: Path, options?: NodeLevelsOptions) => Generator<NodeEntry, void, undefined>;
988
+ /**
989
+ * Check if a node matches a set of props.
990
+ */
991
+ matches: (node: Node_2, props: Partial<Node_2>) => boolean;
992
+ /**
993
+ * Return a generator of all the node entries of a root node. Each entry is
994
+ * returned as a `[Node, Path]` tuple, with the path referring to the node's
995
+ * position inside the root node.
996
+ */
997
+ nodes: (root: Node_2, options?: NodeNodesOptions) => Generator<NodeEntry, void, undefined>;
998
+ /**
999
+ * Get the parent of a node at a specific path.
1000
+ */
1001
+ parent: (root: Node_2, path: Path) => Ancestor;
1002
+ /**
1003
+ * Get the concatenated text string of a node's content.
1004
+ *
1005
+ * Note that this will not include spaces or line breaks between block nodes.
1006
+ * It is not a user-facing string, but a string for performing offset-related
1007
+ * computations for a node.
1008
+ */
1009
+ string: (node: Node_2) => string;
1010
+ /**
1011
+ * Return a generator of all leaf text nodes in a root node.
1012
+ */
1013
+ texts: (root: Node_2, options?: NodeTextsOptions) => Generator<NodeEntry<Text_2>, void, undefined>;
1014
+ }
1015
+
1016
+ export declare interface NodeLevelsOptions {
1017
+ reverse?: boolean;
1018
+ }
1019
+
1020
+ /**
1021
+ * A helper type for narrowing matched nodes with a predicate.
1022
+ */
1023
+ export declare type NodeMatch<T extends Node_2> = ((node: Node_2, path: Path) => node is T) | ((node: Node_2, path: Path) => boolean);
1024
+
1025
+ export declare interface NodeNodesOptions {
1026
+ from?: Path;
1027
+ to?: Path;
1028
+ reverse?: boolean;
1029
+ pass?: (entry: NodeEntry) => boolean;
1030
+ }
1031
+
1032
+ export declare type NodeOperation = InsertNodeOperation | MergeNodeOperation | MoveNodeOperation | RemoveNodeOperation | SetNodeOperation | SplitNodeOperation;
1033
+
1034
+ /**
1035
+ * Convenience type for returning the props of a node.
1036
+ */
1037
+ export declare type NodeProps = Omit<Editor, 'children'> | Omit<Element_2, 'children'> | Omit<Text_2, 'text'>;
1038
+
1039
+ export declare function nodes<T extends Node_2>(editor: Editor, options?: EditorNodesOptions<T>): Generator<NodeEntry<T>, void, undefined>;
1040
+
1041
+ export declare interface NodeTextsOptions {
1042
+ from?: Path;
1043
+ to?: Path;
1044
+ reverse?: boolean;
1045
+ pass?: (node: NodeEntry) => boolean;
1046
+ }
1047
+
1048
+ declare interface NodeTransforms {
1049
+ /**
1050
+ * Insert nodes in the editor
1051
+ * at the specified location or (if not defined) the current selection or (if not defined) the end of the document.
1052
+ */
1053
+ insertNodes: <T extends Node_2>(editor: Editor, nodes: Node_2 | Node_2[], options?: NodeInsertNodesOptions<T>) => void;
1054
+ /**
1055
+ * Lift nodes at a specific location upwards in the document tree, splitting
1056
+ * their parent in two if necessary.
1057
+ */
1058
+ liftNodes: <T extends Node_2>(editor: Editor, options?: {
1059
+ at?: Location_2;
1060
+ match?: NodeMatch<T>;
1061
+ mode?: MaximizeMode;
1062
+ voids?: boolean;
1063
+ }) => void;
1064
+ /**
1065
+ * Merge a node at a location with the previous node of the same depth,
1066
+ * removing any empty containing nodes after the merge if necessary.
1067
+ */
1068
+ mergeNodes: <T extends Node_2>(editor: Editor, options?: {
1069
+ at?: Location_2;
1070
+ match?: NodeMatch<T>;
1071
+ mode?: RangeMode;
1072
+ hanging?: boolean;
1073
+ voids?: boolean;
1074
+ }) => void;
1075
+ /**
1076
+ * Move the nodes at a location to a new location.
1077
+ */
1078
+ moveNodes: <T extends Node_2>(editor: Editor, options: {
1079
+ at?: Location_2;
1080
+ match?: NodeMatch<T>;
1081
+ mode?: MaximizeMode;
1082
+ to: Path;
1083
+ voids?: boolean;
1084
+ }) => void;
1085
+ /**
1086
+ * Remove the nodes at a specific location in the document.
1087
+ */
1088
+ removeNodes: <T extends Node_2>(editor: Editor, options?: {
1089
+ at?: Location_2;
1090
+ match?: NodeMatch<T>;
1091
+ mode?: RangeMode;
1092
+ hanging?: boolean;
1093
+ voids?: boolean;
1094
+ }) => void;
1095
+ /**
1096
+ * Set new properties on the nodes at a location.
1097
+ */
1098
+ setNodes: <T extends Node_2>(editor: Editor, props: Partial<T>, options?: {
1099
+ at?: Location_2;
1100
+ match?: NodeMatch<T>;
1101
+ mode?: MaximizeMode;
1102
+ hanging?: boolean;
1103
+ split?: boolean;
1104
+ voids?: boolean;
1105
+ compare?: PropsCompare;
1106
+ merge?: PropsMerge;
1107
+ }) => void;
1108
+ /**
1109
+ * Split the nodes at a specific location.
1110
+ */
1111
+ splitNodes: <T extends Node_2>(editor: Editor, options?: {
1112
+ at?: Location_2;
1113
+ match?: NodeMatch<T>;
1114
+ mode?: RangeMode;
1115
+ always?: boolean;
1116
+ height?: number;
1117
+ voids?: boolean;
1118
+ }) => void;
1119
+ /**
1120
+ * Unset properties on the nodes at a location.
1121
+ */
1122
+ unsetNodes: <T extends Node_2>(editor: Editor, props: string | string[], options?: {
1123
+ at?: Location_2;
1124
+ match?: NodeMatch<T>;
1125
+ mode?: MaximizeMode;
1126
+ hanging?: boolean;
1127
+ split?: boolean;
1128
+ voids?: boolean;
1129
+ }) => void;
1130
+ /**
1131
+ * Unwrap the nodes at a location from a parent node, splitting the parent if
1132
+ * necessary to ensure that only the content in the range is unwrapped.
1133
+ */
1134
+ unwrapNodes: <T extends Node_2>(editor: Editor, options?: {
1135
+ at?: Location_2;
1136
+ match?: NodeMatch<T>;
1137
+ mode?: MaximizeMode;
1138
+ split?: boolean;
1139
+ voids?: boolean;
1140
+ }) => void;
1141
+ /**
1142
+ * Wrap the nodes at a location in a new container node, splitting the edges
1143
+ * of the range first to ensure that only the content in the range is wrapped.
1144
+ */
1145
+ wrapNodes: <T extends Node_2>(editor: Editor, element: Element_2, options?: {
1146
+ at?: Location_2;
1147
+ match?: NodeMatch<T>;
1148
+ mode?: MaximizeMode;
1149
+ split?: boolean;
1150
+ voids?: boolean;
1151
+ }) => void;
1152
+ }
1153
+
1154
+ declare const NodeTransforms: NodeTransforms;
1155
+
1156
+ export declare const normalize: EditorInterface['normalize'];
1157
+
1158
+ export declare const normalizeNode: WithEditorFirstArg<Editor['normalizeNode']>;
1159
+
1160
+ declare type OmitFirstArg<F> = F extends (x: any, ...args: infer P) => infer R ? (...args: P) => R : never;
1161
+
1162
+ export declare type Operation = ExtendedType<'Operation', BaseOperation>;
1163
+
1164
+ export declare const Operation: OperationInterface;
1165
+
1166
+ export declare interface OperationInterface {
1167
+ /**
1168
+ * Check if a value is a `NodeOperation` object.
1169
+ */
1170
+ isNodeOperation: (value: any) => value is NodeOperation;
1171
+ /**
1172
+ * Check if a value is an `Operation` object.
1173
+ */
1174
+ isOperation: (value: any) => value is Operation;
1175
+ /**
1176
+ * Check if a value is a list of `Operation` objects.
1177
+ */
1178
+ isOperationList: (value: any) => value is Operation[];
1179
+ /**
1180
+ * Check if a value is a `SelectionOperation` object.
1181
+ */
1182
+ isSelectionOperation: (value: any) => value is SelectionOperation;
1183
+ /**
1184
+ * Check if a value is a `TextOperation` object.
1185
+ */
1186
+ isTextOperation: (value: any) => value is TextOperation;
1187
+ /**
1188
+ * Invert an operation, returning a new operation that will exactly undo the
1189
+ * original when applied.
1190
+ */
1191
+ inverse: (op: Operation) => Operation;
1192
+ }
1193
+
1194
+ declare const parent_2: EditorInterface['parent'];
1195
+ export { parent_2 as parent }
1196
+
1197
+ /**
1198
+ * `Path` arrays are a list of indexes that describe a node's exact position in
1199
+ * a Slate node tree. Although they are usually relative to the root `Editor`
1200
+ * object, they can be relative to any `Node` object.
1201
+ */
1202
+ export declare type Path = number[];
1203
+
1204
+ export declare const Path: PathInterface;
1205
+
1206
+ export declare const path: EditorInterface['path'];
1207
+
1208
+ export declare interface PathAncestorsOptions {
1209
+ reverse?: boolean;
1210
+ }
1211
+
1212
+ export declare interface PathInterface {
1213
+ /**
1214
+ * Get a list of ancestor paths for a given path.
1215
+ *
1216
+ * The paths are sorted from shallowest to deepest ancestor. However, if the
1217
+ * `reverse: true` option is passed, they are reversed.
1218
+ */
1219
+ ancestors: (path: Path, options?: PathAncestorsOptions) => Path[];
1220
+ /**
1221
+ * Get the common ancestor path of two paths.
1222
+ */
1223
+ common: (path: Path, another: Path) => Path;
1224
+ /**
1225
+ * Compare a path to another, returning an integer indicating whether the path
1226
+ * was before, at, or after the other.
1227
+ *
1228
+ * Note: Two paths of unequal length can still receive a `0` result if one is
1229
+ * directly above or below the other. If you want exact matching, use
1230
+ * [[Path.equals]] instead.
1231
+ */
1232
+ compare: (path: Path, another: Path) => -1 | 0 | 1;
1233
+ /**
1234
+ * Check if a path ends after one of the indexes in another.
1235
+ */
1236
+ endsAfter: (path: Path, another: Path) => boolean;
1237
+ /**
1238
+ * Check if a path ends at one of the indexes in another.
1239
+ */
1240
+ endsAt: (path: Path, another: Path) => boolean;
1241
+ /**
1242
+ * Check if a path ends before one of the indexes in another.
1243
+ */
1244
+ endsBefore: (path: Path, another: Path) => boolean;
1245
+ /**
1246
+ * Check if a path is exactly equal to another.
1247
+ */
1248
+ equals: (path: Path, another: Path) => boolean;
1249
+ /**
1250
+ * Check if the path of previous sibling node exists
1251
+ */
1252
+ hasPrevious: (path: Path) => boolean;
1253
+ /**
1254
+ * Check if a path is after another.
1255
+ */
1256
+ isAfter: (path: Path, another: Path) => boolean;
1257
+ /**
1258
+ * Check if a path is an ancestor of another.
1259
+ */
1260
+ isAncestor: (path: Path, another: Path) => boolean;
1261
+ /**
1262
+ * Check if a path is before another.
1263
+ */
1264
+ isBefore: (path: Path, another: Path) => boolean;
1265
+ /**
1266
+ * Check if a path is a child of another.
1267
+ */
1268
+ isChild: (path: Path, another: Path) => boolean;
1269
+ /**
1270
+ * Check if a path is equal to or an ancestor of another.
1271
+ */
1272
+ isCommon: (path: Path, another: Path) => boolean;
1273
+ /**
1274
+ * Check if a path is a descendant of another.
1275
+ */
1276
+ isDescendant: (path: Path, another: Path) => boolean;
1277
+ /**
1278
+ * Check if a path is the parent of another.
1279
+ */
1280
+ isParent: (path: Path, another: Path) => boolean;
1281
+ /**
1282
+ * Check is a value implements the `Path` interface.
1283
+ */
1284
+ isPath: (value: any) => value is Path;
1285
+ /**
1286
+ * Check if a path is a sibling of another.
1287
+ */
1288
+ isSibling: (path: Path, another: Path) => boolean;
1289
+ /**
1290
+ * Get a list of paths at every level down to a path. Note: this is the same
1291
+ * as `Path.ancestors`, but including the path itself.
1292
+ *
1293
+ * The paths are sorted from shallowest to deepest. However, if the `reverse:
1294
+ * true` option is passed, they are reversed.
1295
+ */
1296
+ levels: (path: Path, options?: PathLevelsOptions) => Path[];
1297
+ /**
1298
+ * Given a path, get the path to the next sibling node.
1299
+ */
1300
+ next: (path: Path) => Path;
1301
+ /**
1302
+ * Returns whether this operation can affect paths or not. Used as an
1303
+ * optimization when updating dirty paths during normalization
1304
+ *
1305
+ * NOTE: This *must* be kept in sync with the implementation of 'transform'
1306
+ * below
1307
+ */
1308
+ operationCanTransformPath: (operation: Operation) => operation is InsertNodeOperation | RemoveNodeOperation | MergeNodeOperation | SplitNodeOperation | MoveNodeOperation;
1309
+ /**
1310
+ * Given a path, return a new path referring to the parent node above it.
1311
+ */
1312
+ parent: (path: Path) => Path;
1313
+ /**
1314
+ * Given a path, get the path to the previous sibling node.
1315
+ */
1316
+ previous: (path: Path) => Path;
1317
+ /**
1318
+ * Get a path relative to an ancestor.
1319
+ */
1320
+ relative: (path: Path, ancestor: Path) => Path;
1321
+ /**
1322
+ * Transform a path by an operation.
1323
+ */
1324
+ transform: (path: Path, operation: Operation, options?: PathTransformOptions) => Path | null;
1325
+ }
1326
+
1327
+ export declare interface PathLevelsOptions {
1328
+ reverse?: boolean;
1329
+ }
1330
+
1331
+ /**
1332
+ * `PathRef` objects keep a specific path in a document synced over time as new
1333
+ * operations are applied to the editor. You can access their `current` property
1334
+ * at any time for the up-to-date path value.
1335
+ */
1336
+ export declare interface PathRef {
1337
+ current: Path | null;
1338
+ affinity: 'forward' | 'backward' | null;
1339
+ unref(): Path | null;
1340
+ }
1341
+
1342
+ export declare const PathRef: PathRefInterface;
1343
+
1344
+ export declare const pathRef: EditorInterface['pathRef'];
1345
+
1346
+ export declare interface PathRefInterface {
1347
+ /**
1348
+ * Transform the path ref's current value by an operation.
1349
+ */
1350
+ transform: (ref: PathRef, op: Operation) => void;
1351
+ }
1352
+
1353
+ export declare const pathRefs: EditorInterface['pathRefs'];
1354
+
1355
+ export declare interface PathTransformOptions {
1356
+ affinity?: TextDirection | null;
1357
+ }
1358
+
1359
+ export declare type Point = ExtendedType<'Point', BasePoint>;
1360
+
1361
+ export declare const Point: PointInterface;
1362
+
1363
+ export declare const point: EditorInterface['point'];
1364
+
1365
+ /**
1366
+ * `PointEntry` objects are returned when iterating over `Point` objects that
1367
+ * belong to a range.
1368
+ */
1369
+ export declare type PointEntry = [Point, 'anchor' | 'focus'];
1370
+
1371
+ export declare interface PointInterface {
1372
+ /**
1373
+ * Compare a point to another, returning an integer indicating whether the
1374
+ * point was before, at, or after the other.
1375
+ */
1376
+ compare: (point: Point, another: Point) => -1 | 0 | 1;
1377
+ /**
1378
+ * Check if a point is after another.
1379
+ */
1380
+ isAfter: (point: Point, another: Point) => boolean;
1381
+ /**
1382
+ * Check if a point is before another.
1383
+ */
1384
+ isBefore: (point: Point, another: Point) => boolean;
1385
+ /**
1386
+ * Check if a point is exactly equal to another.
1387
+ */
1388
+ equals: (point: Point, another: Point) => boolean;
1389
+ /**
1390
+ * Check if a value implements the `Point` interface.
1391
+ */
1392
+ isPoint: (value: any) => value is Point;
1393
+ /**
1394
+ * Transform a point by an operation.
1395
+ */
1396
+ transform: (point: Point, op: Operation, options?: PointTransformOptions) => Point | null;
1397
+ }
1398
+
1399
+ /**
1400
+ * `PointRef` objects keep a specific point in a document synced over time as new
1401
+ * operations are applied to the editor. You can access their `current` property
1402
+ * at any time for the up-to-date point value.
1403
+ */
1404
+ export declare interface PointRef {
1405
+ current: Point | null;
1406
+ affinity: TextDirection | null;
1407
+ unref(): Point | null;
1408
+ }
1409
+
1410
+ export declare const PointRef: PointRefInterface;
1411
+
1412
+ export declare const pointRef: EditorInterface['pointRef'];
1413
+
1414
+ export declare interface PointRefInterface {
1415
+ /**
1416
+ * Transform the point ref's current value by an operation.
1417
+ */
1418
+ transform: (ref: PointRef, op: Operation) => void;
1419
+ }
1420
+
1421
+ export declare const pointRefs: EditorInterface['pointRefs'];
1422
+
1423
+ export declare interface PointTransformOptions {
1424
+ affinity?: TextDirection | null;
1425
+ }
1426
+
1427
+ export declare function positions(editor: Editor, options?: EditorPositionsOptions): Generator<Point, void, undefined>;
1428
+
1429
+ export declare const previous: EditorInterface['previous'];
1430
+
1431
+ export declare type PropsCompare = (prop: Partial<Node_2>, node: Partial<Node_2>) => boolean;
1432
+
1433
+ export declare type PropsMerge = (prop: Partial<Node_2>, node: Partial<Node_2>) => object;
1434
+
1435
+ export declare const range: EditorInterface['range'];
1436
+
1437
+ declare type Range_2 = ExtendedType<'Range', BaseRange>;
1438
+
1439
+ declare const Range_2: RangeInterface;
1440
+ export { Range_2 as Range }
1441
+
1442
+ export declare type RangeDirection = TextDirection | 'outward' | 'inward';
1443
+
1444
+ export declare interface RangeEdgesOptions {
1445
+ reverse?: boolean;
1446
+ }
1447
+
1448
+ export declare interface RangeInterface {
1449
+ /**
1450
+ * Get the start and end points of a range, in the order in which they appear
1451
+ * in the document.
1452
+ */
1453
+ edges: (range: Range_2, options?: RangeEdgesOptions) => [Point, Point];
1454
+ /**
1455
+ * Get the end point of a range.
1456
+ */
1457
+ end: (range: Range_2) => Point;
1458
+ /**
1459
+ * Check if a range is exactly equal to another.
1460
+ */
1461
+ equals: (range: Range_2, another: Range_2) => boolean;
1462
+ /**
1463
+ * Check if a range includes a path, a point or part of another range.
1464
+ */
1465
+ includes: (range: Range_2, target: Path | Point | Range_2) => boolean;
1466
+ /**
1467
+ * Check if a range includes another range.
1468
+ */
1469
+ surrounds: (range: Range_2, target: Range_2) => boolean;
1470
+ /**
1471
+ * Get the intersection of a range with another.
1472
+ */
1473
+ intersection: (range: Range_2, another: Range_2) => Range_2 | null;
1474
+ /**
1475
+ * Check if a range is backward, meaning that its anchor point appears in the
1476
+ * document _after_ its focus point.
1477
+ */
1478
+ isBackward: (range: Range_2) => boolean;
1479
+ /**
1480
+ * Check if a range is collapsed, meaning that both its anchor and focus
1481
+ * points refer to the exact same position in the document.
1482
+ */
1483
+ isCollapsed: (range: Range_2) => boolean;
1484
+ /**
1485
+ * Check if a range is expanded.
1486
+ *
1487
+ * This is the opposite of [[Range.isCollapsed]] and is provided for legibility.
1488
+ */
1489
+ isExpanded: (range: Range_2) => boolean;
1490
+ /**
1491
+ * Check if a range is forward.
1492
+ *
1493
+ * This is the opposite of [[Range.isBackward]] and is provided for legibility.
1494
+ */
1495
+ isForward: (range: Range_2) => boolean;
1496
+ /**
1497
+ * Check if a value implements the [[Range]] interface.
1498
+ */
1499
+ isRange: (value: any) => value is Range_2;
1500
+ /**
1501
+ * Iterate through all of the point entries in a range.
1502
+ */
1503
+ points: (range: Range_2) => Generator<PointEntry, void, undefined>;
1504
+ /**
1505
+ * Get the start point of a range.
1506
+ */
1507
+ start: (range: Range_2) => Point;
1508
+ /**
1509
+ * Transform a range by an operation.
1510
+ */
1511
+ transform: (range: Range_2, op: Operation, options?: RangeTransformOptions) => Range_2 | null;
1512
+ }
1513
+
1514
+ export declare type RangeMode = 'highest' | 'lowest';
1515
+
1516
+ /**
1517
+ * `RangeRef` objects keep a specific range in a document synced over time as new
1518
+ * operations are applied to the editor. You can access their `current` property
1519
+ * at any time for the up-to-date range value.
1520
+ */
1521
+ export declare interface RangeRef {
1522
+ current: Range_2 | null;
1523
+ affinity: 'forward' | 'backward' | 'outward' | 'inward' | null;
1524
+ unref(): Range_2 | null;
1525
+ }
1526
+
1527
+ export declare const RangeRef: RangeRefInterface;
1528
+
1529
+ export declare const rangeRef: EditorInterface['rangeRef'];
1530
+
1531
+ export declare interface RangeRefInterface {
1532
+ /**
1533
+ * Transform the range ref's current value by an operation.
1534
+ */
1535
+ transform: (ref: RangeRef, op: Operation) => void;
1536
+ }
1537
+
1538
+ export declare const rangeRefs: EditorInterface['rangeRefs'];
1539
+
1540
+ export declare interface RangeTransformOptions {
1541
+ affinity?: RangeDirection | null;
1542
+ }
1543
+
1544
+ export declare const removeMark: EditorInterface['removeMark'];
1545
+
1546
+ export declare type RemoveNodeOperation = ExtendedType<'RemoveNodeOperation', BaseRemoveNodeOperation>;
1547
+
1548
+ export declare const removeNodes: NodeTransforms['removeNodes'];
1549
+
1550
+ export declare type RemoveTextOperation = ExtendedType<'RemoveTextOperation', BaseRemoveTextOperation>;
1551
+
1552
+ export declare type Scrubber = (key: string, value: unknown) => unknown;
1553
+
1554
+ /**
1555
+ * This interface implements a stringify() function, which is used by Slate
1556
+ * internally when generating exceptions containing end user data. Developers
1557
+ * using Slate may call Scrubber.setScrubber() to alter the behavior of this
1558
+ * stringify() function.
1559
+ *
1560
+ * For example, to prevent the cleartext logging of 'text' fields within Nodes:
1561
+ *
1562
+ * import { Scrubber } from 'slate';
1563
+ * Scrubber.setScrubber((key, val) => {
1564
+ * if (key === 'text') return '...scrubbed...'
1565
+ * return val
1566
+ * });
1567
+ *
1568
+ */
1569
+ export declare const Scrubber: ScrubberInterface;
1570
+
1571
+ export declare interface ScrubberInterface {
1572
+ setScrubber(scrubber: Scrubber | undefined): void;
1573
+ stringify(value: any): string;
1574
+ }
1575
+
1576
+ export declare const select: SelectionTransforms['select'];
1577
+
1578
+ declare type Selection_2 = ExtendedType<'Selection', BaseSelection>;
1579
+ export { Selection_2 as Selection }
1580
+
1581
+ declare interface SelectionCollapseOptions {
1582
+ edge?: SelectionEdge;
1583
+ }
1584
+
1585
+ export declare type SelectionEdge = 'anchor' | 'focus' | 'start' | 'end';
1586
+
1587
+ declare type SelectionMode_2 = 'all' | 'highest' | 'lowest';
1588
+ export { SelectionMode_2 as SelectionMode }
1589
+
1590
+ declare interface SelectionMoveOptions {
1591
+ distance?: number;
1592
+ unit?: MoveUnit;
1593
+ reverse?: boolean;
1594
+ edge?: SelectionEdge;
1595
+ }
1596
+
1597
+ export declare type SelectionOperation = SetSelectionOperation;
1598
+
1599
+ declare interface SelectionSetPointOptions {
1600
+ edge?: SelectionEdge;
1601
+ }
1602
+
1603
+ declare interface SelectionTransforms {
1604
+ /**
1605
+ * Collapse the selection.
1606
+ */
1607
+ collapse: (editor: Editor, options?: SelectionCollapseOptions) => void;
1608
+ /**
1609
+ * Unset the selection.
1610
+ */
1611
+ deselect: (editor: Editor) => void;
1612
+ /**
1613
+ * Move the selection's point forward or backward.
1614
+ */
1615
+ move: (editor: Editor, options?: SelectionMoveOptions) => void;
1616
+ /**
1617
+ * Set the selection to a new value.
1618
+ */
1619
+ select: (editor: Editor, target: Location_2) => void;
1620
+ /**
1621
+ * Set new properties on one of the selection's points.
1622
+ */
1623
+ setPoint: (editor: Editor, props: Partial<Point>, options?: SelectionSetPointOptions) => void;
1624
+ /**
1625
+ * Set new properties on the selection.
1626
+ */
1627
+ setSelection: (editor: Editor, props: Partial<Range_2>) => void;
1628
+ }
1629
+
1630
+ declare const SelectionTransforms: SelectionTransforms;
1631
+
1632
+ export declare type SetNodeOperation = ExtendedType<'SetNodeOperation', BaseSetNodeOperation>;
1633
+
1634
+ export declare const setNodes: NodeTransforms['setNodes'];
1635
+
1636
+ export declare const setNormalizing: EditorInterface['setNormalizing'];
1637
+
1638
+ export declare const setPoint: SelectionTransforms['setPoint'];
1639
+
1640
+ export declare const setSelection: SelectionTransforms['setSelection'];
1641
+
1642
+ export declare type SetSelectionOperation = ExtendedType<'SetSelectionOperation', BaseSetSelectionOperation>;
1643
+
1644
+ export declare const shouldMergeNodesRemovePrevNode: EditorInterface['shouldMergeNodesRemovePrevNode'];
1645
+
1646
+ export declare const shouldNormalize: WithEditorFirstArg<Editor['shouldNormalize']>;
1647
+
1648
+ /**
1649
+ * The `Span` interface is a low-level way to refer to locations in nodes
1650
+ * without using `Point` which requires leaf text nodes to be present.
1651
+ */
1652
+ export declare type Span = [Path, Path];
1653
+
1654
+ export declare const Span: SpanInterface;
1655
+
1656
+ export declare interface SpanInterface {
1657
+ /**
1658
+ * Check if a value implements the `Span` interface.
1659
+ */
1660
+ isSpan: (value: any) => value is Span;
1661
+ }
1662
+
1663
+ export declare type SplitNodeOperation = ExtendedType<'SplitNodeOperation', BaseSplitNodeOperation>;
1664
+
1665
+ export declare const splitNodes: NodeTransforms['splitNodes'];
1666
+
1667
+ export declare const start: EditorInterface['start'];
1668
+
1669
+ export declare const string: EditorInterface['string'];
1670
+
1671
+ declare type Text_2 = ExtendedType<'Text', BaseText>;
1672
+
1673
+ declare const Text_2: TextInterface;
1674
+ export { Text_2 as Text }
1675
+
1676
+ declare interface TextDeleteOptions {
1677
+ at?: Location_2;
1678
+ distance?: number;
1679
+ unit?: TextUnit;
1680
+ reverse?: boolean;
1681
+ hanging?: boolean;
1682
+ voids?: boolean;
1683
+ }
1684
+
1685
+ export declare type TextDirection = 'forward' | 'backward';
1686
+
1687
+ export declare interface TextEqualsOptions {
1688
+ loose?: boolean;
1689
+ }
1690
+
1691
+ declare interface TextInsertFragmentOptions {
1692
+ at?: Location_2;
1693
+ hanging?: boolean;
1694
+ voids?: boolean;
1695
+ batchDirty?: boolean;
1696
+ }
1697
+
1698
+ declare interface TextInsertTextOptions {
1699
+ at?: Location_2;
1700
+ voids?: boolean;
1701
+ }
1702
+
1703
+ export declare interface TextInterface {
1704
+ /**
1705
+ * Check if two text nodes are equal.
1706
+ *
1707
+ * When loose is set, the text is not compared. This is
1708
+ * used to check whether sibling text nodes can be merged.
1709
+ */
1710
+ equals: (text: Text_2, another: Text_2, options?: TextEqualsOptions) => boolean;
1711
+ /**
1712
+ * Check if a value implements the `Text` interface.
1713
+ */
1714
+ isText: (value: any) => value is Text_2;
1715
+ /**
1716
+ * Check if a value is a list of `Text` objects.
1717
+ */
1718
+ isTextList: (value: any) => value is Text_2[];
1719
+ /**
1720
+ * Check if some props are a partial of Text.
1721
+ */
1722
+ isTextProps: (props: any) => props is Partial<Text_2>;
1723
+ /**
1724
+ * Check if an text matches set of properties.
1725
+ *
1726
+ * Note: this is for matching custom properties, and it does not ensure that
1727
+ * the `text` property are two nodes equal.
1728
+ */
1729
+ matches: (text: Text_2, props: Partial<Text_2>) => boolean;
1730
+ /**
1731
+ * Get the leaves for a text node given decorations.
1732
+ */
1733
+ decorations: (node: Text_2, decorations: DecoratedRange[]) => Text_2[];
1734
+ }
1735
+
1736
+ export declare type TextOperation = InsertTextOperation | RemoveTextOperation;
1737
+
1738
+ declare interface TextTransforms {
1739
+ /**
1740
+ * Delete content in the editor.
1741
+ */
1742
+ delete: (editor: Editor, options?: TextDeleteOptions) => void;
1743
+ /**
1744
+ * Insert a fragment in the editor
1745
+ * at the specified location or (if not defined) the current selection or (if not defined) the end of the document.
1746
+ */
1747
+ insertFragment: (editor: Editor, fragment: Node_2[], options?: TextInsertFragmentOptions) => void;
1748
+ /**
1749
+ * Insert a string of text in the editor
1750
+ * at the specified location or (if not defined) the current selection or (if not defined) the end of the document.
1751
+ */
1752
+ insertText: (editor: Editor, text: string, options?: TextInsertTextOptions) => void;
1753
+ }
1754
+
1755
+ declare const TextTransforms: TextTransforms;
1756
+
1757
+ export declare type TextUnit = 'character' | 'word' | 'line' | 'block';
1758
+
1759
+ export declare type TextUnitAdjustment = TextUnit | 'offset';
1760
+
1761
+ export declare const Transforms: GeneralTransforms & NodeTransforms & SelectionTransforms & TextTransforms;
1762
+
1763
+ export declare const unhangRange: EditorInterface['unhangRange'];
1764
+
1765
+ export declare const unsetNodes: NodeTransforms['unsetNodes'];
1766
+
1767
+ export declare const unwrapNodes: NodeTransforms['unwrapNodes'];
1768
+
1769
+ declare type WithEditorFirstArg<T extends (...args: any) => any> = (editor: Editor, ...args: Parameters<T>) => ReturnType<T>;
1770
+
1771
+ export declare const withoutNormalizing: EditorInterface['withoutNormalizing'];
1772
+
1773
+ export declare const wrapNodes: NodeTransforms['wrapNodes'];
1774
+
1775
+ export { }
1776
+
1777
+
1778
+ declare global {
1779
+ interface Window {
1780
+ Selection: (typeof Selection)['constructor'];
1781
+ DataTransfer: (typeof DataTransfer)['constructor'];
1782
+ Node: (typeof Node)['constructor'];
1783
+ }
1784
+ }
1785
+
1786
+
1787
+ declare module 'slate' {
1788
+ interface CustomTypes {
1789
+ Text: BaseText & {
1790
+ placeholder?: string;
1791
+ onPlaceholderResize?: (node: HTMLElement | null) => void;
1792
+ [key: string]: unknown;
1793
+ };
1794
+ Range: BaseRange & {
1795
+ placeholder?: string;
1796
+ onPlaceholderResize?: (node: HTMLElement | null) => void;
1797
+ [key: string]: unknown;
1798
+ };
1799
+ }
1800
+ }
1801
+
1802
+
1803
+ declare global {
1804
+ interface Window {
1805
+ MSStream: boolean;
1806
+ }
1807
+ interface DocumentOrShadowRoot {
1808
+ getSelection(): Selection | null;
1809
+ }
1810
+ interface CaretPosition {
1811
+ readonly offsetNode: Node;
1812
+ readonly offset: number;
1813
+ getClientRect(): DOMRect | null;
1814
+ }
1815
+ interface Document {
1816
+ caretPositionFromPoint(x: number, y: number): CaretPosition | null;
1817
+ }
1818
+ interface Node {
1819
+ getRootNode(options?: GetRootNodeOptions): Document | ShadowRoot;
1820
+ }
1821
+ }