@sigma-file-manager/api 1.7.1 → 1.9.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/index.d.ts +147 -5
- package/manifest.schema.json +50 -2
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -67,6 +67,39 @@ export interface ExtensionSidebarItem {
|
|
|
67
67
|
shortcutCommandId?: string;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
export type ExtensionClipboardContentType = 'text' | 'image' | 'files' | 'empty';
|
|
71
|
+
|
|
72
|
+
export interface ExtensionClipboardImageMeta {
|
|
73
|
+
width: number;
|
|
74
|
+
height: number;
|
|
75
|
+
sizeBytes: number;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface ExtensionClipboardImagePayload extends ExtensionClipboardImageMeta {
|
|
79
|
+
pngBytes: Uint8Array;
|
|
80
|
+
contentFingerprint: string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface ExtensionClipboardSnapshot {
|
|
84
|
+
type: ExtensionClipboardContentType;
|
|
85
|
+
changeToken: string;
|
|
86
|
+
fingerprint: string;
|
|
87
|
+
preview: string;
|
|
88
|
+
text?: string;
|
|
89
|
+
image?: ExtensionClipboardImageMeta;
|
|
90
|
+
files?: {
|
|
91
|
+
paths: string[];
|
|
92
|
+
operation: 'copy' | 'move';
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface ExtensionClipboardSourceContext {
|
|
97
|
+
windowTitle?: string;
|
|
98
|
+
processName?: string;
|
|
99
|
+
processPath?: string;
|
|
100
|
+
processIconUrl?: string;
|
|
101
|
+
}
|
|
102
|
+
|
|
70
103
|
export interface ExtensionToolbarDropdownItem {
|
|
71
104
|
id: string;
|
|
72
105
|
title: string;
|
|
@@ -128,6 +161,12 @@ export interface ExtensionKeybinding {
|
|
|
128
161
|
when?: ExtensionKeybindingWhen;
|
|
129
162
|
}
|
|
130
163
|
|
|
164
|
+
export interface ExtensionIconThemeContribution {
|
|
165
|
+
id: string;
|
|
166
|
+
label: string;
|
|
167
|
+
path: string;
|
|
168
|
+
}
|
|
169
|
+
|
|
131
170
|
export interface ExtensionContributions {
|
|
132
171
|
commands?: ExtensionCommand[];
|
|
133
172
|
contextMenu?: ExtensionContextMenuItem[];
|
|
@@ -136,10 +175,12 @@ export interface ExtensionContributions {
|
|
|
136
175
|
themes?: ExtensionThemeContribution[];
|
|
137
176
|
configuration?: ExtensionConfiguration;
|
|
138
177
|
keybindings?: ExtensionKeybinding[];
|
|
178
|
+
iconThemes?: ExtensionIconThemeContribution[];
|
|
139
179
|
}
|
|
140
180
|
|
|
141
181
|
export interface ExtensionEngines {
|
|
142
182
|
sigmaFileManager: string;
|
|
183
|
+
extensionApi?: string;
|
|
143
184
|
}
|
|
144
185
|
|
|
145
186
|
export type PlatformOS = 'windows' | 'macos' | 'linux';
|
|
@@ -192,15 +233,25 @@ export interface ExtensionManifestBase {
|
|
|
192
233
|
engines: ExtensionEngines;
|
|
193
234
|
}
|
|
194
235
|
|
|
195
|
-
|
|
196
|
-
themes: ExtensionThemeContribution[];
|
|
236
|
+
type DeclarativeOnlyExtensionContributionGuards = {
|
|
197
237
|
commands?: never;
|
|
198
238
|
contextMenu?: never;
|
|
199
239
|
sidebar?: never;
|
|
200
240
|
toolbar?: never;
|
|
201
241
|
configuration?: never;
|
|
202
242
|
keybindings?: never;
|
|
203
|
-
}
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
export type ThemeOnlyExtensionContributions = DeclarativeOnlyExtensionContributionGuards & (
|
|
246
|
+
| {
|
|
247
|
+
themes: ExtensionThemeContribution[];
|
|
248
|
+
iconThemes?: ExtensionIconThemeContribution[];
|
|
249
|
+
}
|
|
250
|
+
| {
|
|
251
|
+
themes?: ExtensionThemeContribution[];
|
|
252
|
+
iconThemes: ExtensionIconThemeContribution[];
|
|
253
|
+
}
|
|
254
|
+
);
|
|
204
255
|
|
|
205
256
|
export interface ApiExtensionManifest extends ExtensionManifestBase {
|
|
206
257
|
extensionType: 'api';
|
|
@@ -298,6 +349,10 @@ export interface ExtensionDirEntry {
|
|
|
298
349
|
isDirectory: boolean;
|
|
299
350
|
size?: number;
|
|
300
351
|
modifiedAt?: number;
|
|
352
|
+
linkType?: 'symlink' | 'shortcut' | 'junction' | 'hardlink' | null;
|
|
353
|
+
linkTarget?: string | null;
|
|
354
|
+
linkStatus?: 'valid' | 'broken' | 'unknown' | 'unsupported' | null;
|
|
355
|
+
hardLinkCount?: number | null;
|
|
301
356
|
}
|
|
302
357
|
|
|
303
358
|
export interface ExtensionScopedDirectory {
|
|
@@ -399,23 +454,86 @@ export interface ModalButton {
|
|
|
399
454
|
label: string;
|
|
400
455
|
variant?: 'primary' | 'secondary' | 'danger';
|
|
401
456
|
shortcut?: KeyboardShortcut;
|
|
457
|
+
disabled?: boolean;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
export type ListDetailItemIcon = 'text' | 'image' | 'files';
|
|
461
|
+
|
|
462
|
+
export interface ListDetailItem {
|
|
463
|
+
id: string;
|
|
464
|
+
title: string;
|
|
465
|
+
subtitle?: string;
|
|
466
|
+
thumbnailUrl?: string;
|
|
467
|
+
icon?: ListDetailItemIcon;
|
|
468
|
+
badge?: string;
|
|
469
|
+
pinned?: boolean;
|
|
402
470
|
}
|
|
403
471
|
|
|
472
|
+
export interface ListDetailField {
|
|
473
|
+
label: string;
|
|
474
|
+
value: string;
|
|
475
|
+
iconUrl?: string;
|
|
476
|
+
systemIconPath?: string;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
export interface ListDetailPreview {
|
|
480
|
+
type: 'text' | 'image' | 'files' | 'empty';
|
|
481
|
+
text?: string;
|
|
482
|
+
imageUrl?: string;
|
|
483
|
+
imageStoragePath?: string;
|
|
484
|
+
filePaths?: string[];
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
export interface ListDetailGroupLabels {
|
|
488
|
+
pinned?: string;
|
|
489
|
+
recent?: string;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
export interface ListDetailState {
|
|
493
|
+
items: ListDetailItem[];
|
|
494
|
+
selectedItemId: string | null;
|
|
495
|
+
searchQuery: string;
|
|
496
|
+
filterValue: string;
|
|
497
|
+
filterOptions: UISelectOption[];
|
|
498
|
+
searchPlaceholder?: string;
|
|
499
|
+
detail: ListDetailPreview | null;
|
|
500
|
+
detailFields: ListDetailField[];
|
|
501
|
+
listGroupLabels?: ListDetailGroupLabels;
|
|
502
|
+
emptyListTitle?: string;
|
|
503
|
+
emptyListDescription?: string;
|
|
504
|
+
emptyDetailTitle?: string;
|
|
505
|
+
emptyDetailDescription?: string;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
export type ModalLayout = 'form' | 'listDetail';
|
|
509
|
+
|
|
404
510
|
export interface ModalOptions {
|
|
405
511
|
title: string;
|
|
512
|
+
commandTitle?: string;
|
|
406
513
|
width?: number;
|
|
407
|
-
|
|
514
|
+
layout?: ModalLayout;
|
|
515
|
+
content?: UIElement[];
|
|
516
|
+
listDetail?: ListDetailState;
|
|
408
517
|
buttons?: ModalButton[];
|
|
409
518
|
}
|
|
410
519
|
|
|
520
|
+
export type ListDetailSelectionChangeCallback = (itemId: string | null) => void | Promise<void>;
|
|
521
|
+
export type ListDetailSearchChangeCallback = (searchQuery: string) => void | Promise<void>;
|
|
522
|
+
export type ListDetailFilterChangeCallback = (filterValue: string) => void | Promise<void>;
|
|
523
|
+
|
|
411
524
|
export interface ModalHandle {
|
|
412
525
|
onSubmit(callback: (values: Record<string, unknown>, buttonId: string) => void | boolean | Promise<void | boolean>): void;
|
|
413
526
|
onClose(callback: () => void): void;
|
|
414
527
|
onValueChange(callback: (elementId: string, value: unknown, allValues: Record<string, unknown>) => void): void;
|
|
528
|
+
onSelectionChange(callback: ListDetailSelectionChangeCallback): void;
|
|
529
|
+
onSearchChange(callback: ListDetailSearchChangeCallback): void;
|
|
530
|
+
onFilterChange(callback: ListDetailFilterChangeCallback): void;
|
|
415
531
|
close(): void;
|
|
416
532
|
updateElement(id: string, updates: Partial<UIElement>): void;
|
|
417
533
|
setContent(content: UIElement[]): void;
|
|
418
|
-
setButtons(buttons: ModalButton[]): void
|
|
534
|
+
setButtons(buttons: ModalButton[]): void | Promise<void>;
|
|
535
|
+
setListDetail(updates: Partial<ListDetailState>): void | Promise<void>;
|
|
536
|
+
getListDetail(): ListDetailState;
|
|
419
537
|
getValues(): Record<string, unknown>;
|
|
420
538
|
}
|
|
421
539
|
|
|
@@ -527,6 +645,30 @@ export interface SigmaExtensionAPI {
|
|
|
527
645
|
* Throws if only unsupported types are provided.
|
|
528
646
|
*/
|
|
529
647
|
clipboardWrite(items: Record<string, Uint8Array>[]): Promise<void>;
|
|
648
|
+
restoreClipboardImageFromStorage(relativePath: string): Promise<void>;
|
|
649
|
+
pathExists(path: string): Promise<boolean>;
|
|
650
|
+
/**
|
|
651
|
+
* Reads the current system clipboard content.
|
|
652
|
+
* Priority: files, image, plain text.
|
|
653
|
+
*/
|
|
654
|
+
clipboardRead(): Promise<ExtensionClipboardSnapshot>;
|
|
655
|
+
/**
|
|
656
|
+
* Returns best-effort metadata about the current foreground window.
|
|
657
|
+
* Intended to be sampled when a new clipboard entry is captured.
|
|
658
|
+
*/
|
|
659
|
+
getClipboardSource(): Promise<ExtensionClipboardSourceContext>;
|
|
660
|
+
/**
|
|
661
|
+
* Reads the current clipboard image bytes. Returns null when no image is available.
|
|
662
|
+
*/
|
|
663
|
+
clipboardReadImage(): Promise<ExtensionClipboardImagePayload | null>;
|
|
664
|
+
/**
|
|
665
|
+
* Subscribes to system clipboard changes detected by the app.
|
|
666
|
+
*/
|
|
667
|
+
onClipboardChange(callback: () => void | Promise<void>): Disposable;
|
|
668
|
+
/**
|
|
669
|
+
* Writes file paths to the system clipboard.
|
|
670
|
+
*/
|
|
671
|
+
clipboardWriteFiles(paths: string[], operation?: 'copy' | 'move'): Promise<void>;
|
|
530
672
|
withProgress<T>(
|
|
531
673
|
options: ProgressOptions,
|
|
532
674
|
task: (progress: Progress, token: CancellationToken) => Promise<T>
|
package/manifest.schema.json
CHANGED
|
@@ -61,14 +61,27 @@
|
|
|
61
61
|
],
|
|
62
62
|
"properties": {
|
|
63
63
|
"contributes": {
|
|
64
|
-
"
|
|
65
|
-
|
|
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
|
},
|
|
@@ -687,6 +731,10 @@
|
|
|
687
731
|
"sigmaFileManager": {
|
|
688
732
|
"type": "string",
|
|
689
733
|
"description": "Required Sigma File Manager version range"
|
|
734
|
+
},
|
|
735
|
+
"extensionApi": {
|
|
736
|
+
"type": "string",
|
|
737
|
+
"description": "Required @sigma-file-manager/api version range"
|
|
690
738
|
}
|
|
691
739
|
}
|
|
692
740
|
}
|