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 SelectionChange from './selection-change';
|
15 | import { RegisterOptions, pluginsListType } from '../plugins';
|
16 | import { MenuListType } from '../menus/menu-list';
|
17 | import BtnMenu from '../menus/menu-constructors/BtnMenu';
|
18 | import DropList from '../menus/menu-constructors/DropList';
|
19 | import DropListMenu from '../menus/menu-constructors/DropListMenu';
|
20 | import Panel from '../menus/menu-constructors/Panel';
|
21 | import PanelMenu from '../menus/menu-constructors/PanelMenu';
|
22 | import Tooltip from '../menus/menu-constructors/Tooltip';
|
23 | declare class Editor {
|
24 | static $: typeof $;
|
25 | static BtnMenu: typeof BtnMenu;
|
26 | static DropList: typeof DropList;
|
27 | static DropListMenu: typeof DropListMenu;
|
28 | static Panel: typeof Panel;
|
29 | static PanelMenu: typeof PanelMenu;
|
30 | static Tooltip: typeof Tooltip;
|
31 | static globalCustomMenuConstructorList: MenuListType;
|
32 | static globalPluginsFunctionList: pluginsListType;
|
33 | pluginsFunctionList: pluginsListType;
|
34 | id: string;
|
35 | toolbarSelector: DomElementSelector;
|
36 | textSelector?: DomElementSelector;
|
37 | config: ConfigType;
|
38 | $toolbarElem: DomElement;
|
39 | $textContainerElem: DomElement;
|
40 | $textElem: DomElement;
|
41 | toolbarElemId: string;
|
42 | textElemId: string;
|
43 | isFocus: boolean;
|
44 | isComposing: boolean;
|
45 | isCompatibleMode: boolean;
|
46 | selection: SelectionAndRangeAPI;
|
47 | cmd: CommandAPI;
|
48 | txt: Text;
|
49 | menus: Menus;
|
50 | i18next: any;
|
51 | highlight: any;
|
52 | zIndex: ZIndex;
|
53 | change: Change;
|
54 | history: History;
|
55 | isEnable: Boolean;
|
56 | onSelectionChange: SelectionChange;
|
57 | private beforeDestroyHooks;
|
58 |
|
59 | disable: Function;
|
60 |
|
61 | enable: Function;
|
62 | |
63 |
|
64 |
|
65 |
|
66 |
|
67 | constructor(toolbarSelector: DomElementSelector, textSelector?: DomElementSelector);
|
68 | /**
|
69 | * 初始化选区
|
70 | * @param newLine 新建一行
|
71 | */
|
72 | initSelection(newLine?: boolean): void;
|
73 | /**
|
74 | * 创建编辑器实例
|
75 | */
|
76 | create(): void;
|
77 | /**
|
78 | * 提供给用户添加销毁前的钩子函数
|
79 | * @param fn 钩子函数
|
80 | */
|
81 | beforeDestroy(fn: Function): Editor;
|
82 | /**
|
83 | * 销毁当前编辑器实例
|
84 | */
|
85 | destroy(): void;
|
86 | /**
|
87 | * 将编辑器设置为全屏
|
88 | */
|
89 | fullScreen(): void;
|
90 | /**
|
91 | * 将编辑器退出全屏
|
92 | */
|
93 | unFullScreen(): void;
|
94 | /**
|
95 | * 滚动到指定标题锚点
|
96 | * @param id 标题锚点id
|
97 | */
|
98 | scrollToHead(id: string): void;
|
99 | /**
|
100 | * 自定义添加菜单
|
101 | * @param key 菜单 key
|
102 | * @param Menu 菜单构造函数
|
103 | */
|
104 | static registerMenu(key: string, Menu: any): void;
|
105 | /**
|
106 | * 自定义添加插件
|
107 | * @param { string } name 插件的名称
|
108 | * @param { RegisterOptions } options 插件的选项
|
109 | */
|
110 | registerPlugin(name: string, options: RegisterOptions): void;
|
111 | |
112 |
|
113 |
|
114 |
|
115 |
|
116 | static registerPlugin(name: string, options: RegisterOptions): void;
|
117 | }
|
118 | export default Editor;
|