aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/types
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2024-02-24 18:55:05 +0100
committerLibravatar Kristóf Marussy <kristof@marussy.com>2024-02-24 18:55:05 +0100
commite3ba54260a73acaca1d36fed54179668f446fc88 (patch)
tree4c0aa1c4fc80855bf2718f10cd00c4a0ae801278 /subprojects/frontend/types
parentfix(web): CSP for SVG rasterization (diff)
downloadrefinery-e3ba54260a73acaca1d36fed54179668f446fc88.tar.gz
refinery-e3ba54260a73acaca1d36fed54179668f446fc88.tar.zst
refinery-e3ba54260a73acaca1d36fed54179668f446fc88.zip
feat(web): file open and save
In-place saving is only supported in Chromium.
Diffstat (limited to 'subprojects/frontend/types')
-rw-r--r--subprojects/frontend/types/filesystemAccess.d.ts25
1 files changed, 21 insertions, 4 deletions
diff --git a/subprojects/frontend/types/filesystemAccess.d.ts b/subprojects/frontend/types/filesystemAccess.d.ts
index 000cd2a5..e9accc77 100644
--- a/subprojects/frontend/types/filesystemAccess.d.ts
+++ b/subprojects/frontend/types/filesystemAccess.d.ts
@@ -5,7 +5,6 @@
5 */ 5 */
6 6
7interface FilePickerOptions { 7interface FilePickerOptions {
8 suggestedName?: string;
9 id?: string; 8 id?: string;
10 types?: { 9 types?: {
11 description?: string; 10 description?: string;
@@ -13,11 +12,29 @@ interface FilePickerOptions {
13 }[]; 12 }[];
14} 13}
15 14
15interface FilePickerSaveOptions extends FilePickerOptions {
16 suggestedName?: string;
17}
18
16interface Window { 19interface Window {
17 showOpenFilePicker?: ( 20 showOpenFilePicker?: (
18 options?: FilePickerOptions, 21 options?: FilePickerOpenOptions,
19 ) => Promise<FileSystemFileHandle>; 22 ) => Promise<FileSystemFileHandle[]>;
20 showSaveFilePicker?: ( 23 showSaveFilePicker?: (
21 options?: FilePickerOptions, 24 options?: FilePickerSaveOptions,
22 ) => Promise<FileSystemFileHandle>; 25 ) => Promise<FileSystemFileHandle>;
23} 26}
27
28interface FileSystemHandlePermissionDescriptor {
29 mode?: 'read' | 'readwrite';
30}
31
32interface FileSystemHandle {
33 queryPermission?: (
34 options?: FileSystemHandlePermissionDescriptor,
35 ) => Promise<PermissionStatus>;
36
37 requestPermission?: (
38 options?: FileSystemHandlePermissionDescriptor,
39 ) => Promise<PermissionStatus>;
40}