@tauri-apps/plugin-dialog 2.0.0-rc.0 → 2.0.0-rc.1

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.
Files changed (2) hide show
  1. package/dist-js/index.d.ts +15 -16
  2. package/package.json +2 -2
@@ -1,14 +1,3 @@
1
- interface FileResponse {
2
- base64Data?: string;
3
- duration?: number;
4
- height?: number;
5
- width?: number;
6
- mimeType?: string;
7
- modifiedAt?: number;
8
- name?: string;
9
- path: string;
10
- size: number;
11
- }
12
1
  /**
13
2
  * Extension filters for the file dialog.
14
3
  *
@@ -32,11 +21,18 @@ interface DialogFilter {
32
21
  * @since 2.0.0
33
22
  */
34
23
  interface OpenDialogOptions {
35
- /** The title of the dialog window. */
24
+ /** The title of the dialog window (desktop only). */
36
25
  title?: string;
37
26
  /** The filters of the dialog. */
38
27
  filters?: DialogFilter[];
39
- /** Initial directory or file path. */
28
+ /**
29
+ * Initial directory or file path.
30
+ * If it's a directory path, the dialog interface will change to that folder.
31
+ * If it's not an existing directory, the file name will be set to the dialog's file name input and the dialog will be set to the parent folder.
32
+ *
33
+ * On mobile the file name is always used on the dialog's file name input.
34
+ * If not provided, Android uses `(invalid).txt` as default file name.
35
+ */
40
36
  defaultPath?: string;
41
37
  /** Whether the dialog allows multiple selection or not. */
42
38
  multiple?: boolean;
@@ -56,7 +52,7 @@ interface OpenDialogOptions {
56
52
  * @since 2.0.0
57
53
  */
58
54
  interface SaveDialogOptions {
59
- /** The title of the dialog window. */
55
+ /** The title of the dialog window (desktop only). */
60
56
  title?: string;
61
57
  /** The filters of the dialog. */
62
58
  filters?: DialogFilter[];
@@ -64,6 +60,9 @@ interface SaveDialogOptions {
64
60
  * Initial directory or file path.
65
61
  * If it's a directory path, the dialog interface will change to that folder.
66
62
  * If it's not an existing directory, the file name will be set to the dialog's file name input and the dialog will be set to the parent folder.
63
+ *
64
+ * On mobile the file name is always used on the dialog's file name input.
65
+ * If not provided, Android uses `(invalid).txt` as default file name.
67
66
  */
68
67
  defaultPath?: string;
69
68
  /** Whether to allow creating directories in the dialog. Enabled by default. **macOS Only** */
@@ -90,7 +89,7 @@ interface ConfirmDialogOptions {
90
89
  /** The label of the cancel button. */
91
90
  cancelLabel?: string;
92
91
  }
93
- type OpenDialogReturn<T extends OpenDialogOptions> = T["directory"] extends true ? T["multiple"] extends true ? string[] | null : string | null : T["multiple"] extends true ? FileResponse[] | null : FileResponse | null;
92
+ type OpenDialogReturn<T extends OpenDialogOptions> = T["directory"] extends true ? T["multiple"] extends true ? string[] | null : string | null : T["multiple"] extends true ? string[] | null : string | null;
94
93
  /**
95
94
  * Open a file/directory selection dialog.
96
95
  *
@@ -221,5 +220,5 @@ declare function ask(message: string, options?: string | ConfirmDialogOptions):
221
220
  * @since 2.0.0
222
221
  */
223
222
  declare function confirm(message: string, options?: string | ConfirmDialogOptions): Promise<boolean>;
224
- export type { DialogFilter, FileResponse, OpenDialogOptions, OpenDialogReturn, SaveDialogOptions, MessageDialogOptions, ConfirmDialogOptions, };
223
+ export type { DialogFilter, OpenDialogOptions, OpenDialogReturn, SaveDialogOptions, MessageDialogOptions, ConfirmDialogOptions, };
225
224
  export { open, save, message, ask, confirm };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tauri-apps/plugin-dialog",
3
- "version": "2.0.0-rc.0",
3
+ "version": "2.0.0-rc.1",
4
4
  "license": "MIT or APACHE-2.0",
5
5
  "authors": [
6
6
  "Tauri Programme within The Commons Conservancy"
@@ -24,6 +24,6 @@
24
24
  "LICENSE"
25
25
  ],
26
26
  "dependencies": {
27
- "@tauri-apps/api": "^2.0.0-rc.0"
27
+ "@tauri-apps/api": "^2.0.0-rc.4"
28
28
  }
29
29
  }