@sliprail/sdk 0.1.8 → 0.1.9

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 +10 -0
  2. package/package.json +1 -1
package/lib/index.d.ts CHANGED
@@ -60,6 +60,7 @@ export type LivePreviewContent = {
60
60
  };
61
61
  export type ShortcutContext = SliprailMain & {
62
62
  parameter: any;
63
+ subShortcutId: string;
63
64
  getSettings: (keys?: string[]) => Promise<Record<string, unknown>>;
64
65
  createWindow: (options: WindowOptions) => WindowControl;
65
66
  createStorage: () => KVStorage;
@@ -72,6 +73,14 @@ export type ShortcutContext = SliprailMain & {
72
73
  export type LoadSubShortcutsContext = ShortcutContext & {
73
74
  signal: AbortSignal;
74
75
  };
76
+ export type ShortcutPreview = {
77
+ image: {
78
+ buffer: unknown;
79
+ mimeType: string;
80
+ };
81
+ } | {
82
+ text: string;
83
+ } | undefined | void;
75
84
  export type Shortcut = {
76
85
  id: string;
77
86
  displayName: string;
@@ -87,6 +96,7 @@ export type Shortcut = {
87
96
  appendKeywords?: string[];
88
97
  handle?: (context: ShortcutContext) => Promise<unknown> | unknown;
89
98
  subShortcuts?: Shortcut[] | ((context: LoadSubShortcutsContext) => Promise<Shortcut[]> | Shortcut[]);
99
+ subShortcutPreview?: (context: ShortcutContext) => Promise<ShortcutPreview> | ShortcutPreview;
90
100
  livePreview?: (parameters: string) => Promise<LivePreviewContent | undefined> | LivePreviewContent | undefined;
91
101
  };
92
102
  export type ExtensionSettingValue = undefined | boolean | string | string[] | ExtensionSettings[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sliprail/sdk",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "lib/index.mjs",