mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-11-11 05:57:07 +03:00
fix(tauri.js): fix typings for open and save dialogs (#926)
* fix(tauri.js): fix typings for open and save dialogs add JSDoc types; * chore(tauri.js): add changelog
This commit is contained in:
parent
2b3ef7bcfb
commit
0a5bac1dd6
5
.changes/open-and-save-dialog-resolve-type.md
Normal file
5
.changes/open-and-save-dialog-resolve-type.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri.js": patch
|
||||
---
|
||||
|
||||
- Change `String` to `string` type for `open` and `save` methods
|
@ -12,14 +12,16 @@ export type SaveDialogOptions = Pick<OpenDialogOptions, 'filter' | 'defaultPath'
|
||||
/**
|
||||
* @name openDialog
|
||||
* @description Open a file/directory selection dialog
|
||||
* @param [options]
|
||||
* @param [options.filter]
|
||||
* @param [options.defaultPath]
|
||||
* @param [options.multiple=false]
|
||||
* @param [options.directory=false]
|
||||
* @returns promise resolving to the select path(s)
|
||||
* @param {Object} [options]
|
||||
* @param {string} [options.filter]
|
||||
* @param {string} [options.defaultPath]
|
||||
* @param {boolean} [options.multiple=false]
|
||||
* @param {boolean} [options.directory=false]
|
||||
* @returns {Promise<string | string[]>} Promise resolving to the select path(s)
|
||||
*/
|
||||
async function open(options: OpenDialogOptions = {}): Promise<String | String[]> {
|
||||
async function open(
|
||||
options: OpenDialogOptions = {}
|
||||
): Promise<string | string[]> {
|
||||
if (typeof options === 'object') {
|
||||
Object.freeze(options)
|
||||
}
|
||||
@ -33,12 +35,12 @@ async function open(options: OpenDialogOptions = {}): Promise<String | String[]>
|
||||
/**
|
||||
* @name save
|
||||
* @description Open a file/directory save dialog
|
||||
* @param [options]
|
||||
* @param [options.filter]
|
||||
* @param [options.defaultPath]
|
||||
* @returns promise resolving to the select path
|
||||
* @param {Object} [options]
|
||||
* @param {string} [options.filter]
|
||||
* @param {string} [options.defaultPath]
|
||||
* @returns {Promise<string>} Promise resolving to the select path
|
||||
*/
|
||||
async function save(options: SaveDialogOptions = {}): Promise<String> {
|
||||
async function save(options: SaveDialogOptions = {}): Promise<string> {
|
||||
if (typeof options === 'object') {
|
||||
Object.freeze(options)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user