@sliprail/sdk 0.1.11 → 0.1.13
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 +17 -1
- package/package.json +12 -3
package/lib/index.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export type WindowOptions = {
|
|
|
41
41
|
onClose?: () => void;
|
|
42
42
|
};
|
|
43
43
|
export type WindowControl = {
|
|
44
|
+
shortcutId: string;
|
|
44
45
|
close: () => void;
|
|
45
46
|
show: () => void;
|
|
46
47
|
hide: () => void;
|
|
@@ -59,6 +60,13 @@ export type LivePreviewContent = {
|
|
|
59
60
|
content: string;
|
|
60
61
|
type?: 'info' | 'warn' | 'error' | 'hint';
|
|
61
62
|
};
|
|
63
|
+
type WindowScope = 'shortcut' | 'extension';
|
|
64
|
+
export type GetWindowsOptions = {
|
|
65
|
+
scope?: WindowScope;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* @public
|
|
69
|
+
*/
|
|
62
70
|
export type ShortcutContext = SliprailMain & {
|
|
63
71
|
parameter: any;
|
|
64
72
|
subShortcutId: string;
|
|
@@ -66,7 +74,7 @@ export type ShortcutContext = SliprailMain & {
|
|
|
66
74
|
getSettings: (keys?: string[]) => Promise<Record<string, unknown>>;
|
|
67
75
|
createWindow: (options: WindowOptions) => WindowControl;
|
|
68
76
|
createStorage: () => KVStorage;
|
|
69
|
-
getWindows: () => WindowControl[];
|
|
77
|
+
getWindows: (options?: GetWindowsOptions) => WindowControl[];
|
|
70
78
|
channel: WindowChannel | undefined;
|
|
71
79
|
events: {
|
|
72
80
|
on: (event: 'settingsChange', callback: () => unknown) => void;
|
|
@@ -184,6 +192,9 @@ type StatusWarning = {
|
|
|
184
192
|
};
|
|
185
193
|
export type ExtensionStatus = StatusOk | StatusLoading | StatusError | StatusWarning;
|
|
186
194
|
export type SettingDefinition = BooleanSetting | NumberSetting | StringSetting | ArrayStringSetting | ArrayObjectSetting;
|
|
195
|
+
/**
|
|
196
|
+
* @public
|
|
197
|
+
*/
|
|
187
198
|
export type Extension = {
|
|
188
199
|
id?: string;
|
|
189
200
|
name?: string;
|
|
@@ -222,6 +233,7 @@ export type SliprailMain = {
|
|
|
222
233
|
message: string;
|
|
223
234
|
}) => any;
|
|
224
235
|
showAlert: (message: string) => void;
|
|
236
|
+
showConfirm: (message: string) => Promise<boolean>;
|
|
225
237
|
writeTextToClipboard: (content: string) => void;
|
|
226
238
|
writeHTMLToClipboard: (content: {
|
|
227
239
|
html: string;
|
|
@@ -268,6 +280,10 @@ export type SliprailRenderer = {
|
|
|
268
280
|
debugLog: (...logs: unknown[]) => void;
|
|
269
281
|
};
|
|
270
282
|
declare global {
|
|
283
|
+
/**
|
|
284
|
+
* @public
|
|
285
|
+
* A global constant that can be called in the sliprail extension window.
|
|
286
|
+
*/
|
|
271
287
|
var sliprail: SliprailRenderer;
|
|
272
288
|
}
|
|
273
289
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sliprail/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.mjs",
|
|
@@ -9,13 +9,22 @@
|
|
|
9
9
|
],
|
|
10
10
|
"types": "lib/index.d.ts",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@types/react": "^18.3.
|
|
12
|
+
"@types/react": "^18.3.24"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@types/node": "^20.19.
|
|
15
|
+
"@types/node": "^20.19.25",
|
|
16
16
|
"typescript": "5.6.3"
|
|
17
17
|
},
|
|
18
18
|
"engines": {
|
|
19
19
|
"node": ">=20"
|
|
20
|
+
},
|
|
21
|
+
"magis": {
|
|
22
|
+
"doc": {
|
|
23
|
+
"backUrl": {
|
|
24
|
+
"url": "https://sliprail.fengcen.io",
|
|
25
|
+
"title": "Sliprail",
|
|
26
|
+
"logo": "../../../packages/react-commons/src/assets/sliprail.svg"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
20
29
|
}
|
|
21
30
|
}
|