@mastergo/plugin-typings 2.8.0-beta.0 → 2.8.0-beta.2
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.
- package/README-en.md +2 -0
- package/README.md +2 -0
- package/dist/index.d.ts +24 -10
- package/package.json +1 -1
package/README-en.md
CHANGED
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1041,15 +1041,29 @@ declare global {
|
|
|
1041
1041
|
getBytesAsync(): Promise<Uint8Array>
|
|
1042
1042
|
}
|
|
1043
1043
|
|
|
1044
|
-
type
|
|
1044
|
+
type ThemeColor = 'dark' | 'light'
|
|
1045
1045
|
|
|
1046
|
-
type
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1046
|
+
type LayoutInfo = {
|
|
1047
|
+
leftbar: number;
|
|
1048
|
+
rightbar: number;
|
|
1049
|
+
canvas: number;
|
|
1050
|
+
window: number;
|
|
1051
|
+
height: number;
|
|
1052
|
+
topbar: number;
|
|
1053
|
+
}
|
|
1051
1054
|
|
|
1052
|
-
type
|
|
1055
|
+
type MGEventCallbackMap = {
|
|
1056
|
+
'selectionchange': (selectionLayerIds: string[]) => void;
|
|
1057
|
+
'layoutchange': (layoutInfo: LayoutInfo) => void;
|
|
1058
|
+
'currentpagechange': (pageId: string) => void;
|
|
1059
|
+
'themechange': (theme: ThemeColor) => void;
|
|
1060
|
+
'drop': (event: DropEvent) => void;
|
|
1061
|
+
'run': (command: { command: string }) => void;
|
|
1062
|
+
'close': () => void;
|
|
1063
|
+
'beforeReadyForDev': (sectionLayerId: string, callback: (setReady: boolean) => void) => void;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
type PluginEventType = keyof MGEventCallbackMap
|
|
1053
1067
|
|
|
1054
1068
|
interface PluginAPI {
|
|
1055
1069
|
readonly document: DocumentNode
|
|
@@ -1081,9 +1095,9 @@ declare global {
|
|
|
1081
1095
|
|
|
1082
1096
|
closePlugin(): void
|
|
1083
1097
|
|
|
1084
|
-
on(type:
|
|
1085
|
-
once(type:
|
|
1086
|
-
off(type?:
|
|
1098
|
+
on<T extends PluginEventType>(type: T, callback: MGEventCallbackMap[T]): void
|
|
1099
|
+
once<T extends PluginEventType>(type: T, callback: MGEventCallbackMap[T]): void
|
|
1100
|
+
off<T extends PluginEventType>(type?: T, callback?: MGEventCallbackMap[T]): void
|
|
1087
1101
|
|
|
1088
1102
|
commitUndo(): void
|
|
1089
1103
|
triggerUndo(): void
|