@sigma-file-manager/api 1.7.0 → 1.8.1

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/index.d.ts CHANGED
@@ -128,6 +128,12 @@ export interface ExtensionKeybinding {
128
128
  when?: ExtensionKeybindingWhen;
129
129
  }
130
130
 
131
+ export interface ExtensionIconThemeContribution {
132
+ id: string;
133
+ label: string;
134
+ path: string;
135
+ }
136
+
131
137
  export interface ExtensionContributions {
132
138
  commands?: ExtensionCommand[];
133
139
  contextMenu?: ExtensionContextMenuItem[];
@@ -136,6 +142,7 @@ export interface ExtensionContributions {
136
142
  themes?: ExtensionThemeContribution[];
137
143
  configuration?: ExtensionConfiguration;
138
144
  keybindings?: ExtensionKeybinding[];
145
+ iconThemes?: ExtensionIconThemeContribution[];
139
146
  }
140
147
 
141
148
  export interface ExtensionEngines {
@@ -172,7 +179,7 @@ export interface ExtensionManifestMediaItem {
172
179
  type: ExtensionManifestMediaType;
173
180
  }
174
181
 
175
- export interface ExtensionManifest {
182
+ export interface ExtensionManifestBase {
176
183
  id: string;
177
184
  name: string;
178
185
  previousName?: string;
@@ -185,16 +192,63 @@ export interface ExtensionManifest {
185
192
  media?: ExtensionManifestMediaItem[];
186
193
  categories?: string[];
187
194
  tags?: string[];
188
- extensionType: ExtensionType;
189
- main?: string;
190
195
  permissions: ExtensionPermission[];
191
196
  activationEvents?: ExtensionActivationEvent[];
192
- contributes?: ExtensionContributions;
193
197
  platforms?: PlatformOS[];
194
198
  binaries?: ManifestBinaryDefinition[];
195
199
  engines: ExtensionEngines;
196
200
  }
197
201
 
202
+ type DeclarativeOnlyExtensionContributionGuards = {
203
+ commands?: never;
204
+ contextMenu?: never;
205
+ sidebar?: never;
206
+ toolbar?: never;
207
+ configuration?: never;
208
+ keybindings?: never;
209
+ };
210
+
211
+ export type ThemeOnlyExtensionContributions = DeclarativeOnlyExtensionContributionGuards & (
212
+ | {
213
+ themes: ExtensionThemeContribution[];
214
+ iconThemes?: ExtensionIconThemeContribution[];
215
+ }
216
+ | {
217
+ themes?: ExtensionThemeContribution[];
218
+ iconThemes: ExtensionIconThemeContribution[];
219
+ }
220
+ );
221
+
222
+ export interface ApiExtensionManifest extends ExtensionManifestBase {
223
+ extensionType: 'api';
224
+ main: string;
225
+ contributes?: ExtensionContributions;
226
+ }
227
+
228
+ export interface ThemeOnlyApiExtensionManifest extends ExtensionManifestBase {
229
+ extensionType: 'api';
230
+ main?: never;
231
+ contributes: ThemeOnlyExtensionContributions;
232
+ }
233
+
234
+ export interface IframeExtensionManifest extends ExtensionManifestBase {
235
+ extensionType: 'iframe';
236
+ main: string;
237
+ contributes?: ExtensionContributions;
238
+ }
239
+
240
+ export interface WebviewExtensionManifest extends ExtensionManifestBase {
241
+ extensionType: 'webview';
242
+ main: string;
243
+ contributes?: ExtensionContributions;
244
+ }
245
+
246
+ export type ExtensionManifest
247
+ = | ApiExtensionManifest
248
+ | ThemeOnlyApiExtensionManifest
249
+ | IframeExtensionManifest
250
+ | WebviewExtensionManifest;
251
+
198
252
  export interface Disposable {
199
253
  dispose(): void;
200
254
  }
@@ -61,14 +61,27 @@
61
61
  ],
62
62
  "properties": {
63
63
  "contributes": {
64
- "required": [
65
- "themes"
64
+ "anyOf": [
65
+ {
66
+ "required": [
67
+ "themes"
68
+ ]
69
+ },
70
+ {
71
+ "required": [
72
+ "iconThemes"
73
+ ]
74
+ }
66
75
  ],
67
76
  "additionalProperties": false,
68
77
  "properties": {
69
78
  "themes": {
70
79
  "type": "array",
71
80
  "minItems": 1
81
+ },
82
+ "iconThemes": {
83
+ "type": "array",
84
+ "minItems": 1
72
85
  }
73
86
  }
74
87
  }
@@ -562,6 +575,37 @@
562
575
  }
563
576
  }
564
577
  }
578
+ },
579
+ "iconThemes": {
580
+ "type": "array",
581
+ "description": "Navigator icon themes contributed by the extension",
582
+ "minItems": 1,
583
+ "items": {
584
+ "type": "object",
585
+ "required": [
586
+ "id",
587
+ "label",
588
+ "path"
589
+ ],
590
+ "properties": {
591
+ "id": {
592
+ "type": "string",
593
+ "minLength": 1,
594
+ "pattern": "\\S"
595
+ },
596
+ "label": {
597
+ "type": "string",
598
+ "minLength": 1,
599
+ "pattern": "\\S"
600
+ },
601
+ "path": {
602
+ "type": "string",
603
+ "description": "Relative path to the icon theme JSON file",
604
+ "minLength": 1,
605
+ "pattern": "^(?!\\s*$)(?!\\s*(?:[A-Za-z]:|[\\\\/]))(?!\\s*\\.\\.(?:[\\\\/]|\\s*$))(?!.*[\\\\/]\\.\\.(?:[\\\\/]|\\s*$))(?=.*[^.\\\\/\\s]).*$"
606
+ }
607
+ }
608
+ }
565
609
  }
566
610
  }
567
611
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sigma-file-manager/api",
3
- "version": "1.7.0",
3
+ "version": "1.8.1",
4
4
  "description": "Type definitions and manifest schema for Sigma File Manager extensions",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "repository": {