diff options
author | 2024-02-24 18:55:05 +0100 | |
---|---|---|
committer | 2024-02-24 18:55:05 +0100 | |
commit | e3ba54260a73acaca1d36fed54179668f446fc88 (patch) | |
tree | 4c0aa1c4fc80855bf2718f10cd00c4a0ae801278 /subprojects/frontend/types | |
parent | fix(web): CSP for SVG rasterization (diff) | |
download | refinery-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.ts | 25 |
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 | ||
7 | interface FilePickerOptions { | 7 | interface 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 | ||
15 | interface FilePickerSaveOptions extends FilePickerOptions { | ||
16 | suggestedName?: string; | ||
17 | } | ||
18 | |||
16 | interface Window { | 19 | interface 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 | |||
28 | interface FileSystemHandlePermissionDescriptor { | ||
29 | mode?: 'read' | 'readwrite'; | ||
30 | } | ||
31 | |||
32 | interface FileSystemHandle { | ||
33 | queryPermission?: ( | ||
34 | options?: FileSystemHandlePermissionDescriptor, | ||
35 | ) => Promise<PermissionStatus>; | ||
36 | |||
37 | requestPermission?: ( | ||
38 | options?: FileSystemHandlePermissionDescriptor, | ||
39 | ) => Promise<PermissionStatus>; | ||
40 | } | ||