@sliprail/sdk 0.1.9 → 0.1.10

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 +8 -3
  2. package/package.json +4 -1
package/lib/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { CSSProperties } from 'react';
1
2
  export type SelectFilesOptions = {
2
3
  type?: 'single-file' | 'multiple-files' | 'directory';
3
4
  extensions?: string[];
@@ -80,7 +81,8 @@ export type ShortcutPreview = {
80
81
  };
81
82
  } | {
82
83
  text: string;
83
- } | undefined | void;
84
+ style?: CSSProperties;
85
+ };
84
86
  export type Shortcut = {
85
87
  id: string;
86
88
  displayName: string;
@@ -95,10 +97,13 @@ export type Shortcut = {
95
97
  prependKeywords?: string[];
96
98
  appendKeywords?: string[];
97
99
  handle?: (context: ShortcutContext) => Promise<unknown> | unknown;
98
- subShortcuts?: Shortcut[] | ((context: LoadSubShortcutsContext) => Promise<Shortcut[]> | Shortcut[]);
99
- subShortcutPreview?: (context: ShortcutContext) => Promise<ShortcutPreview> | ShortcutPreview;
100
+ subShortcuts?: SubShortcut[] | ((context: LoadSubShortcutsContext) => Promise<SubShortcut[]> | SubShortcut[]);
101
+ subShortcutPreview?: (context: ShortcutContext) => Promise<ShortcutPreview | undefined> | ShortcutPreview | undefined;
100
102
  livePreview?: (parameters: string) => Promise<LivePreviewContent | undefined> | LivePreviewContent | undefined;
101
103
  };
104
+ export type SubShortcut = Shortcut & {
105
+ preview?: ShortcutPreview;
106
+ };
102
107
  export type ExtensionSettingValue = undefined | boolean | string | string[] | ExtensionSettings[];
103
108
  export type ExtensionSettings = Record<string, ExtensionSettingValue>;
104
109
  type CommonSettingOptions = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sliprail/sdk",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "lib/index.mjs",
@@ -8,6 +8,9 @@
8
8
  "lib/index.d.ts"
9
9
  ],
10
10
  "types": "lib/index.d.ts",
11
+ "dependencies": {
12
+ "@types/react": "^18.3.23"
13
+ },
11
14
  "devDependencies": {
12
15
  "@types/node": "^20.19.11",
13
16
  "typescript": "5.6.3"