@sigma-file-manager/api 1.8.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 +127 -2
- package/manifest.schema.json +4 -0
- 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;
|
|
@@ -147,6 +180,7 @@ export interface ExtensionContributions {
|
|
|
147
180
|
|
|
148
181
|
export interface ExtensionEngines {
|
|
149
182
|
sigmaFileManager: string;
|
|
183
|
+
extensionApi?: string;
|
|
150
184
|
}
|
|
151
185
|
|
|
152
186
|
export type PlatformOS = 'windows' | 'macos' | 'linux';
|
|
@@ -315,6 +349,10 @@ export interface ExtensionDirEntry {
|
|
|
315
349
|
isDirectory: boolean;
|
|
316
350
|
size?: number;
|
|
317
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;
|
|
318
356
|
}
|
|
319
357
|
|
|
320
358
|
export interface ExtensionScopedDirectory {
|
|
@@ -416,23 +454,86 @@ export interface ModalButton {
|
|
|
416
454
|
label: string;
|
|
417
455
|
variant?: 'primary' | 'secondary' | 'danger';
|
|
418
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;
|
|
419
470
|
}
|
|
420
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
|
+
|
|
421
510
|
export interface ModalOptions {
|
|
422
511
|
title: string;
|
|
512
|
+
commandTitle?: string;
|
|
423
513
|
width?: number;
|
|
424
|
-
|
|
514
|
+
layout?: ModalLayout;
|
|
515
|
+
content?: UIElement[];
|
|
516
|
+
listDetail?: ListDetailState;
|
|
425
517
|
buttons?: ModalButton[];
|
|
426
518
|
}
|
|
427
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
|
+
|
|
428
524
|
export interface ModalHandle {
|
|
429
525
|
onSubmit(callback: (values: Record<string, unknown>, buttonId: string) => void | boolean | Promise<void | boolean>): void;
|
|
430
526
|
onClose(callback: () => void): void;
|
|
431
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;
|
|
432
531
|
close(): void;
|
|
433
532
|
updateElement(id: string, updates: Partial<UIElement>): void;
|
|
434
533
|
setContent(content: UIElement[]): void;
|
|
435
|
-
setButtons(buttons: ModalButton[]): void
|
|
534
|
+
setButtons(buttons: ModalButton[]): void | Promise<void>;
|
|
535
|
+
setListDetail(updates: Partial<ListDetailState>): void | Promise<void>;
|
|
536
|
+
getListDetail(): ListDetailState;
|
|
436
537
|
getValues(): Record<string, unknown>;
|
|
437
538
|
}
|
|
438
539
|
|
|
@@ -544,6 +645,30 @@ export interface SigmaExtensionAPI {
|
|
|
544
645
|
* Throws if only unsupported types are provided.
|
|
545
646
|
*/
|
|
546
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>;
|
|
547
672
|
withProgress<T>(
|
|
548
673
|
options: ProgressOptions,
|
|
549
674
|
task: (progress: Progress, token: CancellationToken) => Promise<T>
|
package/manifest.schema.json
CHANGED
|
@@ -731,6 +731,10 @@
|
|
|
731
731
|
"sigmaFileManager": {
|
|
732
732
|
"type": "string",
|
|
733
733
|
"description": "Required Sigma File Manager version range"
|
|
734
|
+
},
|
|
735
|
+
"extensionApi": {
|
|
736
|
+
"type": "string",
|
|
737
|
+
"description": "Required @sigma-file-manager/api version range"
|
|
734
738
|
}
|
|
735
739
|
}
|
|
736
740
|
}
|