mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-24 21:40:48 +02:00
refactor(opener)!: rename reveal_item_in_dir command to reveal_items_in_dir (#3608)
* refactor(opener)!: rename reveal_item_in_dir command to reveal_items_in_dir The `allow-reveal-item-in-dir` and `deny-reveal-item-in-dir` permissions are now `allow-reveal-items-in-dir` and `deny-reveal-items-in-dir`. The `revealItemInDir` JavaScript function and the Rust `Opener` methods are unchanged. * cr * retain rust api * fix build * update docs, rename ts api * cr * Apply suggestion from @Legend-Master --------- Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
This commit is contained in:
co-authored by
Tony
parent
9c550e267d
commit
f2c77194d6
@@ -76,7 +76,7 @@ export async function openPath(path: string, openWith?: string): Promise<void> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Reveal a path with the system's default explorer.
|
||||
* Reveal one or more paths with the system's default explorer.
|
||||
*
|
||||
* #### Platform-specific:
|
||||
*
|
||||
@@ -84,16 +84,16 @@ export async function openPath(path: string, openWith?: string): Promise<void> {
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { revealItemInDir } from '@tauri-apps/plugin-opener';
|
||||
* await revealItemInDir('/path/to/file');
|
||||
* await revealItemInDir([ '/path/to/file', '/path/to/another/file' ]);
|
||||
* import { revealItemsInDir } from '@tauri-apps/plugin-opener';
|
||||
* await revealItemsInDir('/path/to/file');
|
||||
* await revealItemsInDir([ '/path/to/file', '/path/to/another/file' ]);
|
||||
* ```
|
||||
*
|
||||
* @param path The path to reveal.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
export async function revealItemInDir(path: string | string[]): Promise<void> {
|
||||
export async function revealItemsInDir(path: string | string[]): Promise<void> {
|
||||
const paths = typeof path === 'string' ? [path] : path
|
||||
return invoke('plugin:opener|reveal_item_in_dir', { paths })
|
||||
return invoke('plugin:opener|reveal_items_in_dir', { paths })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user