1 |
|
2 |
|
3 |
|
4 |
|
5 | import $, { DomElement, DomElementSelector } from '../utils/dom-core';
|
6 | import { ConfigType } from '../config';
|
7 | import SelectionAndRangeAPI from './selection';
|
8 | import CommandAPI from './command';
|
9 | import Text from '../text/index';
|
10 | import Menus from '../menus/index';
|
11 | import ZIndex from './z-index';
|
12 | import Change from './change/index';
|
13 | import History from './history/index';
|
14 | import BtnMenu from '../menus/menu-constructors/BtnMenu';
|
15 | import DropList from '../menus/menu-constructors/DropList';
|
16 | import DropListMenu from '../menus/menu-constructors/DropListMenu';
|
17 | import Panel from '../menus/menu-constructors/Panel';
|
18 | import PanelMenu from '../menus/menu-constructors/PanelMenu';
|
19 | import Tooltip from '../menus/menu-constructors/Tooltip';
|
20 | declare class Editor {
|
21 | static $: typeof $;
|
22 | static BtnMenu: typeof BtnMenu;
|
23 | static DropList: typeof DropList;
|
24 | static DropListMenu: typeof DropListMenu;
|
25 | static Panel: typeof Panel;
|
26 | static PanelMenu: typeof PanelMenu;
|
27 | static Tooltip: typeof Tooltip;
|
28 | id: string;
|
29 | toolbarSelector: DomElementSelector;
|
30 | textSelector?: DomElementSelector;
|
31 | config: ConfigType;
|
32 | $toolbarElem: DomElement;
|
33 | $textContainerElem: DomElement;
|
34 | $textElem: DomElement;
|
35 | toolbarElemId: string;
|
36 | textElemId: string;
|
37 | isFocus: boolean;
|
38 | isComposing: boolean;
|
39 | isCompatibleMode: boolean;
|
40 | selection: SelectionAndRangeAPI;
|
41 | cmd: CommandAPI;
|
42 | txt: Text;
|
43 | menus: Menus;
|
44 | i18next: any;
|
45 | highlight: any;
|
46 | zIndex: ZIndex;
|
47 | change: Change;
|
48 | history: History;
|
49 | private beforeDestroyHooks;
|
50 |
|
51 | disable: Function;
|
52 |
|
53 | enable: Function;
|
54 | |
55 |
|
56 |
|
57 |
|
58 |
|
59 | constructor(toolbarSelector: DomElementSelector, textSelector?: DomElementSelector);
|
60 | /**
|
61 | * 初始化选区
|
62 | * @param newLine 新建一行
|
63 | */
|
64 | initSelection(newLine?: boolean): void;
|
65 | /**
|
66 | * 创建编辑器实例
|
67 | */
|
68 | create(): void;
|
69 | /**
|
70 | * 提供给用户添加销毁前的钩子函数
|
71 | * @param fn 钩子函数
|
72 | */
|
73 | beforeDestroy(fn: Function): Editor;
|
74 | /**
|
75 | * 销毁当前编辑器实例
|
76 | */
|
77 | destroy(): void;
|
78 | /**
|
79 | * 将编辑器设置为全屏
|
80 | */
|
81 | fullScreen(): void;
|
82 | /**
|
83 | * 将编辑器退出全屏
|
84 | */
|
85 | unFullScreen(): void;
|
86 | /**
|
87 | * 滚动到指定标题锚点
|
88 | * @param id 标题锚点id
|
89 | */
|
90 | scrollToHead(id: string): void;
|
91 | }
|
92 | export default Editor;
|