@tauri-apps/plugin-dialog 2.5.0 → 2.6.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/dist-js/index.d.ts +34 -0
- package/package.json +1 -1
package/dist-js/index.d.ts
CHANGED
|
@@ -69,6 +69,31 @@ interface OpenDialogOptions {
|
|
|
69
69
|
* On desktop, this option is ignored.
|
|
70
70
|
*/
|
|
71
71
|
pickerMode?: PickerMode;
|
|
72
|
+
/**
|
|
73
|
+
* The file access mode of the dialog.
|
|
74
|
+
* If not provided, `copy` is used, which matches the behavior of the {@linkcode open} method before the introduction of this option.
|
|
75
|
+
*
|
|
76
|
+
* **Usage**
|
|
77
|
+
* If a file is opened with {@linkcode fileAccessMode: 'copy'}, it will be copied to the app's sandbox.
|
|
78
|
+
* This means the file can be read, edited, deleted, copied, or any other operation without any issues, since the file
|
|
79
|
+
* now belongs to the app.
|
|
80
|
+
* This also means that the caller has responsibility of deleting the file if this file is not meant to be retained
|
|
81
|
+
* in the app sandbox.
|
|
82
|
+
*
|
|
83
|
+
* If a file is opened with {@linkcode fileAccessMode: 'scoped'}, the file will remain in its original location
|
|
84
|
+
* and security-scoped access will be automatically managed by the system.
|
|
85
|
+
*
|
|
86
|
+
* **Note**
|
|
87
|
+
* This is specifically meant for document pickers on iOS or MacOS, in conjunction with [security scoped resources](https://developer.apple.com/documentation/foundation/nsurl/startaccessingsecurityscopedresource()).
|
|
88
|
+
*
|
|
89
|
+
* Why only document pickers, and not image or video pickers?
|
|
90
|
+
* The image and video pickers on iOS behave differently from the document pickers, and return [NSItemProvider](https://developer.apple.com/documentation/foundation/nsitemprovider) objects instead of file URLs.
|
|
91
|
+
* These are meant to be ephemeral (only available within the callback of the picker), and are not accessible outside of the callback.
|
|
92
|
+
* So for image and video pickers, the only way to access the file is to copy it to the app's sandbox, and this is the URL that is returned from this API.
|
|
93
|
+
* This means there is no provision for using `scoped` mode with image or video pickers.
|
|
94
|
+
* If an image or video picker is used, `copy` is always used.
|
|
95
|
+
*/
|
|
96
|
+
fileAccessMode?: FileAccessMode;
|
|
72
97
|
}
|
|
73
98
|
/**
|
|
74
99
|
* Options for the save dialog.
|
|
@@ -101,6 +126,15 @@ interface SaveDialogOptions {
|
|
|
101
126
|
* **Note:** This option is only supported on iOS 14 and above. This parameter is ignored on iOS 13 and below.
|
|
102
127
|
*/
|
|
103
128
|
export type PickerMode = 'document' | 'media' | 'image' | 'video';
|
|
129
|
+
/**
|
|
130
|
+
* The file access mode of the dialog.
|
|
131
|
+
*
|
|
132
|
+
* - `copy`: copy/move the picked file to the app sandbox; no scoped access required.
|
|
133
|
+
* - `scoped`: keep file in place; security-scoped access is automatically managed.
|
|
134
|
+
*
|
|
135
|
+
* **Note:** This option is only supported on iOS 14 and above. This parameter is ignored on iOS 13 and below.
|
|
136
|
+
*/
|
|
137
|
+
export type FileAccessMode = 'copy' | 'scoped';
|
|
104
138
|
/**
|
|
105
139
|
* Default buttons for a message dialog.
|
|
106
140
|
*
|