@tauri-apps/plugin-opener 2.4.0 → 2.5.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.
- package/README.md +7 -9
- package/dist-js/index.cjs +3 -1
- package/dist-js/index.d.ts +2 -1
- package/dist-js/index.js +3 -1
- package/dist-js/init.d.ts +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -33,8 +33,6 @@ tauri-plugin-opener = { git = "https://github.com/tauri-apps/plugins-workspace",
|
|
|
33
33
|
|
|
34
34
|
You can install the JavaScript Guest bindings using your preferred JavaScript package manager:
|
|
35
35
|
|
|
36
|
-
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
|
|
37
|
-
|
|
38
36
|
<!-- Add the branch for installations using git! -->
|
|
39
37
|
|
|
40
38
|
```sh
|
|
@@ -43,13 +41,6 @@ pnpm add @tauri-apps/plugin-opener
|
|
|
43
41
|
npm add @tauri-apps/plugin-opener
|
|
44
42
|
# or
|
|
45
43
|
yarn add @tauri-apps/plugin-opener
|
|
46
|
-
|
|
47
|
-
# alternatively with Git:
|
|
48
|
-
pnpm add https://github.com/tauri-apps/tauri-plugin-opener#v2
|
|
49
|
-
# or
|
|
50
|
-
npm add https://github.com/tauri-apps/tauri-plugin-opener#v2
|
|
51
|
-
# or
|
|
52
|
-
yarn add https://github.com/tauri-apps/tauri-plugin-opener#v2
|
|
53
44
|
```
|
|
54
45
|
|
|
55
46
|
## Usage
|
|
@@ -84,6 +75,10 @@ await openPath('/path/to/file', 'firefox')
|
|
|
84
75
|
|
|
85
76
|
// Reveal a path with the system's default explorer
|
|
86
77
|
await revealItemInDir('/path/to/file')
|
|
78
|
+
|
|
79
|
+
// Reveal multiple paths with the system's default explorer
|
|
80
|
+
// Note: will be renamed to `revealItemsInDir` in the next major version
|
|
81
|
+
await revealItemInDir(['/path/to/file', '/path/to/another/file'])
|
|
87
82
|
```
|
|
88
83
|
|
|
89
84
|
### Usage from Rust
|
|
@@ -111,6 +106,9 @@ fn main() {
|
|
|
111
106
|
|
|
112
107
|
// Reveal a path with the system's default explorer
|
|
113
108
|
opener.reveal_item_in_dir("/path/to/file")?;
|
|
109
|
+
|
|
110
|
+
// Reveal multiple paths with the system's default explorer
|
|
111
|
+
opener.reveal_items_in_dir(["/path/to/file"])?;
|
|
114
112
|
Ok(())
|
|
115
113
|
})
|
|
116
114
|
.run(tauri::generate_context!())
|
package/dist-js/index.cjs
CHANGED
|
@@ -82,6 +82,7 @@ async function openPath(path, openWith) {
|
|
|
82
82
|
* ```typescript
|
|
83
83
|
* import { revealItemInDir } from '@tauri-apps/plugin-opener';
|
|
84
84
|
* await revealItemInDir('/path/to/file');
|
|
85
|
+
* await revealItemInDir([ '/path/to/file', '/path/to/another/file' ]);
|
|
85
86
|
* ```
|
|
86
87
|
*
|
|
87
88
|
* @param path The path to reveal.
|
|
@@ -89,7 +90,8 @@ async function openPath(path, openWith) {
|
|
|
89
90
|
* @since 2.0.0
|
|
90
91
|
*/
|
|
91
92
|
async function revealItemInDir(path) {
|
|
92
|
-
|
|
93
|
+
const paths = typeof path === 'string' ? [path] : path;
|
|
94
|
+
return core.invoke('plugin:opener|reveal_item_in_dir', { paths });
|
|
93
95
|
}
|
|
94
96
|
|
|
95
97
|
exports.openPath = openPath;
|
package/dist-js/index.d.ts
CHANGED
|
@@ -48,10 +48,11 @@ export declare function openPath(path: string, openWith?: string): Promise<void>
|
|
|
48
48
|
* ```typescript
|
|
49
49
|
* import { revealItemInDir } from '@tauri-apps/plugin-opener';
|
|
50
50
|
* await revealItemInDir('/path/to/file');
|
|
51
|
+
* await revealItemInDir([ '/path/to/file', '/path/to/another/file' ]);
|
|
51
52
|
* ```
|
|
52
53
|
*
|
|
53
54
|
* @param path The path to reveal.
|
|
54
55
|
*
|
|
55
56
|
* @since 2.0.0
|
|
56
57
|
*/
|
|
57
|
-
export declare function revealItemInDir(path: string): Promise<
|
|
58
|
+
export declare function revealItemInDir(path: string | string[]): Promise<void>;
|
package/dist-js/index.js
CHANGED
|
@@ -80,6 +80,7 @@ async function openPath(path, openWith) {
|
|
|
80
80
|
* ```typescript
|
|
81
81
|
* import { revealItemInDir } from '@tauri-apps/plugin-opener';
|
|
82
82
|
* await revealItemInDir('/path/to/file');
|
|
83
|
+
* await revealItemInDir([ '/path/to/file', '/path/to/another/file' ]);
|
|
83
84
|
* ```
|
|
84
85
|
*
|
|
85
86
|
* @param path The path to reveal.
|
|
@@ -87,7 +88,8 @@ async function openPath(path, openWith) {
|
|
|
87
88
|
* @since 2.0.0
|
|
88
89
|
*/
|
|
89
90
|
async function revealItemInDir(path) {
|
|
90
|
-
|
|
91
|
+
const paths = typeof path === 'string' ? [path] : path;
|
|
92
|
+
return invoke('plugin:opener|reveal_item_in_dir', { paths });
|
|
91
93
|
}
|
|
92
94
|
|
|
93
95
|
export { openPath, openUrl, revealItemInDir };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tauri-apps/plugin-opener",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"description": "Open files and URLs using their default application.",
|
|
5
5
|
"license": "MIT OR Apache-2.0",
|
|
6
6
|
"authors": [
|
|
@@ -25,6 +25,6 @@
|
|
|
25
25
|
"LICENSE"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@tauri-apps/api": "^2.
|
|
28
|
+
"@tauri-apps/api": "^2.8.0"
|
|
29
29
|
}
|
|
30
30
|
}
|