@sliprail/sdk 0.1.13 → 0.1.15

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 +13 -6
  2. package/package.json +2 -2
package/lib/index.d.ts CHANGED
@@ -36,6 +36,7 @@ export type WindowOptions = {
36
36
  fullscreenable?: boolean;
37
37
  frame?: boolean;
38
38
  hasShadow?: boolean;
39
+ backgroundThrottling?: boolean;
39
40
  parameters?: Record<string, unknown>;
40
41
  channel?: WindowChannel;
41
42
  onClose?: () => void;
@@ -93,14 +94,20 @@ export type ShortcutPreview = {
93
94
  style?: CSSProperties;
94
95
  };
95
96
  export type ShortcutContextMenu = {
96
- displayName: string;
97
+ displayName: LocalizedString;
97
98
  executeShortcutId: string;
98
99
  };
100
+ export type SupportedLanguage = 'en' | 'zh-hans';
101
+ export type LocalizedString = string | ({
102
+ en: string;
103
+ } & {
104
+ [key in Exclude<SupportedLanguage, 'en'>]?: string;
105
+ });
99
106
  export type Shortcut = {
100
107
  id: string;
101
- displayName: string;
108
+ displayName: LocalizedString;
102
109
  hidden?: boolean;
103
- description?: string;
110
+ description?: LocalizedString;
104
111
  icon?: string | {
105
112
  src: string;
106
113
  template?: boolean;
@@ -123,9 +130,9 @@ export type ExtensionSettingValue = undefined | boolean | string | string[] | Ex
123
130
  export type ExtensionSettings = Record<string, ExtensionSettingValue>;
124
131
  type CommonSettingOptions = {
125
132
  id: string;
126
- displayName: string;
133
+ displayName: LocalizedString;
127
134
  prependDescription?: string | string[];
128
- description?: string;
135
+ description?: LocalizedString;
129
136
  defaultValue?: unknown;
130
137
  refreshOnOtherChange?: boolean | string | string[];
131
138
  showRefreshOnError?: boolean;
@@ -197,7 +204,7 @@ export type SettingDefinition = BooleanSetting | NumberSetting | StringSetting |
197
204
  */
198
205
  export type Extension = {
199
206
  id?: string;
200
- name?: string;
207
+ name?: LocalizedString;
201
208
  role?: string;
202
209
  icon?: string | {
203
210
  src: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sliprail/sdk",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "lib/index.mjs",
@@ -12,7 +12,7 @@
12
12
  "@types/react": "^18.3.24"
13
13
  },
14
14
  "devDependencies": {
15
- "@types/node": "^20.19.25",
15
+ "@types/node": "^20.19.27",
16
16
  "typescript": "5.6.3"
17
17
  },
18
18
  "engines": {