@sliprail/sdk 0.1.22 → 0.1.23

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 CHANGED
@@ -80,6 +80,7 @@ export type AIChunk = {
80
80
  type: 'done';
81
81
  reason: 'error';
82
82
  error: string;
83
+ code?: string;
83
84
  };
84
85
  export type AIResponse = AsyncIterable<AIChunk>;
85
86
  export type AISessionSummary = {
package/lib/index.d.ts CHANGED
@@ -67,10 +67,23 @@ type WindowScope = 'shortcut' | 'extension';
67
67
  export type GetWindowsOptions = {
68
68
  scope?: WindowScope;
69
69
  };
70
+ export type ShortcutFile = {
71
+ name: string;
72
+ type: string;
73
+ size: number;
74
+ lastModified: number;
75
+ } & ({
76
+ path: string;
77
+ data?: never;
78
+ } | {
79
+ data: ArrayBuffer;
80
+ path?: never;
81
+ });
70
82
  /**
71
83
  * @public
72
84
  */
73
85
  export type ShortcutContext = SliprailMain & {
86
+ files?: ShortcutFile[];
74
87
  parameter: any;
75
88
  subShortcutId: string;
76
89
  subShortcutFilter: string | undefined;
@@ -123,12 +136,15 @@ export type Shortcut = {
123
136
  };
124
137
  prependKeywords?: string[];
125
138
  appendKeywords?: string[];
139
+ acceptsParameter?: boolean;
140
+ acceptsFiles?: boolean;
126
141
  handle?: (context: ShortcutContext) => Promise<unknown> | unknown;
127
142
  subShortcutFilters?: string[];
128
143
  subShortcuts?: SubShortcut[] | ((context: LoadSubShortcutsContext) => Promise<SubShortcut[]> | SubShortcut[]);
129
144
  onSubShortcutContextMenu?: (context: ShortcutContext) => ShortcutContextMenu[] | Promise<ShortcutContextMenu[]>;
130
145
  subShortcutPreview?: (context: ShortcutContext) => Promise<ShortcutPreview | undefined> | ShortcutPreview | undefined;
131
146
  livePreview?: (parameters: string) => Promise<LivePreviewContent | undefined> | LivePreviewContent | undefined;
147
+ selectedItemAutoHeight?: boolean;
132
148
  };
133
149
  export type SubShortcut = Shortcut & {
134
150
  preview?: ShortcutPreview;
@@ -235,7 +251,7 @@ export type SliprailMain = {
235
251
  saveTextFile: (options: {
236
252
  filename: string;
237
253
  content: string;
238
- }) => Promise<void>;
254
+ }) => Promise<boolean>;
239
255
  writeFilesToClipboard: (paths: string[]) => void;
240
256
  cutFilesToClipboard: (paths: string[]) => void;
241
257
  selectFiles: (options?: SelectFilesOptions) => Promise<string[]>;
@@ -278,6 +294,8 @@ export type SliprailRenderer = {
278
294
  openUrl: (url: string) => void;
279
295
  openPath: (path: string) => void;
280
296
  openFileLocation: (path: string) => void;
297
+ getPathForFile: (file: File) => string;
298
+ readFile: (path: string) => Promise<Uint8Array>;
281
299
  writeFilesToClipboard: (paths: string[]) => void;
282
300
  cutFilesToClipboard: (paths: string[]) => void;
283
301
  deleteFiles: (paths: string[]) => void;
@@ -286,9 +304,9 @@ export type SliprailRenderer = {
286
304
  saveTextFile: (options: {
287
305
  filename: string;
288
306
  content: string;
289
- }) => Promise<void>;
307
+ }) => Promise<boolean>;
290
308
  saveFile: (file: File) => Promise<void>;
291
- saveBase64File: (filename: string, base64Content: string) => Promise<void>;
309
+ saveBase64File: (filename: string, base64Content: string) => Promise<boolean>;
292
310
  debugLog: (...logs: unknown[]) => void;
293
311
  };
294
312
  declare global {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sliprail/sdk",
3
- "version": "0.1.22",
3
+ "version": "0.1.23",
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": "^18.3.27"
12
+ "@types/react": "^19.2.17"
13
13
  },
14
14
  "devDependencies": {
15
- "@types/node": "^20.19.37",
16
- "typescript": "5.9.3"
15
+ "@types/node": "^24.13.3",
16
+ "typescript": "6.0.3"
17
17
  },
18
18
  "engines": {
19
- "node": ">=20"
19
+ "node": ">=22"
20
20
  },
21
21
  "magis": {
22
22
  "doc": {
23
23
  "backUrl": {
24
- "url": "https://sliprail.fengcen.io",
24
+ "url": "https://sliprail.com",
25
25
  "title": "Sliprail",
26
26
  "logo": "../../../packages/react-commons/src/assets/sliprail.svg"
27
27
  }