You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can install the JavaScript Guest bindings using your preferred JavaScript package manager:
25
+
26
+
> 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.
27
+
28
+
```sh
29
+
pnpm add <!-- plugin here -->
30
+
# or
31
+
npm add <!-- plugin here -->
32
+
# or
33
+
yarn add <!-- plugin here -->
34
+
```
35
+
36
+
## Usage
37
+
38
+
First you need to register the core plugin with Tauri:
39
+
40
+
`src-tauri/src/main.rs`
41
+
42
+
```rust
43
+
fnmain() {
44
+
tauri::Builder::default()
45
+
.plugin(<!--pluginhere-->)
46
+
.run(tauri::generate_context!())
47
+
.expect("error while running tauri application");
48
+
}
49
+
```
50
+
51
+
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
52
+
53
+
```javascript
54
+
55
+
```
56
+
57
+
## Contributing
58
+
59
+
PRs accepted. Please make sure to read the Contributing Guide before making a pull request.
60
+
61
+
## License
62
+
63
+
Code: (c) 2015 - Present - The Tauri Programme within The Commons Conservancy.
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
2
+
// SPDX-License-Identifier: Apache-2.0
3
+
// SPDX-License-Identifier: MIT
4
+
5
+
/**
6
+
* Parse arguments from your Command Line Interface.
7
+
*
8
+
* @module
9
+
*/
10
+
11
+
import{invoke}from'@tauri-apps/api/tauri';
12
+
13
+
/**
14
+
* @since 1.0.0
15
+
*/
16
+
interfaceArgMatch{
17
+
/**
18
+
* string if takes value
19
+
* boolean if flag
20
+
* string[] or null if takes multiple values
21
+
*/
22
+
value: string|boolean|string[]|null
23
+
/**
24
+
* Number of occurrences
25
+
*/
26
+
occurrences: number
27
+
}
28
+
29
+
/**
30
+
* @since 1.0.0
31
+
*/
32
+
interfaceSubcommandMatch{
33
+
name: string
34
+
matches: CliMatches
35
+
}
36
+
37
+
/**
38
+
* @since 1.0.0
39
+
*/
40
+
interfaceCliMatches{
41
+
args: Record<string,ArgMatch>
42
+
subcommand: SubcommandMatch|null
43
+
}
44
+
45
+
/**
46
+
* Parse the arguments provided to the current process and get the matches using the configuration defined [`tauri.cli`](https://tauri.app/v1/api/config/#tauriconfig.cli) in `tauri.conf.json`
47
+
*
48
+
* @example
49
+
* ```typescript
50
+
* import { getMatches } from 'tauri-plugin-cli-api';
0 commit comments