@sliprail/sdk 0.1.1 → 0.1.3

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.
Files changed (2) hide show
  1. package/lib/index.d.ts +9 -2
  2. package/package.json +2 -2
package/lib/index.d.ts CHANGED
@@ -20,12 +20,13 @@ export type WindowChannel = {
20
20
  _window: unknown;
21
21
  _emitter: unknown;
22
22
  };
23
- export type ShowWindowOptions = {
23
+ export type WindowOptions = {
24
24
  htmlFile: string;
25
25
  title?: string;
26
26
  width?: number;
27
27
  height?: number;
28
28
  maximize?: boolean;
29
+ alwaysOnTop?: boolean;
29
30
  parameters?: Record<string, unknown>;
30
31
  channel?: WindowChannel;
31
32
  resizable?: boolean;
@@ -34,6 +35,10 @@ export type ShowWindowOptions = {
34
35
  export type WindowControl = {
35
36
  close: () => void;
36
37
  show: () => void;
38
+ hide: () => void;
39
+ minimize: () => void;
40
+ isFocused: () => boolean;
41
+ isVisible: () => boolean;
37
42
  _runtime?: unknown;
38
43
  };
39
44
  export type KVStorage = {
@@ -52,8 +57,9 @@ export type LivePreviewContent = {
52
57
  export type ShortcutContext = {
53
58
  parameter: any;
54
59
  getSettings: () => Promise<Record<string, unknown>>;
55
- showWindow: (showWindow: ShowWindowOptions) => WindowControl;
60
+ createWindow: (options: WindowOptions) => WindowControl;
56
61
  createStorage: () => KVStorage;
62
+ getWindows: () => WindowControl[];
57
63
  channel: WindowChannel | undefined;
58
64
  events: {
59
65
  on: (event: 'settingsChange', callback: () => unknown) => void;
@@ -226,6 +232,7 @@ export type SliprailRenderer = {
226
232
  }) => Promise<void>;
227
233
  saveFile: (file: File) => Promise<void>;
228
234
  saveBase64File: (filename: string, base64Content: string) => Promise<void>;
235
+ debugLog: (...logs: unknown[]) => void;
229
236
  };
230
237
  declare global {
231
238
  var sliprailMain: SliprailMain;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sliprail/sdk",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "lib/index.mjs",
@@ -9,7 +9,7 @@
9
9
  ],
10
10
  "types": "lib/index.d.ts",
11
11
  "devDependencies": {
12
- "@types/node": "^20.19.10",
12
+ "@types/node": "^20.19.11",
13
13
  "typescript": "5.6.3"
14
14
  },
15
15
  "engines": {