@sigma-file-manager/api 1.5.0 → 1.7.0
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/README.md +59 -52
- package/index.d.ts +644 -619
- package/manifest.schema.json +694 -555
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,619 +1,644 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
const sigma: SigmaExtensionAPI;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export type ExtensionType = 'api' | 'iframe' | 'webview';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
| '
|
|
13
|
-
| '
|
|
14
|
-
| '
|
|
15
|
-
| '
|
|
16
|
-
| '
|
|
17
|
-
| '
|
|
18
|
-
| '
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
| '
|
|
26
|
-
| '
|
|
27
|
-
| '
|
|
28
|
-
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
export
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
export interface
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
export interface
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
export
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
export interface
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
export interface
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
};
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
}): UIElement;
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
1
|
+
declare global {
|
|
2
|
+
const sigma: SigmaExtensionAPI;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export type ExtensionType = 'api' | 'iframe' | 'webview';
|
|
6
|
+
|
|
7
|
+
/** Flat key–value map for one extension locale file (for example `locales/en.json`). */
|
|
8
|
+
export type ExtensionLocaleStrings = Record<string, string>;
|
|
9
|
+
|
|
10
|
+
export type ExtensionPermission
|
|
11
|
+
= | 'contextMenu'
|
|
12
|
+
| 'sidebar'
|
|
13
|
+
| 'toolbar'
|
|
14
|
+
| 'commands'
|
|
15
|
+
| 'fs.read'
|
|
16
|
+
| 'fs.write'
|
|
17
|
+
| 'notifications'
|
|
18
|
+
| 'dialogs'
|
|
19
|
+
| 'shell'
|
|
20
|
+
| 'clipboard'
|
|
21
|
+
| 'openUrl';
|
|
22
|
+
|
|
23
|
+
export type ExtensionActivationEvent
|
|
24
|
+
= | 'onStartup'
|
|
25
|
+
| 'onInstall'
|
|
26
|
+
| 'onUninstall'
|
|
27
|
+
| 'onEnable'
|
|
28
|
+
| 'onDisable'
|
|
29
|
+
| 'onUpdate'
|
|
30
|
+
| 'onLocaleChange'
|
|
31
|
+
| `onCommand:${string}`;
|
|
32
|
+
|
|
33
|
+
export interface ExtensionPublisher {
|
|
34
|
+
name: string;
|
|
35
|
+
url?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface ExtensionCommand {
|
|
39
|
+
id: string;
|
|
40
|
+
title: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
icon?: string;
|
|
43
|
+
shortcut?: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface ExtensionContextMenuCondition {
|
|
47
|
+
selectionType?: 'single' | 'multiple' | 'any';
|
|
48
|
+
entryType?: 'file' | 'directory' | 'any';
|
|
49
|
+
fileExtensions?: string[];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface ExtensionContextMenuItem {
|
|
53
|
+
id: string;
|
|
54
|
+
title: string;
|
|
55
|
+
icon?: string;
|
|
56
|
+
when?: ExtensionContextMenuCondition;
|
|
57
|
+
group?: string;
|
|
58
|
+
order?: number;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface ExtensionSidebarItem {
|
|
62
|
+
id: string;
|
|
63
|
+
title: string;
|
|
64
|
+
icon: string;
|
|
65
|
+
order?: number;
|
|
66
|
+
url?: string;
|
|
67
|
+
shortcutCommandId?: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface ExtensionToolbarDropdownItem {
|
|
71
|
+
id: string;
|
|
72
|
+
title: string;
|
|
73
|
+
icon?: string;
|
|
74
|
+
commandId?: string;
|
|
75
|
+
separator?: boolean;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface ExtensionToolbarDropdown {
|
|
79
|
+
id: string;
|
|
80
|
+
title: string;
|
|
81
|
+
icon?: string;
|
|
82
|
+
items: ExtensionToolbarDropdownItem[];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export type ExtensionConfigurationPropertyType = 'string' | 'number' | 'boolean' | 'array';
|
|
86
|
+
|
|
87
|
+
export interface ExtensionConfigurationProperty {
|
|
88
|
+
type: ExtensionConfigurationPropertyType;
|
|
89
|
+
default?: unknown;
|
|
90
|
+
description?: string;
|
|
91
|
+
enum?: (string | number)[];
|
|
92
|
+
enumDescriptions?: string[];
|
|
93
|
+
minimum?: number;
|
|
94
|
+
maximum?: number;
|
|
95
|
+
minLength?: number;
|
|
96
|
+
maxLength?: number;
|
|
97
|
+
items?: {
|
|
98
|
+
type: 'string' | 'number';
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface ExtensionConfiguration {
|
|
103
|
+
title?: string;
|
|
104
|
+
properties: Record<string, ExtensionConfigurationProperty>;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export type ExtensionThemeBase = 'light' | 'dark';
|
|
108
|
+
|
|
109
|
+
export interface ExtensionThemeContribution {
|
|
110
|
+
id: string;
|
|
111
|
+
title: string;
|
|
112
|
+
description?: string;
|
|
113
|
+
baseTheme: ExtensionThemeBase;
|
|
114
|
+
variables: Record<`--${string}`, string>;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export type ExtensionKeybindingWhen
|
|
118
|
+
= | 'always'
|
|
119
|
+
| 'fileSelected'
|
|
120
|
+
| 'directorySelected'
|
|
121
|
+
| 'singleSelected'
|
|
122
|
+
| 'multipleSelected'
|
|
123
|
+
| 'navigatorFocused';
|
|
124
|
+
|
|
125
|
+
export interface ExtensionKeybinding {
|
|
126
|
+
command: string;
|
|
127
|
+
key: string;
|
|
128
|
+
when?: ExtensionKeybindingWhen;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface ExtensionContributions {
|
|
132
|
+
commands?: ExtensionCommand[];
|
|
133
|
+
contextMenu?: ExtensionContextMenuItem[];
|
|
134
|
+
sidebar?: ExtensionSidebarItem[];
|
|
135
|
+
toolbar?: ExtensionToolbarDropdown[];
|
|
136
|
+
themes?: ExtensionThemeContribution[];
|
|
137
|
+
configuration?: ExtensionConfiguration;
|
|
138
|
+
keybindings?: ExtensionKeybinding[];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface ExtensionEngines {
|
|
142
|
+
sigmaFileManager: string;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export type PlatformOS = 'windows' | 'macos' | 'linux';
|
|
146
|
+
export type PlatformArch = 'x64' | 'arm64';
|
|
147
|
+
|
|
148
|
+
export interface ManifestBinaryAsset {
|
|
149
|
+
platform: PlatformOS;
|
|
150
|
+
arch?: PlatformArch[];
|
|
151
|
+
downloadUrl: string;
|
|
152
|
+
integrity: string;
|
|
153
|
+
archive?: boolean;
|
|
154
|
+
executable?: string;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface ManifestBinaryDefinition {
|
|
158
|
+
id: string;
|
|
159
|
+
name: string;
|
|
160
|
+
version: string;
|
|
161
|
+
executable?: string;
|
|
162
|
+
repository?: string;
|
|
163
|
+
platforms?: PlatformOS[];
|
|
164
|
+
assets: ManifestBinaryAsset[];
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export type ExtensionManifestMediaType = 'image' | 'video';
|
|
168
|
+
|
|
169
|
+
export interface ExtensionManifestMediaItem {
|
|
170
|
+
title: string;
|
|
171
|
+
src: string;
|
|
172
|
+
type: ExtensionManifestMediaType;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export interface ExtensionManifest {
|
|
176
|
+
id: string;
|
|
177
|
+
name: string;
|
|
178
|
+
previousName?: string;
|
|
179
|
+
version: string;
|
|
180
|
+
publisher?: ExtensionPublisher;
|
|
181
|
+
repository: string;
|
|
182
|
+
license: string;
|
|
183
|
+
icon?: string;
|
|
184
|
+
banner?: string;
|
|
185
|
+
media?: ExtensionManifestMediaItem[];
|
|
186
|
+
categories?: string[];
|
|
187
|
+
tags?: string[];
|
|
188
|
+
extensionType: ExtensionType;
|
|
189
|
+
main?: string;
|
|
190
|
+
permissions: ExtensionPermission[];
|
|
191
|
+
activationEvents?: ExtensionActivationEvent[];
|
|
192
|
+
contributes?: ExtensionContributions;
|
|
193
|
+
platforms?: PlatformOS[];
|
|
194
|
+
binaries?: ManifestBinaryDefinition[];
|
|
195
|
+
engines: ExtensionEngines;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export interface Disposable {
|
|
199
|
+
dispose(): void;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export interface ContextMenuContext {
|
|
203
|
+
selectedEntries: {
|
|
204
|
+
path: string;
|
|
205
|
+
name: string;
|
|
206
|
+
isDirectory: boolean;
|
|
207
|
+
size?: number;
|
|
208
|
+
extension?: string;
|
|
209
|
+
}[];
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export interface NotificationOptions {
|
|
213
|
+
title: string;
|
|
214
|
+
subtitle?: string;
|
|
215
|
+
description?: string;
|
|
216
|
+
type?: 'info' | 'success' | 'warning' | 'error';
|
|
217
|
+
duration?: number;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export interface DialogOptions {
|
|
221
|
+
title: string;
|
|
222
|
+
message: string;
|
|
223
|
+
type?: 'info' | 'confirm' | 'prompt';
|
|
224
|
+
confirmText?: string;
|
|
225
|
+
cancelText?: string;
|
|
226
|
+
defaultValue?: string;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export interface DialogResult {
|
|
230
|
+
confirmed: boolean;
|
|
231
|
+
value?: string;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export type ProgressLocation = 'notification' | 'statusBar';
|
|
235
|
+
|
|
236
|
+
export interface ProgressOptions {
|
|
237
|
+
subtitle: string;
|
|
238
|
+
location?: ProgressLocation;
|
|
239
|
+
cancellable?: boolean;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export interface ProgressReport {
|
|
243
|
+
subtitle?: string;
|
|
244
|
+
description?: string;
|
|
245
|
+
increment?: number;
|
|
246
|
+
value?: number;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export interface Progress {
|
|
250
|
+
report(value: ProgressReport): void;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export interface CancellationToken {
|
|
254
|
+
readonly isCancellationRequested: boolean;
|
|
255
|
+
onCancellationRequested(listener: () => void): Disposable;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export interface ExtensionDirEntry {
|
|
259
|
+
path: string;
|
|
260
|
+
name: string;
|
|
261
|
+
isDirectory: boolean;
|
|
262
|
+
size?: number;
|
|
263
|
+
modifiedAt?: number;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export interface ExtensionScopedDirectory {
|
|
267
|
+
path: string;
|
|
268
|
+
permissions: ('read' | 'write')[];
|
|
269
|
+
grantedAt: number;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export interface ExtensionContextEntry {
|
|
273
|
+
path: string;
|
|
274
|
+
name: string;
|
|
275
|
+
isDirectory: boolean;
|
|
276
|
+
isFile: boolean;
|
|
277
|
+
size: number;
|
|
278
|
+
extension: string | null;
|
|
279
|
+
createdAt: number;
|
|
280
|
+
modifiedAt: number;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export interface BuiltinCommandInfo {
|
|
284
|
+
id: string;
|
|
285
|
+
title: string;
|
|
286
|
+
description: string;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export interface FileDialogFilter {
|
|
290
|
+
name: string;
|
|
291
|
+
extensions: string[];
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export interface OpenFileDialogOptions {
|
|
295
|
+
title?: string;
|
|
296
|
+
defaultPath?: string;
|
|
297
|
+
filters?: FileDialogFilter[];
|
|
298
|
+
multiple?: boolean;
|
|
299
|
+
directory?: boolean;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export interface SaveFileDialogOptions {
|
|
303
|
+
title?: string;
|
|
304
|
+
defaultPath?: string;
|
|
305
|
+
filters?: FileDialogFilter[];
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export interface BinaryInfo {
|
|
309
|
+
id: string;
|
|
310
|
+
path: string;
|
|
311
|
+
version?: string;
|
|
312
|
+
storageVersion?: string | null;
|
|
313
|
+
repository?: string;
|
|
314
|
+
downloadUrl?: string;
|
|
315
|
+
latestVersion?: string;
|
|
316
|
+
hasUpdate?: boolean;
|
|
317
|
+
latestCheckedAt?: number;
|
|
318
|
+
installedAt: number;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export type UIElementType
|
|
322
|
+
= | 'input'
|
|
323
|
+
| 'select'
|
|
324
|
+
| 'checkbox'
|
|
325
|
+
| 'textarea'
|
|
326
|
+
| 'button'
|
|
327
|
+
| 'separator'
|
|
328
|
+
| 'text'
|
|
329
|
+
| 'image'
|
|
330
|
+
| 'skeleton'
|
|
331
|
+
| 'alert'
|
|
332
|
+
| 'previewCard'
|
|
333
|
+
| 'previewCardSkeleton';
|
|
334
|
+
|
|
335
|
+
export interface UISelectOption {
|
|
336
|
+
value: string;
|
|
337
|
+
label: string;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export interface UIElement {
|
|
341
|
+
type: UIElementType;
|
|
342
|
+
id?: string;
|
|
343
|
+
label?: string;
|
|
344
|
+
placeholder?: string;
|
|
345
|
+
value?: string | boolean | number;
|
|
346
|
+
options?: UISelectOption[];
|
|
347
|
+
rows?: number;
|
|
348
|
+
variant?: 'primary' | 'secondary' | 'danger';
|
|
349
|
+
tone?: 'info' | 'success' | 'warning' | 'error';
|
|
350
|
+
size?: 'xs' | 'sm' | 'default' | 'lg';
|
|
351
|
+
disabled?: boolean;
|
|
352
|
+
subtitle?: string;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export interface KeyboardShortcut {
|
|
356
|
+
key: string;
|
|
357
|
+
modifiers?: ('ctrl' | 'shift' | 'alt' | 'meta')[];
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export interface ModalButton {
|
|
361
|
+
id: string;
|
|
362
|
+
label: string;
|
|
363
|
+
variant?: 'primary' | 'secondary' | 'danger';
|
|
364
|
+
shortcut?: KeyboardShortcut;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export interface ModalOptions {
|
|
368
|
+
title: string;
|
|
369
|
+
width?: number;
|
|
370
|
+
content: UIElement[];
|
|
371
|
+
buttons?: ModalButton[];
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export interface ModalHandle {
|
|
375
|
+
onSubmit(callback: (values: Record<string, unknown>, buttonId: string) => void | boolean | Promise<void | boolean>): void;
|
|
376
|
+
onClose(callback: () => void): void;
|
|
377
|
+
onValueChange(callback: (elementId: string, value: unknown, allValues: Record<string, unknown>) => void): void;
|
|
378
|
+
close(): void;
|
|
379
|
+
updateElement(id: string, updates: Partial<UIElement>): void;
|
|
380
|
+
setContent(content: UIElement[]): void;
|
|
381
|
+
setButtons(buttons: ModalButton[]): void;
|
|
382
|
+
getValues(): Record<string, unknown>;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
export interface ToolbarRenderHandle {
|
|
386
|
+
unmount(): void;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
export interface PlatformInfo {
|
|
390
|
+
os: PlatformOS;
|
|
391
|
+
arch: string;
|
|
392
|
+
pathSeparator: string;
|
|
393
|
+
isWindows: boolean;
|
|
394
|
+
isMacos: boolean;
|
|
395
|
+
isLinux: boolean;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export interface SigmaExtensionAPI {
|
|
399
|
+
i18n: {
|
|
400
|
+
t(key: string, params?: Record<string, string | number>): string;
|
|
401
|
+
mergeMessages(messages: Record<string, Record<string, string>>): void;
|
|
402
|
+
mergeFromPath(basePath: string): Promise<void>;
|
|
403
|
+
/**
|
|
404
|
+
* Resolves extension-localized strings under `extensions.<extensionId>.<key>`.
|
|
405
|
+
* When no translation exists, this returns `fallback` if provided, otherwise the original `key`.
|
|
406
|
+
*/
|
|
407
|
+
extensionT(key: string, params?: Record<string, string | number>, fallback?: string): string;
|
|
408
|
+
formatMessage(template: string, params?: Record<string, string | number>): string;
|
|
409
|
+
};
|
|
410
|
+
contextMenu: {
|
|
411
|
+
registerItem(
|
|
412
|
+
item: ExtensionContextMenuItem,
|
|
413
|
+
handler: (context: ContextMenuContext) => Promise<void> | void
|
|
414
|
+
): Disposable;
|
|
415
|
+
};
|
|
416
|
+
sidebar: {
|
|
417
|
+
registerPage(page: ExtensionSidebarItem): Disposable;
|
|
418
|
+
};
|
|
419
|
+
toolbar: {
|
|
420
|
+
registerDropdown(
|
|
421
|
+
dropdown: ExtensionToolbarDropdown,
|
|
422
|
+
handlers: Record<string, () => Promise<void> | void>
|
|
423
|
+
): Disposable;
|
|
424
|
+
};
|
|
425
|
+
commands: {
|
|
426
|
+
registerCommand(
|
|
427
|
+
command: ExtensionCommand,
|
|
428
|
+
handler: (...args: unknown[]) => Promise<unknown> | unknown
|
|
429
|
+
): Disposable;
|
|
430
|
+
executeCommand(commandId: string, ...args: unknown[]): Promise<unknown>;
|
|
431
|
+
getBuiltinCommands(): BuiltinCommandInfo[];
|
|
432
|
+
};
|
|
433
|
+
context: {
|
|
434
|
+
getCurrentPath(): string | null;
|
|
435
|
+
getSelectedEntries(): ExtensionContextEntry[];
|
|
436
|
+
getAppVersion(): Promise<string>;
|
|
437
|
+
getDownloadsDir(): Promise<string>;
|
|
438
|
+
getPicturesDir(): Promise<string>;
|
|
439
|
+
openUrl(url: string): Promise<void>;
|
|
440
|
+
onPathChange(callback: (path: string | null) => void): Disposable;
|
|
441
|
+
onSelectionChange(callback: (entries: ExtensionContextEntry[]) => void): Disposable;
|
|
442
|
+
};
|
|
443
|
+
fs: {
|
|
444
|
+
readFile(path: string): Promise<Uint8Array>;
|
|
445
|
+
writeFile(path: string, data: Uint8Array): Promise<void>;
|
|
446
|
+
readDir(path: string): Promise<ExtensionDirEntry[]>;
|
|
447
|
+
exists(path: string): Promise<boolean>;
|
|
448
|
+
downloadFile(url: string, path: string): Promise<void>;
|
|
449
|
+
private: {
|
|
450
|
+
readFile(relativePath: string): Promise<Uint8Array>;
|
|
451
|
+
writeFile(relativePath: string, data: Uint8Array): Promise<void>;
|
|
452
|
+
readDir(relativePath?: string): Promise<ExtensionDirEntry[]>;
|
|
453
|
+
exists(relativePath: string): Promise<boolean>;
|
|
454
|
+
resolvePath(relativePath: string): Promise<string>;
|
|
455
|
+
};
|
|
456
|
+
storage: {
|
|
457
|
+
readFile(relativePath: string): Promise<Uint8Array>;
|
|
458
|
+
writeFile(relativePath: string, data: Uint8Array): Promise<void>;
|
|
459
|
+
readDir(relativePath?: string): Promise<ExtensionDirEntry[]>;
|
|
460
|
+
exists(relativePath: string): Promise<boolean>;
|
|
461
|
+
resolvePath(relativePath: string): Promise<string>;
|
|
462
|
+
importFile(sourcePath: string, targetRelativePath: string): Promise<string>;
|
|
463
|
+
deleteFile(relativePath: string): Promise<void>;
|
|
464
|
+
};
|
|
465
|
+
scoped: {
|
|
466
|
+
requestDirectoryAccess(options?: {
|
|
467
|
+
permission?: 'read' | 'write' | 'readWrite';
|
|
468
|
+
title?: string;
|
|
469
|
+
defaultPath?: string;
|
|
470
|
+
}): Promise<{
|
|
471
|
+
granted: boolean;
|
|
472
|
+
path?: string;
|
|
473
|
+
permissions?: ('read' | 'write')[];
|
|
474
|
+
}>;
|
|
475
|
+
getDirectories(): Promise<ExtensionScopedDirectory[]>;
|
|
476
|
+
readFile(path: string): Promise<Uint8Array>;
|
|
477
|
+
writeFile(path: string, data: Uint8Array): Promise<void>;
|
|
478
|
+
readDir(path: string): Promise<ExtensionDirEntry[]>;
|
|
479
|
+
exists(path: string): Promise<boolean>;
|
|
480
|
+
};
|
|
481
|
+
};
|
|
482
|
+
ui: {
|
|
483
|
+
showNotification(options: NotificationOptions): void;
|
|
484
|
+
showDialog(options: DialogOptions): Promise<DialogResult>;
|
|
485
|
+
copyText(text: string): Promise<void>;
|
|
486
|
+
/**
|
|
487
|
+
* Writes data to the clipboard. Supported MIME types: `image/png`, `text/html`, `text/plain`.
|
|
488
|
+
* When `text/html` is provided alongside `text/plain`, the plain text is used as fallback.
|
|
489
|
+
* Writes the first supported representation found across items (image/png > text/html > text/plain).
|
|
490
|
+
* Throws if only unsupported types are provided.
|
|
491
|
+
*/
|
|
492
|
+
clipboardWrite(items: Record<string, Uint8Array>[]): Promise<void>;
|
|
493
|
+
withProgress<T>(
|
|
494
|
+
options: ProgressOptions,
|
|
495
|
+
task: (progress: Progress, token: CancellationToken) => Promise<T>
|
|
496
|
+
): Promise<T>;
|
|
497
|
+
createModal(options: ModalOptions): ModalHandle;
|
|
498
|
+
showModal(options: ModalOptions): Promise<Record<string, unknown> | null>;
|
|
499
|
+
input(options: {
|
|
500
|
+
id: string;
|
|
501
|
+
label?: string;
|
|
502
|
+
placeholder?: string;
|
|
503
|
+
value?: string;
|
|
504
|
+
disabled?: boolean;
|
|
505
|
+
}): UIElement;
|
|
506
|
+
select(options: {
|
|
507
|
+
id: string;
|
|
508
|
+
label?: string;
|
|
509
|
+
placeholder?: string;
|
|
510
|
+
options: UISelectOption[];
|
|
511
|
+
value?: string;
|
|
512
|
+
disabled?: boolean;
|
|
513
|
+
}): UIElement;
|
|
514
|
+
checkbox(options: {
|
|
515
|
+
id: string;
|
|
516
|
+
label?: string;
|
|
517
|
+
checked?: boolean;
|
|
518
|
+
disabled?: boolean;
|
|
519
|
+
}): UIElement;
|
|
520
|
+
textarea(options: {
|
|
521
|
+
id: string;
|
|
522
|
+
label?: string;
|
|
523
|
+
placeholder?: string;
|
|
524
|
+
value?: string;
|
|
525
|
+
rows?: number;
|
|
526
|
+
disabled?: boolean;
|
|
527
|
+
}): UIElement;
|
|
528
|
+
separator(): UIElement;
|
|
529
|
+
text(content: string): UIElement;
|
|
530
|
+
alert(options: {
|
|
531
|
+
title: string;
|
|
532
|
+
description?: string;
|
|
533
|
+
tone?: 'info' | 'success' | 'warning' | 'error';
|
|
534
|
+
}): UIElement;
|
|
535
|
+
image(options: {
|
|
536
|
+
id?: string;
|
|
537
|
+
src: string;
|
|
538
|
+
alt?: string;
|
|
539
|
+
}): UIElement;
|
|
540
|
+
previewCard(options: {
|
|
541
|
+
thumbnail: string;
|
|
542
|
+
title: string;
|
|
543
|
+
subtitle?: string;
|
|
544
|
+
}): UIElement;
|
|
545
|
+
previewCardSkeleton(): UIElement;
|
|
546
|
+
skeleton(options?: {
|
|
547
|
+
id?: string;
|
|
548
|
+
width?: number;
|
|
549
|
+
height?: number;
|
|
550
|
+
}): UIElement;
|
|
551
|
+
button(options: {
|
|
552
|
+
id: string;
|
|
553
|
+
label: string;
|
|
554
|
+
variant?: 'primary' | 'secondary' | 'danger';
|
|
555
|
+
size?: 'xs' | 'sm' | 'default' | 'lg';
|
|
556
|
+
disabled?: boolean;
|
|
557
|
+
}): UIElement;
|
|
558
|
+
renderToolbar(
|
|
559
|
+
container: HTMLElement,
|
|
560
|
+
elements: UIElement[],
|
|
561
|
+
onButtonClick?: (buttonId: string) => void
|
|
562
|
+
): ToolbarRenderHandle;
|
|
563
|
+
};
|
|
564
|
+
dialog: {
|
|
565
|
+
openFile(options?: OpenFileDialogOptions): Promise<string | string[] | null>;
|
|
566
|
+
saveFile(options?: SaveFileDialogOptions): Promise<string | null>;
|
|
567
|
+
};
|
|
568
|
+
shell: {
|
|
569
|
+
run(
|
|
570
|
+
commandPath: string,
|
|
571
|
+
args?: string[]
|
|
572
|
+
): Promise<{
|
|
573
|
+
code: number;
|
|
574
|
+
stdout: string;
|
|
575
|
+
stderr: string;
|
|
576
|
+
}>;
|
|
577
|
+
runWithProgress(
|
|
578
|
+
commandPath: string,
|
|
579
|
+
args: string[] | undefined,
|
|
580
|
+
onProgress?: (payload: {
|
|
581
|
+
taskId: string;
|
|
582
|
+
line: string;
|
|
583
|
+
isStderr: boolean;
|
|
584
|
+
}) => void
|
|
585
|
+
): Promise<{
|
|
586
|
+
taskId: string;
|
|
587
|
+
result: Promise<{
|
|
588
|
+
code: number;
|
|
589
|
+
stdout: string;
|
|
590
|
+
stderr: string;
|
|
591
|
+
}>;
|
|
592
|
+
cancel: () => Promise<void>;
|
|
593
|
+
}>;
|
|
594
|
+
renamePartFilesToTs(directory: string): Promise<number>;
|
|
595
|
+
};
|
|
596
|
+
settings: {
|
|
597
|
+
get<T>(key: string): Promise<T | undefined>;
|
|
598
|
+
set<T>(key: string, value: T): Promise<void>;
|
|
599
|
+
getAll(): Promise<Record<string, unknown>>;
|
|
600
|
+
reset(key: string): Promise<void>;
|
|
601
|
+
onChange(key: string, callback: (newValue: unknown, oldValue: unknown) => void): Disposable;
|
|
602
|
+
};
|
|
603
|
+
storage: {
|
|
604
|
+
get<T>(key: string): Promise<T | undefined>;
|
|
605
|
+
set<T>(key: string, value: T): Promise<void>;
|
|
606
|
+
remove(key: string): Promise<void>;
|
|
607
|
+
};
|
|
608
|
+
platform: {
|
|
609
|
+
readonly os: PlatformOS;
|
|
610
|
+
readonly arch: string;
|
|
611
|
+
readonly pathSeparator: string;
|
|
612
|
+
readonly isWindows: boolean;
|
|
613
|
+
readonly isMacos: boolean;
|
|
614
|
+
readonly isLinux: boolean;
|
|
615
|
+
joinPath(...segments: string[]): string;
|
|
616
|
+
};
|
|
617
|
+
path: {
|
|
618
|
+
dirname(filePath: string): string;
|
|
619
|
+
basename(filePath: string, suffix?: string): string;
|
|
620
|
+
extname(filePath: string): string;
|
|
621
|
+
};
|
|
622
|
+
runtime: {
|
|
623
|
+
isExtensionInstallCancelledError(error: unknown): boolean;
|
|
624
|
+
};
|
|
625
|
+
binary: {
|
|
626
|
+
getPath(id: string): Promise<string | null>;
|
|
627
|
+
isInstalled(id: string): Promise<boolean>;
|
|
628
|
+
getInfo(id: string): Promise<BinaryInfo | null>;
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
export interface ExtensionActivationContext {
|
|
633
|
+
extensionId: string;
|
|
634
|
+
extensionPath: string;
|
|
635
|
+
storagePath: string;
|
|
636
|
+
activationEvent: ExtensionActivationEvent;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
export interface ExtensionModule {
|
|
640
|
+
activate?(context: ExtensionActivationContext): Promise<void> | void;
|
|
641
|
+
deactivate?(): Promise<void> | void;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
export {};
|