forked from ikuaitu/vue-fabric-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditor.d.ts
42 lines (37 loc) · 1006 Bytes
/
editor.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* eslint-disable @typescript-eslint/no-explicit-any */
/*
* @Author: 秦少卫
* @Date: 2023-05-13 18:53:44
* @LastEditors: 秦少卫
* @LastEditTime: 2024-07-22 10:32:18
* @Description: file content
*/
declare interface IPluginOption {
[propName: string]: unknown | undefined;
}
// 生命周期事件类型
declare type IEditorHooksType =
| 'hookImportBefore'
| 'hookImportAfter'
| 'hookSaveBefore'
| 'hookSaveAfter'
| 'hookTransform';
// 插件class
declare interface IPluginClass extends IPluginTempl {
new (canvas: fabric.Canvas, editor: IEditor, options?: IPluginOption);
}
declare interface IPluginMenu {
text: string;
command?: () => void;
child?: IPluginMenu[];
}
// 插件实例
declare class IPluginTempl {
static pluginName: string;
static events: string[];
static apis: string[];
canvas?: fabric.Canvas | null | undefined;
hotkeyEvent?: (name: string, e: KeyboardEvent) => void;
[propName: IEditorHooksType]: () => void;
[propName: string]: any;
}