-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
334 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import type Editor from '@kuaitu/core'; | ||
|
||
// IEditor类型包含插件实例,Editor不包含插件实例 | ||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
export interface IEditor extends Editor {} | ||
|
||
// 生命周期事件类型 | ||
export type IEditorHooksType = | ||
| 'hookImportBefore' | ||
| 'hookImportAfter' | ||
| 'hookSaveBefore' | ||
| 'hookSaveAfter' | ||
| 'hookTransform'; | ||
|
||
// 插件实例 | ||
export declare class IPluginTempl { | ||
constructor(canvas: fabric.Canvas, editor: IEditor, options?: IPluginOption); | ||
static pluginName: string; | ||
static events: string[]; | ||
static apis: string[]; | ||
hotkeyEvent?: (name: string, e: KeyboardEvent) => void; | ||
hookImportBefore?: (...args: unknown[]) => Promise<unknown>; | ||
hookImportAfter?: (...args: unknown[]) => Promise<unknown>; | ||
hookSaveBefore?: (...args: unknown[]) => Promise<unknown>; | ||
hookSaveAfter?: (...args: unknown[]) => Promise<unknown>; | ||
hookTransform?: (...args: unknown[]) => Promise<unknown>; | ||
[propName: string]: any; | ||
canvas?: fabric.Canvas; | ||
editor?: IEditor; | ||
} | ||
|
||
export declare interface IPluginOption { | ||
[propName: string]: unknown | undefined; | ||
} | ||
|
||
declare class IPluginClass2 extends IPluginTempl { | ||
constructor(); | ||
} | ||
// 插件class | ||
export declare interface IPluginClass { | ||
new (canvas: fabric.Canvas, editor: Editor, options?: IPluginOption): IPluginClass2; | ||
} | ||
|
||
export declare interface IPluginMenu { | ||
text: string; | ||
command?: () => void; | ||
child?: IPluginMenu[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.