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
Copy file name to clipboardExpand all lines: docs/api/config.md
+18-17Lines changed: 18 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ It's composed of the following properties:
14
14
15
15
## `build`
16
16
17
-
<Properties rows={[
17
+
<Properties anchorRoot="build" rows={[
18
18
{property: "distDir", type: "string", description: `The path—either absolute or relative—to the production-ready webpage/webapp directory that will be bundled by Tauri.
@@ -36,7 +36,7 @@ It's composed of the following properties:
36
36
37
37
## `ctx`
38
38
39
-
<Properties rows={[
39
+
<Properties anchorRoot="ctx" rows={[
40
40
{ property: "debug", optional: true, type: "boolean", description: `Tells the CLI to build on debug mode instead of release. Can also be used as <code>tauri build --debug</code>.` },
41
41
{ property: "exitOnPanic", optional: true, type: "boolean", description: `Whether or not the webview should be killed if some Rust code error happened. Can also be used as <code>tauri dev --exit-on-panic</code> or <code>tauri dev -e</code>.` }
42
42
]} />
@@ -50,11 +50,11 @@ It's composed of the following properties:
{ property: "args", optional: true, type: "CliArg[]", description: `List of args for the command.`, child: <Arraytype="CliArg"name="arg"><Properties rows={[
56
+
child: <Properties anchorRoot="tauri.cli" rows={[
57
+
{ property: "args", optional: true, type: "CliArg[]", description: `List of args for the command.`, child: <Arraytype="CliArg"name="arg"><Properties anchorRoot="tauri.cli.args" rows={[
58
58
{ property: "short", optional: true, type: "string", description: `the short version of the argument, without the preceding hyphen (the "-" character).
Any leading hyphen will be stripped, and only the first non hyphen character will be used as the short version.
@@ -131,11 +131,11 @@ It's composed of the following properties:
131
131
},
132
132
{
133
133
property: "embeddedServer", type: "object",
134
-
child: <Properties rows={[{ property: "active", optional: true, type: "boolean", description: `Set it to <code>false</code> if you plan to serve your application statically.` }]} />
134
+
child: <Properties anchorRoot="tauri.embeddedServer" rows={[{ property: "active", optional: true, type: "boolean", description: `Set it to <code>false</code> if you plan to serve your application statically.` }]} />
{ property: "active", optional: true, type: "boolean", description: `Whether we should build your app with tauri-bundler or plain <code>cargo build</code>.` },
140
140
{ property: "targets", optional: true, type: "string | string[]", description: `An array of the bundles you want to generate; e.g. ["deb", "osx", "msi", "appimage", "dmg"] or the string 'all' to make every supported bundle. By default we bundle everything your target supports (osx/dmg on mac, deb/appimage on linux, msi on windows).` },
141
141
{ property: "identifier", type: "string", description: `A string that uniquely identifies your application, in reverse-DNS form (for example, "com.example.appname" or "io.github.username.project"). For OS X and iOS, this is used as the bundle's CFBundleIdentifier value; for Windows, this is hashed to create an application GUID.` },
@@ -147,7 +147,7 @@ It's composed of the following properties:
147
147
E.g. you typed "my-binary":
148
148
<ul>
149
149
<li>"my-binary-x86_64-pc-windows-msvc.exe" for Windows</li>
150
-
<li>"my-binary-x86_64-apple-darwin" for MacOS</li>
150
+
<li>"my-binary-x86_64-apple-darwin" for macOS</li>
151
151
<li>"my-binary-x86_64-unknown-linux-gnu" for Linux</li>
152
152
</ul>
153
153
so don't forget to provide binaries for <strong>all targeted platforms</strong>.
@@ -159,13 +159,13 @@ It's composed of the following properties:
159
159
` },
160
160
{ property: "shortDescription", optional: true, type: "string", description: `A short description of your application.` },
161
161
{ property: "longDescription", optional: true, type: "string", description: `A longer, multi-line description of the application.` },
{ property: "frameworks", optional: true, type: "string[]", description: `A list of strings indicating any MacOS X frameworks that need to be bundled with the application. If a name is used, ".framework" must be omitted and it will look for standard install locations. You may also use a path to a specific framework.` },
168
-
{ property: "minimumSystemVersion", optional: true, type: "string", description: `A version string indicating the minimum MacOS X version that the bundled application supports.` },
{ property: "frameworks", optional: true, type: "string[]", description: `A list of strings indicating any macOS X frameworks that need to be bundled with the application. If a name is used, ".framework" must be omitted and it will look for standard install locations. You may also use a path to a specific framework.` },
168
+
{ property: "minimumSystemVersion", optional: true, type: "string", description: `A version string indicating the minimum macOS X version that the bundled application supports.` },
169
169
{ property: "license", optional: true, type: "string", description: `The path to the license file to add to the DMG.` },
This is a really important part of the configuration since it helps you ensure your webview is secured. See more <ahref="https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP"target="_blank">on Mozilla</a>.
@@ -219,13 +220,13 @@ It's composed of the following properties:
{ property: "active", optional: true, type: "boolean", description: `Whether you want to build with Microsoft Edge or with Microsoft Internet Explorer.` },
Copy file name to clipboardExpand all lines: docs/api/js.md
+44-1Lines changed: 44 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,8 @@ import Alert from '@theme/Alert'
7
7
8
8
Here is the JS API, exposed by the <ahref="https://www.npmjs.com/package/tauri"target="_blank">Tauri package</a> in the "api" directory.
9
9
10
+
Note that you can either enable or disable these APIs in your [tauri.conf.json](/docs/api/config). Please refer to the "whitelist" section.
11
+
10
12
If you haven't done it so far, add the package _locally_ to your project:
11
13
12
14
```sh
@@ -434,7 +436,7 @@ type HttpOptions = {
434
436
* @property{BodyType}[bodyType=3] body type
435
437
*/
436
438
437
-
/**
439
+
/**
438
440
* @param{HttpOptions}options request options
439
441
*/
440
442
request(options: HttpOptions): Promise<any>
@@ -580,6 +582,47 @@ Makes a DELETE HTTP request
580
582
581
583
promise resolving to the response
582
584
585
+
## Notification
586
+
587
+
<Alerticon="info-alt"title="Note">
588
+
589
+
Tauri patches the <ahref="https://developer.mozilla.org/en-US/docs/Web/API/notification"target="_blank">Notification API</a> but not all methods and properties are available.
590
+
591
+
Since we're patching the browser API, you don't need to import anything as it lives in the global scope.
592
+
</Alert>
593
+
594
+
### Types
595
+
596
+
```ts
597
+
interfaceNotificationOptions {
598
+
dir?:'auto'|'ltr'|'rtl'
599
+
lang?:string// The notification's language, as specified using a DOMString representing a BCP 47 language tag. See the Sitepoint ISO 2 letter language codes page for a simple reference.
600
+
badge?:string// A USVString containing the URL of the image used to represent the notification when there isn't enough space to display the notification itself.
601
+
body?:string// A DOMString representing the body text of the notification, which is displayed below the title.
602
+
tag?:string// A DOMString representing an identifying tag for the notification.
603
+
icon?:string// A USVString containing the URL of an icon to be displayed in the notification.
604
+
image?:string// A USVString containing the URL of an image to be displayed in the notification.
605
+
data?:any// Arbitrary data that you want associated with the notification. This can be of any data type.
606
+
vibrate?:any// A vibration pattern for the device's vibration hardware to emit with the notification.
607
+
renotify?:boolean// A Boolean specifying whether the user should be notified after a new notification replaces an old one. The default is false, which means they won't be notified.
608
+
requireInteraction?:boolean// Indicates that a notification should remain active until the user clicks or dismisses it, rather than closing automatically. The default value is false.
609
+
actions?:NotificationAction[] // An array of NotificationActions representing the actions available to the user when the notification is presented. These are options the user can choose among in order to act on the action within the context of the notification itself. The action's name is sent to the service worker notification handler to let it know the action was selected by the user.
610
+
silent?:boolean// A Boolean specifying whether the notification is silent (no sounds or vibrations issued), regardless of the device settings. The default is false, which means it won't be silent.
0 commit comments