@sliprail/sdk 0.1.0 → 0.1.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/lib/index.d.ts +17 -3
- package/package.json +3 -3
package/lib/index.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export type KVStorage = {
|
|
|
42
42
|
has: (key: string) => Promise<boolean>;
|
|
43
43
|
remove: (key: string) => Promise<void>;
|
|
44
44
|
};
|
|
45
|
-
export type
|
|
45
|
+
export type LoadSubShortcutsContext = {
|
|
46
46
|
signal: AbortSignal;
|
|
47
47
|
};
|
|
48
48
|
export type LivePreviewContent = {
|
|
@@ -68,11 +68,12 @@ export type Shortcut = {
|
|
|
68
68
|
src: string;
|
|
69
69
|
template?: boolean;
|
|
70
70
|
fallbackIcon?: string;
|
|
71
|
+
scale?: number;
|
|
71
72
|
};
|
|
72
73
|
prependKeywords?: string[];
|
|
73
74
|
appendKeywords?: string[];
|
|
74
75
|
handle?: (context: ShortcutContext) => Promise<unknown> | unknown;
|
|
75
|
-
|
|
76
|
+
subShortcuts?: Shortcut[] | ((context: LoadSubShortcutsContext) => Promise<Shortcut[]> | Shortcut[]);
|
|
76
77
|
livePreview?: (parameters: string) => Promise<LivePreviewContent | undefined> | LivePreviewContent | undefined;
|
|
77
78
|
};
|
|
78
79
|
export type ExtensionSettingValue = undefined | boolean | string | string[] | ExtensionSettings[];
|
|
@@ -114,6 +115,10 @@ export type StringSetting = CommonSettingOptions & {
|
|
|
114
115
|
autoHeight?: boolean;
|
|
115
116
|
rows?: number;
|
|
116
117
|
maxRows?: number;
|
|
118
|
+
} | {
|
|
119
|
+
type: 'select';
|
|
120
|
+
options: OptionItem[];
|
|
121
|
+
width?: number;
|
|
117
122
|
};
|
|
118
123
|
};
|
|
119
124
|
export type ArrayObjectSetting = CommonSettingOptions & {
|
|
@@ -168,11 +173,17 @@ export type Extension = {
|
|
|
168
173
|
beforeSaveSettings?: (context: ShortcutContext, settings: ExtensionSettings) => ExtensionSettings | Promise<ExtensionSettings>;
|
|
169
174
|
getStatus?: (context: ShortcutContext) => ExtensionStatus | Promise<ExtensionStatus>;
|
|
170
175
|
};
|
|
176
|
+
export type Screenshot = {
|
|
177
|
+
path: string;
|
|
178
|
+
name: string;
|
|
179
|
+
display: number;
|
|
180
|
+
};
|
|
171
181
|
export type SliprailMain = {
|
|
172
182
|
openUrl: (url: string) => void;
|
|
173
183
|
openPath: (path: string) => void;
|
|
174
184
|
openFileLocation: (path: string) => void;
|
|
175
185
|
copyFilesToClipboard: (paths: string[]) => void;
|
|
186
|
+
deleteFiles: (paths: string[]) => void;
|
|
176
187
|
saveTextFile: (options: {
|
|
177
188
|
filename: string;
|
|
178
189
|
content: string;
|
|
@@ -187,9 +198,10 @@ export type SliprailMain = {
|
|
|
187
198
|
copyToClipboard: (content: string) => void;
|
|
188
199
|
pasteFromClipboard: () => string;
|
|
189
200
|
getSystemWindows: () => Promise<WindowInfo[]>;
|
|
190
|
-
captureAllDisplays: () => Promise<
|
|
201
|
+
captureAllDisplays: () => Promise<Screenshot[]>;
|
|
191
202
|
createWindowChannel: () => WindowChannel;
|
|
192
203
|
debugLog: (...logs: unknown[]) => void;
|
|
204
|
+
getPath: (name: 'home' | 'appData' | 'userData' | 'sessionData' | 'temp' | 'exe' | 'module' | 'desktop' | 'documents' | 'downloads' | 'music' | 'pictures' | 'videos' | 'recent' | 'logs' | 'crashDumps') => string;
|
|
193
205
|
};
|
|
194
206
|
export type SliprailRenderer = {
|
|
195
207
|
executeShortcut: (parameters: {
|
|
@@ -205,6 +217,7 @@ export type SliprailRenderer = {
|
|
|
205
217
|
openFileLocation: (path: string) => void;
|
|
206
218
|
copyFilesToClipboard: (paths: string[]) => void;
|
|
207
219
|
cutFilesToClipboard: (paths: string[]) => void;
|
|
220
|
+
deleteFiles: (paths: string[]) => void;
|
|
208
221
|
selectDirectory: () => Promise<string | undefined>;
|
|
209
222
|
openSettings: () => Promise<void>;
|
|
210
223
|
saveTextFile: (options: {
|
|
@@ -213,6 +226,7 @@ export type SliprailRenderer = {
|
|
|
213
226
|
}) => Promise<void>;
|
|
214
227
|
saveFile: (file: File) => Promise<void>;
|
|
215
228
|
saveBase64File: (filename: string, base64Content: string) => Promise<void>;
|
|
229
|
+
debugLog: (...logs: unknown[]) => void;
|
|
216
230
|
};
|
|
217
231
|
declare global {
|
|
218
232
|
var sliprailMain: SliprailMain;
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sliprail/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.mjs",
|
|
7
7
|
"files": [
|
|
8
|
-
"lib/index.mjs",
|
|
9
8
|
"lib/index.d.ts"
|
|
10
9
|
],
|
|
10
|
+
"types": "lib/index.d.ts",
|
|
11
11
|
"devDependencies": {
|
|
12
|
-
"@types/node": "^20.19.
|
|
12
|
+
"@types/node": "^20.19.11",
|
|
13
13
|
"typescript": "5.6.3"
|
|
14
14
|
},
|
|
15
15
|
"engines": {
|