UNPKG

1.28 kBTypeScriptView Raw
1import { Editor, Location, Node } from '../../index';
2import { TextUnit } from '../../types/types';
3export interface TextDeleteOptions {
4 at?: Location;
5 distance?: number;
6 unit?: TextUnit;
7 reverse?: boolean;
8 hanging?: boolean;
9 voids?: boolean;
10}
11export interface TextInsertFragmentOptions {
12 at?: Location;
13 hanging?: boolean;
14 voids?: boolean;
15 batchDirty?: boolean;
16}
17export interface TextInsertTextOptions {
18 at?: Location;
19 voids?: boolean;
20}
21export interface TextTransforms {
22 /**
23 * Delete content in the editor.
24 */
25 delete: (editor: Editor, options?: TextDeleteOptions) => void;
26 /**
27 * Insert a fragment in the editor
28 * at the specified location or (if not defined) the current selection or (if not defined) the end of the document.
29 */
30 insertFragment: (editor: Editor, fragment: Node[], options?: TextInsertFragmentOptions) => void;
31 /**
32 * Insert a string of text in the editor
33 * at the specified location or (if not defined) the current selection or (if not defined) the end of the document.
34 */
35 insertText: (editor: Editor, text: string, options?: TextInsertTextOptions) => void;
36}
37export declare const TextTransforms: TextTransforms;
38//# sourceMappingURL=text.d.ts.map
\No newline at end of file