@sliprail/sdk 0.1.22 → 0.1.24
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/ai.d.ts +1 -0
- package/lib/index.d.ts +28 -9
- package/package.json +6 -6
package/lib/ai.d.ts
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export type WindowOptions = {
|
|
|
35
35
|
skipTaskbar?: boolean;
|
|
36
36
|
thickFrame?: boolean;
|
|
37
37
|
fullscreen?: boolean;
|
|
38
|
+
coverPrimaryDisplay?: boolean;
|
|
38
39
|
fullscreenable?: boolean;
|
|
39
40
|
frame?: boolean;
|
|
40
41
|
hasShadow?: boolean;
|
|
@@ -67,10 +68,23 @@ type WindowScope = 'shortcut' | 'extension';
|
|
|
67
68
|
export type GetWindowsOptions = {
|
|
68
69
|
scope?: WindowScope;
|
|
69
70
|
};
|
|
71
|
+
export type ShortcutFile = {
|
|
72
|
+
name: string;
|
|
73
|
+
type: string;
|
|
74
|
+
size: number;
|
|
75
|
+
lastModified: number;
|
|
76
|
+
} & ({
|
|
77
|
+
path: string;
|
|
78
|
+
data?: never;
|
|
79
|
+
} | {
|
|
80
|
+
data: ArrayBuffer;
|
|
81
|
+
path?: never;
|
|
82
|
+
});
|
|
70
83
|
/**
|
|
71
84
|
* @public
|
|
72
85
|
*/
|
|
73
86
|
export type ShortcutContext = SliprailMain & {
|
|
87
|
+
files?: ShortcutFile[];
|
|
74
88
|
parameter: any;
|
|
75
89
|
subShortcutId: string;
|
|
76
90
|
subShortcutFilter: string | undefined;
|
|
@@ -123,12 +137,15 @@ export type Shortcut = {
|
|
|
123
137
|
};
|
|
124
138
|
prependKeywords?: string[];
|
|
125
139
|
appendKeywords?: string[];
|
|
140
|
+
acceptsParameter?: boolean;
|
|
141
|
+
acceptsFiles?: boolean;
|
|
126
142
|
handle?: (context: ShortcutContext) => Promise<unknown> | unknown;
|
|
127
143
|
subShortcutFilters?: string[];
|
|
128
144
|
subShortcuts?: SubShortcut[] | ((context: LoadSubShortcutsContext) => Promise<SubShortcut[]> | SubShortcut[]);
|
|
129
145
|
onSubShortcutContextMenu?: (context: ShortcutContext) => ShortcutContextMenu[] | Promise<ShortcutContextMenu[]>;
|
|
130
146
|
subShortcutPreview?: (context: ShortcutContext) => Promise<ShortcutPreview | undefined> | ShortcutPreview | undefined;
|
|
131
147
|
livePreview?: (parameters: string) => Promise<LivePreviewContent | undefined> | LivePreviewContent | undefined;
|
|
148
|
+
selectedItemAutoHeight?: boolean;
|
|
132
149
|
};
|
|
133
150
|
export type SubShortcut = Shortcut & {
|
|
134
151
|
preview?: ShortcutPreview;
|
|
@@ -235,7 +252,7 @@ export type SliprailMain = {
|
|
|
235
252
|
saveTextFile: (options: {
|
|
236
253
|
filename: string;
|
|
237
254
|
content: string;
|
|
238
|
-
}) => Promise<
|
|
255
|
+
}) => Promise<boolean>;
|
|
239
256
|
writeFilesToClipboard: (paths: string[]) => void;
|
|
240
257
|
cutFilesToClipboard: (paths: string[]) => void;
|
|
241
258
|
selectFiles: (options?: SelectFilesOptions) => Promise<string[]>;
|
|
@@ -245,18 +262,18 @@ export type SliprailMain = {
|
|
|
245
262
|
}) => any;
|
|
246
263
|
showAlert: (message: string) => void;
|
|
247
264
|
showConfirm: (message: string) => Promise<boolean>;
|
|
248
|
-
writeTextToClipboard: (content: string) => void
|
|
265
|
+
writeTextToClipboard: (content: string) => Promise<void>;
|
|
249
266
|
writeHTMLToClipboard: (content: {
|
|
250
267
|
html: string;
|
|
251
268
|
text: string;
|
|
252
|
-
}) => void
|
|
269
|
+
}) => Promise<void>;
|
|
253
270
|
writeRTFToClipboard: (content: {
|
|
254
271
|
rtf: string;
|
|
255
272
|
text: string;
|
|
256
|
-
}) => void
|
|
257
|
-
readTextFromClipboard: () => string
|
|
258
|
-
readHTMLFromClipboard: () => string
|
|
259
|
-
readRTFFromClipboard: () => string
|
|
273
|
+
}) => Promise<void>;
|
|
274
|
+
readTextFromClipboard: () => Promise<string>;
|
|
275
|
+
readHTMLFromClipboard: () => Promise<string>;
|
|
276
|
+
readRTFFromClipboard: () => Promise<string>;
|
|
260
277
|
readFilesFromClipboard: () => string[];
|
|
261
278
|
getSystemWindows: () => Promise<WindowInfo[]>;
|
|
262
279
|
captureAllDisplays: () => Promise<Screenshot[]>;
|
|
@@ -278,6 +295,8 @@ export type SliprailRenderer = {
|
|
|
278
295
|
openUrl: (url: string) => void;
|
|
279
296
|
openPath: (path: string) => void;
|
|
280
297
|
openFileLocation: (path: string) => void;
|
|
298
|
+
getPathForFile: (file: File) => string;
|
|
299
|
+
readFile: (path: string) => Promise<Uint8Array>;
|
|
281
300
|
writeFilesToClipboard: (paths: string[]) => void;
|
|
282
301
|
cutFilesToClipboard: (paths: string[]) => void;
|
|
283
302
|
deleteFiles: (paths: string[]) => void;
|
|
@@ -286,9 +305,9 @@ export type SliprailRenderer = {
|
|
|
286
305
|
saveTextFile: (options: {
|
|
287
306
|
filename: string;
|
|
288
307
|
content: string;
|
|
289
|
-
}) => Promise<
|
|
308
|
+
}) => Promise<boolean>;
|
|
290
309
|
saveFile: (file: File) => Promise<void>;
|
|
291
|
-
saveBase64File: (filename: string, base64Content: string) => Promise<
|
|
310
|
+
saveBase64File: (filename: string, base64Content: string) => Promise<boolean>;
|
|
292
311
|
debugLog: (...logs: unknown[]) => void;
|
|
293
312
|
};
|
|
294
313
|
declare global {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sliprail/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.24",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.mjs",
|
|
@@ -9,19 +9,19 @@
|
|
|
9
9
|
],
|
|
10
10
|
"types": "lib/index.d.ts",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@types/react": "^
|
|
12
|
+
"@types/react": "^19.2.17"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@types/node": "^
|
|
16
|
-
"typescript": "
|
|
15
|
+
"@types/node": "^24.13.6",
|
|
16
|
+
"typescript": "6.0.3"
|
|
17
17
|
},
|
|
18
18
|
"engines": {
|
|
19
|
-
"node": ">=
|
|
19
|
+
"node": ">=22"
|
|
20
20
|
},
|
|
21
21
|
"magis": {
|
|
22
22
|
"doc": {
|
|
23
23
|
"backUrl": {
|
|
24
|
-
"url": "https://sliprail.
|
|
24
|
+
"url": "https://sliprail.com",
|
|
25
25
|
"title": "Sliprail",
|
|
26
26
|
"logo": "../../../packages/react-commons/src/assets/sliprail.svg"
|
|
27
27
|
}
|