@hprint/core 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,58 +1,58 @@
1
- import type Editor from '@hprint/core';
2
-
3
- // IEditor类型包含插件实例,Editor不包含插件实例
4
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
5
- export interface IEditor extends Editor { }
6
-
7
- // 生命周期事件类型
8
- export type IEditorHooksType =
9
- | 'hookImportBefore'
10
- | 'hookImportAfter'
11
- | 'hookSaveBefore'
12
- | 'hookSaveAfter'
13
- | 'hookTransform'
14
- | 'hookTransformObjectEnd';
15
-
16
- // 插件实例
17
- export declare class IPluginTempl {
18
- constructor(
19
- canvas: fabric.Canvas,
20
- editor: IEditor,
21
- options?: IPluginOption
22
- );
23
- static pluginName: string;
24
- static events: string[];
25
- static apis: string[];
26
- hotkeyEvent?: (name: string, e: KeyboardEvent) => void;
27
- hookImportBefore?: (...args: unknown[]) => Promise<unknown>;
28
- hookImportAfter?: (...args: unknown[]) => Promise<unknown>;
29
- hookSaveBefore?: (...args: unknown[]) => Promise<unknown>;
30
- hookSaveAfter?: (...args: unknown[]) => Promise<unknown>;
31
- hookTransform?: (...args: unknown[]) => Promise<unknown>;
32
- hookTransformObjectEnd?: (...args: unknown[]) => Promise<unknown>;
33
- [propName: string]: any;
34
- canvas?: fabric.Canvas;
35
- editor?: IEditor;
36
- }
37
-
38
- export declare interface IPluginOption {
39
- [propName: string]: unknown | undefined;
40
- }
41
-
42
- declare class IPluginClass2 extends IPluginTempl {
43
- constructor();
44
- }
45
- // 插件class
46
- export declare interface IPluginClass {
47
- new(
48
- canvas: fabric.Canvas,
49
- editor: Editor,
50
- options?: IPluginOption
51
- ): IPluginClass2;
52
- }
53
-
54
- export declare interface IPluginMenu {
55
- text: string;
56
- command?: () => void;
57
- child?: IPluginMenu[];
58
- }
1
+ import type Editor from '@hprint/core';
2
+
3
+ // IEditor类型包含插件实例,Editor不包含插件实例
4
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
5
+ export interface IEditor extends Editor { }
6
+
7
+ // 生命周期事件类型
8
+ export type IEditorHooksType =
9
+ | 'hookImportBefore'
10
+ | 'hookImportAfter'
11
+ | 'hookSaveBefore'
12
+ | 'hookSaveAfter'
13
+ | 'hookTransform'
14
+ | 'hookTransformObjectEnd';
15
+
16
+ // 插件实例
17
+ export declare class IPluginTempl {
18
+ constructor(
19
+ canvas: fabric.Canvas,
20
+ editor: IEditor,
21
+ options?: IPluginOption
22
+ );
23
+ static pluginName: string;
24
+ static events: string[];
25
+ static apis: string[];
26
+ hotkeyEvent?: (name: string, e: KeyboardEvent) => void;
27
+ hookImportBefore?: (...args: unknown[]) => Promise<unknown>;
28
+ hookImportAfter?: (...args: unknown[]) => Promise<unknown>;
29
+ hookSaveBefore?: (...args: unknown[]) => Promise<unknown>;
30
+ hookSaveAfter?: (...args: unknown[]) => Promise<unknown>;
31
+ hookTransform?: (...args: unknown[]) => Promise<unknown>;
32
+ hookTransformObjectEnd?: (...args: unknown[]) => Promise<unknown>;
33
+ [propName: string]: any;
34
+ canvas?: fabric.Canvas;
35
+ editor?: IEditor;
36
+ }
37
+
38
+ export declare interface IPluginOption {
39
+ [propName: string]: unknown | undefined;
40
+ }
41
+
42
+ declare class IPluginClass2 extends IPluginTempl {
43
+ constructor();
44
+ }
45
+ // 插件class
46
+ export declare interface IPluginClass {
47
+ new(
48
+ canvas: fabric.Canvas,
49
+ editor: Editor,
50
+ options?: IPluginOption
51
+ ): IPluginClass2;
52
+ }
53
+
54
+ export declare interface IPluginMenu {
55
+ text: string;
56
+ command?: () => void;
57
+ child?: IPluginMenu[];
58
+ }