1 | import * as Immutable from "immutable";
|
2 | import { SyntheticEvent } from "react";
|
3 |
|
4 | export interface Data extends Immutable.Map<any, any> {}
|
5 |
|
6 | export namespace Data {
|
7 | function create(properties: Immutable.Map<string, any> | { [key: string]: any }): Data;
|
8 | function fromJSON(object: { [key: string]: any }): Data;
|
9 | function fromJS(object: { [key: string]: any }): Data;
|
10 | }
|
11 |
|
12 | export interface RulesByNodeType {
|
13 | [key: string]: Rules;
|
14 | }
|
15 |
|
16 | export interface ObjectAndType {
|
17 | object?: string | undefined;
|
18 | type?: string | undefined;
|
19 | }
|
20 |
|
21 | export interface Rules {
|
22 | data?: {
|
23 | [key: string]: (v: any) => boolean;
|
24 | } | undefined;
|
25 | first?: ObjectAndType | ObjectAndType[] | undefined;
|
26 | isAtomic?: boolean | undefined;
|
27 | isVoid?: boolean | undefined;
|
28 | last?: ObjectAndType | ObjectAndType[] | undefined;
|
29 | marks?:
|
30 | | Array<{
|
31 | type: string | ((type: string) => boolean);
|
32 | }>
|
33 | | undefined;
|
34 | next?: ObjectAndType | ObjectAndType[] | undefined;
|
35 | nodes?:
|
36 | | Array<{
|
37 | min?: number | undefined;
|
38 | max?: number | undefined;
|
39 | match?: ObjectAndType | ObjectAndType[] | undefined;
|
40 | }>
|
41 | | undefined;
|
42 | normalize?: ((editor: Editor, error: SlateError) => void) | undefined;
|
43 | parent?: ObjectAndType | ObjectAndType[] | undefined;
|
44 | text?: RegExp | ((text: string) => boolean) | undefined;
|
45 | previous?: ObjectAndType | ObjectAndType[] | undefined;
|
46 | }
|
47 |
|
48 | export interface SchemaProperties {
|
49 | rules?: Array<{ match: ObjectAndType | ObjectAndType[] } & Rules> | undefined;
|
50 | document?: Rules | undefined;
|
51 | blocks?: RulesByNodeType | undefined;
|
52 | inlines?: RulesByNodeType | undefined;
|
53 | marks?: RulesByNodeType | undefined;
|
54 | annotations?: RulesByNodeType | undefined;
|
55 | decorations?: RulesByNodeType | undefined;
|
56 | }
|
57 |
|
58 | export type Path = Immutable.List<number> | number[] | string;
|
59 | export interface ValueProperties {
|
60 | object?: "value" | undefined;
|
61 | annotations?: Immutable.Map<string, Annotation> | { [key: string]: AnnotationJSON } | undefined;
|
62 | data?: Data | { [key: string]: any } | undefined;
|
63 | document?: Document | undefined;
|
64 | selection?: Selection | undefined;
|
65 | }
|
66 |
|
67 | export interface ValueJSON {
|
68 | object?: "value" | undefined;
|
69 | annotations?: { [key: string]: AnnotationJSON } | undefined;
|
70 | data?: { [key: string]: any } | undefined;
|
71 | document?: DocumentJSON | undefined;
|
72 | selection?: SelectionJSON | undefined;
|
73 | }
|
74 |
|
75 | export class Value extends Immutable.Record({}) {
|
76 | object: "value";
|
77 | annotations: Immutable.Map<string, Annotation>;
|
78 | data: Data;
|
79 | document: Document;
|
80 | selection: Selection;
|
81 |
|
82 | readonly startBlock: Block;
|
83 | readonly endBlock: Block;
|
84 | readonly anchorBlock: Block;
|
85 | readonly focusBlock: Block;
|
86 | readonly nextBlock: Block;
|
87 | readonly previousBlock: Block;
|
88 |
|
89 | readonly startInline: Inline;
|
90 | readonly endInline: Inline;
|
91 | readonly anchorInline: Inline;
|
92 | readonly focusInline: Inline;
|
93 | readonly nextInline: Inline;
|
94 | readonly previousInline: Inline;
|
95 |
|
96 | readonly startText: Text;
|
97 | readonly endText: Text;
|
98 | readonly anchorText: Text;
|
99 | readonly focusText: Text;
|
100 | readonly nextText: Text;
|
101 | readonly previousText: Text;
|
102 |
|
103 | readonly marks: Immutable.OrderedSet<Mark>;
|
104 | readonly activeMarks: Immutable.OrderedSet<Mark>;
|
105 | readonly blocks: Immutable.List<Block>;
|
106 | readonly fragment: Document;
|
107 | readonly inlines: Immutable.List<Inline>;
|
108 | readonly texts: Immutable.List<Text>;
|
109 |
|
110 | static create(properties?: ValueProperties | ValueJSON | Value): Value;
|
111 | static createProperties(attrs: ValueProperties | ValueJSON | Value): ValueProperties;
|
112 | static fromJSON(properties: ValueProperties | ValueJSON): Value;
|
113 | static fromJS(properties: ValueProperties | ValueJSON): Value;
|
114 | static isValue(maybeValue: any): maybeValue is Value;
|
115 |
|
116 | toJSON(options?: {
|
117 | preserveAnnotations?: boolean | undefined;
|
118 | preserveData?: boolean | undefined;
|
119 | preserveSelection?: boolean | undefined;
|
120 | }): ValueJSON;
|
121 | toJS(options?: {
|
122 | preserveAnnotations?: boolean | undefined;
|
123 | preserveData?: boolean | undefined;
|
124 | preserveSelection?: boolean | undefined;
|
125 | }): ValueJSON;
|
126 | addAnnotation(annotation: Annotation | AnnotationProperties | AnnotationJSON): Value;
|
127 | addMark(path: Path, mark: MarkProperties | MarkJSON | Mark | string): Value;
|
128 | insertNode(path: Path, node: Node): Value;
|
129 | insertText(
|
130 | path: Path,
|
131 | offset: number,
|
132 | text: string,
|
133 | ): Value;
|
134 | mergeNode(path: Path): Value;
|
135 | moveNode(path: Immutable.List<number>, newPath: Immutable.List<number>, newIndex?: number): Value;
|
136 | removeAnnotation(annotation: Annotation | AnnotationProperties | AnnotationJSON): Value;
|
137 | removeMark(path: Path, mark: MarkProperties | MarkJSON | Mark | string): Value;
|
138 | removeNode(path: Path): Value;
|
139 | removeText(path: Path, offset: number, text: string): Value;
|
140 | setAnnotation(
|
141 | properties: AnnotationProperties | AnnotationJSON | Annotation,
|
142 | newProperties: AnnotationProperties | AnnotationJSON | Annotation,
|
143 | ): Value;
|
144 | setNode(path: Path, properties: NodeProperties): Value;
|
145 | setMark(
|
146 | path: Path,
|
147 | properties: MarkProperties,
|
148 | newProperties: MarkProperties,
|
149 | ): Value;
|
150 | setProperties(properties: ValueProperties): Value;
|
151 | setSelection(
|
152 | properties:
|
153 | | RangeTypeProperties
|
154 | | RangeTypeJSON
|
155 | | RangeType
|
156 | | string,
|
157 | ): Value;
|
158 | splitNode(
|
159 | path: Path,
|
160 | position: number,
|
161 | properties: NodeProperties,
|
162 | ): Value;
|
163 | mapRanges(iterator: (val: Selection | Annotation) => any): Value;
|
164 | mapPoints(iterator: (point: Point) => Point): Value;
|
165 | }
|
166 |
|
167 | export interface DocumentProperties {
|
168 | object?: "document" | undefined;
|
169 | nodes?: Immutable.List<Node> | Node[] | undefined;
|
170 | key?: string | undefined;
|
171 | data?: Data | { [key: string]: any } | undefined;
|
172 | }
|
173 |
|
174 | export interface DocumentJSON {
|
175 | object?: "document" | undefined;
|
176 | nodes?: NodeJSON[] | undefined;
|
177 | key?: string | undefined;
|
178 | data?: { [key: string]: any } | undefined;
|
179 | }
|
180 |
|
181 | export class Document extends BaseNode {
|
182 | object: "document";
|
183 |
|
184 | static create(
|
185 | properties:
|
186 | | DocumentProperties
|
187 | | DocumentJSON
|
188 | | Document
|
189 | | Array<NodeJSON | NodeProperties | Node>
|
190 | | Immutable.List<NodeJSON | NodeProperties | Node>,
|
191 | ): Document;
|
192 | static fromJSON(properties: DocumentJSON | DocumentProperties | Document): Document;
|
193 | static fromJS(properties: DocumentJSON | DocumentProperties | Document): Document;
|
194 | static isDocument(maybeDocument: any): maybeDocument is Document;
|
195 |
|
196 | toJSON(): DocumentJSON;
|
197 | toJS(): DocumentJSON;
|
198 | }
|
199 |
|
200 | export interface BlockProperties {
|
201 | object?: "block" | undefined;
|
202 | type: string;
|
203 | key?: string | undefined;
|
204 | nodes?: Immutable.List<Block | Text | Inline> | Array<Block | Text | Inline> | undefined;
|
205 | data?: Data | { [key: string]: any } | undefined;
|
206 | }
|
207 |
|
208 | export interface BlockJSON {
|
209 | object?: "block" | undefined;
|
210 | type: string;
|
211 | key?: string | undefined;
|
212 | nodes?: Array<BlockJSON | InlineJSON | TextJSON> | undefined;
|
213 | data?: { [key: string]: any } | undefined;
|
214 | }
|
215 |
|
216 | export class Block extends BaseNode {
|
217 | object: "block";
|
218 | nodes: Immutable.List<Block | Text | Inline>;
|
219 |
|
220 | static create(
|
221 | properties:
|
222 | | BlockProperties
|
223 | | BlockJSON
|
224 | | Block
|
225 | | string,
|
226 | ): Block;
|
227 | static createList(
|
228 | array?:
|
229 | | Array<BlockProperties | BlockJSON | Block | string>
|
230 | | Immutable.List<BlockProperties | BlockJSON | Block | string>,
|
231 | ): Immutable.List<Block>;
|
232 | static fromJSON(properties: BlockJSON | BlockProperties | Block): Block;
|
233 | static fromJS(properties: BlockJSON | BlockProperties | Block): Block;
|
234 | static isBlock(maybeBlock: any): maybeBlock is Block;
|
235 | static isBlockList(
|
236 | maybeBlockList: any,
|
237 | ): maybeBlockList is Immutable.List<Block>;
|
238 |
|
239 | toJSON(): BlockJSON;
|
240 | toJS(): BlockJSON;
|
241 | }
|
242 |
|
243 | export interface InlineProperties {
|
244 | object?: "inline" | undefined;
|
245 | type: string;
|
246 | key?: string | undefined;
|
247 | nodes?: Immutable.List<Inline | Text> | Array<Inline | Text> | undefined;
|
248 | data?: Data | { [key: string]: any } | undefined;
|
249 | }
|
250 |
|
251 | export interface InlineJSON {
|
252 | object?: "inline" | undefined;
|
253 | type: string;
|
254 | key?: string | undefined;
|
255 | nodes?: Array<InlineJSON | TextJSON> | undefined;
|
256 | data?: { [key: string]: any } | undefined;
|
257 | }
|
258 |
|
259 | export class Inline extends BaseNode {
|
260 | object: "inline";
|
261 | nodes: Immutable.List<Inline | Text>;
|
262 |
|
263 | static create(
|
264 | properties:
|
265 | | InlineProperties
|
266 | | InlineJSON
|
267 | | Inline
|
268 | | string,
|
269 | ): Inline;
|
270 | static createList(
|
271 | elements?:
|
272 | | Immutable.List<InlineProperties | InlineJSON | Inline | string>
|
273 | | Array<InlineProperties | InlineJSON | Inline | string>,
|
274 | ): Immutable.List<Inline>;
|
275 | static fromJSON(
|
276 | properties:
|
277 | | InlineProperties
|
278 | | InlineJSON
|
279 | | Inline,
|
280 | ): Inline;
|
281 | static fromJS(
|
282 | properties:
|
283 | | InlineProperties
|
284 | | InlineJSON
|
285 | | Inline,
|
286 | ): Inline;
|
287 | static isInline(maybeInline: any): maybeInline is Inline;
|
288 | static isInlineList(
|
289 | maybeInlineList: any,
|
290 | ): maybeInlineList is Immutable.List<Inline>;
|
291 |
|
292 | toJSON(): InlineJSON;
|
293 | toJS(): InlineJSON;
|
294 | }
|
295 |
|
296 | export interface TextProperties {
|
297 | object?: "text" | undefined;
|
298 | key?: string | undefined;
|
299 | text?: string | undefined;
|
300 | marks?: Immutable.Set<Mark> | Mark[] | undefined;
|
301 | }
|
302 |
|
303 | export interface TextJSON {
|
304 | object?: "text" | undefined;
|
305 | key?: string | undefined;
|
306 | text?: string | undefined;
|
307 | marks?: MarkJSON[] | undefined;
|
308 | }
|
309 |
|
310 | export interface LeafAndOffset {
|
311 | startOffset: number;
|
312 | endOffset: number;
|
313 | index: number;
|
314 | leaf: Leaf;
|
315 | }
|
316 |
|
317 | export class Text extends Immutable.Record({}) {
|
318 | object: "text";
|
319 | key: string;
|
320 |
|
321 | readonly text: string;
|
322 | readonly marks: Immutable.Set<Mark> | null;
|
323 |
|
324 | static create(properties?: TextProperties | TextJSON | Text | string): Text;
|
325 | static createList(
|
326 | elements?:
|
327 | | Array<TextProperties | TextJSON | Text | string>
|
328 | | Immutable.List<TextProperties | TextJSON | Text | string>,
|
329 | ): Immutable.List<Text>;
|
330 | static fromJSON(properties: TextJSON | TextProperties | Text): Text;
|
331 | static fromJS(properties: TextJSON | TextProperties | Text): Text;
|
332 | static isText(maybeText: any): maybeText is Text;
|
333 | static isTextList(maybeTextList: any): maybeTextList is Immutable.List<Text>;
|
334 |
|
335 | toJSON(options?: { preserveKeys?: boolean | undefined }): TextJSON;
|
336 | toJS(options?: { preserveKeys?: boolean | undefined }): TextJSON;
|
337 |
|
338 | addMark(mark: MarkProperties | MarkJSON | Mark | string): Text;
|
339 | addMarks(
|
340 | marks:
|
341 | | Array<MarkProperties | MarkJSON | Mark | string>
|
342 | | Immutable.Set<MarkProperties | MarkJSON | Mark | string>,
|
343 | ): Text;
|
344 | getKeysToPathsTable(): { [key: string]: number[] };
|
345 | getLeaves(
|
346 | annotations: Immutable.Map<string, Annotation>,
|
347 | decorations?: Decoration[] | Immutable.List<Decoration>,
|
348 | ): Immutable.List<Leaf>;
|
349 | getFirstText(): Text | null;
|
350 | getLastText(): Text | null;
|
351 | getText(): string;
|
352 | getNode(path: Path): Node | null;
|
353 | getPath(key: Immutable.List<number> | string | Node): Immutable.List<number> | null;
|
354 | hasNode(path: Path): boolean;
|
355 | insertText(index: number, string: string): Text;
|
356 | regenerateKey(): Text;
|
357 | removeMark(mark: MarkProperties | MarkJSON | Mark | string): Text;
|
358 | removeText(index: number, length: number): Text;
|
359 | resolvePath(path: Path, index?: number): Immutable.List<number>;
|
360 | setMark(
|
361 | properties: MarkProperties | MarkJSON | Mark | string,
|
362 | newProperties: MarkProperties,
|
363 | ): Text;
|
364 | splitText(index: number): Text[];
|
365 | mergeText(other: Text): Text;
|
366 | normalize(editor: Editor): () => void | void;
|
367 |
|
368 | validate(editor: Editor): Error | void;
|
369 | }
|
370 |
|
371 | export interface LeafProperties {
|
372 | object?: "leaf" | undefined;
|
373 | marks?: Immutable.Set<Mark> | Mark[] | undefined;
|
374 | text?: string | undefined;
|
375 | }
|
376 |
|
377 | export interface LeafJSON {
|
378 | object?: "leaf" | undefined;
|
379 | marks?: MarkJSON[] | undefined;
|
380 | text?: string | undefined;
|
381 | }
|
382 |
|
383 | export class Leaf extends Immutable.Record({}) {
|
384 | object: "leaf";
|
385 | marks: Immutable.Set<Mark> | null;
|
386 | text: string;
|
387 |
|
388 | static create(properties: LeafProperties | LeafJSON | Leaf): Leaf;
|
389 | static createLeaves(leaves: Immutable.List<Leaf>): Immutable.List<Leaf>;
|
390 | static splitLeaves(
|
391 | leaves: Immutable.List<Leaf>,
|
392 | offset: number,
|
393 | ): Array<Immutable.List<Leaf>>;
|
394 | static createList(
|
395 | attrs?:
|
396 | | Array<LeafProperties | LeafJSON | Leaf>
|
397 | | Immutable.List<LeafProperties | LeafJSON | Leaf>,
|
398 | ): Immutable.List<Leaf>;
|
399 | static fromJSON(properties: LeafJSON | LeafProperties): Leaf;
|
400 | static fromJS(properties: LeafJSON | LeafProperties): Leaf;
|
401 | static isLeaf(maybeLeaf: any): maybeLeaf is Leaf;
|
402 | static isLeafList(
|
403 | maybeLeafList: any,
|
404 | ): maybeLeafList is Immutable.List<Leaf>;
|
405 |
|
406 | updateMark(mark: Mark, newMark: Mark): Leaf;
|
407 | addMarks(marks: Immutable.Set<Mark>): Leaf;
|
408 | addMark(mark: Mark): Leaf;
|
409 | removeMark(mark: Mark): Leaf;
|
410 |
|
411 | insertText(offset: number, string: string): Leaf;
|
412 |
|
413 | toJSON(): LeafJSON;
|
414 | toJS(): LeafJSON;
|
415 | }
|
416 |
|
417 | interface IterableOptions {
|
418 | direction?: string | undefined;
|
419 | downward?: boolean | undefined;
|
420 | upward?: boolean | undefined;
|
421 | includeBlocks?: boolean | undefined;
|
422 | includeDocument?: boolean | undefined;
|
423 | includeInlines?: boolean | undefined;
|
424 | includeRoot?: boolean | undefined;
|
425 | includeTarget?: boolean | undefined;
|
426 | includeTargetAncestors?: boolean | undefined;
|
427 | includeTexts?: boolean | undefined;
|
428 | match?: ((node: Node, path: Immutable.List<number>) => boolean | null) | undefined;
|
429 | range?: RangeProperties | RangeJSON | Range | undefined;
|
430 | path?: Path | undefined;
|
431 | }
|
432 |
|
433 | export namespace NodeFactory {
|
434 | function create(attrs: Node | NodeJSON | NodeProperties): Node;
|
435 | function createList(
|
436 | elements?:
|
437 | | Array<Node | NodeJSON | NodeProperties>
|
438 | | Immutable.List<Node | NodeJSON | NodeProperties>,
|
439 | ): Immutable.List<Node>;
|
440 | function createProperties(
|
441 | attrs?: Block | Inline | string | { type?: string | undefined; data?: object | undefined },
|
442 | ): NodeProperties;
|
443 | function fromJSON(value: { [key: string]: any }): NodeJSON;
|
444 | function fromJS(value: { [key: string]: any }): NodeJSON;
|
445 | function isNode(maybeNode: any): maybeNode is Node;
|
446 | function isNodeList(maybeNodeList: any): maybeNodeList is Immutable.List<Node>;
|
447 | }
|
448 |
|
449 | export type Node = Document | Block | Inline | Text;
|
450 | export type NodeJSON = DocumentJSON | BlockJSON | InlineJSON | TextJSON;
|
451 | export type NodeProperties =
|
452 | | DocumentProperties
|
453 | | BlockProperties
|
454 | | InlineProperties
|
455 | | TextProperties;
|
456 |
|
457 | declare class BaseNode extends Immutable.Record({}) {
|
458 | data: Data;
|
459 | type: string;
|
460 | key: string;
|
461 | object: "document" | "block" | "inline" | "text";
|
462 | nodes: Immutable.List<Node>;
|
463 |
|
464 | readonly text: string;
|
465 |
|
466 | static isNode(maybeNode: any): maybeNode is Node;
|
467 | static isNodeList(
|
468 | maybeNodeList: any,
|
469 | ): maybeNodeList is Immutable.List<Node>;
|
470 | static createProperties(
|
471 | attrs: NodeProperties | string | Node,
|
472 | ): NodeProperties;
|
473 | static fromJSON(value: NodeJSON | NodeProperties | Node): Node;
|
474 | static fromJS(value: NodeJSON | NodeProperties | Node): Node;
|
475 |
|
476 | addMark(path: Path, mark: Mark): Node;
|
477 | ancestors(path: Path): Iterable<[Node, Immutable.List<number>]>;
|
478 | blocks(
|
479 | options?: IterableOptions & {
|
480 | onlyLeaves?: boolean | undefined;
|
481 | onlyRoots?: boolean | undefined;
|
482 | onlyTypes?: string[] | undefined;
|
483 | },
|
484 | ): Iterable<[Block, Immutable.List<number>]>;
|
485 | createAnnotation(properties: AnnotationProperties | AnnotationJSON | Annotation): Annotation;
|
486 | createDecoration(properties: DecorationProperties | DecorationJSON | Decoration): Decoration;
|
487 | createIterable(options?: IterableOptions): Iterable<[Node, Immutable.List<number>]>;
|
488 | createPoint(properties: PointProperties | PointJSON | Point): Point;
|
489 | createRange(properties: RangeTypeProperties | RangeTypeJSON | RangeType): Range;
|
490 | createSelection(properties: SelectionProperties | SelectionJSON | Selection | Range): Selection;
|
491 | descendants(options?: IterableOptions): Iterable<[Node, Immutable.List<number>]>;
|
492 | filterDescendants(predicate?: (node: Node, path: Immutable.List<number>) => boolean): Immutable.List<Node>;
|
493 | findDescendant(predicate?: (node: Node, path: Immutable.List<number>) => boolean): Node | null;
|
494 | forEachDescendant(predicate?: (node: Node, path: Immutable.List<number>) => boolean): void;
|
495 | getActiveMarksAtRange(range: RangeTypeProperties | RangeTypeJSON | RangeType): Immutable.Set<Mark>;
|
496 | getAncestors(path: Path): Immutable.List<Node> | null;
|
497 | getBlocks(): Immutable.List<Block>;
|
498 | getBlocksByType(type: string): Immutable.List<Block>;
|
499 | getChild(path: Path): Node | null;
|
500 | getClosest(path: Path, predicate: (node: Node, path: Immutable.List<number>) => boolean): Node | null;
|
501 | getClosestBlock(path: Path): Block | null;
|
502 | getClosestInline(path: Path): Inline | null;
|
503 | getClosestVoid(path: Path, editor: Editor): Node | null;
|
504 | getCommonAncestor(a: Path, b: Path): Node | null;
|
505 | getDecorations(editor: Editor): Immutable.List<Decoration>;
|
506 | getDepth(path: Path, startAt?: number): number | null;
|
507 | getDescendant(path: Path): Node | null;
|
508 | getDescendantsAtRange(range: RangeTypeProperties | RangeTypeJSON | RangeType): Immutable.List<Node>;
|
509 | getFirstText(): Text | null;
|
510 | getFragmentAtRange(range: RangeTypeProperties | RangeTypeJSON | RangeType): Document;
|
511 | getFurthest(path: Path, predicate?: (node: Node, path: Immutable.List<number>) => boolean): Node | null;
|
512 | getFurthestBlock(path: Path): Block | null;
|
513 | getFurthestChild(path: Path): Node | null;
|
514 | getFurthestInline(path: Path): Inline | null;
|
515 | getInlines(): Immutable.List<Inline>;
|
516 | getInlinesByType(type: string): Immutable.List<Inline>;
|
517 | getInsertMarksAtPoint(point: PointProperties | PointJSON | Point): Immutable.Set<Mark>;
|
518 | getInsertMarksAtRange(range: RangeProperties | RangeJSON | Range): Immutable.Set<Mark>;
|
519 | getKeysToPathsTable(): { [key: string]: number[] };
|
520 | getLastText(): Text | null;
|
521 | getLeafBlocksAtRange(range: RangeTypeProperties | RangeTypeJSON | RangeType): Immutable.List<Block>;
|
522 | getLeafInlinesAtRange(range: RangeTypeProperties | RangeTypeJSON | RangeType): Immutable.List<Inline>;
|
523 | getNode(path: Path): Node | null;
|
524 | getNodesToPathsMap(): Map<Node, Immutable.List<number>>;
|
525 | getMarks(): Immutable.OrderedSet<Mark>;
|
526 | getMarksAtRange(range: RangeTypeProperties | RangeTypeJSON | RangeType): Immutable.OrderedSet<Mark>;
|
527 | getMarksByType(type: string): Immutable.OrderedSet<Mark>;
|
528 | getNextBlock(path: Path): Block | null;
|
529 | getNextNode(path: Path): Node | null;
|
530 | getNextSibling(path: Path): Node | null;
|
531 | getNextText(path: Path): Text | null;
|
532 | getOffset(path: Path): number;
|
533 | getOffsetAtRange(range: RangeTypeProperties | RangeTypeJSON | RangeType): number;
|
534 | getParent(path: Path): Node | null;
|
535 | getPath(key: Immutable.List<number> | string | Node): Immutable.List<number> | null;
|
536 | getPreviousBlock(path: Path): Block | null;
|
537 | getPreviousNode(path: Path): Node | null;
|
538 | getPreviousSibling(path: Path): Node | null;
|
539 | getPreviousText(path: Path): Text | null;
|
540 | getRootBlocksAtRange(range: RangeTypeProperties | RangeTypeJSON | RangeType): Immutable.List<Block>;
|
541 | getRootInlinesAtRange(range: RangeTypeProperties | RangeTypeJSON | RangeType): Immutable.List<Inline>;
|
542 | getText(): string;
|
543 | getTextAtOffset(offset: number): Text | null;
|
544 | getTextDirection(): string | null;
|
545 | getTexts(): Immutable.List<Text>;
|
546 | getTextsAtRange(range: RangeTypeProperties | RangeTypeJSON | RangeType): Immutable.List<Text>;
|
547 | hasBlockChildren(): boolean;
|
548 | hasChild(path: Path): boolean;
|
549 | hasInlineChildren(): boolean;
|
550 | hasDescendant(path: Path): boolean;
|
551 | hasNode(path: Path): boolean;
|
552 | hasVoidParent(path: Path, editor: Editor): boolean;
|
553 | inlines(
|
554 | options?: IterableOptions & {
|
555 | onlyLeaves?: boolean | undefined;
|
556 | onlyRoots?: boolean | undefined;
|
557 | onlyTypes?: string[] | undefined;
|
558 | },
|
559 | ): Iterable<[Inline, Immutable.List<number>]>;
|
560 | insertNode(path: Path, node: Node): Node;
|
561 | insertText(
|
562 | path: Path,
|
563 | offset: number,
|
564 | text: string,
|
565 | ): Node;
|
566 | isLeafBlock(): this is Block;
|
567 | isLeafInline(): this is Inline;
|
568 | isInRange(path: Path, range: RangeTypeProperties | RangeTypeJSON | RangeType): boolean;
|
569 | mapChildren(predicate?: (node: Node, index: number, nodes: Immutable.List<Node>) => Node): Node;
|
570 | // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
571 | mapDescendants(predicate?: (node: Node, index: number, nodes: Immutable.List<Node>) => Node): Node | void;
|
572 | marks(options?: IterableOptions & { onlyTypes: string[] }): Iterable<[Mark, Node, Immutable.List<number>]>;
|
573 | mergeNode(path: Path): Node;
|
574 | moveNode(path: Path, newPath: Path, newIndex?: number): Node;
|
575 | normalize(editor: Editor): () => void | void;
|
576 | regenerateKey(): Node;
|
577 | removeMark(path: Path, mark: Mark): Node;
|
578 | removeNode(path: Path): Node;
|
579 | removeText(path: Path, offset: number, text: string): Node;
|
580 | replaceNode(path: Path, node: Node): Node;
|
581 | resolveAnnotation(annotation: Annotation | AnnotationProperties | AnnotationJSON): Annotation;
|
582 | resolveDecoration(decoration: RangeType | RangeTypeProperties | RangeTypeJSON): Decoration;
|
583 | resolvePath(path: Path, index?: number): Immutable.List<number>;
|
584 | resolvePoint(point: Point | PointProperties | PointJSON): Point;
|
585 | resolveRange(range: RangeTypeProperties | RangeTypeJSON | RangeType): Range;
|
586 | resolveSelection(selection: Selection | SelectionProperties | SelectionJSON | Range): Selection;
|
587 | setNode(path: Path, properties: NodeProperties): Node;
|
588 | setMark(
|
589 | path: Path,
|
590 | properties: MarkProperties,
|
591 | newProperties: MarkProperties,
|
592 | ): Node;
|
593 | siblings(path: Path, options?: IterableOptions): Iterable<[Node, Immutable.List<number>]>;
|
594 | splitNode(path: Path, position: number, properties: NodeProperties): Node;
|
595 | texts(options: IterableOptions): Iterable<[Text, Immutable.List<number>]>;
|
596 |
|
597 | validate(editor: Editor): Error | void;
|
598 |
|
599 | |
600 |
|
601 |
|
602 |
|
603 | getBlocksAtRange(range: RangeProperties | RangeJSON | Range): Immutable.List<Block>;
|
604 | getBlocksAtRangeAsArray(range: RangeProperties | RangeJSON | Range): Block[];
|
605 | getInlinesAtRange(range: RangeProperties | RangeJSON | Range): Immutable.List<Inline>;
|
606 | getInlinesAtRangeAsArray(range: RangeProperties | RangeJSON | Range): Inline[];
|
607 | getNextTextAndPath(path: Path): Text | null;
|
608 | getNextDeepMatchingNodeAndPath(
|
609 | path: Immutable.List<number>,
|
610 | iterator?: () => boolean,
|
611 | ): null | [Node, Immutable.List<number>];
|
612 | getPreviousTextAndPath(path: Path): Text | null;
|
613 | findFirstDescendantAndPath(
|
614 | iterator: (
|
615 | node: Node,
|
616 | path: Immutable.List<number>,
|
617 | nodes: Immutable.List<Node>,
|
618 | ) => boolean,
|
619 | pathToThisNode: Immutable.List<number>,
|
620 | ): [Node, Immutable.List<number>] | null;
|
621 | getPreviousMatchingNodeAndPath(
|
622 | path: Immutable.List<number>,
|
623 | iterator?: (node: Node) => boolean,
|
624 | ): [Node, Immutable.List<number>] | null;
|
625 | getPreviousDeepMatchingNodeAndPath(
|
626 | path: Immutable.List<number>,
|
627 | iterator?: (node: Node) => boolean,
|
628 | ): [Node, Immutable.List<number>] | null;
|
629 | findLastDescendantAndPath(
|
630 | iterator: (
|
631 | node: Node,
|
632 | path: Immutable.List<number>,
|
633 | nodes: Immutable.List<Node>,
|
634 | ) => boolean,
|
635 | pathToThisNode: Immutable.List<number>,
|
636 | ): [Node, Immutable.List<number>] | null;
|
637 | findDescendantAndPath(
|
638 | iterator: (
|
639 | node: Node,
|
640 | path: Immutable.List<number>,
|
641 | nodes: Immutable.List<Node>,
|
642 | ) => boolean,
|
643 | path?: Immutable.List<number>,
|
644 | findLast?: boolean,
|
645 | ): [Node, Immutable.List<number>] | null;
|
646 | forEachDescendantWithPath(
|
647 | iterator: (
|
648 | node: Node,
|
649 | path: Immutable.List<number>,
|
650 | nodes: Immutable.List<Node>,
|
651 | ) => boolean,
|
652 | path?: Immutable.List<number>,
|
653 | findLast?: boolean,
|
654 | ): boolean;
|
655 | getNextMatchingNodeAndPath(
|
656 | path: Immutable.List<number>,
|
657 | iterator?: (node: Node) => boolean,
|
658 | ): [Node, Immutable.List<number>] | null;
|
659 | getSelectionIndexes(range: RangeType, isSelected?: boolean): { start: number; end: number } | boolean | null;
|
660 | getTextsBetweenPositionsAsArray(startPath: Path, endPath: Path): Array<Node | null>;
|
661 | getOrderedMarksBetweenPositions(
|
662 | startPath: Path,
|
663 | startOffset: number,
|
664 | endPath: Path,
|
665 | endOffset: number,
|
666 | ): Immutable.OrderedSet<Mark>;
|
667 | getTextsBetweenPathPositionsAsArray(
|
668 | startPath: Immutable.List<number>,
|
669 | endPath: Immutable.List<number>,
|
670 | ): Array<Node | null>;
|
671 | getFurthestAncestor(path: Path): Node | null;
|
672 | getLeafBlocksAtRangeAsArray(range: Range | RangeProperties | RangeJSON): Block[];
|
673 | getLeafBlocksBetweenPathPositionsAsArray(
|
674 | startPath: Immutable.List<number>,
|
675 | endPath: Immutable.List<number>,
|
676 | ): Block[];
|
677 | getBlocksAsArray(): Block[];
|
678 | getBlocksByTypeAsArray(type: string): Block[];
|
679 | getFurthestOnlyChildAncestor(path: Path): Node | null;
|
680 | getInlinesAsArray(): Inline[];
|
681 | getInlinesByTypeAsArray(type: string): Inline[];
|
682 | getLeafInlinesAtRangeAsArray(range: Range | RangeProperties | RangeJSON): Inline[];
|
683 | getOrderedMarks(): Immutable.OrderedSet<Mark>;
|
684 | getOrderedMarksAtRange(range: RangeProperties | RangeJSON | Range): Immutable.OrderedSet<Mark>;
|
685 | getOrderedMarksByType(type: string): Immutable.OrderedSet<Mark>;
|
686 | getOrderedMarksByTypeAsArray(type: string): Mark[];
|
687 | getMarksAsArray(): Mark[];
|
688 | getRootInlinesAtRangeAsArray(range: RangeProperties | RangeJSON | Range): Inline[];
|
689 | getTextsAsArray(): Text[];
|
690 | getTextsAtRangeAsArray(range: RangeProperties | RangeJSON | Range): Text[];
|
691 | getMarksAtPosition(path: Path, offset: number): Immutable.OrderedSet<Mark>;
|
692 | getNodesAtRange(range: RangeProperties | RangeJSON | Range): boolean;
|
693 | isNodeInRange(path: Path, range: RangeProperties | RangeJSON | Range): boolean;
|
694 |
|
695 | |
696 |
|
697 |
|
698 |
|
699 | assertChild(path: Path): Node;
|
700 | assertDepth(path: Path, startAt?: number): number;
|
701 | assertDescendant(path: Path): Node;
|
702 | assertNode(path: Path): Node;
|
703 | assertParent(path: Path): Node;
|
704 | assertPath(key: Path): Immutable.List<number>;
|
705 | }
|
706 |
|
707 | export interface MarkProperties {
|
708 | object?: "mark" | undefined;
|
709 | type: string;
|
710 | data?: Data | { [key: string]: any } | undefined;
|
711 | }
|
712 |
|
713 | export interface MarkJSON {
|
714 | object?: "mark" | undefined;
|
715 | type: string;
|
716 | data?: { [key: string]: any } | undefined;
|
717 | }
|
718 |
|
719 | export class Mark extends Immutable.Record({}) {
|
720 | object: "mark";
|
721 | type: string;
|
722 | data: Data;
|
723 |
|
724 | static create(properties: MarkProperties | MarkJSON | Mark | string): Mark;
|
725 | static createSet(
|
726 | element?:
|
727 | | Array<MarkProperties | MarkJSON | Mark | string>
|
728 | | Immutable.Set<MarkProperties | MarkJSON | Mark | string>,
|
729 | ): Immutable.Set<Mark>;
|
730 | static createProperties(attrs: Partial<MarkProperties | MarkJSON | Mark | string>): MarkProperties;
|
731 | static fromJSON(properties: MarkProperties | MarkJSON | Mark): Mark;
|
732 | static fromJS(properties: MarkProperties | MarkJSON | Mark): Mark;
|
733 | static isMark(maybeMark: any): maybeMark is Mark;
|
734 | static isMarkSet(maybeMarkSet: any): maybeMarkSet is Immutable.Set<Mark>;
|
735 |
|
736 | toJSON(): MarkJSON;
|
737 | toJS(): MarkJSON;
|
738 | }
|
739 |
|
740 | export interface SelectionProperties {
|
741 | object?: "selection" | undefined;
|
742 | anchor?: Point | undefined;
|
743 | focus?: Point | undefined;
|
744 | isFocused?: boolean | undefined;
|
745 | marks?: Immutable.Set<Mark> | Mark[] | undefined;
|
746 | }
|
747 |
|
748 | export interface SelectionJSON {
|
749 | object?: "selection" | undefined;
|
750 | anchor?: PointJSON | undefined;
|
751 | focus?: PointJSON | undefined;
|
752 | isFocused?: boolean | undefined;
|
753 | marks?: MarkJSON[] | undefined;
|
754 | }
|
755 |
|
756 | export class Selection extends BaseRange {
|
757 | object: "selection";
|
758 | anchor: Point;
|
759 | focus: Point;
|
760 | isFocused: boolean;
|
761 | marks: Immutable.Set<Mark>;
|
762 |
|
763 | readonly isBlurred: boolean;
|
764 |
|
765 | static create(
|
766 | properties:
|
767 | | RangeTypeProperties
|
768 | | RangeTypeJSON
|
769 | | RangeType,
|
770 | ): Selection;
|
771 | static createProperties(
|
772 | attrs:
|
773 | | RangeTypeProperties
|
774 | | RangeTypeJSON
|
775 | | RangeType
|
776 | | string,
|
777 | ): SelectionProperties;
|
778 | static fromJSON(
|
779 | properties:
|
780 | | RangeTypeProperties
|
781 | | RangeTypeJSON,
|
782 | ): Selection;
|
783 | static fromJS(
|
784 | properties:
|
785 | | RangeTypeProperties
|
786 | | RangeTypeJSON,
|
787 | ): Selection;
|
788 |
|
789 | toJSON(): SelectionJSON;
|
790 | toJS(): SelectionJSON;
|
791 |
|
792 | isSelection(maybeSelection: any): maybeSelection is Selection;
|
793 | setIsFocused(value: boolean): Selection;
|
794 | setMarks(marks: Immutable.Set<Mark>): Selection;
|
795 | setProperties(
|
796 | properties:
|
797 | | RangeTypeProperties
|
798 | | RangeTypeJSON
|
799 | | RangeType
|
800 | | string,
|
801 | ): Selection;
|
802 | }
|
803 |
|
804 | export interface RangeProperties {
|
805 | object?: "range" | undefined;
|
806 | anchor?: Point | undefined;
|
807 | focus?: Point | undefined;
|
808 | }
|
809 |
|
810 | export interface RangeJSON {
|
811 | object?: "range" | undefined;
|
812 | anchor?: PointJSON | undefined;
|
813 | focus?: PointJSON | undefined;
|
814 | }
|
815 |
|
816 | export class Range extends BaseRange {
|
817 | object: "range";
|
818 | anchor: Point;
|
819 | focus: Point;
|
820 |
|
821 | static create(properties: RangeTypeProperties | RangeTypeJSON | RangeType): Range;
|
822 | static createList(
|
823 | elements?:
|
824 | | Array<RangeTypeProperties | RangeTypeJSON | RangeType>
|
825 | | Immutable.List<RangeTypeProperties | RangeTypeJSON | RangeType>,
|
826 | ): Immutable.List<Range>;
|
827 | static createProperties(
|
828 | attrs: RangeTypeProperties | RangeTypeJSON | RangeType,
|
829 | ): RangeProperties;
|
830 | static fromJSON(properties: RangeTypeJSON): Range;
|
831 | static fromJS(properties: RangeTypeJSON): Range;
|
832 | static isRange(maybeRange: any): maybeRange is RangeType;
|
833 |
|
834 | toJSON(options?: { preserveKeys?: boolean | undefined }): RangeJSON;
|
835 | toJS(options?: { preserveKeys?: boolean | undefined }): RangeJSON;
|
836 | }
|
837 |
|
838 | export interface DecorationProperties {
|
839 | object?: "decoration" | undefined;
|
840 | anchor?: Point | undefined;
|
841 | focus?: Point | undefined;
|
842 | type?: string | undefined;
|
843 | data?: Data | { [key: string]: any } | undefined;
|
844 | }
|
845 |
|
846 | export interface DecorationJSON {
|
847 | object?: "decoration" | undefined;
|
848 | anchor?: PointJSON | undefined;
|
849 | focus?: PointJSON | undefined;
|
850 | type?: string | undefined;
|
851 | data?: { [key: string]: any } | undefined;
|
852 | }
|
853 |
|
854 | export class Decoration extends BaseRange {
|
855 | object: "decoration";
|
856 | anchor: Point;
|
857 | focus: Point;
|
858 | type: string;
|
859 | data: Data;
|
860 |
|
861 | static create(
|
862 | properties:
|
863 | | RangeTypeProperties
|
864 | | RangeTypeJSON
|
865 | | RangeType,
|
866 | ): Decoration;
|
867 | static createList(
|
868 | elements?:
|
869 | | Array<RangeTypeProperties | RangeTypeJSON | RangeType>
|
870 | | Immutable.List<RangeTypeProperties | RangeTypeJSON | RangeType>,
|
871 | ): Immutable.List<Decoration>;
|
872 | static createProperties(
|
873 | attrs: RangeTypeProperties | RangeTypeJSON | RangeType,
|
874 | ): DecorationProperties;
|
875 | static fromJSON(properties: DecorationJSON & { mark?: MarkJSON | undefined }): Decoration;
|
876 | static fromJSON(properties: DecorationJSON & { mark?: MarkJSON | undefined }): Decoration;
|
877 | static isDecoration(maybeDecoration: any): maybeDecoration is Decoration;
|
878 |
|
879 | setProperties(properties: RangeTypeProperties | RangeTypeJSON | RangeType): Decoration;
|
880 |
|
881 | toJSON(): DecorationJSON;
|
882 | toJS(): DecorationJSON;
|
883 | }
|
884 |
|
885 | export interface AnnotationProperties {
|
886 | object?: "annotation" | undefined;
|
887 | key: string;
|
888 | type: string;
|
889 | data?: Data | { [key: string]: any } | undefined;
|
890 | anchor?: Point | undefined;
|
891 | focus?: Point | undefined;
|
892 | }
|
893 |
|
894 | export interface AnnotationJSON {
|
895 | object?: "annotation" | undefined;
|
896 | key: string;
|
897 | type: string;
|
898 | data?: { [key: string]: any } | undefined;
|
899 | anchor?: PointJSON | undefined;
|
900 | focus?: PointJSON | undefined;
|
901 | }
|
902 |
|
903 | export class Annotation extends BaseRange {
|
904 | object: "annotation";
|
905 | key: string;
|
906 | type: string;
|
907 | data: Data;
|
908 | anchor: Point;
|
909 | focus: Point;
|
910 |
|
911 | static create(properties: Annotation | AnnotationProperties | AnnotationJSON): Annotation;
|
912 | static createMap(
|
913 | elements?:
|
914 | | { [key: string]: Annotation | AnnotationProperties | AnnotationJSON }
|
915 | | Immutable.Map<string, Annotation>,
|
916 | ): Immutable.Map<string, Annotation>;
|
917 | static createProperties(
|
918 | attrs: AnnotationProperties | AnnotationJSON | Annotation,
|
919 | ): AnnotationProperties;
|
920 | static fromJSON(properties: AnnotationProperties | AnnotationJSON): Annotation;
|
921 | static fromJS(properties: AnnotationProperties | AnnotationJSON): Annotation;
|
922 | static isAnnotation(maybeAnnotation: any): maybeAnnotation is Annotation;
|
923 |
|
924 | toJSON(): AnnotationJSON;
|
925 | toJS(): AnnotationJSON;
|
926 |
|
927 | setProperties(properties: AnnotationProperties | AnnotationJSON | Annotation): Annotation;
|
928 | }
|
929 |
|
930 | export type RangeTypeProperties =
|
931 | | RangeProperties
|
932 | | SelectionProperties
|
933 | | DecorationProperties
|
934 | | AnnotationProperties;
|
935 |
|
936 | export type RangeTypeJSON = RangeJSON | SelectionJSON | DecorationJSON | AnnotationJSON;
|
937 | export type RangeType = Range | Selection | Decoration | Annotation;
|
938 |
|
939 | declare class BaseRange extends Immutable.Record({}) {
|
940 | readonly isCollapsed: boolean;
|
941 | readonly isExpanded: boolean;
|
942 | readonly isBackward: boolean;
|
943 | readonly isForward: boolean;
|
944 | readonly isUnset: boolean;
|
945 | readonly isSet: boolean;
|
946 | readonly start: Point;
|
947 | readonly end: Point;
|
948 |
|
949 | flip(): RangeType;
|
950 | moveForward(n?: number): RangeType;
|
951 | moveBackward(n?: number): RangeType;
|
952 |
|
953 | moveAnchorBackward(n?: number): RangeType;
|
954 | moveAnchorForward(n?: number): RangeType;
|
955 | moveAnchorTo(path: string | number | Immutable.List<number>, offset?: number): RangeType;
|
956 | moveAnchorToStartOfNode(node: Node): RangeType;
|
957 | moveAnchorToEndOfNode(node: Node): RangeType;
|
958 |
|
959 | moveEndBackward(n?: number): RangeType;
|
960 | moveEndForward(n?: number): RangeType;
|
961 | moveEndTo(path: string | number | Immutable.List<number>, offset?: number): RangeType;
|
962 | moveEndToStartOfNode(node: Node): RangeType;
|
963 | moveEndToEndOfNode(node: Node): RangeType;
|
964 |
|
965 | moveFocusBackward(n?: number): RangeType;
|
966 | moveFocusForward(n?: number): RangeType;
|
967 | moveFocusTo(path: string | number | Immutable.List<number>, offset?: number): RangeType;
|
968 | moveFocusToStartOfNode(node: Node): RangeType;
|
969 | moveFocusToEndOfNode(node: Node): RangeType;
|
970 |
|
971 | moveStartBackward(n?: number): RangeType;
|
972 | moveStartForward(n?: number): RangeType;
|
973 | moveStartTo(path: string | number | Immutable.List<number>, offset?: number): RangeType;
|
974 | moveStartToStartOfNode(node: Node): RangeType;
|
975 | moveStartToEndOfNode(node: Node): RangeType;
|
976 |
|
977 | moveToAnchor(): RangeType;
|
978 | moveToEnd(): RangeType;
|
979 | moveToEndOfNode(node: Node): RangeType;
|
980 | moveToFocus(): RangeType;
|
981 | moveToRangeOfNode(start: Node, end?: Node): RangeType;
|
982 | moveToStart(): RangeType;
|
983 | moveToStartOfNode(node: Node): RangeType;
|
984 |
|
985 | normalize(node: Node): RangeType;
|
986 |
|
987 | setAnchor(anchor: Point): RangeType;
|
988 | setEnd(point: Point): RangeType;
|
989 | setFocus(focus: Point): RangeType;
|
990 | setIsAtomic(value: boolean): RangeType;
|
991 | setIsFocused(value: boolean): RangeType;
|
992 | setMarks(marks: Immutable.Set<Mark>): RangeType;
|
993 | setPoints(values: Point[]): RangeType;
|
994 | updatePoints(updater: (point: Point) => Point): RangeType;
|
995 | setStart(point: Point): RangeType;
|
996 | setProperties(
|
997 | properties: RangeTypeProperties | RangeTypeJSON | RangeType,
|
998 | ): RangeType;
|
999 |
|
1000 | toJSON(): RangeTypeJSON;
|
1001 | toJS(): RangeTypeJSON;
|
1002 | toRange(): RangeType;
|
1003 | unset(): RangeType;
|
1004 | }
|
1005 |
|
1006 | export interface PointProperties {
|
1007 | object?: "point" | undefined;
|
1008 | key?: string | undefined;
|
1009 | offset?: number | undefined;
|
1010 | path?: Immutable.List<number> | undefined;
|
1011 | }
|
1012 |
|
1013 | export interface PointJSON {
|
1014 | object?: "point" | undefined;
|
1015 | key?: string | undefined;
|
1016 | offset?: number | undefined;
|
1017 | path?: number[] | undefined;
|
1018 | }
|
1019 |
|
1020 | export class Point extends Immutable.Record({}) {
|
1021 | object: "point";
|
1022 | key: string;
|
1023 | offset: number;
|
1024 | path: Immutable.List<number>;
|
1025 |
|
1026 | static create(properties: PointProperties | PointJSON | Point): Point;
|
1027 | static createProperties(properties: PointProperties | PointJSON | Point): Point;
|
1028 | static fromJSON(properties: PointJSON | PointProperties): Point;
|
1029 | static fromJS(properties: PointJSON | PointProperties): Point;
|
1030 | static isPoint(maybePoint: any): maybePoint is Point;
|
1031 |
|
1032 | readonly isSet: boolean;
|
1033 | readonly isUnset: boolean;
|
1034 |
|
1035 | isAfterPoint(point: Point): boolean;
|
1036 | isAfterRange(range: RangeType): boolean;
|
1037 | isAtEndofRange(range: RangeType): boolean;
|
1038 | isAtStartOfRange(range: RangeType): boolean;
|
1039 | isBeforePoint(point: Point): boolean;
|
1040 | isBeforeRange(range: RangeType): boolean;
|
1041 | isInRange(range: RangeType): boolean;
|
1042 | isAtEndOfNode(node: Node): boolean;
|
1043 | isAtStartOfNode(node: Node): boolean;
|
1044 | isInNode(node: Node): boolean;
|
1045 |
|
1046 | moveBackward(n?: number): this;
|
1047 | moveForward(n?: number): this;
|
1048 | moveTo(path: string | number | Immutable.List<number>, offset?: number): this;
|
1049 | moveToStartOfNode(node: Node): this;
|
1050 | moveToEndOfNode(node: Node): this;
|
1051 | normalize(node: Node): this;
|
1052 | setKey(key: string): this;
|
1053 | setOffset(offset: number): this;
|
1054 | setPath(path: Immutable.List<number> | number[]): this;
|
1055 | toJSON(options?: { preserveKeys?: boolean | undefined }): PointJSON;
|
1056 | toJS(options?: { preserveKeys?: boolean | undefined }): PointJSON;
|
1057 | unset(): this;
|
1058 | }
|
1059 |
|
1060 | export type Operation =
|
1061 | | InsertTextOperation
|
1062 | | RemoveTextOperation
|
1063 | | AddMarkOperation
|
1064 | | RemoveMarkOperation
|
1065 | | SetMarkOperation
|
1066 | | AddAnnotationOperation
|
1067 | | RemoveAnnotationOperation
|
1068 | | SetAnnotationOperation
|
1069 | | InsertNodeOperation
|
1070 | | MergeNodeOperation
|
1071 | | MoveNodeOperation
|
1072 | | RemoveNodeOperation
|
1073 | | SetNodeOperation
|
1074 | | SplitNodeOperation
|
1075 | | SetSelectionOperation
|
1076 | | SetValueOperation;
|
1077 |
|
1078 | export interface OperationProperties {
|
1079 | object?: "operation" | undefined;
|
1080 | type: string;
|
1081 | text?: string | undefined;
|
1082 | target?: number | undefined;
|
1083 | properties?:
|
1084 | | NodeProperties
|
1085 | | ValueProperties
|
1086 | | SelectionProperties
|
1087 | | AnnotationProperties
|
1088 | | undefined;
|
1089 | position?: number | undefined;
|
1090 | path?: Immutable.List<number> | undefined;
|
1091 | offset?: number | undefined;
|
1092 | node?: Node | undefined;
|
1093 | newProperties?:
|
1094 | | NodeProperties
|
1095 | | ValueProperties
|
1096 | | SelectionProperties
|
1097 | | MarkProperties
|
1098 | | AnnotationProperties
|
1099 | | undefined;
|
1100 | newPath?: Immutable.List<number> | undefined;
|
1101 | mark?: Mark | undefined;
|
1102 | data?: Data | { [key: string]: any } | undefined;
|
1103 | annotation?: Annotation | undefined;
|
1104 | }
|
1105 |
|
1106 | export interface OperationJSON {
|
1107 | object?: "operation" | undefined;
|
1108 | type: string;
|
1109 | text?: string | undefined;
|
1110 | target?: number | undefined;
|
1111 | properties?:
|
1112 | | NodeJSON
|
1113 | | ValueJSON
|
1114 | | SelectionJSON
|
1115 | | AnnotationJSON
|
1116 | | undefined;
|
1117 | position?: number | undefined;
|
1118 | path?: number[] | undefined;
|
1119 | offset?: number | undefined;
|
1120 | node?: Node | undefined;
|
1121 | newProperties?:
|
1122 | | NodeJSON
|
1123 | | ValueJSON
|
1124 | | SelectionJSON
|
1125 | | MarkJSON
|
1126 | | AnnotationJSON
|
1127 | | undefined;
|
1128 | newPath?: number[] | undefined;
|
1129 | mark?: MarkJSON | undefined;
|
1130 | data?: { [key: string]: any } | undefined;
|
1131 | annotation?: AnnotationJSON | undefined;
|
1132 | }
|
1133 |
|
1134 | export class BaseOperation extends Immutable.Record({}) {
|
1135 | object: "operation";
|
1136 | type: string;
|
1137 |
|
1138 | static create(attrs?: Operation | OperationProperties | OperationJSON): Operation;
|
1139 | static createList():
|
1140 | | Immutable.List<Operation | OperationProperties | OperationJSON>
|
1141 | | Array<Operation | OperationProperties | OperationJSON>;
|
1142 |
|
1143 | static fromJSON(object: OperationProperties | OperationJSON): Operation;
|
1144 | static fromJS(object: OperationProperties | OperationJSON): Operation;
|
1145 |
|
1146 | static isOperation(maybeOperation: any): maybeOperation is Operation;
|
1147 | static isOperationList(maybeOperationList: any): maybeOperationList is Immutable.List<Operation>;
|
1148 |
|
1149 | toJSON(): OperationJSON;
|
1150 |
|
1151 | apply(value: Value): Value;
|
1152 | invert(): this;
|
1153 | }
|
1154 |
|
1155 | export class InsertTextOperation extends BaseOperation {
|
1156 | type: "insert_text";
|
1157 | path: Immutable.List<number>;
|
1158 | offset: number;
|
1159 | text: string;
|
1160 | data: Data;
|
1161 | }
|
1162 |
|
1163 | export class RemoveTextOperation extends BaseOperation {
|
1164 | type: "remove_text";
|
1165 | path: Immutable.List<number>;
|
1166 | offset: number;
|
1167 | text: string;
|
1168 | data: Data;
|
1169 | }
|
1170 |
|
1171 | export class AddMarkOperation extends BaseOperation {
|
1172 | type: "add_mark";
|
1173 | path: Immutable.List<number>;
|
1174 | mark: Mark;
|
1175 | data: Data;
|
1176 | }
|
1177 |
|
1178 | export class RemoveMarkOperation extends BaseOperation {
|
1179 | type: "remove_mark";
|
1180 | path: Immutable.List<number>;
|
1181 | mark: Mark;
|
1182 | data: Data;
|
1183 | }
|
1184 |
|
1185 | export class SetMarkOperation extends BaseOperation {
|
1186 | type: "set_mark";
|
1187 | path: Immutable.List<number>;
|
1188 | properties: MarkProperties;
|
1189 | newProperties: MarkProperties;
|
1190 | data: Data;
|
1191 | }
|
1192 |
|
1193 | export class AddAnnotationOperation extends BaseOperation {
|
1194 | type: "add_annotation";
|
1195 | annotation: Annotation;
|
1196 | data: Data;
|
1197 | }
|
1198 |
|
1199 | export class RemoveAnnotationOperation extends BaseOperation {
|
1200 | type: "remove_annotation";
|
1201 | annotation: Annotation;
|
1202 | data: Data;
|
1203 | }
|
1204 |
|
1205 | export class SetAnnotationOperation extends BaseOperation {
|
1206 | type: "set_annotation";
|
1207 | properties: AnnotationProperties;
|
1208 | newProperties: AnnotationProperties;
|
1209 | data: Data;
|
1210 | }
|
1211 |
|
1212 | export class InsertNodeOperation extends BaseOperation {
|
1213 | type: "insert_node";
|
1214 | path: Immutable.List<number>;
|
1215 | node: Node;
|
1216 | data: Data;
|
1217 | }
|
1218 |
|
1219 | export class MergeNodeOperation extends BaseOperation {
|
1220 | type: "merge_node";
|
1221 | path: Immutable.List<number>;
|
1222 | position: number;
|
1223 | properties: NodeProperties;
|
1224 | data: Data;
|
1225 | }
|
1226 |
|
1227 | export class MoveNodeOperation extends BaseOperation {
|
1228 | type: "move_node";
|
1229 | path: Immutable.List<number>;
|
1230 | newPath: Immutable.List<number>;
|
1231 | data: Data;
|
1232 | }
|
1233 |
|
1234 | export class RemoveNodeOperation extends BaseOperation {
|
1235 | type: "remove_node";
|
1236 | path: Immutable.List<number>;
|
1237 | node: Node;
|
1238 | data: Data;
|
1239 | }
|
1240 |
|
1241 | export class SetNodeOperation extends BaseOperation {
|
1242 | type: "set_node";
|
1243 | path: Immutable.List<number>;
|
1244 | properties: NodeProperties;
|
1245 | newProperties: NodeProperties;
|
1246 | data: Data;
|
1247 | }
|
1248 |
|
1249 | export class SplitNodeOperation extends BaseOperation {
|
1250 | type: "split_node";
|
1251 | path: Immutable.List<number>;
|
1252 | position: number;
|
1253 | target: number;
|
1254 | properties: NodeProperties;
|
1255 | data: Data;
|
1256 | }
|
1257 |
|
1258 | export class SetSelectionOperation extends BaseOperation {
|
1259 | type: "set_selection";
|
1260 | properties: SelectionProperties;
|
1261 | newProperties: SelectionProperties;
|
1262 | data: Data;
|
1263 | }
|
1264 |
|
1265 | export class SetValueOperation extends BaseOperation {
|
1266 | type: "set_value";
|
1267 | properties: ValueProperties;
|
1268 | newProperties: ValueProperties;
|
1269 | data: Data;
|
1270 | }
|
1271 |
|
1272 | export type ErrorCode =
|
1273 | | "child_max_invalid"
|
1274 | | "child_min_invalid"
|
1275 | | "child_object_invalid"
|
1276 | | "child_required"
|
1277 | | "child_type_invalid"
|
1278 | | "child_unknown"
|
1279 | | "first_child_object_invalid"
|
1280 | | "first_child_type_invalid"
|
1281 | | "last_child_object_invalid"
|
1282 | | "last_child_type_invalid"
|
1283 | | "next_sibling_object_invalid"
|
1284 | | "next_sibling_type_invalid"
|
1285 | | "node_data_invalid"
|
1286 | | "node_is_void_invalid"
|
1287 | | "node_mark_invalid"
|
1288 | | "node_object_invalid"
|
1289 | | "node_text_invalid"
|
1290 | | "node_type_invalid"
|
1291 | | "parent_object_invalid"
|
1292 | | "parent_type_invalid"
|
1293 | | "previous_sibling_object_invalid"
|
1294 | | "previous_sibling_type_invalid";
|
1295 |
|
1296 | export class SlateError extends Error {
|
1297 | code: ErrorCode;
|
1298 | [key: string]: any;
|
1299 | }
|
1300 |
|
1301 | export namespace KeyUtils {
|
1302 | function create(key?: string): string;
|
1303 | function setGenerator(func: () => any): void;
|
1304 | function resetGenerator(): void;
|
1305 | }
|
1306 |
|
1307 | export type useMemoization = (enabled: boolean) => void;
|
1308 | export type resetMemoization = () => void;
|
1309 |
|
1310 | export namespace PathUtils {
|
1311 | |
1312 |
|
1313 |
|
1314 | function compare(
|
1315 | path: Immutable.List<number>,
|
1316 | target: Immutable.List<number>,
|
1317 | ): number | null;
|
1318 |
|
1319 | |
1320 |
|
1321 |
|
1322 | function create(
|
1323 | attrs: Immutable.List<number> | number[],
|
1324 | ): Immutable.List<number>;
|
1325 |
|
1326 | |
1327 |
|
1328 |
|
1329 | function crop(
|
1330 | a: Immutable.List<number>,
|
1331 | b: Immutable.List<number>,
|
1332 | size?: number,
|
1333 | ): Array<Immutable.List<number>>;
|
1334 |
|
1335 | |
1336 |
|
1337 |
|
1338 | function decrement(
|
1339 | path: Immutable.List<number>,
|
1340 | n?: number,
|
1341 | index?: number,
|
1342 | ): Immutable.List<number>;
|
1343 |
|
1344 | |
1345 |
|
1346 |
|
1347 | function getAncestors(
|
1348 | path: Immutable.List<number>,
|
1349 | ): Immutable.List<number>;
|
1350 |
|
1351 | |
1352 |
|
1353 |
|
1354 | function increment(
|
1355 | path: Immutable.List<number>,
|
1356 | n?: number,
|
1357 | index?: number,
|
1358 | ): Immutable.List<number>;
|
1359 |
|
1360 | |
1361 |
|
1362 |
|
1363 | function isAbove(
|
1364 | path: Immutable.List<number>,
|
1365 | target: Immutable.List<number>,
|
1366 | ): boolean;
|
1367 |
|
1368 | |
1369 |
|
1370 |
|
1371 | function isAfter(
|
1372 | path: Immutable.List<number>,
|
1373 | target: Immutable.List<number>,
|
1374 | ): boolean;
|
1375 |
|
1376 | |
1377 |
|
1378 |
|
1379 | function isBefore(
|
1380 | path: Immutable.List<number>,
|
1381 | target: Immutable.List<number>,
|
1382 | ): boolean;
|
1383 |
|
1384 | |
1385 |
|
1386 |
|
1387 | function isEqual(
|
1388 | path: Immutable.List<number>,
|
1389 | target: Immutable.List<number>,
|
1390 | ): boolean;
|
1391 |
|
1392 | |
1393 |
|
1394 |
|
1395 |
|
1396 | function isOlder(
|
1397 | path: Immutable.List<number>,
|
1398 | target: Immutable.List<number>,
|
1399 | ): boolean;
|
1400 |
|
1401 | |
1402 |
|
1403 |
|
1404 | function isPath(
|
1405 | maybePath: any,
|
1406 | ): maybePath is Immutable.List<number> | number[];
|
1407 |
|
1408 | |
1409 |
|
1410 |
|
1411 | function isSibling(
|
1412 | path: Immutable.List<number>,
|
1413 | target: Immutable.List<number>,
|
1414 | ): boolean;
|
1415 |
|
1416 | |
1417 |
|
1418 |
|
1419 |
|
1420 | function isYounger(
|
1421 | path: Immutable.List<number>,
|
1422 | target: Immutable.List<number>,
|
1423 | ): boolean;
|
1424 |
|
1425 | |
1426 |
|
1427 |
|
1428 | function lift(
|
1429 | path: Immutable.List<number>,
|
1430 | n?: number,
|
1431 | ): Immutable.List<number>;
|
1432 |
|
1433 | |
1434 |
|
1435 |
|
1436 | function drop(
|
1437 | path: Immutable.List<number>,
|
1438 | n?: number,
|
1439 | ): Immutable.List<number>;
|
1440 |
|
1441 | |
1442 |
|
1443 |
|
1444 | function max(
|
1445 | a: Immutable.List<number>,
|
1446 | b: Immutable.List<number>,
|
1447 | ): number;
|
1448 |
|
1449 | |
1450 |
|
1451 |
|
1452 | function min(
|
1453 | a: Immutable.List<number>,
|
1454 | b: Immutable.List<number>,
|
1455 | ): number;
|
1456 |
|
1457 | |
1458 |
|
1459 |
|
1460 | function relate(
|
1461 | a: Immutable.List<number>,
|
1462 | b: Immutable.List<number>,
|
1463 | ): Immutable.List<number>;
|
1464 |
|
1465 | |
1466 |
|
1467 |
|
1468 | function transform(
|
1469 | path: Immutable.List<number>,
|
1470 | operation: Operation | OperationJSON | OperationProperties,
|
1471 | ): Immutable.List<Immutable.List<number>>;
|
1472 | }
|
1473 |
|
1474 | export interface Command {
|
1475 | type: string;
|
1476 | args: any[];
|
1477 | }
|
1478 |
|
1479 | export interface Query {
|
1480 | type: string;
|
1481 | args: any[];
|
1482 | }
|
1483 |
|
1484 | export type CommandFunc<T extends Controller = Controller> = (editor: T, ...args: any[]) => T;
|
1485 | export type QueryFunc<T extends Controller = Controller> = (editor: T, ...args: any[]) => any;
|
1486 |
|
1487 | export interface Plugin<T extends Controller = Controller> {
|
1488 |
|
1489 | normalizeNode?: ((node: Node, editor: T, next: () => void) => ((editor: T) => void) | void) | undefined;
|
1490 | onChange?: ((editor: T, next: () => void) => void) | undefined;
|
1491 | onCommand?: ((command: Command, editor: T, next: () => void) => void) | undefined;
|
1492 | onConstruct?: ((editor: T, next: () => void) => void) | undefined;
|
1493 | onQuery?: ((query: Query, editor: T, next: () => void) => void) | undefined;
|
1494 | // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
1495 | validateNode?: ((node: Node, editor: T, next: () => void) => SlateError | void) | undefined;
|
1496 |
|
1497 | commands?: { [name: string]: CommandFunc<T> } | undefined;
|
1498 | queries?: { [name: string]: QueryFunc<T> } | undefined;
|
1499 | schema?: SchemaProperties | undefined;
|
1500 | }
|
1501 |
|
1502 | export interface Plugins<T extends Controller = Controller> extends Array<Plugin<T> | Plugins<T>> {}
|
1503 |
|
1504 | export interface EditorProperties<T extends Controller = Controller> {
|
1505 | object?: "editor" | undefined;
|
1506 | onChange?: ((change: { operations: Immutable.List<Operation>; value: Value }) => void) | undefined;
|
1507 | plugins?: Plugins<T> | undefined;
|
1508 | readOnly?: boolean | undefined;
|
1509 | value?: Value | undefined;
|
1510 | }
|
1511 |
|
1512 | export interface EditorOptions {
|
1513 | controller?: Controller | undefined;
|
1514 | construct?: boolean | undefined;
|
1515 | normalize?: boolean | undefined;
|
1516 | }
|
1517 |
|
1518 | export class Editor implements Controller {
|
1519 | object: "editor";
|
1520 | controller: Controller;
|
1521 | middleware: object;
|
1522 | onChange: (change: { operations: Immutable.List<Operation>; value: Value }) => void;
|
1523 | operations: Immutable.List<Operation>;
|
1524 | plugins: Array<Plugin<Editor>>;
|
1525 | readOnly: boolean;
|
1526 | value: Value;
|
1527 |
|
1528 | constructor(attributes: EditorProperties<Editor>, options?: EditorOptions);
|
1529 |
|
1530 | /**
|
1531 | * Synchronously flush the current changes to editor, calling onChange.
|
1532 | * In normal operation you never need to use this method! Reserved for testing.
|
1533 | */
|
1534 | flush(): Editor;
|
1535 |
|
1536 | setReadOnly(readOnly: boolean): Editor;
|
1537 |
|
1538 | /**
|
1539 | * Set the editor's value state.
|
1540 | * You can optionally provide a normalize option to either for the editor to completely re-normalize the new value based on its schema or not.
|
1541 | * By default, the editor will re-normalize only if the value is not equal to its previously seen value (which it knows was normalized).
|
1542 | */
|
1543 | setValue(value: Value, options?: { normalize: boolean }): Editor;
|
1544 |
|
1545 | isEditor(maybeEditor: any): maybeEditor is Editor;
|
1546 |
|
1547 | addMark(mark: string | MarkProperties | MarkJSON | Mark): Editor;
|
1548 | addMarks(
|
1549 | mark: Set<string | MarkProperties | MarkJSON | Mark> | Array<string | MarkProperties | MarkJSON | Mark>,
|
1550 | ): Editor;
|
1551 | delete(): Editor;
|
1552 | deleteBackward(n?: number): Editor;
|
1553 | deleteForward(n?: number): Editor;
|
1554 | insertBlock(block: string | Block | BlockProperties | BlockJSON): Editor;
|
1555 | insertFragment(fragment: Document): Editor;
|
1556 | insertInline(inline: string | Inline | InlineProperties | InlineJSON): Editor;
|
1557 | insertText(
|
1558 | text: string,
|
1559 | marks?:
|
1560 | | Immutable.Set<string | MarkProperties | MarkJSON | Mark>
|
1561 | | Array<string | MarkProperties | MarkJSON | Mark>,
|
1562 | ): Editor;
|
1563 | setBlocks(properties: string | Block | BlockProperties | BlockJSON): Editor;
|
1564 | setInlines(properties: string | Inline | InlineProperties): Editor;
|
1565 | splitBlock(depth?: number): Editor;
|
1566 | splitInline(depth: number): Editor;
|
1567 | removeMark(mark: string | MarkProperties | MarkJSON | Mark): Editor;
|
1568 | replaceMark(
|
1569 | mark: string | MarkProperties | MarkJSON | Mark,
|
1570 | newMark: string | MarkProperties | MarkJSON | Mark,
|
1571 | ): Editor;
|
1572 | toggleMark(mark: string | MarkProperties | MarkJSON | Mark): Editor;
|
1573 | unwrapBlock(properties: string | Block | BlockProperties | BlockJSON): Editor;
|
1574 | unwrapInline(properties: string | Inline | InlineProperties | InlineJSON): Editor;
|
1575 | wrapBlock(properties: string | Block | BlockProperties | BlockJSON): Editor;
|
1576 | wrapInline(properties: string | Inline | InlineProperties | InlineJSON): Editor;
|
1577 | wrapText(prefix: string, suffix?: string): Editor;
|
1578 | blur(): Editor;
|
1579 | deselect(): Editor;
|
1580 | flip(): Editor;
|
1581 | focus(): Editor;
|
1582 | moveAnchorBackward(n?: number): Editor;
|
1583 | moveAnchorWordBackward(): Editor;
|
1584 | moveAnchorForward(n?: number): Editor;
|
1585 | moveAnchorWordForward(): Editor;
|
1586 | moveAnchorTo(path: string | number | Immutable.List<number>, offset?: number): Editor;
|
1587 | moveAnchorToEndOfBlock(): Editor;
|
1588 | moveAnchorToEndOfInline(): Editor;
|
1589 | moveAnchorToEndOfDocument(): Editor;
|
1590 | moveAnchorToEndOfNextBlock(): Editor;
|
1591 | moveAnchorToEndOfNextInline(): Editor;
|
1592 | moveAnchorToEndOfNextText(): Editor;
|
1593 | moveAnchorToEndOfNode(node: Block | Document | Inline | Text): Editor;
|
1594 | moveAnchorToEndOfPreviousBlock(): Editor;
|
1595 | moveAnchorToEndOfPreviousInline(): Editor;
|
1596 | moveAnchorToEndOfPreviousText(): Editor;
|
1597 | moveAnchorToEndOfText(): Editor;
|
1598 | moveAnchorToStartOfBlock(): Editor;
|
1599 | moveAnchorToStartOfDocument(): Editor;
|
1600 | moveAnchorToStartOfInline(): Editor;
|
1601 | moveAnchorToStartOfNextBlock(): Editor;
|
1602 | moveAnchorToStartOfNextInline(): Editor;
|
1603 | moveAnchorToStartOfNextText(): Editor;
|
1604 | moveAnchorToStartOfNode(node: Block | Document | Inline | Text): Editor;
|
1605 | moveAnchorToStartOfPreviousBlock(): Editor;
|
1606 | moveAnchorToStartOfPreviousInline(): Editor;
|
1607 | moveAnchorToStartOfPreviousText(): Editor;
|
1608 | moveAnchorToStartOfText(): Editor;
|
1609 | moveEndBackward(n?: number): Editor;
|
1610 | moveEndForward(n?: number): Editor;
|
1611 | moveEndTo(path: string | number | Immutable.List<number>, offset?: number): Editor;
|
1612 | moveEndToEndOfBlock(): Editor;
|
1613 | moveEndToEndOfDocument(): Editor;
|
1614 | moveEndToEndOfInline(): Editor;
|
1615 | moveEndToEndOfNextBlock(): Editor;
|
1616 | moveEndToEndOfNextInline(): Editor;
|
1617 | moveEndToEndOfNextText(): Editor;
|
1618 | moveEndToEndOfNode(node: Block | Document | Inline | Text): Editor;
|
1619 | moveEndToEndOfPreviousBlock(): Editor;
|
1620 | moveEndToEndOfPreviousInline(): Editor;
|
1621 | moveEndToEndOfPreviousText(): Editor;
|
1622 | moveEndToEndOfText(): Editor;
|
1623 | moveEndToStartOfBlock(): Editor;
|
1624 | moveEndToStartOfDocument(): Editor;
|
1625 | moveEndToStartOfInline(): Editor;
|
1626 | moveEndToStartOfNextBlock(): Editor;
|
1627 | moveEndToStartOfNextInline(): Editor;
|
1628 | moveEndToStartOfNextText(): Editor;
|
1629 | moveEndToStartOfNode(node: Block | Document | Inline | Text): Editor;
|
1630 | moveEndToStartOfPreviousBlock(): Editor;
|
1631 | moveEndToStartOfPreviousInline(): Editor;
|
1632 | moveEndToStartOfPreviousText(): Editor;
|
1633 | moveEndToStartOfText(): Editor;
|
1634 | moveEndWordBackward(): Editor;
|
1635 | moveEndWordForward(): Editor;
|
1636 | moveFocusBackward(n?: number): Editor;
|
1637 | moveFocusForward(n?: number): Editor;
|
1638 | moveFocusTo(path: string | number | Immutable.List<number>, offset?: number): Editor;
|
1639 | moveFocusToEndOfBlock(): Editor;
|
1640 | moveFocusToEndOfDocument(): Editor;
|
1641 | moveFocusToEndOfInline(): Editor;
|
1642 | moveFocusToEndOfNextBlock(): Editor;
|
1643 | moveFocusToEndOfNextInline(): Editor;
|
1644 | moveFocusToEndOfNextText(): Editor;
|
1645 | moveFocusToEndOfNode(node: Block | Document | Inline | Text): Editor;
|
1646 | moveFocusToEndOfPreviousBlock(): Editor;
|
1647 | moveFocusToEndOfPreviousInline(): Editor;
|
1648 | moveFocusToEndOfPreviousText(): Editor;
|
1649 | moveFocusToEndOfText(): Editor;
|
1650 | moveFocusToStartOfBlock(): Editor;
|
1651 | moveFocusToStartOfDocument(): Editor;
|
1652 | moveFocusToStartOfInline(): Editor;
|
1653 | moveFocusToStartOfNextBlock(): Editor;
|
1654 | moveFocusToStartOfNextInline(): Editor;
|
1655 | moveFocusToStartOfNextText(): Editor;
|
1656 | moveFocusToStartOfNode(node: Block | Document | Inline | Text): Editor;
|
1657 | moveFocusToStartOfPreviousBlock(): Editor;
|
1658 | moveFocusToStartOfPreviousInline(): Editor;
|
1659 | moveFocusToStartOfPreviousText(): Editor;
|
1660 | moveFocusToStartOfText(): Editor;
|
1661 | moveFocusWordBackward(): Editor;
|
1662 | moveFocusWordForward(): Editor;
|
1663 | moveStartForward(n?: number): Editor;
|
1664 | moveStartBackward(n?: number): Editor;
|
1665 | moveStartTo(path: string | number | Immutable.List<number>, n?: number): Editor;
|
1666 | moveStartToEndOfBlock(): Editor;
|
1667 | moveStartToEndOfDocument(): Editor;
|
1668 | moveStartToEndOfInline(): Editor;
|
1669 | moveStartToEndOfNextBlock(): Editor;
|
1670 | moveStartToEndOfNextInline(): Editor;
|
1671 | moveStartToEndOfNextText(): Editor;
|
1672 | moveStartToEndOfNode(node: Block | Document | Inline | Text): Editor;
|
1673 | moveStartToEndOfPreviousBlock(): Editor;
|
1674 | moveStartToEndOfPreviousInline(): Editor;
|
1675 | moveStartToEndOfPreviousText(): Editor;
|
1676 | moveStartToEndOfText(): Editor;
|
1677 | moveStartToStartOfBlock(): Editor;
|
1678 | moveStartToStartOfDocument(): Editor;
|
1679 | moveStartToStartOfInline(): Editor;
|
1680 | moveStartToStartOfNextBlock(): Editor;
|
1681 | moveStartToStartOfNextInline(): Editor;
|
1682 | moveStartToStartOfNextText(): Editor;
|
1683 | moveStartToStartOfNode(node: Block | Document | Inline | Text): Editor;
|
1684 | moveStartToStartOfPreviousBlock(): Editor;
|
1685 | moveStartToStartOfPreviousInline(): Editor;
|
1686 | moveStartToStartOfPreviousText(): Editor;
|
1687 | moveStartToStartOfText(): Editor;
|
1688 | moveStartWordForward(): Editor;
|
1689 | moveStartWordBackward(): Editor;
|
1690 | moveBackward(n?: number): Editor;
|
1691 | moveForward(n?: number): Editor;
|
1692 | moveTo(path: string | number | Immutable.List<number>, offset?: number): Editor;
|
1693 | moveToAnchor(): Editor;
|
1694 | moveToFocus(): Editor;
|
1695 | moveToStart(): Editor;
|
1696 | moveToEnd(): Editor;
|
1697 | moveToEndOfBlock(): Editor;
|
1698 | moveToEndOfDocument(): Editor;
|
1699 | moveToEndOfInline(): Editor;
|
1700 | moveToEndOfNextBlock(): Editor;
|
1701 | moveToEndOfNextInline(): Editor;
|
1702 | moveToEndOfNextText(): Editor;
|
1703 | moveToEndOfNode(node: Block | Document | Inline | Text): Editor;
|
1704 | moveToEndOfPreviousBlock(): Editor;
|
1705 | moveToEndOfPreviousInline(): Editor;
|
1706 | moveToEndOfPreviousText(): Editor;
|
1707 | moveToEndOfText(): Editor;
|
1708 | moveToStartOfBlock(): Editor;
|
1709 | moveToStartOfDocument(): Editor;
|
1710 | moveToStartOfInline(): Editor;
|
1711 | moveToStartOfNextBlock(): Editor;
|
1712 | moveToStartOfNextInline(): Editor;
|
1713 | moveToStartOfNextText(): Editor;
|
1714 | moveToStartOfNode(node: Block | Document | Inline | Text): Editor;
|
1715 | moveToStartOfPreviousBlock(): Editor;
|
1716 | moveToStartOfPreviousInline(): Editor;
|
1717 | moveToStartOfPreviousText(): Editor;
|
1718 | moveToStartOfText(): Editor;
|
1719 | moveWordBackward(): Editor;
|
1720 | moveWordForward(): Editor;
|
1721 | moveToRangeOfDocument(): Editor;
|
1722 | moveToRangeOfNode(node: Block | Document | Inline | Text): Editor;
|
1723 | select(
|
1724 | properties: string | RangeTypeProperties | RangeTypeJSON | RangeType,
|
1725 | options?: { snapshot?: boolean | undefined },
|
1726 | ): Editor;
|
1727 | setAnchor(point: Point): void;
|
1728 | setEnd(point: Point): void;
|
1729 | setFocus(point: Point): void;
|
1730 | setStart(point: Point): void;
|
1731 | addMarkAtRange(
|
1732 | range: RangeTypeProperties | RangeTypeJSON | RangeType,
|
1733 | mark: string | MarkProperties | Mark,
|
1734 | ): Editor;
|
1735 | addMarksAtRange(
|
1736 | range: RangeTypeProperties | RangeTypeJSON | RangeType,
|
1737 | marks:
|
1738 | | Array<string | MarkProperties | MarkJSON | Mark>
|
1739 | | Immutable.Set<string | MarkProperties | MarkJSON | Mark>,
|
1740 | ): Editor;
|
1741 | deleteAtRange(range: RangeTypeProperties | RangeTypeJSON | RangeType): Editor;
|
1742 | deleteCharBackward(): Editor;
|
1743 | deleteCharBackwardAtRange(range: RangeTypeProperties | RangeTypeJSON | RangeType): Editor;
|
1744 | deleteLineBackward(): Editor;
|
1745 | deleteLineBackwardAtRange(range: RangeTypeProperties | RangeTypeJSON | RangeType): Editor;
|
1746 | deleteWordBackward(): Editor;
|
1747 | deleteWordBackwardAtRange(range: RangeTypeProperties | RangeTypeJSON | RangeType): Editor;
|
1748 | deleteBackwardAtRange(range: RangeTypeProperties | RangeTypeJSON | RangeType, n?: number): Editor;
|
1749 | deleteCharForward(): Editor;
|
1750 | deleteCharForwardAtRange(range: RangeTypeProperties | RangeTypeJSON | RangeType): Editor;
|
1751 | deleteLineForward(): Editor;
|
1752 | deleteLineForwardAtRange(range: RangeTypeProperties | RangeTypeJSON | RangeType): Editor;
|
1753 | deleteWordForwardAtRange(range: RangeTypeProperties | RangeTypeJSON | RangeType): Editor;
|
1754 | deleteWordForward(): Editor;
|
1755 | deleteForwardAtRange(range: RangeTypeProperties | RangeTypeJSON | RangeType, n?: number): Editor;
|
1756 | insertBlockAtRange(
|
1757 | range: RangeTypeProperties | RangeTypeJSON | RangeType,
|
1758 | block: string | Block | BlockProperties | BlockJSON,
|
1759 | ): Editor;
|
1760 | insertFragmentAtRange(range: RangeTypeProperties | RangeTypeJSON | RangeType, fragment: Document): Editor;
|
1761 | insertInlineAtRange(
|
1762 | range: RangeTypeProperties | RangeTypeJSON | RangeType,
|
1763 | inline: Inline | InlineProperties | InlineJSON,
|
1764 | ): Editor;
|
1765 | insertTextAtRange(range: RangeTypeProperties | RangeTypeJSON | RangeType, text: string): Editor;
|
1766 | setBlocksAtRange(
|
1767 | range: RangeTypeProperties | RangeTypeJSON | RangeType,
|
1768 | properties: string | Block | BlockProperties | BlockJSON,
|
1769 | ): Editor;
|
1770 | setInlinesAtRange(
|
1771 | range: RangeTypeProperties | RangeTypeJSON | RangeType,
|
1772 | properties: string | Inline | InlineProperties | InlineJSON,
|
1773 | ): Editor;
|
1774 | splitBlockAtRange(range: RangeTypeProperties | RangeTypeJSON | RangeType, height?: number): Editor;
|
1775 | splitInlineAtRange(range: RangeTypeProperties | RangeTypeJSON | RangeType, height?: number): Editor;
|
1776 | removeMarkAtRange(
|
1777 | range: RangeTypeProperties | RangeTypeJSON | RangeType,
|
1778 | mark: string | MarkProperties | MarkJSON | Mark,
|
1779 | ): Editor;
|
1780 | toggleMarkAtRange(
|
1781 | range: RangeTypeProperties | RangeTypeJSON | RangeType,
|
1782 | mark: string | MarkProperties | MarkJSON | Mark,
|
1783 | ): Editor;
|
1784 | unwrapBlockAtRange(
|
1785 | range: RangeTypeProperties | RangeTypeJSON | RangeType,
|
1786 | properties: string | Block | BlockProperties | BlockJSON,
|
1787 | ): Editor;
|
1788 | unwrapInlineAtRange(
|
1789 | range: RangeTypeProperties | RangeTypeJSON | RangeType,
|
1790 | properties: string | Inline | InlineProperties | InlineJSON,
|
1791 | ): Editor;
|
1792 | wrapBlockAtRange(
|
1793 | range: RangeTypeProperties | RangeTypeJSON | RangeType,
|
1794 | properties: string | Block | BlockProperties | BlockJSON,
|
1795 | ): Editor;
|
1796 | wrapInlineAtRange(
|
1797 | range: RangeTypeProperties | RangeTypeJSON | RangeType,
|
1798 | properties: string | Inline | InlineProperties | InlineJSON,
|
1799 | ): Editor;
|
1800 | wrapTextAtRange(range: RangeTypeProperties | RangeTypeJSON | RangeType, prefix: string, suffix?: string): Editor;
|
1801 | addMarkByKey(key: string, offset: number, length: number, mark: string | MarkProperties | MarkJSON | Mark): Editor;
|
1802 | addMarkByPath(
|
1803 | path: Immutable.List<number>,
|
1804 | offset: number,
|
1805 | length: number,
|
1806 | mark: string | MarkProperties | MarkJSON | Mark,
|
1807 | ): Editor;
|
1808 | addMarksByPath(
|
1809 | path: Immutable.List<number>,
|
1810 | offset: number,
|
1811 | length: number,
|
1812 | marks:
|
1813 | | Array<string | MarkProperties | MarkJSON | Mark>
|
1814 | | Immutable.Set<string | MarkProperties | MarkJSON | Mark>,
|
1815 | ): Editor;
|
1816 | insertNodeByKey(key: string, index: number, node: Block | Document | Inline | Text): Editor;
|
1817 | insertNodeByPath(path: Immutable.List<number>, index: number, node: Block | Document | Inline | Text): Editor;
|
1818 | insertFragmentByKey(key: string, index: number, fragment: Document): Editor;
|
1819 | insertFragmentByPath(path: Immutable.List<number>, index: number, fragment: Document): Editor;
|
1820 | insertTextByKey(
|
1821 | key: string,
|
1822 | offset: number,
|
1823 | text: string,
|
1824 | marks?:
|
1825 | | Array<string | MarkProperties | MarkJSON | Mark>
|
1826 | | Immutable.Set<string | MarkProperties | MarkJSON | Mark>,
|
1827 | ): Editor;
|
1828 | insertTextByPath(
|
1829 | path: Immutable.List<number>,
|
1830 | offset: number,
|
1831 | text: string,
|
1832 | marks?:
|
1833 | | Array<string | MarkProperties | MarkJSON | Mark>
|
1834 | | Immutable.Set<string | MarkProperties | MarkJSON | Mark>,
|
1835 | ): Editor;
|
1836 | mergeNodeByKey(key: string): Editor;
|
1837 | mergeNodeByPath(path: Immutable.List<number>): Editor;
|
1838 | moveNodeByKey(key: string, newKey: string, newIndex: number): Editor;
|
1839 | moveNodeByPath(path: Immutable.List<number>, newPath: Immutable.List<number>, newIndex: number): Editor;
|
1840 | removeMarkByKey(
|
1841 | key: string,
|
1842 | offset: number,
|
1843 | length: number,
|
1844 | mark: string | MarkProperties | MarkJSON | Mark,
|
1845 | ): Editor;
|
1846 | removeMarkByPath(
|
1847 | path: Immutable.List<number>,
|
1848 | offset: number,
|
1849 | length: number,
|
1850 | mark: string | MarkProperties | MarkJSON | Mark,
|
1851 | ): Editor;
|
1852 | removeAllMarksByKey(key: string): Editor;
|
1853 | removeAllMarksByPath(path: Immutable.List<number>): Editor;
|
1854 | removeMarksByPath(
|
1855 | path: Immutable.List<number>,
|
1856 | offset: number,
|
1857 | length: number,
|
1858 | marks:
|
1859 | | Array<string | MarkProperties | MarkJSON | Mark>
|
1860 | | Immutable.Set<string | MarkProperties | MarkJSON | Mark>,
|
1861 | ): Editor;
|
1862 | removeNodeByKey(key: string): Editor;
|
1863 | removeNodeByPath(path: Immutable.List<number>): Editor;
|
1864 | replaceNodeByKey(key: string, node: Block | Document | Inline | Text): Editor;
|
1865 | replaceNodeByPath(path: Immutable.List<number>, newNode: Block | Document | Inline | Text): Editor;
|
1866 | removeTextByKey(key: string, offset: number, length: number): Editor;
|
1867 | removeTextByPath(path: Immutable.List<number>, offset: number, length: number): Editor;
|
1868 | replaceTextByKey(key: string, node: Block | Document | Inline | Text): Editor;
|
1869 | replaceTextByPath(
|
1870 | path: Immutable.List<number>,
|
1871 | offset: number,
|
1872 | length: number,
|
1873 | text: string,
|
1874 | marks?: Immutable.Set<Mark> | Mark[],
|
1875 | ): Editor;
|
1876 | setMarkByKey(
|
1877 | key: string,
|
1878 | offset: number,
|
1879 | length: number,
|
1880 | properties: string | MarkProperties | MarkJSON | Mark,
|
1881 | newProperties: string | Partial<MarkProperties> | Partial<MarkJSON> | Partial<Mark>,
|
1882 | ): Editor;
|
1883 | setMarkByPath(
|
1884 | path: Immutable.List<number>,
|
1885 | offset: number,
|
1886 | length: number,
|
1887 | properties: string | MarkProperties | MarkJSON | Mark,
|
1888 | newProperties: string | Partial<MarkProperties> | Partial<MarkJSON> | Partial<Mark>,
|
1889 | ): Editor;
|
1890 | setNodeByKey(key: string, properties: string | Partial<BlockProperties> | Partial<InlineProperties>): Editor;
|
1891 | setNodeByPath(path: Immutable.List<number>, newProperties: string | NodeProperties): Editor;
|
1892 | setTextByKey(key: string, text: string, marks: Immutable.Set<Mark>): Editor;
|
1893 | setTextByPath(path: Immutable.List<number>, text: string, marks: Immutable.Set<Mark>): Editor;
|
1894 | splitDescendantsByKey(key: string, textKey: string, textOffset: number): Editor;
|
1895 | splitDescendantsByPath(path: Immutable.List<number>, textPath: Immutable.List<number>, textOffset: number): Editor;
|
1896 | splitNodeByKey(key: string, offset: number): Editor;
|
1897 | splitNodeByPath(path: Immutable.List<number>, position: number, options?: { target?: number | undefined }): Editor;
|
1898 | unwrapInlineByKey(key: string, properties: string | InlineProperties): Editor;
|
1899 | unwrapInlineByPath(path: Path, properties: string | InlineProperties): Editor;
|
1900 | unwrapBlockByKey(key: string, properties: string | BlockProperties): Editor;
|
1901 | unwrapBlockByPath(path: Path, properties: string | BlockProperties): Editor;
|
1902 | unwrapChildrenByKey(key: string): Editor;
|
1903 | unwrapChildrenByPath(path: Immutable.List<number> | number[]): Editor;
|
1904 | unwrapNodeByKey(key: string): Editor;
|
1905 | unwrapNodeByPath(path: Immutable.List<number>): Editor;
|
1906 | wrapInlineByKey(key: string, properties: string | InlineProperties): Editor;
|
1907 | wrapInlineByPath(path: Path, properties: string | InlineProperties): Editor;
|
1908 | wrapBlockByKey(key: string, properties: string | BlockProperties): Editor;
|
1909 | wrapBlockByPath(path: Immutable.List<number>, block: string | Block): Editor;
|
1910 | wrapNodeByKey(key: string, parent: Block | Document | Inline | Text): Editor;
|
1911 | wrapNodeByPath(path: Immutable.List<number>, parent: Block | Document | Inline | Text): Editor;
|
1912 | normalize(): Editor;
|
1913 | withoutNormalizing(fn: () => void): Editor;
|
1914 | withoutSaving(fn: () => void): Editor;
|
1915 | withoutMerging(fn: () => void): Editor;
|
1916 | redo(): Editor;
|
1917 | undo(): Editor;
|
1918 | save(operation: Operation): void;
|
1919 | snapshotSelection(): Editor;
|
1920 | command(type: string | ((...args: any[]) => any), ...args: any[]): Editor;
|
1921 | hasCommand(type: string): boolean;
|
1922 | hasQuery(type: string): boolean;
|
1923 | query(query: string | ((...args: any[]) => any), ...args: any[]): any;
|
1924 | registerCommand(command: string): Editor;
|
1925 | registerQuery(query: string): Editor;
|
1926 | applyOperation(operation: Operation | OperationJSON | OperationProperties): Editor;
|
1927 | run(key: string, ...args: any[]): Editor;
|
1928 | setData(data: Data): Editor;
|
1929 | addAnnotation(annotation: AnnotationProperties | AnnotationJSON | Annotation): Editor;
|
1930 | removeAnnotation(annotation: AnnotationProperties | AnnotationJSON | Annotation): Editor;
|
1931 | setAnnotation(annotation: Annotation, newProperties: AnnotationProperties | AnnotationJSON | Annotation): Editor;
|
1932 | }
|
1933 |
|
1934 | export interface Controller {
|
1935 |
|
1936 | |
1937 |
|
1938 |
|
1939 | addMark(mark: MarkProperties | MarkJSON | Mark | string): Controller;
|
1940 | addMarks(
|
1941 | mark:
|
1942 | | Set<MarkProperties | MarkJSON | Mark | string>
|
1943 | | Array<MarkProperties | MarkJSON | Mark | string>,
|
1944 | ): Controller;
|
1945 | |
1946 |
|
1947 |
|
1948 | delete(): Controller;
|
1949 |
|
1950 | |
1951 |
|
1952 |
|
1953 |
|
1954 | deleteBackward(n?: number): Controller;
|
1955 |
|
1956 | |
1957 |
|
1958 |
|
1959 |
|
1960 | deleteForward(n?: number): Controller;
|
1961 |
|
1962 | |
1963 |
|
1964 |
|
1965 |
|
1966 | insertBlock(block: Block | BlockProperties | BlockJSON | string): Controller;
|
1967 |
|
1968 | |
1969 |
|
1970 |
|
1971 | insertFragment(fragment: Document): Controller;
|
1972 |
|
1973 | |
1974 |
|
1975 |
|
1976 |
|
1977 | insertInline(inline: Inline | InlineProperties | InlineJSON | string): Controller;
|
1978 |
|
1979 | |
1980 |
|
1981 |
|
1982 | insertText(text: string): Controller;
|
1983 |
|
1984 | |
1985 |
|
1986 |
|
1987 |
|
1988 | setBlocks(properties: Block | BlockProperties | BlockJSON | string): Controller;
|
1989 |
|
1990 | |
1991 |
|
1992 |
|
1993 |
|
1994 | setInlines(properties: Inline | InlineProperties | InlineProperties | string): Controller;
|
1995 |
|
1996 | |
1997 |
|
1998 |
|
1999 |
|
2000 | splitBlock(depth?: number): Controller;
|
2001 |
|
2002 | |
2003 |
|
2004 |
|
2005 |
|
2006 | splitInline(depth: number): Controller;
|
2007 |
|
2008 | |
2009 |
|
2010 |
|
2011 |
|
2012 | removeMark(mark: Mark | MarkProperties | MarkJSON | string): Controller;
|
2013 |
|
2014 | |
2015 |
|
2016 |
|
2017 |
|
2018 | replaceMark(
|
2019 | mark: MarkProperties | MarkJSON | Mark | string,
|
2020 | newMark: MarkProperties | MarkJSON | Mark | string,
|
2021 | ): Controller;
|
2022 |
|
2023 | |
2024 |
|
2025 |
|
2026 |
|
2027 | toggleMark(mark: MarkProperties | MarkJSON | Mark | string): Controller;
|
2028 |
|
2029 | |
2030 |
|
2031 |
|
2032 | unwrapBlock(properties: BlockProperties | BlockJSON | Block | string): Controller;
|
2033 |
|
2034 | |
2035 |
|
2036 |
|
2037 | unwrapInline(properties: InlineProperties | InlineJSON | Inline | string): Controller;
|
2038 |
|
2039 | |
2040 |
|
2041 |
|
2042 | wrapBlock(properties: BlockProperties | BlockJSON | Block | string): Controller;
|
2043 |
|
2044 | |
2045 |
|
2046 |
|
2047 | wrapInline(properties: InlineProperties | InlineJSON | Inline | string): Controller;
|
2048 |
|
2049 | |
2050 |
|
2051 |
|
2052 |
|
2053 | wrapText(prefix: string, suffix?: string): Controller;
|
2054 |
|
2055 |
|
2056 | |
2057 |
|
2058 |
|
2059 | blur(): Controller;
|
2060 |
|
2061 | |
2062 |
|
2063 |
|
2064 | deselect(): Controller;
|
2065 |
|
2066 | |
2067 |
|
2068 |
|
2069 | flip(): Controller;
|
2070 |
|
2071 | |
2072 |
|
2073 |
|
2074 | focus(): Controller;
|
2075 |
|
2076 | |
2077 |
|
2078 |
|
2079 | moveAnchorBackward(n?: number): Controller;
|
2080 | moveAnchorWordBackward(): Controller;
|
2081 | |
2082 |
|
2083 |
|
2084 | moveAnchorForward(n?: number): Controller;
|
2085 | moveAnchorWordForward(): Controller;
|
2086 | |
2087 |
|
2088 |
|
2089 | moveAnchorTo(path: string | number | Immutable.List<number>, offset?: number): Controller;
|
2090 | |
2091 |
|
2092 |
|
2093 | moveAnchorToEndOfBlock(): Controller;
|
2094 | |
2095 |
|
2096 |
|
2097 | moveAnchorToEndOfInline(): Controller;
|
2098 | |
2099 |
|
2100 |
|
2101 | moveAnchorToEndOfDocument(): Controller;
|
2102 | |
2103 |
|
2104 |
|
2105 | moveAnchorToEndOfNextBlock(): Controller;
|
2106 | |
2107 |
|
2108 |
|
2109 | moveAnchorToEndOfNextInline(): Controller;
|
2110 | |
2111 |
|
2112 |
|
2113 | moveAnchorToEndOfNextText(): Controller;
|
2114 | |
2115 |
|
2116 |
|
2117 | moveAnchorToEndOfNode(node: Node): Controller;
|
2118 | |
2119 |
|
2120 |
|
2121 | moveAnchorToEndOfPreviousBlock(): Controller;
|
2122 | |
2123 |
|
2124 |
|
2125 | moveAnchorToEndOfPreviousInline(): Controller;
|
2126 | |
2127 |
|
2128 |
|
2129 | moveAnchorToEndOfPreviousText(): Controller;
|
2130 | |
2131 |
|
2132 |
|
2133 | moveAnchorToEndOfText(): Controller;
|
2134 | |
2135 |
|
2136 |
|
2137 | moveAnchorToStartOfBlock(): Controller;
|
2138 | |
2139 |
|
2140 |
|
2141 | moveAnchorToStartOfDocument(): Controller;
|
2142 | |
2143 |
|
2144 |
|
2145 | moveAnchorToStartOfInline(): Controller;
|
2146 | |
2147 |
|
2148 |
|
2149 | moveAnchorToStartOfNextBlock(): Controller;
|
2150 | |
2151 |
|
2152 |
|
2153 | moveAnchorToStartOfNextInline(): Controller;
|
2154 | |
2155 |
|
2156 |
|
2157 | moveAnchorToStartOfNextText(): Controller;
|
2158 | |
2159 |
|
2160 |
|
2161 | moveAnchorToStartOfNode(node: Node): Controller;
|
2162 | |
2163 |
|
2164 |
|
2165 | moveAnchorToStartOfPreviousBlock(): Controller;
|
2166 | |
2167 |
|
2168 |
|
2169 | moveAnchorToStartOfPreviousInline(): Controller;
|
2170 | |
2171 |
|
2172 |
|
2173 | moveAnchorToStartOfPreviousText(): Controller;
|
2174 | |
2175 |
|
2176 |
|
2177 | moveAnchorToStartOfText(): Controller;
|
2178 |
|
2179 | |
2180 |
|
2181 |
|
2182 | moveEndBackward(n?: number): Controller;
|
2183 | |
2184 |
|
2185 |
|
2186 | moveEndForward(n?: number): Controller;
|
2187 |
|
2188 | |
2189 |
|
2190 |
|
2191 | moveEndTo(path: string | number | Immutable.List<number>, offset?: number): Controller;
|
2192 | |
2193 |
|
2194 |
|
2195 | moveEndToEndOfBlock(): Controller;
|
2196 | |
2197 |
|
2198 |
|
2199 | moveEndToEndOfDocument(): Controller;
|
2200 | |
2201 |
|
2202 |
|
2203 | moveEndToEndOfInline(): Controller;
|
2204 | |
2205 |
|
2206 |
|
2207 | moveEndToEndOfNextBlock(): Controller;
|
2208 | |
2209 |
|
2210 |
|
2211 | moveEndToEndOfNextInline(): Controller;
|
2212 | |
2213 |
|
2214 |
|
2215 | moveEndToEndOfNextText(): Controller;
|
2216 | |
2217 |
|
2218 |
|
2219 | moveEndToEndOfNode(node: Node): Controller;
|
2220 | |
2221 |
|
2222 |
|
2223 | moveEndToEndOfPreviousBlock(): Controller;
|
2224 | |
2225 |
|
2226 |
|
2227 | moveEndToEndOfPreviousInline(): Controller;
|
2228 | |
2229 |
|
2230 |
|
2231 | moveEndToEndOfPreviousText(): Controller;
|
2232 | |
2233 |
|
2234 |
|
2235 | moveEndToEndOfText(): Controller;
|
2236 | |
2237 |
|
2238 |
|
2239 | moveEndToStartOfBlock(): Controller;
|
2240 | |
2241 |
|
2242 |
|
2243 | moveEndToStartOfDocument(): Controller;
|
2244 | |
2245 |
|
2246 |
|
2247 | moveEndToStartOfInline(): Controller;
|
2248 | |
2249 |
|
2250 |
|
2251 | moveEndToStartOfNextBlock(): Controller;
|
2252 | |
2253 |
|
2254 |
|
2255 | moveEndToStartOfNextInline(): Controller;
|
2256 | |
2257 |
|
2258 |
|
2259 | moveEndToStartOfNextText(): Controller;
|
2260 | |
2261 |
|
2262 |
|
2263 | moveEndToStartOfNode(node: Node): Controller;
|
2264 | |
2265 |
|
2266 |
|
2267 | moveEndToStartOfPreviousBlock(): Controller;
|
2268 | |
2269 |
|
2270 |
|
2271 | moveEndToStartOfPreviousInline(): Controller;
|
2272 | |
2273 |
|
2274 |
|
2275 | moveEndToStartOfPreviousText(): Controller;
|
2276 | |
2277 |
|
2278 |
|
2279 | moveEndToStartOfText(): Controller;
|
2280 | moveEndWordBackward(): Controller;
|
2281 | moveEndWordForward(): Controller;
|
2282 | |
2283 |
|
2284 |
|
2285 | moveFocusBackward(n?: number): Controller;
|
2286 | |
2287 |
|
2288 |
|
2289 | moveFocusForward(n?: number): Controller;
|
2290 | |
2291 |
|
2292 |
|
2293 | moveFocusTo(path: string | number | Immutable.List<number>, offset?: number): Controller;
|
2294 | |
2295 |
|
2296 |
|
2297 | moveFocusToEndOfBlock(): Controller;
|
2298 | |
2299 |
|
2300 |
|
2301 | moveFocusToEndOfDocument(): Controller;
|
2302 | |
2303 |
|
2304 |
|
2305 | moveFocusToEndOfInline(): Controller;
|
2306 | |
2307 |
|
2308 |
|
2309 | moveFocusToEndOfNextBlock(): Controller;
|
2310 | |
2311 |
|
2312 |
|
2313 | moveFocusToEndOfNextInline(): Controller;
|
2314 | |
2315 |
|
2316 |
|
2317 | moveFocusToEndOfNextText(): Controller;
|
2318 | |
2319 |
|
2320 |
|
2321 | moveFocusToEndOfNode(node: Node): Controller;
|
2322 | |
2323 |
|
2324 |
|
2325 | moveFocusToEndOfPreviousBlock(): Controller;
|
2326 | |
2327 |
|
2328 |
|
2329 | moveFocusToEndOfPreviousInline(): Controller;
|
2330 | |
2331 |
|
2332 |
|
2333 | moveFocusToEndOfPreviousText(): Controller;
|
2334 | |
2335 |
|
2336 |
|
2337 | moveFocusToEndOfText(): Controller;
|
2338 | |
2339 |
|
2340 |
|
2341 | moveFocusToStartOfBlock(): Controller;
|
2342 | |
2343 |
|
2344 |
|
2345 | moveFocusToStartOfDocument(): Controller;
|
2346 | |
2347 |
|
2348 |
|
2349 | moveFocusToStartOfInline(): Controller;
|
2350 | |
2351 |
|
2352 |
|
2353 | moveFocusToStartOfNextBlock(): Controller;
|
2354 | |
2355 |
|
2356 |
|
2357 | moveFocusToStartOfNextInline(): Controller;
|
2358 | |
2359 |
|
2360 |
|
2361 | moveFocusToStartOfNextText(): Controller;
|
2362 | |
2363 |
|
2364 |
|
2365 | moveFocusToStartOfNode(node: Node): Controller;
|
2366 | |
2367 |
|
2368 |
|
2369 | moveFocusToStartOfPreviousBlock(): Controller;
|
2370 | |
2371 |
|
2372 |
|
2373 | moveFocusToStartOfPreviousInline(): Controller;
|
2374 | |
2375 |
|
2376 |
|
2377 | moveFocusToStartOfPreviousText(): Controller;
|
2378 | |
2379 |
|
2380 |
|
2381 | moveFocusToStartOfText(): Controller;
|
2382 | moveFocusWordBackward(): Controller;
|
2383 | moveFocusWordForward(): Controller;
|
2384 | |
2385 |
|
2386 |
|
2387 | moveStartForward(n?: number): Controller;
|
2388 | |
2389 |
|
2390 |
|
2391 | moveStartBackward(n?: number): Controller;
|
2392 | |
2393 |
|
2394 |
|
2395 | moveStartTo(path: string | number | Immutable.List<number>, n?: number): Controller;
|
2396 | |
2397 |
|
2398 |
|
2399 | moveStartToEndOfBlock(): Controller;
|
2400 | |
2401 |
|
2402 |
|
2403 | moveStartToEndOfDocument(): Controller;
|
2404 | |
2405 |
|
2406 |
|
2407 | moveStartToEndOfInline(): Controller;
|
2408 | |
2409 |
|
2410 |
|
2411 | moveStartToEndOfNextBlock(): Controller;
|
2412 | |
2413 |
|
2414 |
|
2415 | moveStartToEndOfNextInline(): Controller;
|
2416 | |
2417 |
|
2418 |
|
2419 | moveStartToEndOfNextText(): Controller;
|
2420 | |
2421 |
|
2422 |
|
2423 | moveStartToEndOfNode(node: Node): Controller;
|
2424 | |
2425 |
|
2426 |
|
2427 | moveStartToEndOfPreviousBlock(): Controller;
|
2428 | |
2429 |
|
2430 |
|
2431 | moveStartToEndOfPreviousInline(): Controller;
|
2432 | |
2433 |
|
2434 |
|
2435 | moveStartToEndOfPreviousText(): Controller;
|
2436 | |
2437 |
|
2438 |
|
2439 | moveStartToEndOfText(): Controller;
|
2440 | |
2441 |
|
2442 |
|
2443 | moveStartToStartOfBlock(): Controller;
|
2444 | |
2445 |
|
2446 |
|
2447 | moveStartToStartOfDocument(): Controller;
|
2448 | |
2449 |
|
2450 |
|
2451 | moveStartToStartOfInline(): Controller;
|
2452 | |
2453 |
|
2454 |
|
2455 | moveStartToStartOfNextBlock(): Controller;
|
2456 | |
2457 |
|
2458 |
|
2459 | moveStartToStartOfNextInline(): Controller;
|
2460 | |
2461 |
|
2462 |
|
2463 | moveStartToStartOfNextText(): Controller;
|
2464 | |
2465 |
|
2466 |
|
2467 | moveStartToStartOfNode(node: Node): Controller;
|
2468 | |
2469 |
|
2470 |
|
2471 | moveStartToStartOfPreviousBlock(): Controller;
|
2472 | |
2473 |
|
2474 |
|
2475 | moveStartToStartOfPreviousInline(): Controller;
|
2476 | |
2477 |
|
2478 |
|
2479 | moveStartToStartOfPreviousText(): Controller;
|
2480 | |
2481 |
|
2482 |
|
2483 | moveStartToStartOfText(): Controller;
|
2484 | moveStartWordForward(): Controller;
|
2485 | moveStartWordBackward(): Controller;
|
2486 | |
2487 |
|
2488 |
|
2489 | moveBackward(n?: number): Controller;
|
2490 | |
2491 |
|
2492 |
|
2493 | moveForward(n?: number): Controller;
|
2494 | |
2495 |
|
2496 |
|
2497 | moveTo(path: string | number | Immutable.List<number>, offset?: number): Controller;
|
2498 | |
2499 |
|
2500 |
|
2501 | moveToAnchor(): Controller;
|
2502 | |
2503 |
|
2504 |
|
2505 | moveToFocus(): Controller;
|
2506 | |
2507 |
|
2508 |
|
2509 | moveToStart(): Controller;
|
2510 | |
2511 |
|
2512 |
|
2513 | moveToEnd(): Controller;
|
2514 | |
2515 |
|
2516 |
|
2517 | moveToEndOfBlock(): Controller;
|
2518 | |
2519 |
|
2520 |
|
2521 | moveToEndOfDocument(): Controller;
|
2522 | |
2523 |
|
2524 |
|
2525 | moveToEndOfInline(): Controller;
|
2526 | |
2527 |
|
2528 |
|
2529 | moveToEndOfNextBlock(): Controller;
|
2530 | |
2531 |
|
2532 |
|
2533 | moveToEndOfNextInline(): Controller;
|
2534 | |
2535 |
|
2536 |
|
2537 | moveToEndOfNextText(): Controller;
|
2538 | |
2539 |
|
2540 |
|
2541 | moveToEndOfNode(node: Node): Controller;
|
2542 | |
2543 |
|
2544 |
|
2545 | moveToEndOfPreviousBlock(): Controller;
|
2546 | |
2547 |
|
2548 |
|
2549 | moveToEndOfPreviousInline(): Controller;
|
2550 | |
2551 |
|
2552 |
|
2553 | moveToEndOfPreviousText(): Controller;
|
2554 | |
2555 |
|
2556 |
|
2557 | moveToEndOfText(): Controller;
|
2558 | |
2559 |
|
2560 |
|
2561 | moveToStartOfBlock(): Controller;
|
2562 | |
2563 |
|
2564 |
|
2565 | moveToStartOfDocument(): Controller;
|
2566 | |
2567 |
|
2568 |
|
2569 | moveToStartOfInline(): Controller;
|
2570 | |
2571 |
|
2572 |
|
2573 | moveToStartOfNextBlock(): Controller;
|
2574 | |
2575 |
|
2576 |
|
2577 | moveToStartOfNextInline(): Controller;
|
2578 | |
2579 |
|
2580 |
|
2581 | moveToStartOfNextText(): Controller;
|
2582 | |
2583 |
|
2584 |
|
2585 | moveToStartOfNode(node: Node): Controller;
|
2586 | |
2587 |
|
2588 |
|
2589 | moveToStartOfPreviousBlock(): Controller;
|
2590 | |
2591 |
|
2592 |
|
2593 | moveToStartOfPreviousInline(): Controller;
|
2594 | |
2595 |
|
2596 |
|
2597 | moveToStartOfPreviousText(): Controller;
|
2598 | |
2599 |
|
2600 |
|
2601 | moveToStartOfText(): Controller;
|
2602 | moveWordBackward(): Controller;
|
2603 | moveWordForward(): Controller;
|
2604 | |
2605 |
|
2606 |
|
2607 | moveToRangeOfDocument(): Controller;
|
2608 | |
2609 |
|
2610 |
|
2611 | moveToRangeOfNode(node: Node): Controller;
|
2612 | |
2613 |
|
2614 |
|
2615 | select(
|
2616 | properties:
|
2617 | | RangeTypeProperties
|
2618 | | RangeTypeJSON
|
2619 | | RangeType
|
2620 | | string,
|
2621 | options?: { snapshot?: boolean | undefined },
|
2622 | ): Controller;
|
2623 | setAnchor(point: Point): void;
|
2624 | setEnd(point: Point): void;
|
2625 | setFocus(point: Point): void;
|
2626 | setStart(point: Point): void;
|
2627 |
|
2628 |
|
2629 |
|
2630 | |
2631 |
|
2632 |
|
2633 |
|
2634 | addMarkAtRange(
|
2635 | range: RangeType | RangeTypeProperties | RangeTypeJSON,
|
2636 | mark: Mark | MarkProperties | string,
|
2637 | ): Controller;
|
2638 | addMarksAtRange(
|
2639 | range: RangeType | RangeTypeProperties | RangeTypeJSON,
|
2640 | marks:
|
2641 | | Array<MarkProperties | MarkJSON | Mark | string>
|
2642 | | Immutable.Set<MarkProperties | MarkJSON | Mark | string>,
|
2643 | ): Controller;
|
2644 | |
2645 |
|
2646 |
|
2647 | deleteAtRange(range: RangeType | RangeTypeProperties | RangeTypeJSON): Controller;
|
2648 | |
2649 |
|
2650 |
|
2651 | deleteCharBackward(): Controller;
|
2652 | |
2653 |
|
2654 |
|
2655 | deleteCharBackwardAtRange(range: RangeType | RangeTypeProperties | RangeTypeJSON): Controller;
|
2656 | |
2657 |
|
2658 |
|
2659 | deleteLineBackward(): Controller;
|
2660 | |
2661 |
|
2662 |
|
2663 | deleteLineBackwardAtRange(range: RangeType | RangeTypeProperties | RangeTypeJSON): Controller;
|
2664 | |
2665 |
|
2666 |
|
2667 | deleteWordBackward(): Controller;
|
2668 | |
2669 |
|
2670 |
|
2671 | deleteWordBackwardAtRange(range: RangeType | RangeTypeProperties | RangeTypeJSON): Controller;
|
2672 | |
2673 |
|
2674 |
|
2675 | deleteBackwardAtRange(range: RangeType | RangeTypeProperties | RangeTypeJSON, n?: number): Controller;
|
2676 | |
2677 |
|
2678 |
|
2679 | deleteCharForward(): Controller;
|
2680 | |
2681 |
|
2682 |
|
2683 | deleteCharForwardAtRange(range: RangeType | RangeTypeProperties | RangeTypeJSON): Controller;
|
2684 | |
2685 |
|
2686 |
|
2687 | deleteLineForward(): Controller;
|
2688 | |
2689 |
|
2690 |
|
2691 | deleteLineForwardAtRange(range: RangeType | RangeTypeProperties | RangeTypeJSON): Controller;
|
2692 | |
2693 |
|
2694 |
|
2695 | deleteWordForwardAtRange(range: RangeType | RangeTypeProperties | RangeTypeJSON): Controller;
|
2696 | |
2697 |
|
2698 |
|
2699 | deleteWordForward(): Controller;
|
2700 | |
2701 |
|
2702 |
|
2703 | deleteForwardAtRange(range: RangeType | RangeTypeProperties | RangeTypeJSON, n?: number): Controller;
|
2704 | |
2705 |
|
2706 |
|
2707 |
|
2708 | insertBlockAtRange(
|
2709 | range: RangeType | RangeTypeProperties | RangeTypeJSON,
|
2710 | block: Block | BlockProperties | BlockJSON | string,
|
2711 | ): Controller;
|
2712 | |
2713 |
|
2714 |
|
2715 | insertFragmentAtRange(
|
2716 | range: RangeType | RangeTypeProperties | RangeTypeJSON,
|
2717 | fragment: Document,
|
2718 | ): Controller;
|
2719 | |
2720 |
|
2721 |
|
2722 |
|
2723 | insertInlineAtRange(
|
2724 | range: RangeType | RangeTypeProperties | RangeTypeJSON,
|
2725 | inline: Inline | InlineJSON | InlineProperties,
|
2726 | ): Controller;
|
2727 | |
2728 |
|
2729 |
|
2730 | insertTextAtRange(
|
2731 | range: RangeType | RangeTypeProperties | RangeTypeJSON,
|
2732 | text: string,
|
2733 | ): Controller;
|
2734 | |
2735 |
|
2736 |
|
2737 |
|
2738 | setBlocksAtRange(
|
2739 | range: RangeType | RangeTypeProperties | RangeTypeJSON,
|
2740 | properties: Block | BlockJSON | BlockProperties | string,
|
2741 | ): Controller;
|
2742 | |
2743 |
|
2744 |
|
2745 |
|
2746 | setInlinesAtRange(
|
2747 | range: RangeType | RangeTypeProperties | RangeTypeJSON,
|
2748 | properties: InlineProperties | InlineJSON | Inline | string,
|
2749 | ): Controller;
|
2750 | |
2751 |
|
2752 |
|
2753 | splitBlockAtRange(
|
2754 | range: RangeType | RangeTypeProperties | RangeTypeJSON,
|
2755 | height?: number,
|
2756 | ): Controller;
|
2757 | |
2758 |
|
2759 |
|
2760 | splitInlineAtRange(
|
2761 | range: RangeType | RangeTypeProperties | RangeTypeJSON,
|
2762 | height?: number,
|
2763 | ): Controller;
|
2764 | |
2765 |
|
2766 |
|
2767 |
|
2768 | removeMarkAtRange(
|
2769 | range: RangeType | RangeTypeProperties | RangeTypeJSON,
|
2770 | mark: Mark | MarkProperties | MarkJSON | string,
|
2771 | ): Controller;
|
2772 | |
2773 |
|
2774 |
|
2775 |
|
2776 | toggleMarkAtRange(
|
2777 | range: RangeType | RangeTypeProperties | RangeTypeJSON,
|
2778 | mark: Mark | MarkProperties | MarkJSON | string,
|
2779 | ): Controller;
|
2780 | |
2781 |
|
2782 |
|
2783 | unwrapBlockAtRange(
|
2784 | range: RangeType | RangeTypeProperties | RangeTypeJSON,
|
2785 | properties: BlockProperties | BlockJSON | Block | string,
|
2786 | ): Controller;
|
2787 | |
2788 |
|
2789 |
|
2790 | unwrapInlineAtRange(
|
2791 | range: RangeType | RangeTypeProperties | RangeTypeJSON,
|
2792 | properties: InlineProperties | InlineJSON | Inline | string,
|
2793 | ): Controller;
|
2794 | |
2795 |
|
2796 |
|
2797 | wrapBlockAtRange(
|
2798 | range: RangeType | RangeTypeProperties | RangeTypeJSON,
|
2799 | properties: BlockProperties | BlockJSON | Block | string,
|
2800 | ): Controller;
|
2801 | |
2802 |
|
2803 |
|
2804 | wrapInlineAtRange(
|
2805 | range: RangeType | RangeTypeProperties | RangeTypeJSON,
|
2806 | properties: InlineProperties | InlineJSON | Inline | string,
|
2807 | ): Controller;
|
2808 | |
2809 |
|
2810 |
|
2811 |
|
2812 | wrapTextAtRange(
|
2813 | range: RangeType | RangeTypeProperties | RangeTypeJSON,
|
2814 | prefix: string,
|
2815 | suffix?: string,
|
2816 | ): Controller;
|
2817 |
|
2818 |
|
2819 | |
2820 |
|
2821 |
|
2822 | addMarkByKey(
|
2823 | key: string,
|
2824 | offset: number,
|
2825 | length: number,
|
2826 | mark: MarkProperties | MarkJSON | Mark | string,
|
2827 | ): Controller;
|
2828 | |
2829 |
|
2830 |
|
2831 | addMarkByPath(
|
2832 | path: Immutable.List<number>,
|
2833 | offset: number,
|
2834 | length: number,
|
2835 | mark: MarkProperties | MarkJSON | Mark | string,
|
2836 | ): Controller;
|
2837 | addMarksByPath(
|
2838 | path: Immutable.List<number>,
|
2839 | offset: number,
|
2840 | length: number,
|
2841 | marks:
|
2842 | | Array<MarkProperties | MarkJSON | Mark | string>
|
2843 | | Immutable.Set<MarkProperties | MarkJSON | Mark | string>,
|
2844 | ): Controller;
|
2845 | |
2846 |
|
2847 |
|
2848 | insertNodeByKey(key: string, index: number, node: Node): Controller;
|
2849 | |
2850 |
|
2851 |
|
2852 | insertNodeByPath(path: Immutable.List<number>, index: number, node: Node): Controller;
|
2853 | |
2854 |
|
2855 |
|
2856 | insertFragmentByKey(key: string, index: number, fragment: Document): Controller;
|
2857 | |
2858 |
|
2859 |
|
2860 | insertFragmentByPath(path: Immutable.List<number>, index: number, fragment: Document): Controller;
|
2861 | |
2862 |
|
2863 |
|
2864 | insertTextByKey(
|
2865 | key: string,
|
2866 | offset: number,
|
2867 | text: string,
|
2868 | marks?:
|
2869 | | Array<MarkProperties | MarkJSON | Mark | string>
|
2870 | | Immutable.Set<MarkProperties | MarkJSON | Mark | string>,
|
2871 | ): Controller;
|
2872 | |
2873 |
|
2874 |
|
2875 | insertTextByPath(
|
2876 | path: Immutable.List<number>,
|
2877 | offset: number,
|
2878 | text: string,
|
2879 | marks?:
|
2880 | | Array<MarkProperties | MarkJSON | Mark | string>
|
2881 | | Immutable.Set<MarkProperties | MarkJSON | Mark | string>,
|
2882 | ): Controller;
|
2883 | |
2884 |
|
2885 |
|
2886 | mergeNodeByKey(key: string): Controller;
|
2887 | |
2888 |
|
2889 |
|
2890 | mergeNodeByPath(path: Immutable.List<number>): Controller;
|
2891 | |
2892 |
|
2893 |
|
2894 | moveNodeByKey(key: string, newKey: string, newIndex: number): Controller;
|
2895 | |
2896 |
|
2897 |
|
2898 | moveNodeByPath(
|
2899 | path: Immutable.List<number>,
|
2900 | newPath: Immutable.List<number>,
|
2901 | newIndex: number,
|
2902 | ): Controller;
|
2903 | |
2904 |
|
2905 |
|
2906 | removeMarkByKey(
|
2907 | key: string,
|
2908 | offset: number,
|
2909 | length: number,
|
2910 | mark: MarkProperties | MarkJSON | Mark | string,
|
2911 | ): Controller;
|
2912 | |
2913 |
|
2914 |
|
2915 | removeMarkByPath(
|
2916 | path: Immutable.List<number>,
|
2917 | offset: number,
|
2918 | length: number,
|
2919 | mark: MarkProperties | MarkJSON | Mark | string,
|
2920 | ): Controller;
|
2921 | |
2922 |
|
2923 |
|
2924 | removeAllMarksByKey(key: string): Controller;
|
2925 | |
2926 |
|
2927 |
|
2928 | removeAllMarksByPath(path: Immutable.List<number>): Controller;
|
2929 | removeMarksByPath(
|
2930 | path: Immutable.List<number>,
|
2931 | offset: number,
|
2932 | length: number,
|
2933 | marks:
|
2934 | | Array<MarkProperties | MarkJSON | Mark | string>
|
2935 | | Immutable.Set<MarkProperties | MarkJSON | Mark | string>,
|
2936 | ): Controller;
|
2937 | |
2938 |
|
2939 |
|
2940 | removeNodeByKey(key: string): Controller;
|
2941 | |
2942 |
|
2943 |
|
2944 | removeNodeByPath(path: Immutable.List<number>): Controller;
|
2945 | |
2946 |
|
2947 |
|
2948 | replaceNodeByKey(key: string, node: Node): Controller;
|
2949 | |
2950 |
|
2951 |
|
2952 | replaceNodeByPath(path: Immutable.List<number>, newNode: Node): Controller;
|
2953 | |
2954 |
|
2955 |
|
2956 | removeTextByKey(key: string, offset: number, length: number): Controller;
|
2957 | |
2958 |
|
2959 |
|
2960 | removeTextByPath(path: Immutable.List<number>, offset: number, length: number): Controller;
|
2961 | |
2962 |
|
2963 |
|
2964 | |
2965 |
|
2966 |
|
2967 | replaceTextByKey(key: string, node: Node): Controller;
|
2968 | |
2969 |
|
2970 |
|
2971 | replaceTextByPath(
|
2972 | path: Immutable.List<number>,
|
2973 | offset: number,
|
2974 | length: number,
|
2975 | text: string,
|
2976 | marks?: Immutable.Set<Mark> | Mark[],
|
2977 | ): Controller;
|
2978 | |
2979 |
|
2980 |
|
2981 | setMarkByKey(
|
2982 | key: string,
|
2983 | offset: number,
|
2984 | length: number,
|
2985 | properties: MarkProperties | MarkJSON | Mark | string,
|
2986 | newProperties: Partial<MarkProperties | MarkJSON | Mark | string>,
|
2987 | ): Controller;
|
2988 | |
2989 |
|
2990 |
|
2991 | setMarkByPath(
|
2992 | path: Immutable.List<number>,
|
2993 | offset: number,
|
2994 | length: number,
|
2995 | properties: MarkProperties | MarkJSON | Mark | string,
|
2996 | newProperties: Partial<MarkProperties | MarkJSON | Mark | string>,
|
2997 | ): Controller;
|
2998 | |
2999 |
|
3000 |
|
3001 | setNodeByKey(key: string, properties: BlockProperties | InlineProperties | string): Controller;
|
3002 | |
3003 |
|
3004 |
|
3005 | setNodeByPath(path: Immutable.List<number>, newProperties: NodeProperties | InlineProperties | string): Controller;
|
3006 | |
3007 |
|
3008 |
|
3009 | setTextByKey(key: string, text: string, marks: Immutable.Set<Mark>): Controller;
|
3010 | |
3011 |
|
3012 |
|
3013 | setTextByPath(path: Immutable.List<number>, text: string, marks: Immutable.Set<Mark>): Controller;
|
3014 | |
3015 |
|
3016 |
|
3017 | splitDescendantsByKey(key: string, textKey: string, textOffset: number): Controller;
|
3018 | |
3019 |
|
3020 |
|
3021 | splitDescendantsByPath(
|
3022 | path: Immutable.List<number>,
|
3023 | textPath: Immutable.List<number>,
|
3024 | textOffset: number,
|
3025 | ): Controller;
|
3026 |
|
3027 | |
3028 |
|
3029 |
|
3030 | splitNodeByKey(key: string, offset: number): Controller;
|
3031 | |
3032 |
|
3033 |
|
3034 | splitNodeByPath(
|
3035 | path: Immutable.List<number>,
|
3036 | position: number,
|
3037 | options?: { target?: number | undefined },
|
3038 | ): Controller;
|
3039 | |
3040 |
|
3041 |
|
3042 | unwrapInlineByKey(key: string, properties: InlineProperties | string): Controller;
|
3043 | |
3044 |
|
3045 |
|
3046 | unwrapInlineByPath(path: Path, properties: InlineProperties | string): Controller;
|
3047 | |
3048 |
|
3049 |
|
3050 | unwrapBlockByKey(key: string, properties: BlockProperties | string): Controller;
|
3051 | |
3052 |
|
3053 |
|
3054 | unwrapBlockByPath(path: Path, properties: BlockProperties | string): Controller;
|
3055 | |
3056 |
|
3057 |
|
3058 | unwrapChildrenByKey(key: string): Controller;
|
3059 | |
3060 |
|
3061 |
|
3062 |
|
3063 | unwrapChildrenByPath(path: Immutable.List<number> | number[]): Controller;
|
3064 | |
3065 |
|
3066 |
|
3067 |
|
3068 | unwrapNodeByKey(key: string): Controller;
|
3069 | |
3070 |
|
3071 |
|
3072 |
|
3073 | unwrapNodeByPath(path: Immutable.List<number>): Controller;
|
3074 | |
3075 |
|
3076 |
|
3077 | wrapInlineByKey(key: string, properties: InlineProperties | string): Controller;
|
3078 | |
3079 |
|
3080 |
|
3081 | wrapInlineByPath(path: Path, properties: InlineProperties | string): Controller;
|
3082 | |
3083 |
|
3084 |
|
3085 | wrapBlockByKey(key: string, properties: BlockProperties | string): Controller;
|
3086 | |
3087 |
|
3088 |
|
3089 | wrapBlockByPath(path: Immutable.List<number>, block: Block | string): Controller;
|
3090 | |
3091 |
|
3092 |
|
3093 | wrapNodeByKey(key: string, parent: Node): Controller;
|
3094 | |
3095 |
|
3096 |
|
3097 | wrapNodeByPath(path: Immutable.List<number>, parent: Node): Controller;
|
3098 |
|
3099 |
|
3100 | |
3101 |
|
3102 |
|
3103 |
|
3104 | normalize(): Controller;
|
3105 | |
3106 |
|
3107 |
|
3108 |
|
3109 |
|
3110 |
|
3111 | withoutNormalizing(fn: () => void): Controller;
|
3112 | |
3113 |
|
3114 |
|
3115 |
|
3116 | withoutSaving(fn: () => void): void;
|
3117 | |
3118 |
|
3119 |
|
3120 |
|
3121 | withoutMerging(fn: () => void): void;
|
3122 |
|
3123 |
|
3124 | |
3125 |
|
3126 |
|
3127 | redo(): Controller;
|
3128 | |
3129 |
|
3130 |
|
3131 | undo(): Controller;
|
3132 | |
3133 |
|
3134 |
|
3135 | save(operation: Operation): void;
|
3136 | |
3137 |
|
3138 |
|
3139 | snapshotSelection(): Controller;
|
3140 | command(type: string | ((...args: any[]) => any), ...args: any[]): Controller;
|
3141 | /**
|
3142 | * Check if a command by type has been registered.
|
3143 | */
|
3144 | hasCommand(type: string): boolean;
|
3145 | /**
|
3146 | * Check if a query by type has been registered.
|
3147 | */
|
3148 | hasQuery(type: string): boolean;
|
3149 | query(query: string | ((...args: any[]) => any), ...args: any[]): any;
|
3150 | /**
|
3151 | * Add a new command by type to the controller. This will make the command available as a top-level method on the controller
|
3152 | */
|
3153 | registerCommand(command: string): Controller;
|
3154 | /**
|
3155 | * Add a new query by type to the controller. This will make the query available as a top-level method on the controller.
|
3156 | */
|
3157 | registerQuery(query: string): Controller;
|
3158 | /**
|
3159 | * Apply an `operation` to the controller, updating its value.
|
3160 | */
|
3161 | applyOperation(operation: Operation | OperationJSON | OperationProperties): Controller;
|
3162 | /**
|
3163 | * Run the middleware stack by key with args, returning its result.
|
3164 | * In normal operation you never need to use this method! Reserved for testing.
|
3165 | */
|
3166 | run(key: string, ...args: any[]): Controller;
|
3167 | /**
|
3168 | * Set data
|
3169 | */
|
3170 | setData(data: Data): Controller;
|
3171 | /**
|
3172 | * Add annotation
|
3173 | */
|
3174 | addAnnotation(annotation: Annotation | AnnotationProperties | AnnotationJSON): Controller;
|
3175 | /**
|
3176 | * Remove annotation
|
3177 | */
|
3178 | removeAnnotation(annotation: Annotation | AnnotationProperties | AnnotationJSON): Controller;
|
3179 | /**
|
3180 | * Set annotation
|
3181 | */
|
3182 | setAnnotation(
|
3183 | annotation: Annotation,
|
3184 | newProperties: AnnotationProperties | AnnotationJSON | Annotation,
|
3185 | ): Controller;
|
3186 | }
|
3187 |
|
3188 | export {};
|
3189 |
|
\ | No newline at end of file |