Skip to content

Commit

Permalink
chore(docs): Update Rust & TS docs
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianLars authored Sep 30, 2023
1 parent 554733b commit 068cdfb
Show file tree
Hide file tree
Showing 16 changed files with 288 additions and 220 deletions.
2 changes: 1 addition & 1 deletion docs/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ If you have entered a command to the `build.beforeBuildCommand` property, this o
Usage: cargo-tauri icon [OPTIONS] [INPUT]
Arguments:
[INPUT] Path to the source icon (png, 1240x1240px with transparency) [default: ./app-icon.png]
[INPUT] Path to the source icon (png, 1024x1024px with transparency) [default: ./app-icon.png]
Options:
-o, --output <OUTPUT> Output directory. Default: 'icons' directory next to the tauri.conf.json file
Expand Down
27 changes: 25 additions & 2 deletions docs/api/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ Type: `object`
| <div className="anchor-with-padding" id="bundleconfig.identifier">`identifier`<a class="hash-link" href="#bundleconfig.identifier"></a></div> | string (required) | | The application identifier in reverse domain name notation (e.g. `com.tauri.example`). This string must be unique across applications since it is used in system configurations like the bundle ID and path to the webview data directory. This string must contain only alphanumeric characters (A–Z, a–z, and 0–9), hyphens (-), and periods (.). |
| <div className="anchor-with-padding" id="bundleconfig.publisher">`publisher`<a class="hash-link" href="#bundleconfig.publisher"></a></div> | string? | _null_ | The application's publisher. Defaults to the second element in the identifier string. Currently maps to the Manufacturer property of the Windows Installer. |
| <div className="anchor-with-padding" id="bundleconfig.icon">`icon`<a class="hash-link" href="#bundleconfig.icon"></a></div> | string[] | [] | The app's icons |
| <div className="anchor-with-padding" id="bundleconfig.resources">`resources`<a class="hash-link" href="#bundleconfig.resources"></a></div> | array? | _null_ | App resources to bundle. Each resource is a path to a file or directory. Glob patterns are supported. |
| <div className="anchor-with-padding" id="bundleconfig.resources">`resources`<a class="hash-link" href="#bundleconfig.resources"></a></div> | [`BundleResources`](#bundleresources)? | [view](#bundleresources) | App resources to bundle. Each resource is a path to a file or directory. Glob patterns are supported. |
| <div className="anchor-with-padding" id="bundleconfig.copyright">`copyright`<a class="hash-link" href="#bundleconfig.copyright"></a></div> | string? | _null_ | A copyright string associated with your application. |
| <div className="anchor-with-padding" id="bundleconfig.category">`category`<a class="hash-link" href="#bundleconfig.category"></a></div> | string? | _null_ | The application kind.<br /><br />Should be one of the following: Business, DeveloperTool, Education, Entertainment, Finance, Game, ActionGame, AdventureGame, ArcadeGame, BoardGame, CardGame, CasinoGame, DiceGame, EducationalGame, FamilyGame, KidsGame, MusicGame, PuzzleGame, RacingGame, RolePlayingGame, SimulationGame, SportsGame, StrategyGame, TriviaGame, WordGame, GraphicsAndDesign, HealthcareAndFitness, Lifestyle, Medical, Music, News, Photography, Productivity, Reference, SocialNetworking, Sports, Travel, Utility, Video, Weather. |
| <div className="anchor-with-padding" id="bundleconfig.shortdescription">`shortDescription`<a class="hash-link" href="#bundleconfig.shortdescription"></a></div> | string? | _null_ | A short description of your application. |
Expand Down Expand Up @@ -306,6 +306,15 @@ Can be any **ONE** of the following types:
- "dmg": The Apple Disk Image bundle (.dmg).
- "updater": The Tauri updater bundle.

##### BundleResources

Definition for bundle resources. Can be either a list of paths to include or a map of source to target paths.

Can be any of the following types:

- `string[]`: A list of paths to include.
- `object`: A map of source to target paths.

##### AppImageConfig

Configuration for AppImage bundles.
Expand Down Expand Up @@ -480,6 +489,7 @@ Type: `object`
| <div className="anchor-with-padding" id="nsisconfig.languages">`languages`<a class="hash-link" href="#nsisconfig.languages"></a></div> | array? | _null_ | A list of installer languages. By default the OS language is used. If the OS language is not in the list of languages, the first language will be used. To allow the user to select the language, set `display_language_selector` to `true`.<br /><br />See <https://github.com/kichik/nsis/tree/9465c08046f00ccb6eda985abbdbf52c275c6c4d/Contrib/Language%20files> for the complete list of languages. |
| <div className="anchor-with-padding" id="nsisconfig.customlanguagefiles">`customLanguageFiles`<a class="hash-link" href="#nsisconfig.customlanguagefiles"></a></div> | object? | _null_ | A key-value pair where the key is the language and the value is the path to a custom `.nsh` file that holds the translated text for tauri's custom messages.<br /><br />See <https://github.com/tauri-apps/tauri/blob/dev/tooling/bundler/src/bundle/windows/templates/nsis-languages/English.nsh> for an example `.nsh` file.<br /><br />**Note**: the key must be a valid NSIS language and it must be added to [`NsisConfig`] languages array, |
| <div className="anchor-with-padding" id="nsisconfig.displaylanguageselector">`displayLanguageSelector`<a class="hash-link" href="#nsisconfig.displaylanguageselector"></a></div> | boolean | `false` | Whether to display a language selector dialog before the installer and uninstaller windows are rendered or not. By default the OS language is selected, with a fallback to the first language in the `languages` array. |
| <div className="anchor-with-padding" id="nsisconfig.compression">`compression`<a class="hash-link" href="#nsisconfig.compression"></a></div> | [`NsisCompression`](#nsiscompression)? | [view](#nsiscompression) | Set the compression algorithm used to compress files in the installer.<br /><br />See <https://nsis.sourceforge.io/Reference/SetCompressor> |


###### NSISInstallerMode
Expand All @@ -500,6 +510,18 @@ Installer metadata will be saved under the `HKCU` registry path.

Installer metadata will be saved under the `HKLM` or `HKCU` registry path based on the user's choice.

###### NsisCompression

Compression algorithms used in the NSIS installer.

See <https://nsis.sourceforge.io/Reference/SetCompressor>

Can be any **ONE** of the following types:

- "zlib": ZLIB uses the deflate algorithm, it is a quick and simple method. With the default compression level it uses about 300 KB of memory.
- "bzip2": BZIP2 usually gives better compression ratios than ZLIB, but it is a bit slower and uses more memory. With the default compression level it uses about 4 MB of memory.
- "lzma": LZMA (default) is a new compression method that gives very good compression ratios. The decompression speed is high (10-20 MB/s on a 2 GHz CPU), the compression speed is lower. The memory size that will be used for decompression is the dictionary size plus a few KBs, the default is 8 MB.

#### AllowlistConfig

Allowlist configuration. The allowlist is a translation of the [Cargo allowlist features](https://docs.rs/tauri/latest/tauri/#cargo-allowlist-features).
Expand Down Expand Up @@ -843,6 +865,7 @@ Type: `object`
| <div className="anchor-with-padding" id="securityconfig.freezeprototype">`freezePrototype`<a class="hash-link" href="#securityconfig.freezeprototype"></a></div> | boolean | `false` | Freeze the `Object.prototype` when using the custom protocol. |
| <div className="anchor-with-padding" id="securityconfig.dangerousdisableassetcspmodification">`dangerousDisableAssetCspModification`<a class="hash-link" href="#securityconfig.dangerousdisableassetcspmodification"></a></div> | [`DisabledCspModificationKind`](#disabledcspmodificationkind) | `false` | Disables the Tauri-injected CSP sources.<br /><br />At compile time, Tauri parses all the frontend assets and changes the Content-Security-Policy to only allow loading of your own scripts and styles by injecting nonce and hash sources. This stricts your CSP, which may introduce issues when using along with other flexing sources.<br /><br />This configuration option allows both a boolean and a list of strings as value. A boolean instructs Tauri to disable the injection for all CSP injections, and a list of strings indicates the CSP directives that Tauri cannot inject.<br /><br />**WARNING:** Only disable this if you know what you are doing and have properly configured the CSP. Your application might be vulnerable to XSS attacks without this Tauri protection. |
| <div className="anchor-with-padding" id="securityconfig.dangerousremotedomainipcaccess">`dangerousRemoteDomainIpcAccess`<a class="hash-link" href="#securityconfig.dangerousremotedomainipcaccess"></a></div> | [`RemoteDomainAccessScope`](#remotedomainaccessscope) | [] | Allow external domains to send command to Tauri.<br /><br />By default, external domains do not have access to `window.__TAURI__`, which means they cannot communicate with the commands defined in Rust. This prevents attacks where an externally loaded malicious or compromised sites could start executing commands on the user's device.<br /><br />This configuration allows a set of external domains to have access to the Tauri commands. When you configure a domain to be allowed to access the IPC, all subpaths are allowed. Subdomains are not allowed.<br /><br />**WARNING:** Only use this option if you either have internal checks against malicious external sites or you can trust the allowed external sites. You application might be vulnerable to dangerous Tauri command related attacks otherwise. |
| <div className="anchor-with-padding" id="securityconfig.dangeroususehttpscheme">`dangerousUseHttpScheme`<a class="hash-link" href="#securityconfig.dangeroususehttpscheme"></a></div> | boolean | `false` | Sets whether the custom protocols should use `http://<scheme>.localhost` instead of the default `https://<scheme>.localhost` on Windows.<br /><br />**WARNING:** Using a `http` scheme will allow mixed content when trying to fetch `http` endpoints and is therefore less secure but will match the behavior of the `<scheme>://localhost` protocols used on macOS and Linux. |


##### Csp
Expand Down Expand Up @@ -883,7 +906,7 @@ Type: `object`
| <div className="anchor-with-padding" id="remotedomainaccessscope.scheme">`scheme`<a class="hash-link" href="#remotedomainaccessscope.scheme"></a></div> | string? | _null_ | The URL scheme to allow. By default, all schemas are allowed. |
| <div className="anchor-with-padding" id="remotedomainaccessscope.domain">`domain`<a class="hash-link" href="#remotedomainaccessscope.domain"></a></div> | string (required) | | The domain to allow. |
| <div className="anchor-with-padding" id="remotedomainaccessscope.windows">`windows`<a class="hash-link" href="#remotedomainaccessscope.windows"></a></div> | string[] (required) | | The list of window labels this scope applies to. |
| <div className="anchor-with-padding" id="remotedomainaccessscope.plugins">`plugins`<a class="hash-link" href="#remotedomainaccessscope.plugins"></a></div> | string[] | [] | The list of plugins that are allowed in this scope. |
| <div className="anchor-with-padding" id="remotedomainaccessscope.plugins">`plugins`<a class="hash-link" href="#remotedomainaccessscope.plugins"></a></div> | string[] | [] | The list of plugins that are allowed in this scope. The names should be without the `tauri-plugin-` prefix, for example `"store"` for `tauri-plugin-store`. |
| <div className="anchor-with-padding" id="remotedomainaccessscope.enabletauriapi">`enableTauriAPI`<a class="hash-link" href="#remotedomainaccessscope.enabletauriapi"></a></div> | boolean | `false` | Enables access to the Tauri API. |


Expand Down
12 changes: 6 additions & 6 deletions docs/api/js/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This package is also accessible with `window.__TAURI__.cli` when [`build.withGlo
Number of occurrences

**Defined in:** [cli.ts:27](https://github.com/tauri-apps/tauri/blob/b7ae725/tooling/api/src/cli.ts#L27)
**Defined in:** [cli.ts:27](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/cli.ts#L27)

##### `value`

Expand All @@ -28,7 +28,7 @@ string if takes value
boolean if flag
string[] or null if takes multiple values

**Defined in:** [cli.ts:23](https://github.com/tauri-apps/tauri/blob/b7ae725/tooling/api/src/cli.ts#L23)
**Defined in:** [cli.ts:23](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/cli.ts#L23)

### `CliMatches`

Expand All @@ -40,13 +40,13 @@ string[] or null if takes multiple values

> **args**: [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )<`string`, [`ArgMatch`](cli.md#argmatch)\>
**Defined in:** [cli.ts:42](https://github.com/tauri-apps/tauri/blob/b7ae725/tooling/api/src/cli.ts#L42)
**Defined in:** [cli.ts:42](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/cli.ts#L42)

##### `subcommand`

> **subcommand**: `null` \| [`SubcommandMatch`](cli.md#subcommandmatch)
**Defined in:** [cli.ts:43](https://github.com/tauri-apps/tauri/blob/b7ae725/tooling/api/src/cli.ts#L43)
**Defined in:** [cli.ts:43](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/cli.ts#L43)

### `SubcommandMatch`

Expand All @@ -58,13 +58,13 @@ string[] or null if takes multiple values

> **matches**: [`CliMatches`](cli.md#climatches)
**Defined in:** [cli.ts:35](https://github.com/tauri-apps/tauri/blob/b7ae725/tooling/api/src/cli.ts#L35)
**Defined in:** [cli.ts:35](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/cli.ts#L35)

##### `name`

> **name**: `string`
**Defined in:** [cli.ts:34](https://github.com/tauri-apps/tauri/blob/b7ae725/tooling/api/src/cli.ts#L34)
**Defined in:** [cli.ts:34](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/cli.ts#L34)

## Functions

Expand Down
36 changes: 18 additions & 18 deletions docs/api/js/dialog.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,31 @@ It is recommended to allowlist only the APIs you use for optimal bundle size and
The label of the cancel button.

**Defined in:** [dialog.ts:112](https://github.com/tauri-apps/tauri/blob/b7ae725/tooling/api/src/dialog.ts#L112)
**Defined in:** [dialog.ts:112](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L112)

##### `okLabel`

> `Optional` **okLabel**: `string`
The label of the confirm button.

**Defined in:** [dialog.ts:110](https://github.com/tauri-apps/tauri/blob/b7ae725/tooling/api/src/dialog.ts#L110)
**Defined in:** [dialog.ts:110](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L110)

##### `title`

> `Optional` **title**: `string`
The title of the dialog. Defaults to the app name.

**Defined in:** [dialog.ts:106](https://github.com/tauri-apps/tauri/blob/b7ae725/tooling/api/src/dialog.ts#L106)
**Defined in:** [dialog.ts:106](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L106)

##### `type`

> `Optional` **type**: `"info"` \| `"warning"` \| `"error"`
The type of the dialog. Defaults to `info`.

**Defined in:** [dialog.ts:108](https://github.com/tauri-apps/tauri/blob/b7ae725/tooling/api/src/dialog.ts#L108)
**Defined in:** [dialog.ts:108](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L108)

### `DialogFilter`

Expand All @@ -81,15 +81,15 @@ Extensions to filter, without a `.` prefix.
extensions: ['svg', 'png']
```

**Defined in:** [dialog.ts:48](https://github.com/tauri-apps/tauri/blob/b7ae725/tooling/api/src/dialog.ts#L48)
**Defined in:** [dialog.ts:48](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L48)

##### `name`

> **name**: `string`
Filter name.

**Defined in:** [dialog.ts:40](https://github.com/tauri-apps/tauri/blob/b7ae725/tooling/api/src/dialog.ts#L40)
**Defined in:** [dialog.ts:40](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L40)

### `MessageDialogOptions`

Expand All @@ -103,23 +103,23 @@ Filter name.
The label of the confirm button.

**Defined in:** [dialog.ts:101](https://github.com/tauri-apps/tauri/blob/b7ae725/tooling/api/src/dialog.ts#L101)
**Defined in:** [dialog.ts:101](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L101)

##### `title`

> `Optional` **title**: `string`
The title of the dialog. Defaults to the app name.

**Defined in:** [dialog.ts:97](https://github.com/tauri-apps/tauri/blob/b7ae725/tooling/api/src/dialog.ts#L97)
**Defined in:** [dialog.ts:97](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L97)

##### `type`

> `Optional` **type**: `"info"` \| `"warning"` \| `"error"`
The type of the dialog. Defaults to `info`.

**Defined in:** [dialog.ts:99](https://github.com/tauri-apps/tauri/blob/b7ae725/tooling/api/src/dialog.ts#L99)
**Defined in:** [dialog.ts:99](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L99)

### `OpenDialogOptions`

Expand All @@ -135,31 +135,31 @@ Options for the open dialog.
Initial directory or file path.

**Defined in:** [dialog.ts:62](https://github.com/tauri-apps/tauri/blob/b7ae725/tooling/api/src/dialog.ts#L62)
**Defined in:** [dialog.ts:62](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L62)

##### `directory`

> `Optional` **directory**: `boolean`
Whether the dialog is a directory selection or not.

**Defined in:** [dialog.ts:66](https://github.com/tauri-apps/tauri/blob/b7ae725/tooling/api/src/dialog.ts#L66)
**Defined in:** [dialog.ts:66](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L66)

##### `filters`

> `Optional` **filters**: [`DialogFilter`](dialog.md#dialogfilter)[]
The filters of the dialog.

**Defined in:** [dialog.ts:60](https://github.com/tauri-apps/tauri/blob/b7ae725/tooling/api/src/dialog.ts#L60)
**Defined in:** [dialog.ts:60](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L60)

##### `multiple`

> `Optional` **multiple**: `boolean`
Whether the dialog allows multiple selection or not.

**Defined in:** [dialog.ts:64](https://github.com/tauri-apps/tauri/blob/b7ae725/tooling/api/src/dialog.ts#L64)
**Defined in:** [dialog.ts:64](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L64)

##### `recursive`

Expand All @@ -168,15 +168,15 @@ Whether the dialog allows multiple selection or not.
If `directory` is true, indicates that it will be read recursively later.
Defines whether subdirectories will be allowed on the scope or not.

**Defined in:** [dialog.ts:71](https://github.com/tauri-apps/tauri/blob/b7ae725/tooling/api/src/dialog.ts#L71)
**Defined in:** [dialog.ts:71](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L71)

##### `title`

> `Optional` **title**: `string`
The title of the dialog window.

**Defined in:** [dialog.ts:58](https://github.com/tauri-apps/tauri/blob/b7ae725/tooling/api/src/dialog.ts#L58)
**Defined in:** [dialog.ts:58](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L58)

### `SaveDialogOptions`

Expand All @@ -194,23 +194,23 @@ Initial directory or file path.
If it's a directory path, the dialog interface will change to that folder.
If it's not an existing directory, the file name will be set to the dialog's file name input and the dialog will be set to the parent folder.

**Defined in:** [dialog.ts:89](https://github.com/tauri-apps/tauri/blob/b7ae725/tooling/api/src/dialog.ts#L89)
**Defined in:** [dialog.ts:89](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L89)

##### `filters`

> `Optional` **filters**: [`DialogFilter`](dialog.md#dialogfilter)[]
The filters of the dialog.

**Defined in:** [dialog.ts:83](https://github.com/tauri-apps/tauri/blob/b7ae725/tooling/api/src/dialog.ts#L83)
**Defined in:** [dialog.ts:83](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L83)

##### `title`

> `Optional` **title**: `string`
The title of the dialog window.

**Defined in:** [dialog.ts:81](https://github.com/tauri-apps/tauri/blob/b7ae725/tooling/api/src/dialog.ts#L81)
**Defined in:** [dialog.ts:81](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L81)

## Functions

Expand Down
Loading

0 comments on commit 068cdfb

Please sign in to comment.