@sliprail/sdk 0.1.10 → 0.1.11
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/lib/index.d.ts +8 -0
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -62,6 +62,7 @@ export type LivePreviewContent = {
|
|
|
62
62
|
export type ShortcutContext = SliprailMain & {
|
|
63
63
|
parameter: any;
|
|
64
64
|
subShortcutId: string;
|
|
65
|
+
subShortcutFilter: string | undefined;
|
|
65
66
|
getSettings: (keys?: string[]) => Promise<Record<string, unknown>>;
|
|
66
67
|
createWindow: (options: WindowOptions) => WindowControl;
|
|
67
68
|
createStorage: () => KVStorage;
|
|
@@ -83,6 +84,10 @@ export type ShortcutPreview = {
|
|
|
83
84
|
text: string;
|
|
84
85
|
style?: CSSProperties;
|
|
85
86
|
};
|
|
87
|
+
export type ShortcutContextMenu = {
|
|
88
|
+
displayName: string;
|
|
89
|
+
executeShortcutId: string;
|
|
90
|
+
};
|
|
86
91
|
export type Shortcut = {
|
|
87
92
|
id: string;
|
|
88
93
|
displayName: string;
|
|
@@ -97,7 +102,9 @@ export type Shortcut = {
|
|
|
97
102
|
prependKeywords?: string[];
|
|
98
103
|
appendKeywords?: string[];
|
|
99
104
|
handle?: (context: ShortcutContext) => Promise<unknown> | unknown;
|
|
105
|
+
subShortcutFilters?: string[];
|
|
100
106
|
subShortcuts?: SubShortcut[] | ((context: LoadSubShortcutsContext) => Promise<SubShortcut[]> | SubShortcut[]);
|
|
107
|
+
onSubShortcutContextMenu?: (context: ShortcutContext) => ShortcutContextMenu[] | Promise<ShortcutContextMenu[]>;
|
|
101
108
|
subShortcutPreview?: (context: ShortcutContext) => Promise<ShortcutPreview | undefined> | ShortcutPreview | undefined;
|
|
102
109
|
livePreview?: (parameters: string) => Promise<LivePreviewContent | undefined> | LivePreviewContent | undefined;
|
|
103
110
|
};
|
|
@@ -239,6 +246,7 @@ export type SliprailRenderer = {
|
|
|
239
246
|
extensionId: string;
|
|
240
247
|
shortcutId: string;
|
|
241
248
|
parameter?: string;
|
|
249
|
+
subShortcutId?: string;
|
|
242
250
|
}) => Promise<unknown>;
|
|
243
251
|
getParameters: () => Promise<Record<string, unknown>>;
|
|
244
252
|
openExtensionSettings: () => void;
|