1 |
|
2 | import "./assets/less/index.less";
|
3 | import VditorMethod from "./method";
|
4 | declare class Vditor extends VditorMethod {
|
5 | readonly version: string;
|
6 | vditor: IVditor;
|
7 | |
8 |
|
9 |
|
10 |
|
11 | constructor(id: string | HTMLElement, options?: IOptions);
|
12 | /** 设置主题 */
|
13 | setTheme(theme: "dark" | "classic", contentTheme?: string, codeTheme?: string, contentThemePath?: string): void;
|
14 | /** 获取 Markdown 内容 */
|
15 | getValue(): string;
|
16 | /** 获取编辑器当前编辑模式 */
|
17 | getCurrentMode(): "sv" | "wysiwyg" | "ir";
|
18 | /** 聚焦到编辑器 */
|
19 | focus(): void;
|
20 | /** 让编辑器失焦 */
|
21 | blur(): void;
|
22 | /** 禁用编辑器 */
|
23 | disabled(): void;
|
24 | /** 解除编辑器禁用 */
|
25 | enable(): void;
|
26 | /** 返回选中的字符串 */
|
27 | getSelection(): string;
|
28 | /** 设置预览区域内容 */
|
29 | renderPreview(value?: string): void;
|
30 | /** 获取焦点位置 */
|
31 | getCursorPosition(): {
|
32 | left: number;
|
33 | top: number;
|
34 | };
|
35 |
|
36 | isUploading(): boolean;
|
37 |
|
38 | clearCache(): void;
|
39 |
|
40 | disabledCache(): void;
|
41 |
|
42 | enableCache(): void;
|
43 |
|
44 | html2md(value: string): string;
|
45 |
|
46 | exportJSON(value: string): string;
|
47 |
|
48 | getHTML(): string;
|
49 |
|
50 | tip(text: string, time?: number): void;
|
51 |
|
52 | setPreviewMode(mode: "both" | "editor"): void;
|
53 |
|
54 | deleteValue(): void;
|
55 |
|
56 | updateValue(value: string): void;
|
57 |
|
58 | insertValue(value: string, render?: boolean): void;
|
59 |
|
60 | setValue(markdown: string, clearStack?: boolean): void;
|
61 |
|
62 | clearStack(): void;
|
63 |
|
64 | destroy(): void;
|
65 |
|
66 | getCommentIds(): ICommentsData[];
|
67 |
|
68 | hlCommentIds(ids: string[]): void;
|
69 |
|
70 | unHlCommentIds(ids: string[]): void;
|
71 |
|
72 | removeCommentIds(removeIds: string[]): void;
|
73 | private init;
|
74 | }
|
75 | export default Vditor;
|