diff --git a/docs/api/cli.md b/docs/api/cli.md index 8d521c9e59f..1f91bda6ccd 100644 --- a/docs/api/cli.md +++ b/docs/api/cli.md @@ -70,15 +70,20 @@ Options: ``` -Usage: cargo-tauri plugin init [OPTIONS] --name +Usage: cargo-tauri plugin init [OPTIONS] [PLUGIN_NAME] + +Arguments: + [PLUGIN_NAME] Name of your Tauri plugin. If not specified, it will be infered from the current directory Options: - -n, --name Name of your Tauri plugin + --no-api Initializes a Tauri plugin without the TypeScript API -v, --verbose... Enables verbose logging - --api Initializes a Tauri plugin with TypeScript API -d, --directory Set target directory for init [default: /home/runner/work/tauri-docs/tauri-docs] -t, --tauri-path Path of the Tauri project to use (relative to the cwd) -a, --author Author name + --android Whether to initialize an Android project for the plugin + --ios Whether to initialize an iOS project for the plugin + --mobile Whether to initialize Android and iOS projects for the plugin -h, --help Print help -V, --version Print version ``` @@ -91,21 +96,55 @@ Options: Usage: cargo-tauri dev [OPTIONS] [ARGS]... Arguments: - [ARGS]... Command line arguments passed to the runner. Arguments after `--` are passed to the application + [ARGS]... + Command line arguments passed to the runner. Arguments after `--` are passed to the application Options: - -r, --runner Binary to use to run the application - -v, --verbose... Enables verbose logging - -t, --target Target triple to build against - -f, --features [...] List of cargo features to activate - -e, --exit-on-panic Exit on panic - -c, --config JSON string or path to JSON file to merge with tauri.conf.json - --release Run the code in release mode - --no-watch Disable the file watcher - --no-dev-server Disable the dev server for static files - --port Specify port for the dev server for static files. Defaults to 1430 Can also be set using `TAURI_DEV_SERVER_PORT` env var - -h, --help Print help - -V, --version Print version + -r, --runner + Binary to use to run the application + + -v, --verbose... + Enables verbose logging + + -t, --target + Target triple to build against + + -f, --features [...] + List of cargo features to activate + + -e, --exit-on-panic + Exit on panic + + -c, --config + JSON string or path to JSON file to merge with tauri.conf.json + + --release + Run the code in release mode + + --no-dev-server-wait + Skip waiting for the frontend dev server to start before building the tauri application + + [env: TAURI_CLI_NO_DEV_SERVER_WAIT=] + + --no-watch + Disable the file watcher + + --force-ip-prompt + Force prompting for an IP to use to connect to the dev server on mobile + + --no-dev-server + Disable the built-in dev server for static files + + --port + Specify port for the built-in dev server for static files. Defaults to 1430 + + [env: TAURI_CLI_PORT=] + + -h, --help + Print help (see a summary with '-h') + + -V, --version + Print version ``` This command will open the WebView in development mode. It makes use of the `build.devPath` property from your `src-tauri/tauri.conf.json` file. @@ -183,14 +222,15 @@ 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, 1024x1024px with transparency) [default: ./app-icon.png] + [INPUT] Path to the source icon (png, 1240x1240px with transparency) [default: ./app-icon.png] Options: - -o, --output Output directory. Default: 'icons' directory next to the tauri.conf.json file - -v, --verbose... Enables verbose logging - -p, --png Custom PNG icon sizes to generate. When set, the default icons are not generated - -h, --help Print help - -V, --version Print version + -o, --output Output directory. Default: 'icons' directory next to the tauri.conf.json file + -v, --verbose... Enables verbose logging + -p, --png Custom PNG icon sizes to generate. When set, the default icons are not generated + --ios-color The background color of the iOS icon - string as defined in the W3C's CSS Color Module Level 4 [default: #fff] + -h, --help Print help + -V, --version Print version ``` For more information, check out the complete [Tauri Icon Guide](../guides/features/icons.md). diff --git a/docs/api/config.md b/docs/api/config.md index daddd982e16..7022dded76b 100644 --- a/docs/api/config.md +++ b/docs/api/config.md @@ -4,7 +4,7 @@ toc_max_heading_level: 5 # Configuration -The Tauri configuration object. It is read from a file where you can define your frontend assets, configure the bundler, enable the app updater, define a system tray, enable APIs via the allowlist and more. +The Tauri configuration object. It is read from a file where you can define your frontend assets, configure the bundler and define a tray icon. The configuration file is generated by the [`tauri init`](https://tauri.app/v1/api/cli#init) command that lives in your Tauri application source directory (src-tauri). @@ -18,7 +18,7 @@ Tauri also supports JSON5 and TOML files via the `config-json5` and `config-toml ## Platform-Specific Configuration -In addition to the default configuration file, Tauri can read a platform-specific configuration from `tauri.linux.conf.json`, `tauri.windows.conf.json`, and `tauri.macos.conf.json` (or `Tauri.linux.toml`, `Tauri.windows.toml` and `Tauri.macos.toml` if the `Tauri.toml` format is used), which gets merged with the main configuration object. +In addition to the default configuration file, Tauri can read a platform-specific configuration from `tauri.linux.conf.json`, `tauri.windows.conf.json`, `tauri.macos.conf.json`, `tauri.android.conf.json` and `tauri.ios.conf.json` (or `Tauri.linux.toml`, `Tauri.windows.toml`, `Tauri.macos.toml`, `Tauri.android.toml` and `Tauri.ios.toml` if the `Tauri.toml` format is used), which gets merged with the main configuration object. ## Configuration Structure @@ -42,16 +42,10 @@ The configuration is composed of the following objects: "version": "0.1.0" }, "tauri": { - "allowlist": { - "all": true - }, "bundle": {}, "security": { "csp": null }, - "updater": { - "active": false - }, "windows": [ { "fullscreen": false, @@ -79,6 +73,8 @@ Type: `object` The package configuration. +See more: + Type: `object` | Name | Type | Default | Description | @@ -91,18 +87,17 @@ Type: `object` The Tauri configuration object. +See more: + Type: `object` | Name | Type | Default | Description | | ---- | ---- | ------- | ----------- | |
`pattern`
| [`PatternKind`](#patternkind) | [view](#patternkind) | The pattern to use. | |
`windows`
| [`WindowConfig`](#windowconfig) | [] | The windows configuration. | -|
`cli`
| [`CliConfig`](#cliconfig)? | [view](#cliconfig) | The CLI configuration. | |
`bundle`
| [`BundleConfig`](#bundleconfig) | [view](#bundleconfig) | The bundler configuration. | -|
`allowlist`
| [`AllowlistConfig`](#allowlistconfig) | [view](#allowlistconfig) | The allowlist configuration. | |
`security`
| [`SecurityConfig`](#securityconfig) | [view](#securityconfig) | Security configuration. | -|
`updater`
| [`UpdaterConfig`](#updaterconfig) | [view](#updaterconfig) | The updater configuration. | -|
`systemTray`
| [`SystemTrayConfig`](#systemtrayconfig)? | [view](#systemtrayconfig) | Configuration for app system tray. | +|
`trayIcon`
| [`TrayIconConfig`](#trayiconconfig)? | [view](#trayiconconfig) | Configuration for app tray icon. | |
`macOSPrivateApi`
| boolean | `false` | MacOS private API configuration. Enables the transparent background API and sets the `fullScreenEnabled` preference to `true`. | @@ -134,6 +129,8 @@ Can be any **ONE** of the following types: The window configuration object. +See more: + Type: `object` | Name | Type | Default | Description | @@ -163,6 +160,7 @@ Type: `object` |
`visible`
| boolean | `true` | Whether the window is visible or not. | |
`decorations`
| boolean | `true` | Whether the window should have borders and bars. | |
`alwaysOnTop`
| boolean | `false` | Whether the window should always be on top of other windows. | +|
`visibleOnAllWorkspaces`
| boolean | `false` | Whether the window should be visible on all workspaces or virtual desktops. | |
`contentProtected`
| boolean | `false` | Prevents the window contents from being captured by other apps. | |
`skipTaskbar`
| boolean | `false` | If `true`, hides the window icon from the taskbar on Windows and Linux. | |
`theme`
| [`Theme`](#theme)? | [view](#theme) | The initial window theme. Defaults to the system theme. Only implemented on Windows and macOS 10.14+. | @@ -171,6 +169,9 @@ Type: `object` |
`acceptFirstMouse`
| boolean | `false` | Whether clicking an inactive window also clicks through to the webview on macOS. | |
`tabbingIdentifier`
| string? | _null_ | Defines the window [tabbing identifier](https://developer.apple.com/documentation/appkit/nswindow/1644704-tabbingidentifier) for macOS.

Windows with matching tabbing identifiers will be grouped together. If the tabbing identifier is not set, automatic tabbing will be disabled. | |
`additionalBrowserArgs`
| string? | _null_ | Defines additional browser arguments on Windows. By default wry passes `--disable-features=msWebOOUI,msPdfOOUI,msSmartScreenProtection` so if you use this method, you also need to disable these components by yourself if you want. | +|
`shadow`
| boolean | `true` | Whether or not the window has shadow.

## Platform-specific

- **Windows:**
- `false` has no effect on decorated window, shadow are always ON.
- `true` will make ndecorated window have a 1px white border, and on Windows 11, it will have a rounded corners.
- **Linux:** Unsupported. | +|
`windowEffects`
| [`WindowEffectsConfig`](#windoweffectsconfig)? | [view](#windoweffectsconfig) | Window effects.

Requires the window to be transparent.

## Platform-specific:

- **Windows**: If using decorations or shadows, you may want to try this workaround
- **Linux**: Unsupported | +|
`incognito`
| boolean | `false` | Whether or not the webview should be launched in incognito mode.

## Platform-specific:

- **Android**: Unsupported. | ##### WindowUrl @@ -208,59 +209,86 @@ Can be any **ONE** of the following types: - You need to define a custom drag region to make your window draggable, however due to a limitation you can't drag the window when it's not in focus . - The color of the window title depends on the system theme. -#### CliConfig +##### WindowEffectsConfig -describes a CLI configuration +The window effects configuration object Type: `object` | Name | Type | Default | Description | | ---- | ---- | ------- | ----------- | -|
`description`
| string? | _null_ | Command description which will be shown on the help information. | -|
`longDescription`
| string? | _null_ | Command long description which will be shown on the help information. | -|
`beforeHelp`
| string? | _null_ | Adds additional help information to be displayed in addition to auto-generated help. This information is displayed before the auto-generated help information. This is often used for header information. | -|
`afterHelp`
| string? | _null_ | Adds additional help information to be displayed in addition to auto-generated help. This information is displayed after the auto-generated help information. This is often used to describe how to use the arguments, or caveats to be noted. | -|
`args`
| [`CliArg`](#cliarg)? | _null_ | List of arguments for the command | -|
`subcommands`
| [`CliConfig`](#cliconfig)? | _null_ | List of subcommands of this command | +|
`effects`
| [`WindowEffect`](#windoweffect) (required) | | List of Window effects to apply to the Window. Conflicting effects will apply the first one and ignore the rest. | +|
`state`
| [`WindowEffectState`](#windoweffectstate)? | [view](#windoweffectstate) | Window effect state **macOS Only** | +|
`radius`
| number? _(format: `double`)_ | _null_ | Window effect corner radius **macOS Only** | +|
`color`
| [`Color`](#color)? | [view](#color) | Window effect color. Affects [`WindowEffect::Blur`] and [`WindowEffect::Acrylic`] only on Windows 10 v1903+. Doesn't have any effect on Windows 7 or Windows 11. | -##### CliArg +###### WindowEffect -A CLI argument definition. +Platform-specific window effects -Type: `object` +Can be any **ONE** of the following types: -| Name | Type | Default | Description | -| ---- | ---- | ------- | ----------- | -|
`short`
| string? | _null_ | The short version of the argument, without the preceding -.

NOTE: Any leading `-` characters will be stripped, and only the first non-character will be used as the short version. | -|
`name`
| string (required) | | The unique argument name | -|
`description`
| string? | _null_ | The argument description which will be shown on the help information. Typically, this is a short (one line) description of the arg. | -|
`longDescription`
| string? | _null_ | The argument long description which will be shown on the help information. Typically this a more detailed (multi-line) message that describes the argument. | -|
`takesValue`
| boolean | `false` | Specifies that the argument takes a value at run time.

NOTE: values for arguments may be specified in any of the following methods
- Using a space such as -o value or --option value
- Using an equals and no space such as -o=value or --option=value
- Use a short and no space such as -ovalue | -|
`multiple`
| boolean | `false` | Specifies that the argument may have an unknown number of multiple values. Without any other settings, this argument may appear only once.

For example, --opt val1 val2 is allowed, but --opt val1 val2 --opt val3 is not.

NOTE: Setting this requires `takes_value` to be set to true. | -|
`multipleOccurrences`
| boolean | `false` | Specifies that the argument may appear more than once. For flags, this results in the number of occurrences of the flag being recorded. For example -ddd or -d -d -d would count as three occurrences. For options or arguments that take a value, this does not affect how many values they can accept. (i.e. only one at a time is allowed)

For example, --opt val1 --opt val2 is allowed, but --opt val1 val2 is not. | -|
`numberOfValues`
| integer? _(format: `uint`)_ | _null_ | Specifies how many values are required to satisfy this argument. For example, if you had a `-f ` argument where you wanted exactly 3 'files' you would set `number_of_values = 3`, and this argument wouldn't be satisfied unless the user provided 3 and only 3 values.

**NOTE:** Does *not* require `multiple_occurrences = true` to be set. Setting `multiple_occurrences = true` would allow `-f -f ` where as *not* setting it would only allow one occurrence of this argument.

**NOTE:** implicitly sets `takes_value = true` and `multiple_values = true`. | -|
`possibleValues`
| array? | _null_ | Specifies a list of possible values for this argument. At runtime, the CLI verifies that only one of the specified values was used, or fails with an error message. | -|
`minValues`
| integer? _(format: `uint`)_ | _null_ | Specifies the minimum number of values for this argument. For example, if you had a -f `` argument where you wanted at least 2 'files', you would set `minValues: 2`, and this argument would be satisfied if the user provided, 2 or more values. | -|
`maxValues`
| integer? _(format: `uint`)_ | _null_ | Specifies the maximum number of values are for this argument. For example, if you had a -f `` argument where you wanted up to 3 'files', you would set .max_values(3), and this argument would be satisfied if the user provided, 1, 2, or 3 values. | -|
`required`
| boolean | `false` | Sets whether or not the argument is required by default.

- Required by default means it is required, when no other conflicting rules have been evaluated
- Conflicting rules take precedence over being required. | -|
`requiredUnlessPresent`
| string? | _null_ | Sets an arg that override this arg's required setting i.e. this arg will be required unless this other argument is present. | -|
`requiredUnlessPresentAll`
| array? | _null_ | Sets args that override this arg's required setting i.e. this arg will be required unless all these other arguments are present. | -|
`requiredUnlessPresentAny`
| array? | _null_ | Sets args that override this arg's required setting i.e. this arg will be required unless at least one of these other arguments are present. | -|
`conflictsWith`
| string? | _null_ | Sets a conflicting argument by name i.e. when using this argument, the following argument can't be present and vice versa. | -|
`conflictsWithAll`
| array? | _null_ | The same as conflictsWith but allows specifying multiple two-way conflicts per argument. | -|
`requires`
| string? | _null_ | Tets an argument by name that is required when this one is present i.e. when using this argument, the following argument must be present. | -|
`requiresAll`
| array? | _null_ | Sts multiple arguments by names that are required when this one is present i.e. when using this argument, the following arguments must be present. | -|
`requiresIf`
| array? | _null_ | Allows a conditional requirement with the signature [arg, value] the requirement will only become valid if `arg`'s value equals `${value}`. | -|
`requiredIfEq`
| array? | _null_ | Allows specifying that an argument is required conditionally with the signature [arg, value] the requirement will only become valid if the `arg`'s value equals `${value}`. | -|
`requireEquals`
| boolean? | _null_ | Requires that options use the --option=val syntax i.e. an equals between the option and associated value. | -|
`index`
| integer? _(format: `uint`, minimum: `1`)_ | _null_ | The positional argument index, starting at 1.

The index refers to position according to other positional argument. It does not define position in the argument list as a whole. When utilized with multiple=true, only the last positional argument may be defined as multiple (i.e. the one with the highest index). | +- "appearanceBased": A default material appropriate for the view's effectiveAppearance. **macOS 10.14-** +- "light": *macOS 10.14-** +- "dark": *macOS 10.14-** +- "mediumLight": *macOS 10.14-** +- "ultraDark": *macOS 10.14-** +- "titlebar": *macOS 10.10+** +- "selection": *macOS 10.10+** +- "menu": *macOS 10.11+** +- "popover": *macOS 10.11+** +- "sidebar": *macOS 10.11+** +- "headerView": *macOS 10.14+** +- "sheet": *macOS 10.14+** +- "windowBackground": *macOS 10.14+** +- "hudWindow": *macOS 10.14+** +- "fullScreenUI": *macOS 10.14+** +- "tooltip": *macOS 10.14+** +- "contentBackground": *macOS 10.14+** +- "underWindowBackground": *macOS 10.14+** +- "underPageBackground": *macOS 10.14+** +- "mica": Mica effect that matches the system dark perefence **Windows 11 Only** +- "micaDark": Mica effect with dark mode but only if dark mode is enabled on the system **Windows 11 Only** +- "micaLight": Mica effect with light mode **Windows 11 Only** +- "tabbed": Tabbed effect that matches the system dark perefence **Windows 11 Only** +- "tabbedDark": Tabbed effect with dark mode but only if dark mode is enabled on the system **Windows 11 Only** +- "tabbedLight": Tabbed effect with light mode **Windows 11 Only** +- "blur": **Windows 7/10/11(22H1) Only** + + ## Notes + +This effect has bad performance when resizing/dragging the window on Windows 11 build 22621. +- "acrylic": **Windows 10/11 Only** + + ## Notes + +This effect has bad performance when resizing/dragging the window on Windows 10 v1903+ and Windows 11 build 22000. + +###### WindowEffectState + +Window effect state **macOS only** + + + +Can be any **ONE** of the following types: + +- "followsWindowActiveState": Make window effect state follow the window's active state +- "active": Make window effect state always active +- "inactive": Make window effect state always inactive + +###### Color + +a tuple struct of RGBA colors. Each value has minimum of 0 and maximum of 255. +Type: ``integer` _(format: `uint8`)_[]` #### BundleConfig Configuration for tauri-bundler. +See more: + Type: `object` | Name | Type | Default | Description | @@ -270,9 +298,10 @@ Type: `object` |
`identifier`
| 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 (.). | |
`publisher`
| 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. | |
`icon`
| string[] | [] | The app's icons | -|
`resources`
| [`BundleResources`](#bundleresources)? | [view](#bundleresources) | App resources to bundle. Each resource is a path to a file or directory. Glob patterns are supported. | +|
`resources`
| array? | _null_ | App resources to bundle. Each resource is a path to a file or directory. Glob patterns are supported. | |
`copyright`
| string? | _null_ | A copyright string associated with your application. | |
`category`
| string? | _null_ | The application kind.

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. | +|
`fileAssociations`
| [`FileAssociation`](#fileassociation)? | _null_ | File associations to application. | |
`shortDescription`
| string? | _null_ | A short description of your application. | |
`longDescription`
| string? | _null_ | A longer, multi-line description of the application. | |
`appimage`
| [`AppImageConfig`](#appimageconfig) | [view](#appimageconfig) | Configuration for the AppImage bundle. | @@ -280,6 +309,9 @@ Type: `object` |
`macOS`
| [`MacConfig`](#macconfig) | [view](#macconfig) | Configuration for the macOS bundles. | |
`externalBin`
| array? | _null_ | A list of—either absolute or relative—paths to binaries to embed with your application.

Note that Tauri will look for system-specific binaries following the pattern "binary-name{-target-triple}{.system-extension}".

E.g. for the external binary "my-binary", Tauri looks for:

- "my-binary-x86_64-pc-windows-msvc.exe" for Windows
- "my-binary-x86_64-apple-darwin" for macOS
- "my-binary-x86_64-unknown-linux-gnu" for Linux

so don't forget to provide binaries for all targeted platforms. | |
`windows`
| [`WindowsConfig`](#windowsconfig) | [view](#windowsconfig) | Configuration for the Windows bundle. | +|
`iOS`
| [`IosConfig`](#iosconfig) | [view](#iosconfig) | iOS configuration. | +|
`android`
| [`AndroidConfig`](#androidconfig) | [view](#androidconfig) | Android configuration. | +|
`updater`
| [`UpdaterConfig`](#updaterconfig) | [view](#updaterconfig) | The updater configuration. | ##### BundleTarget @@ -306,19 +338,47 @@ Can be any **ONE** of the following types: - "dmg": The Apple Disk Image bundle (.dmg). - "updater": The Tauri updater bundle. -##### BundleResources +##### FileAssociation -Definition for bundle resources. Can be either a list of paths to include or a map of source to target paths. +File association + +Type: `object` + +| Name | Type | Default | Description | +| ---- | ---- | ------- | ----------- | +|
`ext`
| [`AssociationExt`](#associationext) (required) | | File extensions to associate with this app. e.g. 'png' | +|
`name`
| string? | _null_ | The name. Maps to `CFBundleTypeName` on macOS. Default to ext[0] | +|
`description`
| string? | _null_ | The association description. Windows-only. It is displayed on the `Type` column on Windows Explorer. | +|
`role`
| [`BundleTypeRole`](#bundletyperole) | [view](#bundletyperole) | The app’s role with respect to the type. Maps to `CFBundleTypeRole` on macOS. | +|
`mimeType`
| string? | _null_ | The mime-type e.g. 'image/png' or 'text/plain'. Linux-only. | -Can be any of the following types: -- `string[]`: A list of paths to include. -- `object`: A map of source to target paths. +###### AssociationExt + +An extension for a [`FileAssociation`]. + +A leading `.` is automatically stripped. + +Type: `string` + +###### BundleTypeRole + +macOS-only. Corresponds to CFBundleTypeRole + +Can be any **ONE** of the following types: + +- "Editor": CFBundleTypeRole.Editor. Files can be read and edited. +- "Viewer": CFBundleTypeRole.Viewer. Files can be read. +- "Shell": CFBundleTypeRole.Shell +- "QLGenerator": CFBundleTypeRole.QLGenerator +- "None": CFBundleTypeRole.None ##### AppImageConfig Configuration for AppImage bundles. +See more: + Type: `object` | Name | Type | Default | Description | @@ -330,6 +390,8 @@ Type: `object` Configuration for Debian (.deb) bundles. +See more: + Type: `object` | Name | Type | Default | Description | @@ -343,6 +405,8 @@ Type: `object` Configuration for the macOS bundles. +See more: + Type: `object` | Name | Type | Default | Description | @@ -360,6 +424,8 @@ Type: `object` Windows bundler configuration. +See more: + Type: `object` | Name | Type | Default | Description | @@ -432,6 +498,8 @@ Can be any **ONE** of the following types: Configuration for the MSI bundle using WiX. +See more: + Type: `object` | Name | Type | Default | Description | @@ -465,6 +533,8 @@ Can be any of the following types: Configuration for a target language for the WiX build. +See more: + Type: `object` | Name | Type | Default | Description | @@ -489,7 +559,6 @@ Type: `object` |
`languages`
| 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`.

See for the complete list of languages. | |
`customLanguageFiles`
| 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.

See for an example `.nsh` file.

**Note**: the key must be a valid NSIS language and it must be added to [`NsisConfig`] languages array, | |
`displayLanguageSelector`
| 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. | -|
`compression`
| [`NsisCompression`](#nsiscompression)? | [view](#nsiscompression) | Set the compression algorithm used to compress files in the installer.

See | ###### NSISInstallerMode @@ -510,352 +579,72 @@ 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 - -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). - -# Notes - -- Endpoints that don't have their own allowlist option are enabled by default. -- There is only "opt-in", no "opt-out". Setting an option to `false` has no effect. - -# Examples - -- * [`"app-all": true`](https://tauri.app/v1/api/config/#appallowlistconfig.all) will make the [hide](https://tauri.app/v1/api/js/app#hide) endpoint be available regardless of whether `hide` is set to `false` or `true` in the allowlist. - -Type: `object` - -| Name | Type | Default | Description | -| ---- | ---- | ------- | ----------- | -|
`all`
| boolean | `false` | Use this flag to enable all API features. | -|
`fs`
| [`FsAllowlistConfig`](#fsallowlistconfig) | [view](#fsallowlistconfig) | File system API allowlist. | -|
`window`
| [`WindowAllowlistConfig`](#windowallowlistconfig) | [view](#windowallowlistconfig) | Window API allowlist. | -|
`shell`
| [`ShellAllowlistConfig`](#shellallowlistconfig) | [view](#shellallowlistconfig) | Shell API allowlist. | -|
`dialog`
| [`DialogAllowlistConfig`](#dialogallowlistconfig) | [view](#dialogallowlistconfig) | Dialog API allowlist. | -|
`http`
| [`HttpAllowlistConfig`](#httpallowlistconfig) | [view](#httpallowlistconfig) | HTTP API allowlist. | -|
`notification`
| [`NotificationAllowlistConfig`](#notificationallowlistconfig) | [view](#notificationallowlistconfig) | Notification API allowlist. | -|
`globalShortcut`
| [`GlobalShortcutAllowlistConfig`](#globalshortcutallowlistconfig) | [view](#globalshortcutallowlistconfig) | Global shortcut API allowlist. | -|
`os`
| [`OsAllowlistConfig`](#osallowlistconfig) | [view](#osallowlistconfig) | OS allowlist. | -|
`path`
| [`PathAllowlistConfig`](#pathallowlistconfig) | [view](#pathallowlistconfig) | Path API allowlist. | -|
`protocol`
| [`ProtocolAllowlistConfig`](#protocolallowlistconfig) | [view](#protocolallowlistconfig) | Custom protocol allowlist. | -|
`process`
| [`ProcessAllowlistConfig`](#processallowlistconfig) | [view](#processallowlistconfig) | Process API allowlist. | -|
`clipboard`
| [`ClipboardAllowlistConfig`](#clipboardallowlistconfig) | [view](#clipboardallowlistconfig) | Clipboard APIs allowlist. | -|
`app`
| [`AppAllowlistConfig`](#appallowlistconfig) | [view](#appallowlistconfig) | App APIs allowlist. | - - -##### FsAllowlistConfig - -Allowlist for the file system APIs. - -Type: `object` - -| Name | Type | Default | Description | -| ---- | ---- | ------- | ----------- | -|
`scope`
| [`FsAllowlistScope`](#fsallowlistscope) | [] | The access scope for the filesystem APIs. | -|
`all`
| boolean | `false` | Use this flag to enable all file system API features. | -|
`readFile`
| boolean | `false` | Read file from local filesystem. | -|
`writeFile`
| boolean | `false` | Write file to local filesystem. | -|
`readDir`
| boolean | `false` | Read directory from local filesystem. | -|
`copyFile`
| boolean | `false` | Copy file from local filesystem. | -|
`createDir`
| boolean | `false` | Create directory from local filesystem. | -|
`removeDir`
| boolean | `false` | Remove directory from local filesystem. | -|
`removeFile`
| boolean | `false` | Remove file from local filesystem. | -|
`renameFile`
| boolean | `false` | Rename file from local filesystem. | -|
`exists`
| boolean | `false` | Check if path exists on the local filesystem. | - - -###### FsAllowlistScope - -Filesystem scope definition. It is a list of glob patterns that restrict the API access from the webview. - -Each pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`. +##### IosConfig -Can be any of the following types: - -- `string[]`: A list of paths that are allowed by this scope. -- `{ "allow": string[], "deny": string[], "requireLiteralLeadingDot": boolean? }`: A complete scope configuration. - - - | Name | Type | Default | Description | - | ---- | ---- | ------- | ----------- | - |
`allow`
| string[] | [] | A list of paths that are allowed by this scope. | - |
`deny`
| string[] | [] | A list of paths that are not allowed by this scope. This gets precedence over the `Scope::allow` list. | - |
`requireLiteralLeadingDot`
| boolean? | _null_ | Whether or not paths that contain components that start with a `.` will require that `.` appears literally in the pattern; `*`, `?`, `**`, or `[...]` will not match. This is useful because such files are conventionally considered hidden on Unix systems and it might be desirable to skip them when listing files.

Defaults to `true` on Unix systems and `false` on Windows | - - - -##### WindowAllowlistConfig - -Allowlist for the window APIs. +General configuration for the iOS target. Type: `object` | Name | Type | Default | Description | | ---- | ---- | ------- | ----------- | -|
`all`
| boolean | `false` | Use this flag to enable all window API features. | -|
`create`
| boolean | `false` | Allows dynamic window creation. | -|
`center`
| boolean | `false` | Allows centering the window. | -|
`requestUserAttention`
| boolean | `false` | Allows requesting user attention on the window. | -|
`setResizable`
| boolean | `false` | Allows setting the resizable flag of the window. | -|
`setMaximizable`
| boolean | `false` | Allows setting whether the window's native maximize button is enabled or not. | -|
`setMinimizable`
| boolean | `false` | Allows setting whether the window's native minimize button is enabled or not. | -|
`setClosable`
| boolean | `false` | Allows setting whether the window's native close button is enabled or not. | -|
`setTitle`
| boolean | `false` | Allows changing the window title. | -|
`maximize`
| boolean | `false` | Allows maximizing the window. | -|
`unmaximize`
| boolean | `false` | Allows unmaximizing the window. | -|
`minimize`
| boolean | `false` | Allows minimizing the window. | -|
`unminimize`
| boolean | `false` | Allows unminimizing the window. | -|
`show`
| boolean | `false` | Allows showing the window. | -|
`hide`
| boolean | `false` | Allows hiding the window. | -|
`close`
| boolean | `false` | Allows closing the window. | -|
`setDecorations`
| boolean | `false` | Allows setting the decorations flag of the window. | -|
`setAlwaysOnTop`
| boolean | `false` | Allows setting the always_on_top flag of the window. | -|
`setContentProtected`
| boolean | `false` | Allows preventing the window contents from being captured by other apps. | -|
`setSize`
| boolean | `false` | Allows setting the window size. | -|
`setMinSize`
| boolean | `false` | Allows setting the window minimum size. | -|
`setMaxSize`
| boolean | `false` | Allows setting the window maximum size. | -|
`setPosition`
| boolean | `false` | Allows changing the position of the window. | -|
`setFullscreen`
| boolean | `false` | Allows setting the fullscreen flag of the window. | -|
`setFocus`
| boolean | `false` | Allows focusing the window. | -|
`setIcon`
| boolean | `false` | Allows changing the window icon. | -|
`setSkipTaskbar`
| boolean | `false` | Allows setting the skip_taskbar flag of the window. | -|
`setCursorGrab`
| boolean | `false` | Allows grabbing the cursor. | -|
`setCursorVisible`
| boolean | `false` | Allows setting the cursor visibility. | -|
`setCursorIcon`
| boolean | `false` | Allows changing the cursor icon. | -|
`setCursorPosition`
| boolean | `false` | Allows setting the cursor position. | -|
`setIgnoreCursorEvents`
| boolean | `false` | Allows ignoring cursor events. | -|
`startDragging`
| boolean | `false` | Allows start dragging on the window. | -|
`print`
| boolean | `false` | Allows opening the system dialog to print the window content. | - - -##### ShellAllowlistConfig - -Allowlist for the shell APIs. - -Type: `object` - -| Name | Type | Default | Description | -| ---- | ---- | ------- | ----------- | -|
`scope`
| [`ShellAllowlistScope`](#shellallowlistscope) | [] | Access scope for the binary execution APIs. Sidecars are automatically enabled. | -|
`all`
| boolean | `false` | Use this flag to enable all shell API features. | -|
`execute`
| boolean | `false` | Enable binary execution. | -|
`sidecar`
| boolean | `false` | Enable sidecar execution, allowing the JavaScript layer to spawn a sidecar command, an executable that is shipped with the application. For more information see . | -|
`open`
| [`ShellAllowlistOpen`](#shellallowlistopen) | `false` | Open URL with the user's default application. | - - -###### ShellAllowlistScope +|
`developmentTeam`
| string? | _null_ | The development team. This value is required for iOS development because code signing is enforced. The `APPLE_DEVELOPMENT_TEAM` environment variable can be set to overwrite it. | -Shell scope definition. It is a list of command names and associated CLI arguments that restrict the API access from the webview. -Type: [`ShellAllowedCommand`](#shellallowedcommand) +##### AndroidConfig -###### ShellAllowedCommand - -A command allowed to be executed by the webview API. +General configuration for the iOS target. Type: `object` | Name | Type | Default | Description | | ---- | ---- | ------- | ----------- | -|
`name`
| string (required) | | The name for this allowed shell command configuration.

This name will be used inside of the webview API to call this command along with any specified arguments. | -|
`cmd`
| string | _null_ | The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`. | -|
`args`
| [`ShellAllowedArgs`](#shellallowedargs) | `false` | The allowed arguments for the command execution. | -|
`sidecar`
| boolean | `false` | If this command is a sidecar command. | - - -###### ShellAllowedArgs - -A set of command arguments allowed to be executed by the webview API. - -A value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. A list of [`ShellAllowedArg`] will set those arguments as the only valid arguments to be passed to the attached command configuration. - -Can be any of the following types: - -- `boolean`: Use a simple boolean to allow all or disable all arguments to this command configuration. -- [`ShellAllowedArg`](#shellallowedarg): A specific set of [`ShellAllowedArg`] that are valid to call for the command configuration. - -###### ShellAllowedArg - -A command argument allowed to be executed by the webview API. - -Can be any of the following types: - -- `string`: A non-configurable argument that is passed to the command in the order it was specified. -- `{ "validator": string }`: A variable that is set while calling the command from the webview API. - - - | Name | Type | Default | Description | - | ---- | ---- | ------- | ----------- | - |
`validator`
| string (required) | | [regex](https://docs.rs/regex/latest/regex/#syntax) validator to require passed values to conform to an expected input.

This will require the argument value passed to this variable to match the `validator` regex before it will be executed. | - - - -###### ShellAllowlistOpen - -Defines the `shell > open` api scope. - -Can be any of the following types: - -- `boolean`: If the shell open API should be enabled. - - If enabled, the default validation regex (`^((mailto:\w+)|(tel:\w+)|(https?://\w+)).+`) is used. -- `string`: Enable the shell open API, with a custom regex that the opened path must match against. - - If using a custom regex to support a non-http(s) schema, care should be used to prevent values that allow flag-like strings to pass validation. e.g. `--enable-debugging`, `-i`, `/R`. +|
`minSdkVersion`
| integer _(format: `uint32`)_ | `24` | The minimum API level required for the application to run. The Android system will prevent the user from installing the application if the system's API level is lower than the value specified. | -##### DialogAllowlistConfig -Allowlist for the dialog APIs. +##### UpdaterConfig -Type: `object` - -| Name | Type | Default | Description | -| ---- | ---- | ------- | ----------- | -|
`all`
| boolean | `false` | Use this flag to enable all dialog API features. | -|
`open`
| boolean | `false` | Allows the API to open a dialog window to pick files. | -|
`save`
| boolean | `false` | Allows the API to open a dialog window to pick where to save files. | -|
`message`
| boolean | `false` | Allows the API to show a message dialog window. | -|
`ask`
| boolean | `false` | Allows the API to show a dialog window with Yes/No buttons. | -|
`confirm`
| boolean | `false` | Allows the API to show a dialog window with Ok/Cancel buttons. | - - -##### HttpAllowlistConfig - -Allowlist for the HTTP APIs. - -Type: `object` - -| Name | Type | Default | Description | -| ---- | ---- | ------- | ----------- | -|
`scope`
| [`HttpAllowlistScope`](#httpallowlistscope) | [] | The access scope for the HTTP APIs. | -|
`all`
| boolean | `false` | Use this flag to enable all HTTP API features. | -|
`request`
| boolean | `false` | Allows making HTTP requests. | - - -###### HttpAllowlistScope - -HTTP API scope definition. It is a list of URLs that can be accessed by the webview when using the HTTP APIs. The scoped URL is matched against the request URL using a glob pattern. - -Examples: -- "https://*": allows all HTTPS urls -- "https://*.github.com/tauri-apps/tauri": allows any subdomain of "github.com" with the "tauri-apps/api" path -- "https://myapi.service.com/users/*": allows access to any URLs that begins with "https://myapi.service.com/users/" - -Type: `string _(format: `uri`)_[]` - -##### NotificationAllowlistConfig - -Allowlist for the notification APIs. - -Type: `object` - -| Name | Type | Default | Description | -| ---- | ---- | ------- | ----------- | -|
`all`
| boolean | `false` | Use this flag to enable all notification API features. | - - -##### GlobalShortcutAllowlistConfig - -Allowlist for the global shortcut APIs. - -Type: `object` - -| Name | Type | Default | Description | -| ---- | ---- | ------- | ----------- | -|
`all`
| boolean | `false` | Use this flag to enable all global shortcut API features. | - - -##### OsAllowlistConfig - -Allowlist for the OS APIs. - -Type: `object` - -| Name | Type | Default | Description | -| ---- | ---- | ------- | ----------- | -|
`all`
| boolean | `false` | Use this flag to enable all OS API features. | - - -##### PathAllowlistConfig - -Allowlist for the path APIs. - -Type: `object` - -| Name | Type | Default | Description | -| ---- | ---- | ------- | ----------- | -|
`all`
| boolean | `false` | Use this flag to enable all path API features. | - - -##### ProtocolAllowlistConfig +The Updater configuration object. -Allowlist for the custom protocols. +See more: Type: `object` | Name | Type | Default | Description | | ---- | ---- | ------- | ----------- | -|
`assetScope`
| [`FsAllowlistScope`](#fsallowlistscope) | [] | The access scope for the asset protocol. | -|
`all`
| boolean | `false` | Use this flag to enable all custom protocols. | -|
`asset`
| boolean | `false` | Enables the asset protocol. | - - -##### ProcessAllowlistConfig +|
`active`
| boolean | `false` | Whether the updater is active or not. | +|
`pubkey`
| string | _null_ | Signature public key. | +|
`windows`
| [`UpdaterWindowsConfig`](#updaterwindowsconfig) | [view](#updaterwindowsconfig) | The Windows configuration for the updater. | -Allowlist for the process APIs. -Type: `object` - -| Name | Type | Default | Description | -| ---- | ---- | ------- | ----------- | -|
`all`
| boolean | `false` | Use this flag to enable all process APIs. | -|
`relaunch`
| boolean | `false` | Enables the relaunch API. | -|
`relaunchDangerousAllowSymlinkMacos`
| boolean | `false` | Dangerous option that allows macOS to relaunch even if the binary contains a symlink.

This is due to macOS having less symlink protection. Highly recommended to not set this flag unless you have a very specific reason too, and understand the implications of it. | -|
`exit`
| boolean | `false` | Enables the exit API. | +###### UpdaterWindowsConfig +The updater configuration for Windows. -##### ClipboardAllowlistConfig - -Allowlist for the clipboard APIs. +See more: Type: `object` | Name | Type | Default | Description | | ---- | ---- | ------- | ----------- | -|
`all`
| boolean | `false` | Use this flag to enable all clipboard APIs. | -|
`writeText`
| boolean | `false` | Enables the clipboard's `writeText` API. | -|
`readText`
| boolean | `false` | Enables the clipboard's `readText` API. | - +|
`installMode`
| [`WindowsUpdateInstallMode`](#windowsupdateinstallmode) | [view](#windowsupdateinstallmode) | The installation mode for the update on Windows. Defaults to `passive`. | -##### AppAllowlistConfig -Allowlist for the app APIs. +###### WindowsUpdateInstallMode -Type: `object` +Install modes for the Windows update. -| Name | Type | Default | Description | -| ---- | ---- | ------- | ----------- | -|
`all`
| boolean | `false` | Use this flag to enable all app APIs. | -|
`show`
| boolean | `false` | Enables the app's `show` API. | -|
`hide`
| boolean | `false` | Enables the app's `hide` API. | +Can be any **ONE** of the following types: +- "basicUi": Specifies there's a basic UI during the installation process, including a final dialog box at the end. +- "quiet": The quiet mode means there's no user interaction required. Requires admin privileges if the installer does. +- "passive": Specifies unattended mode, which means the installation only shows a progress bar. #### SecurityConfig Security configuration. +See more: + Type: `object` | Name | Type | Default | Description | @@ -865,7 +654,7 @@ Type: `object` |
`freezePrototype`
| boolean | `false` | Freeze the `Object.prototype` when using the custom protocol. | |
`dangerousDisableAssetCspModification`
| [`DisabledCspModificationKind`](#disabledcspmodificationkind) | `false` | Disables the Tauri-injected CSP sources.

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.

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.

**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. | |
`dangerousRemoteDomainIpcAccess`
| [`RemoteDomainAccessScope`](#remotedomainaccessscope) | [] | Allow external domains to send command to Tauri.

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.

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.

**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. | -|
`dangerousUseHttpScheme`
| boolean | `false` | Sets whether the custom protocols should use `http://.localhost` instead of the default `https://.localhost` on Windows.

**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 `://localhost` protocols used on macOS and Linux. | +|
`assetProtocol`
| [`AssetProtocolConfig`](#assetprotocolconfig) | [view](#assetprotocolconfig) | Custom protocol config. | ##### Csp @@ -906,73 +695,67 @@ Type: `object` |
`scheme`
| string? | _null_ | The URL scheme to allow. By default, all schemas are allowed. | |
`domain`
| string (required) | | The domain to allow. | |
`windows`
| string[] (required) | | The list of window labels this scope applies to. | -|
`plugins`
| 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`. | -|
`enableTauriAPI`
| boolean | `false` | Enables access to the Tauri API. | +|
`plugins`
| string[] | [] | The list of plugins that are allowed in this scope. | -#### UpdaterConfig +##### AssetProtocolConfig -The Updater configuration object. +Config for the asset custom protocol. + +See more: Type: `object` | Name | Type | Default | Description | | ---- | ---- | ------- | ----------- | -|
`active`
| boolean | `false` | Whether the updater is active or not. | -|
`dialog`
| boolean | `true` | Display built-in dialog or use event system if disabled. | -|
`endpoints`
| [`UpdaterEndpoint`](#updaterendpoint)? | _null_ | The updater endpoints. TLS is enforced on production.

The updater URL can contain the following variables:
- {{current_version}}: The version of the app that is requesting the update
- {{target}}: The operating system name (one of `linux`, `windows` or `darwin`).
- {{arch}}: The architecture of the machine (one of `x86_64`, `i686`, `aarch64` or `armv7`).

# Examples
- "https://my.cdn.com/latest.json": a raw JSON endpoint that returns the latest version and download links for each platform.
- "https://updates.app.dev/{{target}}?version={{current_version}}&arch={{arch}}": a dedicated API with positional and query string arguments. | -|
`pubkey`
| string | _null_ | Signature public key. | -|
`windows`
| [`UpdaterWindowsConfig`](#updaterwindowsconfig) | [view](#updaterwindowsconfig) | The Windows configuration for the updater. | +|
`scope`
| [`FsScope`](#fsscope) | [] | The access scope for the asset protocol. | +|
`enable`
| boolean | `false` | Enables the asset protocol. | -##### UpdaterEndpoint +###### FsScope -A URL to an updater server. +Protocol scope definition. It is a list of glob patterns that restrict the API access from the webview. -The URL must use the `https` scheme on production. - -Type: `string` _(format: `uri`)_ - -##### UpdaterWindowsConfig - -The updater configuration for Windows. - -Type: `object` - -| Name | Type | Default | Description | -| ---- | ---- | ------- | ----------- | -|
`installerArgs`
| string[] | [] | Additional arguments given to the NSIS or WiX installer. | -|
`installMode`
| [`WindowsUpdateInstallMode`](#windowsupdateinstallmode) | [view](#windowsupdateinstallmode) | The installation mode for the update on Windows. Defaults to `passive`. | +Each pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`. +Can be any of the following types: -###### WindowsUpdateInstallMode +- `string[]`: A list of paths that are allowed by this scope. +- `{ "allow": string[], "deny": string[], "requireLiteralLeadingDot": boolean? }`: A complete scope configuration. -Install modes for the Windows update. + + | Name | Type | Default | Description | + | ---- | ---- | ------- | ----------- | + |
`allow`
| string[] | [] | A list of paths that are allowed by this scope. | + |
`deny`
| string[] | [] | A list of paths that are not allowed by this scope. This gets precedence over the `Scope::allow` list. | + |
`requireLiteralLeadingDot`
| boolean? | _null_ | Whether or not paths that contain components that start with a `.` will require that `.` appears literally in the pattern; `*`, `?`, `**`, or `[...]` will not match. This is useful because such files are conventionally considered hidden on Unix systems and it might be desirable to skip them when listing files.

Defaults to `true` on Unix systems and `false` on Windows | + -Can be any **ONE** of the following types: -- "basicUi": Specifies there's a basic UI during the installation process, including a final dialog box at the end. -- "quiet": The quiet mode means there's no user interaction required. Requires admin privileges if the installer does. -- "passive": Specifies unattended mode, which means the installation only shows a progress bar. +#### TrayIconConfig -#### SystemTrayConfig +Configuration for application tray icon. -Configuration for application system tray icon. +See more: Type: `object` | Name | Type | Default | Description | | ---- | ---- | ------- | ----------- | -|
`iconPath`
| string (required) | | Path to the default icon to use on the system tray. | -|
`iconAsTemplate`
| boolean | `false` | A Boolean value that determines whether the image represents a [template](https://developer.apple.com/documentation/appkit/nsimage/1520017-template?language=objc) image on macOS. | -|
`menuOnLeftClick`
| boolean | `true` | A Boolean value that determines whether the menu should appear when the tray icon receives a left click on macOS. | -|
`title`
| string? | _null_ | Title for MacOS tray | +|
`id`
| string? | _null_ | Set an id for this tray icon so you can reference it later, defaults to `main`. | +|
`iconPath`
| string (required) | | Path to the default icon to use for the tray icon. | +|
`iconAsTemplate`
| boolean | `false` | A Boolean value that determines whether the image represents a [template](https://developer.apple.com/documentation/appkit/nsimage/1520017-template?language=objc) image on macOS. | +|
`menuOnLeftClick`
| boolean | `true` | A Boolean value that determines whether the menu should appear when the tray icon receives a left click on macOS. | +|
`title`
| string? | _null_ | Title for MacOS tray | +|
`tooltip`
| string? | _null_ | Tray icon tooltip on Windows and macOS | ### BuildConfig The Build configuration object. +See more: + Type: `object` | Name | Type | Default | Description | @@ -1035,4 +818,6 @@ Can be any of the following types: The plugin configs holds a HashMap mapping a plugin name to its configuration object. +See more: + Type: `object` diff --git a/docs/api/js/README.md b/docs/api/js/README.md index 39632f7de4a..6bd0cc82f10 100644 --- a/docs/api/js/README.md +++ b/docs/api/js/README.md @@ -2,20 +2,7 @@ ### Modules -- [app](app.md) -- [cli](cli.md) -- [clipboard](clipboard.md) -- [dialog](dialog.md) - [event](event.md) -- [fs](fs.md) -- [globalShortcut](globalShortcut.md) -- [http](http.md) - [mocks](mocks.md) -- [notification](notification.md) -- [os](os.md) - [path](path.md) -- [process](process.md) -- [shell](shell.md) -- [tauri](tauri.md) -- [updater](updater.md) - [window](window.md) diff --git a/docs/api/js/app.md b/docs/api/js/app.md deleted file mode 100644 index bf3baa1d748..00000000000 --- a/docs/api/js/app.md +++ /dev/null @@ -1,108 +0,0 @@ -# app - -Get application metadata. - -This package is also accessible with `window.__TAURI__.app` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`. - -The APIs must be added to [`tauri.allowlist.app`](https://tauri.app/v1/api/config/#allowlistconfig.app) in `tauri.conf.json`: -```json -{ - "tauri": { - "allowlist": { - "app": { - "all": true, // enable all app APIs - "show": true, - "hide": true - } - } - } -} -``` -It is recommended to allowlist only the APIs you use for optimal bundle size and security. - -## Functions - -### `getName` - -> **getName**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> - -Gets the application name. - -**Example** - -```typescript -import { getName } from '@tauri-apps/api/app'; -const appName = await getName(); -``` - -**Since**: 1.0.0 - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> - -### `getTauriVersion` - -> **getTauriVersion**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> - -Gets the Tauri version. - -**Example** - -```typescript -import { getTauriVersion } from '@tauri-apps/api/app'; -const tauriVersion = await getTauriVersion(); -``` - -**Since**: 1.0.0 - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> - -### `getVersion` - -> **getVersion**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> - -Gets the application version. - -**Example** - -```typescript -import { getVersion } from '@tauri-apps/api/app'; -const appVersion = await getVersion(); -``` - -**Since**: 1.0.0 - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> - -### `hide` - -> **hide**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -Hides the application on macOS. - -**Example** - -```typescript -import { hide } from '@tauri-apps/api/app'; -await hide(); -``` - -**Since**: 1.2.0 - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -### `show` - -> **show**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -Shows the application on macOS. This function does not automatically focus any specific app window. - -**Example** - -```typescript -import { show } from '@tauri-apps/api/app'; -await show(); -``` - -**Since**: 1.2.0 - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> diff --git a/docs/api/js/cli.md b/docs/api/js/cli.md deleted file mode 100644 index 2d4088c7228..00000000000 --- a/docs/api/js/cli.md +++ /dev/null @@ -1,96 +0,0 @@ -# cli - -Parse arguments from your Command Line Interface. - -This package is also accessible with `window.__TAURI__.cli` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`. - -## Interfaces - -### `ArgMatch` - -**Since**: 1.0.0 - -#### Properties - -##### `occurrences` - -> **occurrences**: `number` - -Number of occurrences - -**Defined in:** [cli.ts:27](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/cli.ts#L27) - -##### `value` - -> **value**: `null` \| `string` \| `boolean` \| `string`[] - -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/a3277a2/tooling/api/src/cli.ts#L23) - -### `CliMatches` - -**Since**: 1.0.0 - -#### Properties - -##### `args` - -> **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/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/a3277a2/tooling/api/src/cli.ts#L43) - -### `SubcommandMatch` - -**Since**: 1.0.0 - -#### Properties - -##### `matches` - -> **matches**: [`CliMatches`](cli.md#climatches) - -**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/a3277a2/tooling/api/src/cli.ts#L34) - -## Functions - -### `getMatches` - -> **getMatches**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`CliMatches`](cli.md#climatches)\> - -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` - -**Example** - -```typescript -import { getMatches } from '@tauri-apps/api/cli'; -const matches = await getMatches(); -if (matches.subcommand?.name === 'run') { - // `./your-app run $ARGS` was executed - const args = matches.subcommand?.matches.args - if ('debug' in args) { - // `./your-app run --debug` was executed - } -} else { - const args = matches.args - // `./your-app $ARGS` was executed -} -``` - -**Since**: 1.0.0 - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`CliMatches`](cli.md#climatches)\> diff --git a/docs/api/js/clipboard.md b/docs/api/js/clipboard.md deleted file mode 100644 index c47d92a2e61..00000000000 --- a/docs/api/js/clipboard.md +++ /dev/null @@ -1,66 +0,0 @@ -# clipboard - -Read and write to the system clipboard. - -This package is also accessible with `window.__TAURI__.clipboard` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`. - -The APIs must be added to [`tauri.allowlist.clipboard`](https://tauri.app/v1/api/config/#allowlistconfig.clipboard) in `tauri.conf.json`: -```json -{ - "tauri": { - "allowlist": { - "clipboard": { - "all": true, // enable all Clipboard APIs - "writeText": true, - "readText": true - } - } - } -} -``` -It is recommended to allowlist only the APIs you use for optimal bundle size and security. - -## Functions - -### `readText` - -> **readText**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string` \| `null`\> - -Gets the clipboard content as plain text. - -**Example** - -```typescript -import { readText } from '@tauri-apps/api/clipboard'; -const clipboardText = await readText(); -``` - -**Since**: 1.0.0. - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string` \| `null`\> - -### `writeText` - -> **writeText**(`text`: `string`): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -Writes plain text to the clipboard. - -**Example** - -```typescript -import { writeText, readText } from '@tauri-apps/api/clipboard'; -await writeText('Tauri is awesome!'); -assert(await readText(), 'Tauri is awesome!'); -``` - -**Since**: 1.0.0. - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `text` | `string` | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -A promise indicating the success or failure of the operation. diff --git a/docs/api/js/dialog.md b/docs/api/js/dialog.md deleted file mode 100644 index 6c2f0a026f9..00000000000 --- a/docs/api/js/dialog.md +++ /dev/null @@ -1,399 +0,0 @@ -# dialog - -Native system dialogs for opening and saving files. - -This package is also accessible with `window.__TAURI__.dialog` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`. - -The APIs must be added to [`tauri.allowlist.dialog`](https://tauri.app/v1/api/config/#allowlistconfig.dialog) in `tauri.conf.json`: -```json -{ - "tauri": { - "allowlist": { - "dialog": { - "all": true, // enable all dialog APIs - "ask": true, // enable dialog ask API - "confirm": true, // enable dialog confirm API - "message": true, // enable dialog message API - "open": true, // enable file open API - "save": true // enable file save API - } - } - } -} -``` -It is recommended to allowlist only the APIs you use for optimal bundle size and security. - -## Interfaces - -### `ConfirmDialogOptions` - -#### Properties - -##### `cancelLabel` - -> `Optional` **cancelLabel**: `string` - -The label of the cancel button. - -**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/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/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/a3277a2/tooling/api/src/dialog.ts#L108) - -### `DialogFilter` - -Extension filters for the file dialog. - -**Since**: 1.0.0 - -#### Properties - -##### `extensions` - -> **extensions**: `string`[] - -Extensions to filter, without a `.` prefix. - -**Example** - -```typescript -extensions: ['svg', 'png'] -``` - -**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/a3277a2/tooling/api/src/dialog.ts#L40) - -### `MessageDialogOptions` - -**Since**: 1.0.0 - -#### Properties - -##### `okLabel` - -> `Optional` **okLabel**: `string` - -The label of the confirm button. - -**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/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/a3277a2/tooling/api/src/dialog.ts#L99) - -### `OpenDialogOptions` - -Options for the open dialog. - -**Since**: 1.0.0 - -#### Properties - -##### `defaultPath` - -> `Optional` **defaultPath**: `string` - -Initial directory or file path. - -**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/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/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/a3277a2/tooling/api/src/dialog.ts#L64) - -##### `recursive` - -> `Optional` **recursive**: `boolean` - -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/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/a3277a2/tooling/api/src/dialog.ts#L58) - -### `SaveDialogOptions` - -Options for the save dialog. - -**Since**: 1.0.0 - -#### Properties - -##### `defaultPath` - -> `Optional` **defaultPath**: `string` - -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/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/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/a3277a2/tooling/api/src/dialog.ts#L81) - -## Functions - -### `ask` - -> **ask**(`message`: `string`, `options?`: `string` \| [`ConfirmDialogOptions`](dialog.md#confirmdialogoptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`boolean`\> - -Shows a question dialog with `Yes` and `No` buttons. - -**Example** - -```typescript -import { ask } from '@tauri-apps/api/dialog'; -const yes = await ask('Are you sure?', 'Tauri'); -const yes2 = await ask('This action cannot be reverted. Are you sure?', { title: 'Tauri', type: 'warning' }); -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | Description | -| :------ | :------ | :------ | -| `message` | `string` | The message to show. | -| `options?` | `string` \| [`ConfirmDialogOptions`](dialog.md#confirmdialogoptions) | The dialog's options. If a string, it represents the dialog title. | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`boolean`\> - -A promise resolving to a boolean indicating whether `Yes` was clicked or not. - -### `confirm` - -> **confirm**(`message`: `string`, `options?`: `string` \| [`ConfirmDialogOptions`](dialog.md#confirmdialogoptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`boolean`\> - -Shows a question dialog with `Ok` and `Cancel` buttons. - -**Example** - -```typescript -import { confirm } from '@tauri-apps/api/dialog'; -const confirmed = await confirm('Are you sure?', 'Tauri'); -const confirmed2 = await confirm('This action cannot be reverted. Are you sure?', { title: 'Tauri', type: 'warning' }); -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | Description | -| :------ | :------ | :------ | -| `message` | `string` | The message to show. | -| `options?` | `string` \| [`ConfirmDialogOptions`](dialog.md#confirmdialogoptions) | The dialog's options. If a string, it represents the dialog title. | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`boolean`\> - -A promise resolving to a boolean indicating whether `Ok` was clicked or not. - -### `message` - -> **message**(`message`: `string`, `options?`: `string` \| [`MessageDialogOptions`](dialog.md#messagedialogoptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -Shows a message dialog with an `Ok` button. - -**Example** - -```typescript -import { message } from '@tauri-apps/api/dialog'; -await message('Tauri is awesome', 'Tauri'); -await message('File not found', { title: 'Tauri', type: 'error' }); -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | Description | -| :------ | :------ | :------ | -| `message` | `string` | The message to show. | -| `options?` | `string` \| [`MessageDialogOptions`](dialog.md#messagedialogoptions) | The dialog's options. If a string, it represents the dialog title. | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -A promise indicating the success or failure of the operation. - -### `open` - -> **open**(`options?`: [`OpenDialogOptions`](dialog.md#opendialogoptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`null` \| `string` \| `string`[]\> - -Open a file/directory selection dialog. - -The selected paths are added to the filesystem and asset protocol allowlist scopes. -When security is more important than the easy of use of this API, -prefer writing a dedicated command instead. - -Note that the allowlist scope change is not persisted, so the values are cleared when the application is restarted. -You can save it to the filesystem using [tauri-plugin-persisted-scope](https://github.com/tauri-apps/tauri-plugin-persisted-scope). - -**Example** - -```typescript -import { open } from '@tauri-apps/api/dialog'; -// Open a selection dialog for image files -const selected = await open({ - multiple: true, - filters: [{ - name: 'Image', - extensions: ['png', 'jpeg'] - }] -}); -if (Array.isArray(selected)) { - // user selected multiple files -} else if (selected === null) { - // user cancelled the selection -} else { - // user selected a single file -} -``` - -**Example** - -```typescript -import { open } from '@tauri-apps/api/dialog'; -import { appDir } from '@tauri-apps/api/path'; -// Open a selection dialog for directories -const selected = await open({ - directory: true, - multiple: true, - defaultPath: await appDir(), -}); -if (Array.isArray(selected)) { - // user selected multiple directories -} else if (selected === null) { - // user cancelled the selection -} else { - // user selected a single directory -} -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `options` | [`OpenDialogOptions`](dialog.md#opendialogoptions) | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`null` \| `string` \| `string`[]\> - -A promise resolving to the selected path(s) - -### `save` - -> **save**(`options?`: [`SaveDialogOptions`](dialog.md#savedialogoptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string` \| `null`\> - -Open a file/directory save dialog. - -The selected path is added to the filesystem and asset protocol allowlist scopes. -When security is more important than the easy of use of this API, -prefer writing a dedicated command instead. - -Note that the allowlist scope change is not persisted, so the values are cleared when the application is restarted. -You can save it to the filesystem using [tauri-plugin-persisted-scope](https://github.com/tauri-apps/tauri-plugin-persisted-scope). - -**Example** - -```typescript -import { save } from '@tauri-apps/api/dialog'; -const filePath = await save({ - filters: [{ - name: 'Image', - extensions: ['png', 'jpeg'] - }] -}); -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `options` | [`SaveDialogOptions`](dialog.md#savedialogoptions) | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string` \| `null`\> - -A promise resolving to the selected path. diff --git a/docs/api/js/event.md b/docs/api/js/event.md index 62e9b4b290c..d921da1f9ad 100644 --- a/docs/api/js/event.md +++ b/docs/api/js/event.md @@ -14,24 +14,19 @@ This package is also accessible with `window.__TAURI__.event` when [`build.withG | Name | Type | Defined in | | :------ | :------ | :------ | -| | `"tauri://update"` | [event.ts:34](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L34) | -| | `"tauri://update-download-progress"` | [event.ts:38](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L38) | -| | `"tauri://update-install"` | [event.ts:36](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L36) | -| | `"tauri://menu"` | [event.ts:33](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L33) | -| | `"tauri://update-status"` | [event.ts:37](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L37) | -| | `"tauri://update-available"` | [event.ts:35](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L35) | -| | `"tauri://blur"` | [event.ts:27](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L27) | -| | `"tauri://close-requested"` | [event.ts:23](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L23) | -| | `"tauri://window-created"` | [event.ts:24](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L24) | -| | `"tauri://destroyed"` | [event.ts:25](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L25) | -| | `"tauri://file-drop"` | [event.ts:30](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L30) | -| | `"tauri://file-drop-cancelled"` | [event.ts:32](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L32) | -| | `"tauri://file-drop-hover"` | [event.ts:31](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L31) | -| | `"tauri://focus"` | [event.ts:26](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L26) | -| | `"tauri://move"` | [event.ts:22](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L22) | -| | `"tauri://resize"` | [event.ts:21](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L21) | -| | `"tauri://scale-change"` | [event.ts:28](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L28) | -| | `"tauri://theme-changed"` | [event.ts:29](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L29) | +| | `"tauri://menu"` | [event.ts:59](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L59) | +| | `"tauri://blur"` | [event.ts:53](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L53) | +| | `"tauri://close-requested"` | [event.ts:49](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L49) | +| | `"tauri://window-created"` | [event.ts:50](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L50) | +| | `"tauri://destroyed"` | [event.ts:51](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L51) | +| | `"tauri://file-drop"` | [event.ts:56](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L56) | +| | `"tauri://file-drop-cancelled"` | [event.ts:58](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L58) | +| | `"tauri://file-drop-hover"` | [event.ts:57](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L57) | +| | `"tauri://focus"` | [event.ts:52](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L52) | +| | `"tauri://move"` | [event.ts:48](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L48) | +| | `"tauri://resize"` | [event.ts:47](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L47) | +| | `"tauri://scale-change"` | [event.ts:54](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L54) | +| | `"tauri://theme-changed"` | [event.ts:55](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L55) | ## Interfaces @@ -49,7 +44,7 @@ This package is also accessible with `window.__TAURI__.event` when [`build.withG Event name -**Defined in:** [helpers/event.ts:12](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/helpers/event.ts#L12) +**Defined in:** [event.ts:16](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L16) ##### `id` @@ -57,7 +52,7 @@ Event name Event identifier used to unlisten -**Defined in:** [helpers/event.ts:16](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/helpers/event.ts#L16) +**Defined in:** [event.ts:20](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L20) ##### `payload` @@ -65,7 +60,7 @@ Event identifier used to unlisten Event payload -**Defined in:** [helpers/event.ts:18](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/helpers/event.ts#L18) +**Defined in:** [event.ts:22](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L22) ##### `windowLabel` @@ -73,7 +68,24 @@ Event payload The label of the window that emitted this event. -**Defined in:** [helpers/event.ts:14](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/helpers/event.ts#L14) +**Defined in:** [event.ts:18](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L18) + +### `Options` + +#### Properties + +##### `target` + +> `Optional` **target**: `string` + +Label of the window the function targets. + +When listening to events and using this value, +only events triggered by the window with the given label are received. + +When emitting events, only the window with the given label will receive it. + +**Defined in:** [event.ts:40](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L40) ## Type Aliases @@ -97,13 +109,13 @@ The label of the window that emitted this event. **Returns: **`void` -**Defined in:** [helpers/event.ts:21](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/helpers/event.ts#L21) +**Defined in:** [event.ts:25](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L25) ### `EventName` > **EventName**: ``${TauriEvent}`` \| `string` & [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )<`never`, `never`\> -**Defined in:** [event.ts:15](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L15) +**Defined in:** [event.ts:29](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L29) ### `UnlistenFn` @@ -115,13 +127,13 @@ The label of the window that emitted this event. **Returns: **`void` -**Defined in:** [helpers/event.ts:23](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/helpers/event.ts#L23) +**Defined in:** [event.ts:27](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L27) ## Functions ### `emit` -> **emit**(`event`: `string`, `payload?`: `unknown`): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> +> **emit**(`event`: `string`, `payload?`: `unknown`, `options?`: [`Options`](event.md#options)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> Emits an event to the backend and all Tauri windows. @@ -140,12 +152,13 @@ await emit('frontend-loaded', { loggedIn: true, token: 'authToken' }); | :------ | :------ | :------ | | `event` | `string` | Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. | | `payload?` | `unknown` | - | +| `options?` | [`Options`](event.md#options) | - | **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> ### `listen` -> **listen**<`T`\>(`event`: [`EventName`](event.md#eventname), `handler`: [`EventCallback`](event.md#eventcallback)<`T`\>): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`UnlistenFn`](event.md#unlistenfn)\> +> **listen**<`T`\>(`event`: [`EventName`](event.md#eventname), `handler`: [`EventCallback`](event.md#eventcallback)<`T`\>, `options?`: [`Options`](event.md#options)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`UnlistenFn`](event.md#unlistenfn)\> Listen to an event. The event can be either global or window-specific. See [windowLabel](event.md#windowlabel) to check the event source. @@ -174,6 +187,7 @@ unlisten(); | :------ | :------ | :------ | | `event` | [`EventName`](event.md#eventname) | Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. | | `handler` | [`EventCallback`](event.md#eventcallback)<`T`\> | Event handler callback. | +| `options?` | [`Options`](event.md#options) | - | **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`UnlistenFn`](event.md#unlistenfn)\> @@ -182,7 +196,7 @@ Note that removing the listener is required if your listener goes out of scope e ### `once` -> **once**<`T`\>(`event`: [`EventName`](event.md#eventname), `handler`: [`EventCallback`](event.md#eventcallback)<`T`\>): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`UnlistenFn`](event.md#unlistenfn)\> +> **once**<`T`\>(`event`: [`EventName`](event.md#eventname), `handler`: [`EventCallback`](event.md#eventcallback)<`T`\>, `options?`: [`Options`](event.md#options)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`UnlistenFn`](event.md#unlistenfn)\> Listen to an one-off event. See [listen](event.md#listen) for more information. @@ -214,6 +228,7 @@ unlisten(); | :------ | :------ | :------ | | `event` | [`EventName`](event.md#eventname) | Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. | | `handler` | [`EventCallback`](event.md#eventcallback)<`T`\> | - | +| `options?` | [`Options`](event.md#options) | - | **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`UnlistenFn`](event.md#unlistenfn)\> diff --git a/docs/api/js/fs.md b/docs/api/js/fs.md deleted file mode 100644 index dd6806cbe86..00000000000 --- a/docs/api/js/fs.md +++ /dev/null @@ -1,595 +0,0 @@ -# fs - -Access the file system. - -This package is also accessible with `window.__TAURI__.fs` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`. - -The APIs must be added to [`tauri.allowlist.fs`](https://tauri.app/v1/api/config/#allowlistconfig.fs) in `tauri.conf.json`: -```json -{ - "tauri": { - "allowlist": { - "fs": { - "all": true, // enable all FS APIs - "readFile": true, - "writeFile": true, - "readDir": true, - "copyFile": true, - "createDir": true, - "removeDir": true, - "removeFile": true, - "renameFile": true, - "exists": true - } - } - } -} -``` -It is recommended to allowlist only the APIs you use for optimal bundle size and security. - -## Security - -This module prevents path traversal, not allowing absolute paths or parent dir components -(i.e. "/usr/path/to/file" or "../path/to/file" paths are not allowed). -Paths accessed with this API must be relative to one of the [base directories](fs.md#basedirectory) -so if you need access to arbitrary filesystem paths, you must write such logic on the core layer instead. - -The API has a scope configuration that forces you to restrict the paths that can be accessed using glob patterns. - -The scope configuration is an array of glob patterns describing folder paths that are allowed. -For instance, this scope configuration only allows accessing files on the -*databases* folder of the [$APPDATA directory](path.md#appdatadir): -```json -{ - "tauri": { - "allowlist": { - "fs": { - "scope": ["$APPDATA/databases/*"] - } - } - } -} -``` - -Notice the use of the `$APPDATA` variable. The value is injected at runtime, resolving to the [app data directory](path.md#appdatadir). -The available variables are: -[`$APPCONFIG`](path.md#appconfigdir), [`$APPDATA`](path.md#appdatadir), [`$APPLOCALDATA`](path.md#applocaldatadir), -[`$APPCACHE`](path.md#appcachedir), [`$APPLOG`](path.md#applogdir), -[`$AUDIO`](path.md#audiodir), [`$CACHE`](path.md#cachedir), [`$CONFIG`](path.md#configdir), [`$DATA`](path.md#datadir), -[`$LOCALDATA`](path.md#localdatadir), [`$DESKTOP`](path.md#desktopdir), [`$DOCUMENT`](path.md#documentdir), -[`$DOWNLOAD`](path.md#downloaddir), [`$EXE`](path.md#executabledir), [`$FONT`](path.md#fontdir), [`$HOME`](path.md#homedir), -[`$PICTURE`](path.md#picturedir), [`$PUBLIC`](path.md#publicdir), [`$RUNTIME`](path.md#runtimedir), -[`$TEMPLATE`](path.md#templatedir), [`$VIDEO`](path.md#videodir), [`$RESOURCE`](path.md#resourcedir), [`$APP`](path.md#appdir), -[`$LOG`](path.md#logdir), [`$TEMP`](os.md#tempdir). - -Trying to execute any API with a URL not configured on the scope results in a promise rejection due to denied access. - -Note that this scope applies to **all** APIs on this module. - -## References - -### `Dir` - -Renames and re-exports [BaseDirectory](fs.md#basedirectory) - -### `writeFile` - -Renames and re-exports [writeTextFile](fs.md#writetextfile) - -## Enumerations - -### `BaseDirectory` - -**Since**: 1.0.0 - -#### Enumeration Members - -| Name | Type | Defined in | -| :------ | :------ | :------ | -| | `18` | [fs.ts:98](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L98) | -| | `24` | [fs.ts:104](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L104) | -| | `21` | [fs.ts:101](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L101) | -| | `22` | [fs.ts:102](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L102) | -| | `23` | [fs.ts:103](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L103) | -| | `25` | [fs.ts:105](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L105) | -| | `1` | [fs.ts:81](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L81) | -| | `2` | [fs.ts:82](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L82) | -| | `3` | [fs.ts:83](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L83) | -| | `4` | [fs.ts:84](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L84) | -| | `6` | [fs.ts:86](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L86) | -| | `7` | [fs.ts:87](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L87) | -| | `8` | [fs.ts:88](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L88) | -| | `9` | [fs.ts:89](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L89) | -| | `10` | [fs.ts:90](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L90) | -| | `11` | [fs.ts:91](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L91) | -| | `5` | [fs.ts:85](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L85) | -| | `19` | [fs.ts:99](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L99) | -| | `12` | [fs.ts:92](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L92) | -| | `13` | [fs.ts:93](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L93) | -| | `17` | [fs.ts:97](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L97) | -| | `14` | [fs.ts:94](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L94) | -| | `20` | [fs.ts:100](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L100) | -| | `15` | [fs.ts:95](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L95) | -| | `16` | [fs.ts:96](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L96) | - -## Interfaces - -### `FileEntry` - -**Since**: 1.0.0 - -#### Properties - -##### `children` - -> `Optional` **children**: [`FileEntry`](fs.md#fileentry)[] - -Children of this entry if it's a directory; null otherwise - -**Defined in:** [fs.ts:167](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L167) - -##### `name` - -> `Optional` **name**: `string` - -Name of the directory/file -can be null if the path terminates with `..` - -**Defined in:** [fs.ts:165](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L165) - -##### `path` - -> **path**: `string` - -**Defined in:** [fs.ts:160](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L160) - -### `FsBinaryFileOption` - -Options object used to write a binary data to a file. - -**Since**: 1.0.0 - -#### Properties - -##### `contents` - -> **contents**: [`BinaryFileContents`](fs.md#binaryfilecontents) - -The byte array contents. - -**Defined in:** [fs.ts:153](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L153) - -##### `path` - -> **path**: `string` - -Path to the file to write. - -**Defined in:** [fs.ts:151](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L151) - -### `FsDirOptions` - -**Since**: 1.0.0 - -#### Properties - -##### `dir` - -> `Optional` **dir**: [`BaseDirectory`](fs.md#basedirectory) - -**Defined in:** [fs.ts:126](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L126) - -##### `recursive` - -> `Optional` **recursive**: `boolean` - -**Defined in:** [fs.ts:127](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L127) - -### `FsOptions` - -**Since**: 1.0.0 - -#### Properties - -##### `append` - -> `Optional` **append**: `boolean` - -Whether the content should overwrite the content of the file or append to it. - -**Since**: 1.5.0 - -**Defined in:** [fs.ts:118](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L118) - -##### `dir` - -> `Optional` **dir**: [`BaseDirectory`](fs.md#basedirectory) - -**Defined in:** [fs.ts:112](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L112) - -### `FsTextFileOption` - -Options object used to write a UTF-8 string to a file. - -**Since**: 1.0.0 - -#### Properties - -##### `contents` - -> **contents**: `string` - -The UTF-8 string to write to the file. - -**Defined in:** [fs.ts:139](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L139) - -##### `path` - -> **path**: `string` - -Path to the file to write. - -**Defined in:** [fs.ts:137](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L137) - -## Type Aliases - -### `BinaryFileContents` - -> **BinaryFileContents**: `Iterable`<`number`\> \| `ArrayLike`<`number`\> \| [`ArrayBuffer`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer ) - -**Defined in:** [fs.ts:142](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L142) - -## Functions - -### `copyFile` - -> **copyFile**(`source`: `string`, `destination`: `string`, `options?`: [`FsOptions`](fs.md#fsoptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -Copies a file to a destination. - -**Example** - -```typescript -import { copyFile, BaseDirectory } from '@tauri-apps/api/fs'; -// Copy the `$APPCONFIG/app.conf` file to `$APPCONFIG/app.conf.bk` -await copyFile('app.conf', 'app.conf.bk', { dir: BaseDirectory.AppConfig }); -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `source` | `string` | -| `destination` | `string` | -| `options` | [`FsOptions`](fs.md#fsoptions) | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -A promise indicating the success or failure of the operation. - -### `createDir` - -> **createDir**(`dir`: `string`, `options?`: [`FsDirOptions`](fs.md#fsdiroptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -Creates a directory. -If one of the path's parent components doesn't exist -and the `recursive` option isn't set to true, the promise will be rejected. - -**Example** - -```typescript -import { createDir, BaseDirectory } from '@tauri-apps/api/fs'; -// Create the `$APPDATA/users` directory -await createDir('users', { dir: BaseDirectory.AppData, recursive: true }); -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `dir` | `string` | -| `options` | [`FsDirOptions`](fs.md#fsdiroptions) | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -A promise indicating the success or failure of the operation. - -### `exists` - -> **exists**(`path`: `string`, `options?`: [`FsOptions`](fs.md#fsoptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`boolean`\> - -Check if a path exists. - -**Example** - -```typescript -import { exists, BaseDirectory } from '@tauri-apps/api/fs'; -// Check if the `$APPDATA/avatar.png` file exists -await exists('avatar.png', { dir: BaseDirectory.AppData }); -``` - -**Since**: 1.1.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `path` | `string` | -| `options` | [`FsOptions`](fs.md#fsoptions) | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`boolean`\> - -### `readBinaryFile` - -> **readBinaryFile**(`filePath`: `string`, `options?`: [`FsOptions`](fs.md#fsoptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Uint8Array`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array )\> - -Reads a file as byte array. - -**Example** - -```typescript -import { readBinaryFile, BaseDirectory } from '@tauri-apps/api/fs'; -// Read the image file in the `$RESOURCEDIR/avatar.png` path -const contents = await readBinaryFile('avatar.png', { dir: BaseDirectory.Resource }); -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `filePath` | `string` | -| `options` | [`FsOptions`](fs.md#fsoptions) | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Uint8Array`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array )\> - -### `readDir` - -> **readDir**(`dir`: `string`, `options?`: [`FsDirOptions`](fs.md#fsdiroptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`FileEntry`](fs.md#fileentry)[]\> - -List directory files. - -**Example** - -```typescript -import { readDir, BaseDirectory } from '@tauri-apps/api/fs'; -// Reads the `$APPDATA/users` directory recursively -const entries = await readDir('users', { dir: BaseDirectory.AppData, recursive: true }); - -function processEntries(entries) { - for (const entry of entries) { - console.log(`Entry: ${entry.path}`); - if (entry.children) { - processEntries(entry.children) - } - } -} -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `dir` | `string` | -| `options` | [`FsDirOptions`](fs.md#fsdiroptions) | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`FileEntry`](fs.md#fileentry)[]\> - -### `readTextFile` - -> **readTextFile**(`filePath`: `string`, `options?`: [`FsOptions`](fs.md#fsoptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> - -Reads a file as an UTF-8 encoded string. - -**Example** - -```typescript -import { readTextFile, BaseDirectory } from '@tauri-apps/api/fs'; -// Read the text file in the `$APPCONFIG/app.conf` path -const contents = await readTextFile('app.conf', { dir: BaseDirectory.AppConfig }); -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `filePath` | `string` | -| `options` | [`FsOptions`](fs.md#fsoptions) | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> - -### `removeDir` - -> **removeDir**(`dir`: `string`, `options?`: [`FsDirOptions`](fs.md#fsdiroptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -Removes a directory. -If the directory is not empty and the `recursive` option isn't set to true, the promise will be rejected. - -**Example** - -```typescript -import { removeDir, BaseDirectory } from '@tauri-apps/api/fs'; -// Remove the directory `$APPDATA/users` -await removeDir('users', { dir: BaseDirectory.AppData }); -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `dir` | `string` | -| `options` | [`FsDirOptions`](fs.md#fsdiroptions) | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -A promise indicating the success or failure of the operation. - -### `removeFile` - -> **removeFile**(`file`: `string`, `options?`: [`FsOptions`](fs.md#fsoptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -Removes a file. - -**Example** - -```typescript -import { removeFile, BaseDirectory } from '@tauri-apps/api/fs'; -// Remove the `$APPConfig/app.conf` file -await removeFile('app.conf', { dir: BaseDirectory.AppConfig }); -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `file` | `string` | -| `options` | [`FsOptions`](fs.md#fsoptions) | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -A promise indicating the success or failure of the operation. - -### `renameFile` - -> **renameFile**(`oldPath`: `string`, `newPath`: `string`, `options?`: [`FsOptions`](fs.md#fsoptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -Renames a file. - -**Example** - -```typescript -import { renameFile, BaseDirectory } from '@tauri-apps/api/fs'; -// Rename the `$APPDATA/avatar.png` file -await renameFile('avatar.png', 'deleted.png', { dir: BaseDirectory.AppData }); -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `oldPath` | `string` | -| `newPath` | `string` | -| `options` | [`FsOptions`](fs.md#fsoptions) | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -A promise indicating the success or failure of the operation. - -### `writeBinaryFile` - -> **writeBinaryFile**(`path`: `string`, `contents`: [`BinaryFileContents`](fs.md#binaryfilecontents), `options?`: [`FsOptions`](fs.md#fsoptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -Writes a byte array content to a file. - -**Example** - -```typescript -import { writeBinaryFile, BaseDirectory } from '@tauri-apps/api/fs'; -// Write a binary file to the `$APPDATA/avatar.png` path -await writeBinaryFile('avatar.png', new Uint8Array([]), { dir: BaseDirectory.AppData }); -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | Description | -| :------ | :------ | :------ | -| `path` | `string` | - | -| `contents` | [`BinaryFileContents`](fs.md#binaryfilecontents) | - | -| `options?` | [`FsOptions`](fs.md#fsoptions) | Configuration object. | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -A promise indicating the success or failure of the operation. - -> **writeBinaryFile**(`file`: [`FsBinaryFileOption`](fs.md#fsbinaryfileoption), `options?`: [`FsOptions`](fs.md#fsoptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -Writes a byte array content to a file. - -**Example** - -```typescript -import { writeBinaryFile, BaseDirectory } from '@tauri-apps/api/fs'; -// Write a binary file to the `$APPDATA/avatar.png` path -await writeBinaryFile({ path: 'avatar.png', contents: new Uint8Array([]) }, { dir: BaseDirectory.AppData }); -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | Description | -| :------ | :------ | :------ | -| `file` | [`FsBinaryFileOption`](fs.md#fsbinaryfileoption) | The object containing the file path and contents. | -| `options?` | [`FsOptions`](fs.md#fsoptions) | Configuration object. | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -A promise indicating the success or failure of the operation. - -### `writeTextFile` - -> **writeTextFile**(`path`: `string`, `contents`: `string`, `options?`: [`FsOptions`](fs.md#fsoptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -Writes a UTF-8 text file. - -**Example** - -```typescript -import { writeTextFile, BaseDirectory } from '@tauri-apps/api/fs'; -// Write a text file to the `$APPCONFIG/app.conf` path -await writeTextFile('app.conf', 'file contents', { dir: BaseDirectory.AppConfig }); -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `path` | `string` | -| `contents` | `string` | -| `options?` | [`FsOptions`](fs.md#fsoptions) | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -> **writeTextFile**(`file`: [`FsTextFileOption`](fs.md#fstextfileoption), `options?`: [`FsOptions`](fs.md#fsoptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -Writes a UTF-8 text file. - -**Example** - -```typescript -import { writeTextFile, BaseDirectory } from '@tauri-apps/api/fs'; -// Write a text file to the `$APPCONFIG/app.conf` path -await writeTextFile({ path: 'app.conf', contents: 'file contents' }, { dir: BaseDirectory.AppConfig }); -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `file` | [`FsTextFileOption`](fs.md#fstextfileoption) | -| `options?` | [`FsOptions`](fs.md#fsoptions) | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -A promise indicating the success or failure of the operation. diff --git a/docs/api/js/globalShortcut.md b/docs/api/js/globalShortcut.md deleted file mode 100644 index d5b227669b5..00000000000 --- a/docs/api/js/globalShortcut.md +++ /dev/null @@ -1,156 +0,0 @@ -# globalShortcut - -Register global shortcuts. - -This package is also accessible with `window.__TAURI__.globalShortcut` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`. - -The APIs must be added to [`tauri.allowlist.globalShortcut`](https://tauri.app/v1/api/config/#allowlistconfig.globalshortcut) in `tauri.conf.json`: -```json -{ - "tauri": { - "allowlist": { - "globalShortcut": { - "all": true // enable all global shortcut APIs - } - } - } -} -``` -It is recommended to allowlist only the APIs you use for optimal bundle size and security. - -## Type Aliases - -### `ShortcutHandler` - -> **ShortcutHandler**: (`shortcut`: `string`) => `void` - -**Type declaration** - -> (`shortcut`: `string`): `void` - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `shortcut` | `string` | - -**Returns: **`void` - -**Defined in:** [globalShortcut.ts:29](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/globalShortcut.ts#L29) - -## Functions - -### `isRegistered` - -> **isRegistered**(`shortcut`: `string`): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`boolean`\> - -Determines whether the given shortcut is registered by this application or not. - -**Example** - -```typescript -import { isRegistered } from '@tauri-apps/api/globalShortcut'; -const isRegistered = await isRegistered('CommandOrControl+P'); -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | Description | -| :------ | :------ | :------ | -| `shortcut` | `string` | Array of shortcut definitions, modifiers and key separated by "+" e.g. CmdOrControl+Q | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`boolean`\> - -### `register` - -> **register**(`shortcut`: `string`, `handler`: [`ShortcutHandler`](globalShortcut.md#shortcuthandler)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -Register a global shortcut. - -**Example** - -```typescript -import { register } from '@tauri-apps/api/globalShortcut'; -await register('CommandOrControl+Shift+C', () => { - console.log('Shortcut triggered'); -}); -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | Description | -| :------ | :------ | :------ | -| `shortcut` | `string` | Shortcut definition, modifiers and key separated by "+" e.g. CmdOrControl+Q | -| `handler` | [`ShortcutHandler`](globalShortcut.md#shortcuthandler) | Shortcut handler callback - takes the triggered shortcut as argument | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -### `registerAll` - -> **registerAll**(`shortcuts`: `string`[], `handler`: [`ShortcutHandler`](globalShortcut.md#shortcuthandler)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -Register a collection of global shortcuts. - -**Example** - -```typescript -import { registerAll } from '@tauri-apps/api/globalShortcut'; -await registerAll(['CommandOrControl+Shift+C', 'Ctrl+Alt+F12'], (shortcut) => { - console.log(`Shortcut ${shortcut} triggered`); -}); -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | Description | -| :------ | :------ | :------ | -| `shortcuts` | `string`[] | Array of shortcut definitions, modifiers and key separated by "+" e.g. CmdOrControl+Q | -| `handler` | [`ShortcutHandler`](globalShortcut.md#shortcuthandler) | Shortcut handler callback - takes the triggered shortcut as argument | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -### `unregister` - -> **unregister**(`shortcut`: `string`): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -Unregister a global shortcut. - -**Example** - -```typescript -import { unregister } from '@tauri-apps/api/globalShortcut'; -await unregister('CmdOrControl+Space'); -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | Description | -| :------ | :------ | :------ | -| `shortcut` | `string` | shortcut definition, modifiers and key separated by "+" e.g. CmdOrControl+Q | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -### `unregisterAll` - -> **unregisterAll**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -Unregisters all shortcuts registered by the application. - -**Example** - -```typescript -import { unregisterAll } from '@tauri-apps/api/globalShortcut'; -await unregisterAll(); -``` - -**Since**: 1.0.0 - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> diff --git a/docs/api/js/http.md b/docs/api/js/http.md deleted file mode 100644 index 864608172ec..00000000000 --- a/docs/api/js/http.md +++ /dev/null @@ -1,680 +0,0 @@ -# http - -Access the HTTP client written in Rust. - -This package is also accessible with `window.__TAURI__.http` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`. - -The APIs must be allowlisted on `tauri.conf.json`: -```json -{ - "tauri": { - "allowlist": { - "http": { - "all": true, // enable all http APIs - "request": true // enable HTTP request API - } - } - } -} -``` -It is recommended to allowlist only the APIs you use for optimal bundle size and security. - -## Security - -This API has a scope configuration that forces you to restrict the URLs and paths that can be accessed using glob patterns. - -For instance, this scope configuration only allows making HTTP requests to the GitHub API for the `tauri-apps` organization: -```json -{ - "tauri": { - "allowlist": { - "http": { - "scope": ["https://api.github.com/repos/tauri-apps/*"] - } - } - } -} -``` -Trying to execute any API with a URL not configured on the scope results in a promise rejection due to denied access. - -## Enumerations - -### `ResponseType` - -**Since**: 1.0.0 - -#### Enumeration Members - -| Name | Type | Defined in | -| :------ | :------ | :------ | -| | `3` | [http.ts:74](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L74) | -| | `1` | [http.ts:72](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L72) | -| | `2` | [http.ts:73](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L73) | - -## Classes - -### `Body` - -The body object to be used on POST and PUT requests. - -**Since**: 1.0.0 - -#### Properties - -##### `payload` - -> **payload**: `unknown` - -**Defined in:** [http.ts:139](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L139) - -##### `type` - -> **type**: `string` - -**Defined in:** [http.ts:138](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L138) - -#### Methods - -##### `bytes` - -> `Static` **bytes**(`bytes`: `Iterable`<`number`\> \| [`ArrayBuffer`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer ) \| `ArrayLike`<`number`\>): [`Body`](http.md#body) - -Creates a new byte array body. - -**Example** - -```typescript -import { Body } from "@tauri-apps/api/http" -Body.bytes(new Uint8Array([1, 2, 3])); -``` - -**Parameters** - -| Name | Type | Description | -| :------ | :------ | :------ | -| `bytes` | `Iterable`<`number`\> \| [`ArrayBuffer`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer ) \| `ArrayLike`<`number`\> | The body byte array. | - -**Returns: **[`Body`](http.md#body) - -The body object ready to be used on the POST and PUT requests. - -##### `form` - -> `Static` **form**(`data`: [`FormInput`](http.md#forminput)): [`Body`](http.md#body) - -Creates a new form data body. The form data is an object where each key is the entry name, -and the value is either a string or a file object. - -By default it sets the `application/x-www-form-urlencoded` Content-Type header, -but you can set it to `multipart/form-data` if the Cargo feature `http-multipart` is enabled. - -Note that a file path must be allowed in the `fs` allowlist scope. - -**Example** - -```typescript -import { Body } from "@tauri-apps/api/http" -const body = Body.form({ - key: 'value', - image: { - file: '/path/to/file', // either a path or an array buffer of the file contents - mime: 'image/jpeg', // optional - fileName: 'image.jpg' // optional - } -}); - -// alternatively, use a FormData: -const form = new FormData(); -form.append('key', 'value'); -form.append('image', file, 'image.png'); -const formBody = Body.form(form); -``` - -**Parameters** - -| Name | Type | Description | -| :------ | :------ | :------ | -| `data` | [`FormInput`](http.md#forminput) | The body data. | - -**Returns: **[`Body`](http.md#body) - -The body object ready to be used on the POST and PUT requests. - -##### `json` - -> `Static` **json**(`data`: [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )<`any`, `any`\>): [`Body`](http.md#body) - -Creates a new JSON body. - -**Example** - -```typescript -import { Body } from "@tauri-apps/api/http" -Body.json({ - registered: true, - name: 'tauri' -}); -``` - -**Parameters** - -| Name | Type | Description | -| :------ | :------ | :------ | -| `data` | [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )<`any`, `any`\> | The body JSON object. | - -**Returns: **[`Body`](http.md#body) - -The body object ready to be used on the POST and PUT requests. - -##### `text` - -> `Static` **text**(`value`: `string`): [`Body`](http.md#body) - -Creates a new UTF-8 string body. - -**Example** - -```typescript -import { Body } from "@tauri-apps/api/http" -Body.text('The body content as a string'); -``` - -**Parameters** - -| Name | Type | Description | -| :------ | :------ | :------ | -| `value` | `string` | The body string. | - -**Returns: **[`Body`](http.md#body) - -The body object ready to be used on the POST and PUT requests. - -### `Client` - -**Since**: 1.0.0 - -#### Properties - -##### `id` - -> **id**: `number` - -**Defined in:** [http.ts:316](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L316) - -#### Methods - -##### `delete` - -> **delete**<`T`\>(`url`: `string`, `options?`: [`RequestOptions`](http.md#requestoptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Response`](http.md#response)<`T`\>\> - -Makes a DELETE request. - -**Example** - -```typescript -import { getClient } from '@tauri-apps/api/http'; -const client = await getClient(); -const response = await client.delete('http://localhost:3003/users/1'); -``` - -**Type parameters** - -- `T` - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `url` | `string` | -| `options?` | [`RequestOptions`](http.md#requestoptions) | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Response`](http.md#response)<`T`\>\> - -##### `drop` - -> **drop**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -Drops the client instance. - -**Example** - -```typescript -import { getClient } from '@tauri-apps/api/http'; -const client = await getClient(); -await client.drop(); -``` - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -##### `get` - -> **get**<`T`\>(`url`: `string`, `options?`: [`RequestOptions`](http.md#requestoptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Response`](http.md#response)<`T`\>\> - -Makes a GET request. - -**Example** - -```typescript -import { getClient, ResponseType } from '@tauri-apps/api/http'; -const client = await getClient(); -const response = await client.get('http://localhost:3003/users', { - timeout: 30, - // the expected response type - responseType: ResponseType.JSON -}); -``` - -**Type parameters** - -- `T` - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `url` | `string` | -| `options?` | [`RequestOptions`](http.md#requestoptions) | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Response`](http.md#response)<`T`\>\> - -##### `patch` - -> **patch**<`T`\>(`url`: `string`, `options?`: [`RequestOptions`](http.md#requestoptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Response`](http.md#response)<`T`\>\> - -Makes a PATCH request. - -**Example** - -```typescript -import { getClient, Body } from '@tauri-apps/api/http'; -const client = await getClient(); -const response = await client.patch('http://localhost:3003/users/1', { - body: Body.json({ email: 'contact@tauri.app' }) -}); -``` - -**Type parameters** - -- `T` - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `url` | `string` | -| `options?` | [`RequestOptions`](http.md#requestoptions) | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Response`](http.md#response)<`T`\>\> - -##### `post` - -> **post**<`T`\>(`url`: `string`, `body?`: [`Body`](http.md#body), `options?`: [`RequestOptions`](http.md#requestoptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Response`](http.md#response)<`T`\>\> - -Makes a POST request. - -**Example** - -```typescript -import { getClient, Body, ResponseType } from '@tauri-apps/api/http'; -const client = await getClient(); -const response = await client.post('http://localhost:3003/users', { - body: Body.json({ - name: 'tauri', - password: 'awesome' - }), - // in this case the server returns a simple string - responseType: ResponseType.Text, -}); -``` - -**Type parameters** - -- `T` - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `url` | `string` | -| `body?` | [`Body`](http.md#body) | -| `options?` | [`RequestOptions`](http.md#requestoptions) | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Response`](http.md#response)<`T`\>\> - -##### `put` - -> **put**<`T`\>(`url`: `string`, `body?`: [`Body`](http.md#body), `options?`: [`RequestOptions`](http.md#requestoptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Response`](http.md#response)<`T`\>\> - -Makes a PUT request. - -**Example** - -```typescript -import { getClient, Body } from '@tauri-apps/api/http'; -const client = await getClient(); -const response = await client.put('http://localhost:3003/users/1', { - body: Body.form({ - file: { - file: '/home/tauri/avatar.png', - mime: 'image/png', - fileName: 'avatar.png' - } - }) -}); -``` - -**Type parameters** - -- `T` - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `url` | `string` | -| `body?` | [`Body`](http.md#body) | -| `options?` | [`RequestOptions`](http.md#requestoptions) | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Response`](http.md#response)<`T`\>\> - -##### `request` - -> **request**<`T`\>(`options`: [`HttpOptions`](http.md#httpoptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Response`](http.md#response)<`T`\>\> - -Makes an HTTP request. - -**Example** - -```typescript -import { getClient } from '@tauri-apps/api/http'; -const client = await getClient(); -const response = await client.request({ - method: 'GET', - url: 'http://localhost:3003/users', -}); -``` - -**Type parameters** - -- `T` - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `options` | [`HttpOptions`](http.md#httpoptions) | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Response`](http.md#response)<`T`\>\> - -### `Response` - -Response object. - -**Since**: 1.0.0 - -**Type parameters** - -- `T` - -#### Properties - -##### `data` - -> **data**: `T` - -The response data. - -**Defined in:** [http.ts:299](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L299) - -##### `headers` - -> **headers**: [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )<`string`, `string`\> - -The response headers. - -**Defined in:** [http.ts:295](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L295) - -##### `ok` - -> **ok**: `boolean` - -A boolean indicating whether the response was successful (status in the range 200–299) or not. - -**Defined in:** [http.ts:293](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L293) - -##### `rawHeaders` - -> **rawHeaders**: [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )<`string`, `string`[]\> - -The response raw headers. - -**Defined in:** [http.ts:297](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L297) - -##### `status` - -> **status**: `number` - -The response status code. - -**Defined in:** [http.ts:291](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L291) - -##### `url` - -> **url**: `string` - -The request URL. - -**Defined in:** [http.ts:289](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L289) - -## Interfaces - -### `ClientOptions` - -**Since**: 1.0.0 - -#### Properties - -##### `connectTimeout` - -> `Optional` **connectTimeout**: `number` \| [`Duration`](http.md#duration) - -**Defined in:** [http.ts:65](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L65) - -##### `maxRedirections` - -> `Optional` **maxRedirections**: `number` - -Defines the maximum number of redirects the client should follow. -If set to 0, no redirects will be followed. - -**Defined in:** [http.ts:64](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L64) - -### `Duration` - -**Since**: 1.0.0 - -#### Properties - -##### `nanos` - -> **nanos**: `number` - -**Defined in:** [http.ts:53](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L53) - -##### `secs` - -> **secs**: `number` - -**Defined in:** [http.ts:52](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L52) - -### `FilePart` - -**Since**: 1.0.0 - -**Type parameters** - -- `T` - -#### Properties - -##### `file` - -> **file**: `string` \| `T` - -**Defined in:** [http.ts:81](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L81) - -##### `fileName` - -> `Optional` **fileName**: `string` - -**Defined in:** [http.ts:83](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L83) - -##### `mime` - -> `Optional` **mime**: `string` - -**Defined in:** [http.ts:82](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L82) - -### `HttpOptions` - -Options object sent to the backend. - -**Since**: 1.0.0 - -#### Properties - -##### `body` - -> `Optional` **body**: [`Body`](http.md#body) - -**Defined in:** [http.ts:263](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L263) - -##### `headers` - -> `Optional` **headers**: [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )<`string`, `any`\> - -**Defined in:** [http.ts:261](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L261) - -##### `method` - -> **method**: [`HttpVerb`](http.md#httpverb) - -**Defined in:** [http.ts:259](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L259) - -##### `query` - -> `Optional` **query**: [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )<`string`, `any`\> - -**Defined in:** [http.ts:262](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L262) - -##### `responseType` - -> `Optional` **responseType**: [`ResponseType`](http.md#responsetype) - -**Defined in:** [http.ts:265](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L265) - -##### `timeout` - -> `Optional` **timeout**: `number` \| [`Duration`](http.md#duration) - -**Defined in:** [http.ts:264](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L264) - -##### `url` - -> **url**: `string` - -**Defined in:** [http.ts:260](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L260) - -## Type Aliases - -### `FetchOptions` - -> **FetchOptions**: [`Omit`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys )<[`HttpOptions`](http.md#httpoptions), `"url"`\> - -Options for the `fetch` API. - -**Defined in:** [http.ts:271](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L271) - -### `FormInput` - -> **FormInput**: [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )<`string`, [`Part`](http.md#part)\> \| [`FormData`]( https://developer.mozilla.org/en-US/docs/Web/API/FormData ) - -**Defined in:** [http.ts:88](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L88) - -### `HttpVerb` - -> **HttpVerb**: `"GET"` \| `"POST"` \| `"PUT"` \| `"DELETE"` \| `"PATCH"` \| `"HEAD"` \| `"OPTIONS"` \| `"CONNECT"` \| `"TRACE"` - -The request HTTP verb. - -**Defined in:** [http.ts:242](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L242) - -### `Part` - -> **Part**: `string` \| [`Uint8Array`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array ) \| [`FilePart`](http.md#filepart)<[`Uint8Array`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array )\> - -**Defined in:** [http.ts:86](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L86) - -### `RequestOptions` - -> **RequestOptions**: [`Omit`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys )<[`HttpOptions`](http.md#httpoptions), `"method"` \| `"url"`\> - -Request options. - -**Defined in:** [http.ts:269](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L269) - -## Functions - -### `fetch` - -> **fetch**<`T`\>(`url`: `string`, `options?`: [`FetchOptions`](http.md#fetchoptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Response`](http.md#response)<`T`\>\> - -Perform an HTTP request using the default client. - -**Example** - -```typescript -import { fetch } from '@tauri-apps/api/http'; -const response = await fetch('http://localhost:3003/users/2', { - method: 'GET', - timeout: 30, -}); -``` - -**Type parameters** - -- `T` - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `url` | `string` | -| `options?` | [`FetchOptions`](http.md#fetchoptions) | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Response`](http.md#response)<`T`\>\> - -### `getClient` - -> **getClient**(`options?`: [`ClientOptions`](http.md#clientoptions)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Client`](http.md#client)\> - -Creates a new client using the specified options. - -**Example** - -```typescript -import { getClient } from '@tauri-apps/api/http'; -const client = await getClient(); -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | Description | -| :------ | :------ | :------ | -| `options?` | [`ClientOptions`](http.md#clientoptions) | Client configuration. | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Client`](http.md#client)\> - -A promise resolving to the client instance. diff --git a/docs/api/js/js-api.json b/docs/api/js/js-api.json index 8d5b3b3d53d..6f605aee16b 100644 --- a/docs/api/js/js-api.json +++ b/docs/api/js/js-api.json @@ -1 +1 @@ -{"id":0,"name":"@tauri-apps/api","kind":1,"flags":{},"originalName":"","children":[{"id":1,"name":"app","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"Get application metadata.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.app`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":".\n\nThe APIs must be added to ["},{"kind":"code","text":"`tauri.allowlist.app`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#allowlistconfig.app) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":":\n"},{"kind":"code","text":"```json\n{\n \"tauri\": {\n \"allowlist\": {\n \"app\": {\n \"all\": true, // enable all app APIs\n \"show\": true,\n \"hide\": true\n }\n }\n }\n}\n```"},{"kind":"text","text":"\nIt is recommended to allowlist only the APIs you use for optimal bundle size and security."}]},"children":[{"id":2,"name":"getName","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"app.ts","line":60,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/app.ts#L60"}],"signatures":[{"id":3,"name":"getName","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the application name."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getName } from '@tauri-apps/api/app';\nconst appName = await getName();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":6,"name":"getTauriVersion","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"app.ts","line":80,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/app.ts#L80"}],"signatures":[{"id":7,"name":"getTauriVersion","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the Tauri version."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getTauriVersion } from '@tauri-apps/api/app';\nconst tauriVersion = await getTauriVersion();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":4,"name":"getVersion","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"app.ts","line":41,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/app.ts#L41"}],"signatures":[{"id":5,"name":"getVersion","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the application version."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getVersion } from '@tauri-apps/api/app';\nconst appVersion = await getVersion();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":10,"name":"hide","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"app.ts","line":120,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/app.ts#L120"}],"signatures":[{"id":11,"name":"hide","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Hides the application on macOS."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { hide } from '@tauri-apps/api/app';\nawait hide();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.2.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":8,"name":"show","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"app.ts","line":100,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/app.ts#L100"}],"signatures":[{"id":9,"name":"show","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Shows the application on macOS. This function does not automatically focus any specific app window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { show } from '@tauri-apps/api/app';\nawait show();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.2.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Functions","children":[2,6,4,10,8]}],"sources":[{"fileName":"app.ts","line":29,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/app.ts#L29"}]},{"id":12,"name":"cli","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"Parse arguments from your Command Line Interface.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.cli`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":"."}]},"children":[{"id":13,"name":"ArgMatch","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":15,"name":"occurrences","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Number of occurrences"}]},"sources":[{"fileName":"cli.ts","line":27,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/cli.ts#L27"}],"type":{"type":"intrinsic","name":"number"}},{"id":14,"name":"value","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"string if takes value\nboolean if flag\nstring[] or null if takes multiple values"}]},"sources":[{"fileName":"cli.ts","line":23,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/cli.ts#L23"}],"type":{"type":"union","types":[{"type":"literal","value":null},{"type":"intrinsic","name":"string"},{"type":"intrinsic","name":"boolean"},{"type":"array","elementType":{"type":"intrinsic","name":"string"}}]}}],"groups":[{"title":"Properties","children":[15,14]}],"sources":[{"fileName":"cli.ts","line":17,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/cli.ts#L17"}]},{"id":19,"name":"CliMatches","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":20,"name":"args","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"cli.ts","line":42,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/cli.ts#L42"}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"},{"type":"reference","id":13,"name":"ArgMatch"}],"name":"Record","externalUrl":"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type","qualifiedName":"Record","package":"typescript"}},{"id":21,"name":"subcommand","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"cli.ts","line":43,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/cli.ts#L43"}],"type":{"type":"union","types":[{"type":"literal","value":null},{"type":"reference","id":16,"name":"SubcommandMatch"}]}}],"groups":[{"title":"Properties","children":[20,21]}],"sources":[{"fileName":"cli.ts","line":41,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/cli.ts#L41"}]},{"id":16,"name":"SubcommandMatch","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":18,"name":"matches","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"cli.ts","line":35,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/cli.ts#L35"}],"type":{"type":"reference","id":19,"name":"CliMatches"}},{"id":17,"name":"name","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"cli.ts","line":34,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/cli.ts#L34"}],"type":{"type":"intrinsic","name":"string"}}],"groups":[{"title":"Properties","children":[18,17]}],"sources":[{"fileName":"cli.ts","line":33,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/cli.ts#L33"}]},{"id":22,"name":"getMatches","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"cli.ts","line":66,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/cli.ts#L66"}],"signatures":[{"id":23,"name":"getMatches","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Parse the arguments provided to the current process and get the matches using the configuration defined ["},{"kind":"code","text":"`tauri.cli`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#tauriconfig.cli) in "},{"kind":"code","text":"`tauri.conf.json`"}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getMatches } from '@tauri-apps/api/cli';\nconst matches = await getMatches();\nif (matches.subcommand?.name === 'run') {\n // `./your-app run $ARGS` was executed\n const args = matches.subcommand?.matches.args\n if ('debug' in args) {\n // `./your-app run --debug` was executed\n }\n} else {\n const args = matches.args\n // `./your-app $ARGS` was executed\n}\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"reference","id":19,"name":"CliMatches"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Interfaces","children":[13,19,16]},{"title":"Functions","children":[22]}],"sources":[{"fileName":"cli.ts","line":12,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/cli.ts#L12"}]},{"id":24,"name":"clipboard","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"Read and write to the system clipboard.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.clipboard`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":".\n\nThe APIs must be added to ["},{"kind":"code","text":"`tauri.allowlist.clipboard`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#allowlistconfig.clipboard) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":":\n"},{"kind":"code","text":"```json\n{\n \"tauri\": {\n \"allowlist\": {\n \"clipboard\": {\n \"all\": true, // enable all Clipboard APIs\n \"writeText\": true,\n \"readText\": true\n }\n }\n }\n}\n```"},{"kind":"text","text":"\nIt is recommended to allowlist only the APIs you use for optimal bundle size and security."}]},"children":[{"id":28,"name":"readText","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"clipboard.ts","line":63,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/clipboard.ts#L63"}],"signatures":[{"id":29,"name":"readText","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the clipboard content as plain text."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { readText } from '@tauri-apps/api/clipboard';\nconst clipboardText = await readText();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0."}]}]},"type":{"type":"reference","typeArguments":[{"type":"union","types":[{"type":"intrinsic","name":"string"},{"type":"literal","value":null}]}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":25,"name":"writeText","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"clipboard.ts","line":44,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/clipboard.ts#L44"}],"signatures":[{"id":26,"name":"writeText","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Writes plain text to the clipboard."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { writeText, readText } from '@tauri-apps/api/clipboard';\nawait writeText('Tauri is awesome!');\nassert(await readText(), 'Tauri is awesome!');\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0."}]}]},"parameters":[{"id":27,"name":"text","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Functions","children":[28,25]}],"sources":[{"fileName":"clipboard.ts","line":29,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/clipboard.ts#L29"}]},{"id":30,"name":"dialog","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"Native system dialogs for opening and saving files.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.dialog`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":".\n\nThe APIs must be added to ["},{"kind":"code","text":"`tauri.allowlist.dialog`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#allowlistconfig.dialog) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":":\n"},{"kind":"code","text":"```json\n{\n \"tauri\": {\n \"allowlist\": {\n \"dialog\": {\n \"all\": true, // enable all dialog APIs\n \"ask\": true, // enable dialog ask API\n \"confirm\": true, // enable dialog confirm API\n \"message\": true, // enable dialog message API\n \"open\": true, // enable file open API\n \"save\": true // enable file save API\n }\n }\n }\n}\n```"},{"kind":"text","text":"\nIt is recommended to allowlist only the APIs you use for optimal bundle size and security."}]},"children":[{"id":49,"name":"ConfirmDialogOptions","kind":256,"kindString":"Interface","flags":{},"children":[{"id":53,"name":"cancelLabel","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The label of the cancel button."}]},"sources":[{"fileName":"dialog.ts","line":112,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L112"}],"type":{"type":"intrinsic","name":"string"}},{"id":52,"name":"okLabel","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The label of the confirm button."}]},"sources":[{"fileName":"dialog.ts","line":110,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L110"}],"type":{"type":"intrinsic","name":"string"}},{"id":50,"name":"title","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The title of the dialog. Defaults to the app name."}]},"sources":[{"fileName":"dialog.ts","line":106,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L106"}],"type":{"type":"intrinsic","name":"string"}},{"id":51,"name":"type","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The type of the dialog. Defaults to "},{"kind":"code","text":"`info`"},{"kind":"text","text":"."}]},"sources":[{"fileName":"dialog.ts","line":108,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L108"}],"type":{"type":"union","types":[{"type":"literal","value":"info"},{"type":"literal","value":"warning"},{"type":"literal","value":"error"}]}}],"groups":[{"title":"Properties","children":[53,52,50,51]}],"sources":[{"fileName":"dialog.ts","line":104,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L104"}]},{"id":31,"name":"DialogFilter","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[{"kind":"text","text":"Extension filters for the file dialog."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":33,"name":"extensions","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Extensions to filter, without a "},{"kind":"code","text":"`.`"},{"kind":"text","text":" prefix."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nextensions: ['svg', 'png']\n```"}]}]},"sources":[{"fileName":"dialog.ts","line":48,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L48"}],"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}},{"id":32,"name":"name","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Filter name."}]},"sources":[{"fileName":"dialog.ts","line":40,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L40"}],"type":{"type":"intrinsic","name":"string"}}],"groups":[{"title":"Properties","children":[33,32]}],"sources":[{"fileName":"dialog.ts","line":38,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L38"}]},{"id":45,"name":"MessageDialogOptions","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":48,"name":"okLabel","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The label of the confirm button."}]},"sources":[{"fileName":"dialog.ts","line":101,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L101"}],"type":{"type":"intrinsic","name":"string"}},{"id":46,"name":"title","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The title of the dialog. Defaults to the app name."}]},"sources":[{"fileName":"dialog.ts","line":97,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L97"}],"type":{"type":"intrinsic","name":"string"}},{"id":47,"name":"type","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The type of the dialog. Defaults to "},{"kind":"code","text":"`info`"},{"kind":"text","text":"."}]},"sources":[{"fileName":"dialog.ts","line":99,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L99"}],"type":{"type":"union","types":[{"type":"literal","value":"info"},{"type":"literal","value":"warning"},{"type":"literal","value":"error"}]}}],"groups":[{"title":"Properties","children":[48,46,47]}],"sources":[{"fileName":"dialog.ts","line":95,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L95"}]},{"id":34,"name":"OpenDialogOptions","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[{"kind":"text","text":"Options for the open dialog."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":37,"name":"defaultPath","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Initial directory or file path."}]},"sources":[{"fileName":"dialog.ts","line":62,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L62"}],"type":{"type":"intrinsic","name":"string"}},{"id":39,"name":"directory","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the dialog is a directory selection or not."}]},"sources":[{"fileName":"dialog.ts","line":66,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L66"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":36,"name":"filters","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The filters of the dialog."}]},"sources":[{"fileName":"dialog.ts","line":60,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L60"}],"type":{"type":"array","elementType":{"type":"reference","id":31,"name":"DialogFilter"}}},{"id":38,"name":"multiple","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the dialog allows multiple selection or not."}]},"sources":[{"fileName":"dialog.ts","line":64,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L64"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":40,"name":"recursive","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"If "},{"kind":"code","text":"`directory`"},{"kind":"text","text":" is true, indicates that it will be read recursively later.\nDefines whether subdirectories will be allowed on the scope or not."}]},"sources":[{"fileName":"dialog.ts","line":71,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L71"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":35,"name":"title","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The title of the dialog window."}]},"sources":[{"fileName":"dialog.ts","line":58,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L58"}],"type":{"type":"intrinsic","name":"string"}}],"groups":[{"title":"Properties","children":[37,39,36,38,40,35]}],"sources":[{"fileName":"dialog.ts","line":56,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L56"}]},{"id":41,"name":"SaveDialogOptions","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[{"kind":"text","text":"Options for the save dialog."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":44,"name":"defaultPath","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Initial directory or file path.\nIf it's a directory path, the dialog interface will change to that folder.\nIf 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."}]},"sources":[{"fileName":"dialog.ts","line":89,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L89"}],"type":{"type":"intrinsic","name":"string"}},{"id":43,"name":"filters","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The filters of the dialog."}]},"sources":[{"fileName":"dialog.ts","line":83,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L83"}],"type":{"type":"array","elementType":{"type":"reference","id":31,"name":"DialogFilter"}}},{"id":42,"name":"title","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The title of the dialog window."}]},"sources":[{"fileName":"dialog.ts","line":81,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L81"}],"type":{"type":"intrinsic","name":"string"}}],"groups":[{"title":"Properties","children":[44,43,42]}],"sources":[{"fileName":"dialog.ts","line":79,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L79"}]},{"id":64,"name":"ask","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"dialog.ts","line":271,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L271"}],"signatures":[{"id":65,"name":"ask","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Shows a question dialog with "},{"kind":"code","text":"`Yes`"},{"kind":"text","text":" and "},{"kind":"code","text":"`No`"},{"kind":"text","text":" buttons."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { ask } from '@tauri-apps/api/dialog';\nconst yes = await ask('Are you sure?', 'Tauri');\nconst yes2 = await ask('This action cannot be reverted. Are you sure?', { title: 'Tauri', type: 'warning' });\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a boolean indicating whether "},{"kind":"code","text":"`Yes`"},{"kind":"text","text":" was clicked or not."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":66,"name":"message","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The message to show."}]},"type":{"type":"intrinsic","name":"string"}},{"id":67,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The dialog's options. If a string, it represents the dialog title."}]},"type":{"type":"union","types":[{"type":"intrinsic","name":"string"},{"type":"reference","id":49,"name":"ConfirmDialogOptions"}]}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":68,"name":"confirm","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"dialog.ts","line":307,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L307"}],"signatures":[{"id":69,"name":"confirm","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Shows a question dialog with "},{"kind":"code","text":"`Ok`"},{"kind":"text","text":" and "},{"kind":"code","text":"`Cancel`"},{"kind":"text","text":" buttons."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { confirm } from '@tauri-apps/api/dialog';\nconst confirmed = await confirm('Are you sure?', 'Tauri');\nconst confirmed2 = await confirm('This action cannot be reverted. Are you sure?', { title: 'Tauri', type: 'warning' });\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a boolean indicating whether "},{"kind":"code","text":"`Ok`"},{"kind":"text","text":" was clicked or not."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":70,"name":"message","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The message to show."}]},"type":{"type":"intrinsic","name":"string"}},{"id":71,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The dialog's options. If a string, it represents the dialog title."}]},"type":{"type":"union","types":[{"type":"intrinsic","name":"string"},{"type":"reference","id":49,"name":"ConfirmDialogOptions"}]}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":60,"name":"message","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"dialog.ts","line":238,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L238"}],"signatures":[{"id":61,"name":"message","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Shows a message dialog with an "},{"kind":"code","text":"`Ok`"},{"kind":"text","text":" button."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { message } from '@tauri-apps/api/dialog';\nawait message('Tauri is awesome', 'Tauri');\nawait message('File not found', { title: 'Tauri', type: 'error' });\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":62,"name":"message","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The message to show."}]},"type":{"type":"intrinsic","name":"string"}},{"id":63,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The dialog's options. If a string, it represents the dialog title."}]},"type":{"type":"union","types":[{"type":"intrinsic","name":"string"},{"type":"reference","id":45,"name":"MessageDialogOptions"}]}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":54,"name":"open","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"dialog.ts","line":167,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L167"}],"signatures":[{"id":55,"name":"open","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Open a file/directory selection dialog.\n\nThe selected paths are added to the filesystem and asset protocol allowlist scopes.\nWhen security is more important than the easy of use of this API,\nprefer writing a dedicated command instead.\n\nNote that the allowlist scope change is not persisted, so the values are cleared when the application is restarted.\nYou can save it to the filesystem using [tauri-plugin-persisted-scope](https://github.com/tauri-apps/tauri-plugin-persisted-scope)."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { open } from '@tauri-apps/api/dialog';\n// Open a selection dialog for image files\nconst selected = await open({\n multiple: true,\n filters: [{\n name: 'Image',\n extensions: ['png', 'jpeg']\n }]\n});\nif (Array.isArray(selected)) {\n // user selected multiple files\n} else if (selected === null) {\n // user cancelled the selection\n} else {\n // user selected a single file\n}\n```"}]},{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { open } from '@tauri-apps/api/dialog';\nimport { appDir } from '@tauri-apps/api/path';\n// Open a selection dialog for directories\nconst selected = await open({\n directory: true,\n multiple: true,\n defaultPath: await appDir(),\n});\nif (Array.isArray(selected)) {\n // user selected multiple directories\n} else if (selected === null) {\n // user cancelled the selection\n} else {\n // user selected a single directory\n}\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to the selected path(s)"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":56,"name":"options","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":34,"name":"OpenDialogOptions"},"defaultValue":"{}"}],"type":{"type":"reference","typeArguments":[{"type":"union","types":[{"type":"literal","value":null},{"type":"intrinsic","name":"string"},{"type":"array","elementType":{"type":"intrinsic","name":"string"}}]}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":57,"name":"save","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"dialog.ts","line":207,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L207"}],"signatures":[{"id":58,"name":"save","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Open a file/directory save dialog.\n\nThe selected path is added to the filesystem and asset protocol allowlist scopes.\nWhen security is more important than the easy of use of this API,\nprefer writing a dedicated command instead.\n\nNote that the allowlist scope change is not persisted, so the values are cleared when the application is restarted.\nYou can save it to the filesystem using [tauri-plugin-persisted-scope](https://github.com/tauri-apps/tauri-plugin-persisted-scope)."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { save } from '@tauri-apps/api/dialog';\nconst filePath = await save({\n filters: [{\n name: 'Image',\n extensions: ['png', 'jpeg']\n }]\n});\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to the selected path."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":59,"name":"options","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":41,"name":"SaveDialogOptions"},"defaultValue":"{}"}],"type":{"type":"reference","typeArguments":[{"type":"union","types":[{"type":"intrinsic","name":"string"},{"type":"literal","value":null}]}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Interfaces","children":[49,31,45,34,41]},{"title":"Functions","children":[64,68,60,54,57]}],"sources":[{"fileName":"dialog.ts","line":31,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/dialog.ts#L31"}]},{"id":72,"name":"event","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"The event system allows you to emit events to the backend and listen to events from it.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.event`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":"."}]},"children":[{"id":74,"name":"TauriEvent","kind":8,"kindString":"Enumeration","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"children":[{"id":88,"name":"CHECK_UPDATE","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":34,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L34"}],"type":{"type":"literal","value":"tauri://update"}},{"id":92,"name":"DOWNLOAD_PROGRESS","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":38,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L38"}],"type":{"type":"literal","value":"tauri://update-download-progress"}},{"id":90,"name":"INSTALL_UPDATE","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":36,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L36"}],"type":{"type":"literal","value":"tauri://update-install"}},{"id":87,"name":"MENU","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":33,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L33"}],"type":{"type":"literal","value":"tauri://menu"}},{"id":91,"name":"STATUS_UPDATE","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":37,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L37"}],"type":{"type":"literal","value":"tauri://update-status"}},{"id":89,"name":"UPDATE_AVAILABLE","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":35,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L35"}],"type":{"type":"literal","value":"tauri://update-available"}},{"id":81,"name":"WINDOW_BLUR","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":27,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L27"}],"type":{"type":"literal","value":"tauri://blur"}},{"id":77,"name":"WINDOW_CLOSE_REQUESTED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":23,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L23"}],"type":{"type":"literal","value":"tauri://close-requested"}},{"id":78,"name":"WINDOW_CREATED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":24,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L24"}],"type":{"type":"literal","value":"tauri://window-created"}},{"id":79,"name":"WINDOW_DESTROYED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":25,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L25"}],"type":{"type":"literal","value":"tauri://destroyed"}},{"id":84,"name":"WINDOW_FILE_DROP","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":30,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L30"}],"type":{"type":"literal","value":"tauri://file-drop"}},{"id":86,"name":"WINDOW_FILE_DROP_CANCELLED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":32,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L32"}],"type":{"type":"literal","value":"tauri://file-drop-cancelled"}},{"id":85,"name":"WINDOW_FILE_DROP_HOVER","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":31,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L31"}],"type":{"type":"literal","value":"tauri://file-drop-hover"}},{"id":80,"name":"WINDOW_FOCUS","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":26,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L26"}],"type":{"type":"literal","value":"tauri://focus"}},{"id":76,"name":"WINDOW_MOVED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":22,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L22"}],"type":{"type":"literal","value":"tauri://move"}},{"id":75,"name":"WINDOW_RESIZED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":21,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L21"}],"type":{"type":"literal","value":"tauri://resize"}},{"id":82,"name":"WINDOW_SCALE_FACTOR_CHANGED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":28,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L28"}],"type":{"type":"literal","value":"tauri://scale-change"}},{"id":83,"name":"WINDOW_THEME_CHANGED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":29,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L29"}],"type":{"type":"literal","value":"tauri://theme-changed"}}],"groups":[{"title":"Enumeration Members","children":[88,92,90,87,91,89,81,77,78,79,84,86,85,80,76,75,82,83]}],"sources":[{"fileName":"event.ts","line":20,"character":12,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L20"}]},{"id":1163,"name":"Event","kind":256,"kindString":"Interface","flags":{},"children":[{"id":1164,"name":"event","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name"}]},"sources":[{"fileName":"helpers/event.ts","line":12,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/helpers/event.ts#L12"}],"type":{"type":"reference","id":73,"name":"EventName"}},{"id":1166,"name":"id","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Event identifier used to unlisten"}]},"sources":[{"fileName":"helpers/event.ts","line":16,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/helpers/event.ts#L16"}],"type":{"type":"intrinsic","name":"number"}},{"id":1167,"name":"payload","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Event payload"}]},"sources":[{"fileName":"helpers/event.ts","line":18,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/helpers/event.ts#L18"}],"type":{"type":"reference","id":1168,"name":"T"}},{"id":1165,"name":"windowLabel","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The label of the window that emitted this event."}]},"sources":[{"fileName":"helpers/event.ts","line":14,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/helpers/event.ts#L14"}],"type":{"type":"intrinsic","name":"string"}}],"groups":[{"title":"Properties","children":[1164,1166,1167,1165]}],"sources":[{"fileName":"helpers/event.ts","line":10,"character":17,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/helpers/event.ts#L10"}],"typeParameters":[{"id":1168,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}]},{"id":1169,"name":"EventCallback","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"helpers/event.ts","line":21,"character":12,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/helpers/event.ts#L21"}],"typeParameters":[{"id":1173,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"type":{"type":"reflection","declaration":{"id":1170,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"helpers/event.ts","line":21,"character":31,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/helpers/event.ts#L21"}],"signatures":[{"id":1171,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":1172,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":1163,"typeArguments":[{"type":"reference","id":1173,"name":"T"}],"name":"Event"}}],"type":{"type":"intrinsic","name":"void"}}]}}},{"id":73,"name":"EventName","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"event.ts","line":15,"character":12,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L15"}],"type":{"type":"union","types":[{"type":"template-literal","head":"","tail":[[{"type":"reference","id":74,"name":"TauriEvent"},""]]},{"type":"intersection","types":[{"type":"intrinsic","name":"string"},{"type":"reference","typeArguments":[{"type":"intrinsic","name":"never"},{"type":"intrinsic","name":"never"}],"name":"Record","externalUrl":"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type","qualifiedName":"Record","package":"typescript"}]}]}},{"id":1174,"name":"UnlistenFn","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"helpers/event.ts","line":23,"character":12,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/helpers/event.ts#L23"}],"type":{"type":"reflection","declaration":{"id":1175,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"helpers/event.ts","line":23,"character":25,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/helpers/event.ts#L23"}],"signatures":[{"id":1176,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"intrinsic","name":"void"}}]}}},{"id":103,"name":"emit","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"event.ts","line":113,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L113"}],"signatures":[{"id":104,"name":"emit","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Emits an event to the backend and all Tauri windows."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { emit } from '@tauri-apps/api/event';\nawait emit('frontend-loaded', { loggedIn: true, token: 'authToken' });\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":105,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"intrinsic","name":"string"}},{"id":106,"name":"payload","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"unknown"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":93,"name":"listen","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"event.ts","line":63,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L63"}],"signatures":[{"id":94,"name":"listen","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to an event. The event can be either global or window-specific.\nSee "},{"kind":"inline-tag","tag":"@link","text":"windowLabel","target":1165},{"kind":"text","text":" to check the event source."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { listen } from '@tauri-apps/api/event';\nconst unlisten = await listen('error', (event) => {\n console.log(`Got error in window ${event.windowLabel}, payload: ${event.payload}`);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"typeParameter":[{"id":95,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":96,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"reference","id":73,"name":"EventName"}},{"id":97,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event handler callback."}]},"type":{"type":"reference","id":1169,"typeArguments":[{"type":"reference","id":95,"name":"T"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":1174,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":98,"name":"once","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"event.ts","line":94,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L94"}],"signatures":[{"id":99,"name":"once","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to an one-off event. See "},{"kind":"inline-tag","tag":"@link","text":"listen","target":93},{"kind":"text","text":" for more information."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { once } from '@tauri-apps/api/event';\ninterface LoadedPayload {\n loggedIn: boolean,\n token: string\n}\nconst unlisten = await once('loaded', (event) => {\n console.log(`App is loaded, loggedIn: ${event.payload.loggedIn}, token: ${event.payload.token}`);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"typeParameter":[{"id":100,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":101,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"reference","id":73,"name":"EventName"}},{"id":102,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":1169,"typeArguments":[{"type":"reference","id":100,"name":"T"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":1174,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Enumerations","children":[74]},{"title":"Interfaces","children":[1163]},{"title":"Type Aliases","children":[1169,73,1174]},{"title":"Functions","children":[103,93,98]}],"sources":[{"fileName":"event.ts","line":12,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/event.ts#L12"}]},{"id":107,"name":"fs","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"Access the file system.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.fs`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":".\n\nThe APIs must be added to ["},{"kind":"code","text":"`tauri.allowlist.fs`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#allowlistconfig.fs) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":":\n"},{"kind":"code","text":"```json\n{\n \"tauri\": {\n \"allowlist\": {\n \"fs\": {\n \"all\": true, // enable all FS APIs\n \"readFile\": true,\n \"writeFile\": true,\n \"readDir\": true,\n \"copyFile\": true,\n \"createDir\": true,\n \"removeDir\": true,\n \"removeFile\": true,\n \"renameFile\": true,\n \"exists\": true\n }\n }\n }\n}\n```"},{"kind":"text","text":"\nIt is recommended to allowlist only the APIs you use for optimal bundle size and security.\n\n## Security\n\nThis module prevents path traversal, not allowing absolute paths or parent dir components\n(i.e. \"/usr/path/to/file\" or \"../path/to/file\" paths are not allowed).\nPaths accessed with this API must be relative to one of the "},{"kind":"inline-tag","tag":"@link","text":"base directories","target":108},{"kind":"text","text":"\nso if you need access to arbitrary filesystem paths, you must write such logic on the core layer instead.\n\nThe API has a scope configuration that forces you to restrict the paths that can be accessed using glob patterns.\n\nThe scope configuration is an array of glob patterns describing folder paths that are allowed.\nFor instance, this scope configuration only allows accessing files on the\n*databases* folder of the "},{"kind":"inline-tag","tag":"@link","text":"$APPDATA directory","target":384},{"kind":"text","text":":\n"},{"kind":"code","text":"```json\n{\n \"tauri\": {\n \"allowlist\": {\n \"fs\": {\n \"scope\": [\"$APPDATA/databases/*\"]\n }\n }\n }\n}\n```"},{"kind":"text","text":"\n\nNotice the use of the "},{"kind":"code","text":"`$APPDATA`"},{"kind":"text","text":" variable. The value is injected at runtime, resolving to the "},{"kind":"inline-tag","tag":"@link","text":"app data directory","target":384},{"kind":"text","text":".\nThe available variables are:\n"},{"kind":"inline-tag","tag":"@link","text":"`$APPCONFIG`","target":382},{"kind":"text","text":", "},{"kind":"inline-tag","tag":"@link","text":"`$APPDATA`","target":384},{"kind":"text","text":", "},{"kind":"inline-tag","tag":"@link","text":"`$APPLOCALDATA`","target":386},{"kind":"text","text":",\n"},{"kind":"inline-tag","tag":"@link","text":"`$APPCACHE`","target":388},{"kind":"text","text":", "},{"kind":"inline-tag","tag":"@link","text":"`$APPLOG`","target":390},{"kind":"text","text":",\n"},{"kind":"inline-tag","tag":"@link","text":"`$AUDIO`","target":392},{"kind":"text","text":", "},{"kind":"inline-tag","tag":"@link","text":"`$CACHE`","target":394},{"kind":"text","text":", "},{"kind":"inline-tag","tag":"@link","text":"`$CONFIG`","target":396},{"kind":"text","text":", "},{"kind":"inline-tag","tag":"@link","text":"`$DATA`","target":398},{"kind":"text","text":",\n"},{"kind":"inline-tag","tag":"@link","text":"`$LOCALDATA`","target":412},{"kind":"text","text":", "},{"kind":"inline-tag","tag":"@link","text":"`$DESKTOP`","target":400},{"kind":"text","text":", "},{"kind":"inline-tag","tag":"@link","text":"`$DOCUMENT`","target":402},{"kind":"text","text":",\n"},{"kind":"inline-tag","tag":"@link","text":"`$DOWNLOAD`","target":404},{"kind":"text","text":", "},{"kind":"inline-tag","tag":"@link","text":"`$EXE`","target":406},{"kind":"text","text":", "},{"kind":"inline-tag","tag":"@link","text":"`$FONT`","target":408},{"kind":"text","text":", "},{"kind":"inline-tag","tag":"@link","text":"`$HOME`","target":410},{"kind":"text","text":",\n"},{"kind":"inline-tag","tag":"@link","text":"`$PICTURE`","target":414},{"kind":"text","text":", "},{"kind":"inline-tag","tag":"@link","text":"`$PUBLIC`","target":416},{"kind":"text","text":", "},{"kind":"inline-tag","tag":"@link","text":"`$RUNTIME`","target":423},{"kind":"text","text":",\n"},{"kind":"inline-tag","tag":"@link","text":"`$TEMPLATE`","target":425},{"kind":"text","text":", "},{"kind":"inline-tag","tag":"@link","text":"`$VIDEO`","target":427},{"kind":"text","text":", "},{"kind":"inline-tag","tag":"@link","text":"`$RESOURCE`","target":418},{"kind":"text","text":", "},{"kind":"inline-tag","tag":"@link","text":"`$APP`","target":380},{"kind":"text","text":",\n"},{"kind":"inline-tag","tag":"@link","text":"`$LOG`","target":429},{"kind":"text","text":", "},{"kind":"inline-tag","tag":"@link","text":"`$TEMP`","target":372},{"kind":"text","text":".\n\nTrying to execute any API with a URL not configured on the scope results in a promise rejection due to denied access.\n\nNote that this scope applies to **all** APIs on this module."}]},"children":[{"id":151,"name":"Dir","kind":8388608,"kindString":"Reference","flags":{},"sources":[{"fileName":"fs.ts","line":599,"character":19,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L599"}],"target":108},{"id":168,"name":"writeFile","kind":8388608,"kindString":"Reference","flags":{},"sources":[{"fileName":"fs.ts","line":603,"character":19,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L603"}],"target":160},{"id":108,"name":"BaseDirectory","kind":8,"kindString":"Enumeration","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":126,"name":"App","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"fs.ts","line":98,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L98"}],"type":{"type":"literal","value":18}},{"id":132,"name":"AppCache","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"fs.ts","line":104,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L104"}],"type":{"type":"literal","value":24}},{"id":129,"name":"AppConfig","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"fs.ts","line":101,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L101"}],"type":{"type":"literal","value":21}},{"id":130,"name":"AppData","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"fs.ts","line":102,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L102"}],"type":{"type":"literal","value":22}},{"id":131,"name":"AppLocalData","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"fs.ts","line":103,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L103"}],"type":{"type":"literal","value":23}},{"id":133,"name":"AppLog","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"fs.ts","line":105,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L105"}],"type":{"type":"literal","value":25}},{"id":109,"name":"Audio","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"fs.ts","line":81,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L81"}],"type":{"type":"literal","value":1}},{"id":110,"name":"Cache","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"fs.ts","line":82,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L82"}],"type":{"type":"literal","value":2}},{"id":111,"name":"Config","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"fs.ts","line":83,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L83"}],"type":{"type":"literal","value":3}},{"id":112,"name":"Data","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"fs.ts","line":84,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L84"}],"type":{"type":"literal","value":4}},{"id":114,"name":"Desktop","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"fs.ts","line":86,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L86"}],"type":{"type":"literal","value":6}},{"id":115,"name":"Document","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"fs.ts","line":87,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L87"}],"type":{"type":"literal","value":7}},{"id":116,"name":"Download","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"fs.ts","line":88,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L88"}],"type":{"type":"literal","value":8}},{"id":117,"name":"Executable","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"fs.ts","line":89,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L89"}],"type":{"type":"literal","value":9}},{"id":118,"name":"Font","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"fs.ts","line":90,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L90"}],"type":{"type":"literal","value":10}},{"id":119,"name":"Home","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"fs.ts","line":91,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L91"}],"type":{"type":"literal","value":11}},{"id":113,"name":"LocalData","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"fs.ts","line":85,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L85"}],"type":{"type":"literal","value":5}},{"id":127,"name":"Log","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"fs.ts","line":99,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L99"}],"type":{"type":"literal","value":19}},{"id":120,"name":"Picture","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"fs.ts","line":92,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L92"}],"type":{"type":"literal","value":12}},{"id":121,"name":"Public","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"fs.ts","line":93,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L93"}],"type":{"type":"literal","value":13}},{"id":125,"name":"Resource","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"fs.ts","line":97,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L97"}],"type":{"type":"literal","value":17}},{"id":122,"name":"Runtime","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"fs.ts","line":94,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L94"}],"type":{"type":"literal","value":14}},{"id":128,"name":"Temp","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"fs.ts","line":100,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L100"}],"type":{"type":"literal","value":20}},{"id":123,"name":"Template","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"fs.ts","line":95,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L95"}],"type":{"type":"literal","value":15}},{"id":124,"name":"Video","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"fs.ts","line":96,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L96"}],"type":{"type":"literal","value":16}}],"groups":[{"title":"Enumeration Members","children":[126,132,129,130,131,133,109,110,111,112,114,115,116,117,118,119,113,127,120,121,125,122,128,123,124]}],"sources":[{"fileName":"fs.ts","line":80,"character":12,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L80"}]},{"id":147,"name":"FileEntry","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":150,"name":"children","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Children of this entry if it's a directory; null otherwise"}]},"sources":[{"fileName":"fs.ts","line":167,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L167"}],"type":{"type":"array","elementType":{"type":"reference","id":147,"name":"FileEntry"}}},{"id":149,"name":"name","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Name of the directory/file\ncan be null if the path terminates with "},{"kind":"code","text":"`..`"}]},"sources":[{"fileName":"fs.ts","line":165,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L165"}],"type":{"type":"intrinsic","name":"string"}},{"id":148,"name":"path","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"fs.ts","line":160,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L160"}],"type":{"type":"intrinsic","name":"string"}}],"groups":[{"title":"Properties","children":[150,149,148]}],"sources":[{"fileName":"fs.ts","line":159,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L159"}]},{"id":144,"name":"FsBinaryFileOption","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[{"kind":"text","text":"Options object used to write a binary data to a file."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":146,"name":"contents","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The byte array contents."}]},"sources":[{"fileName":"fs.ts","line":153,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L153"}],"type":{"type":"reference","id":143,"name":"BinaryFileContents"}},{"id":145,"name":"path","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Path to the file to write."}]},"sources":[{"fileName":"fs.ts","line":151,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L151"}],"type":{"type":"intrinsic","name":"string"}}],"groups":[{"title":"Properties","children":[146,145]}],"sources":[{"fileName":"fs.ts","line":149,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L149"}]},{"id":137,"name":"FsDirOptions","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":138,"name":"dir","kind":1024,"kindString":"Property","flags":{"isOptional":true},"sources":[{"fileName":"fs.ts","line":126,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L126"}],"type":{"type":"reference","id":108,"name":"BaseDirectory"}},{"id":139,"name":"recursive","kind":1024,"kindString":"Property","flags":{"isOptional":true},"sources":[{"fileName":"fs.ts","line":127,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L127"}],"type":{"type":"intrinsic","name":"boolean"}}],"groups":[{"title":"Properties","children":[138,139]}],"sources":[{"fileName":"fs.ts","line":125,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L125"}]},{"id":134,"name":"FsOptions","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":136,"name":"append","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the content should overwrite the content of the file or append to it."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.5.0"}]}]},"sources":[{"fileName":"fs.ts","line":118,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L118"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":135,"name":"dir","kind":1024,"kindString":"Property","flags":{"isOptional":true},"sources":[{"fileName":"fs.ts","line":112,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L112"}],"type":{"type":"reference","id":108,"name":"BaseDirectory"}}],"groups":[{"title":"Properties","children":[136,135]}],"sources":[{"fileName":"fs.ts","line":111,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L111"}]},{"id":140,"name":"FsTextFileOption","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[{"kind":"text","text":"Options object used to write a UTF-8 string to a file."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":142,"name":"contents","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The UTF-8 string to write to the file."}]},"sources":[{"fileName":"fs.ts","line":139,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L139"}],"type":{"type":"intrinsic","name":"string"}},{"id":141,"name":"path","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Path to the file to write."}]},"sources":[{"fileName":"fs.ts","line":137,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L137"}],"type":{"type":"intrinsic","name":"string"}}],"groups":[{"title":"Properties","children":[142,141]}],"sources":[{"fileName":"fs.ts","line":135,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L135"}]},{"id":143,"name":"BinaryFileContents","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"fs.ts","line":142,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L142"}],"type":{"type":"union","types":[{"type":"reference","typeArguments":[{"type":"intrinsic","name":"number"}],"name":"Iterable","qualifiedName":"Iterable","package":"typescript"},{"type":"reference","typeArguments":[{"type":"intrinsic","name":"number"}],"name":"ArrayLike","qualifiedName":"ArrayLike","package":"typescript"},{"type":"reference","name":"ArrayBuffer","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer","qualifiedName":"ArrayBuffer","package":"typescript"}]}},{"id":189,"name":"copyFile","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"fs.ts","line":495,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L495"}],"signatures":[{"id":190,"name":"copyFile","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Copies a file to a destination."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { copyFile, BaseDirectory } from '@tauri-apps/api/fs';\n// Copy the `$APPCONFIG/app.conf` file to `$APPCONFIG/app.conf.bk`\nawait copyFile('app.conf', 'app.conf.bk', { dir: BaseDirectory.AppConfig });\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":191,"name":"source","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":192,"name":"destination","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":193,"name":"options","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":134,"name":"FsOptions"},"defaultValue":"{}"}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":181,"name":"createDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"fs.ts","line":440,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L440"}],"signatures":[{"id":182,"name":"createDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Creates a directory.\nIf one of the path's parent components doesn't exist\nand the "},{"kind":"code","text":"`recursive`"},{"kind":"text","text":" option isn't set to true, the promise will be rejected."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { createDir, BaseDirectory } from '@tauri-apps/api/fs';\n// Create the `$APPDATA/users` directory\nawait createDir('users', { dir: BaseDirectory.AppData, recursive: true });\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":183,"name":"dir","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":184,"name":"options","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":137,"name":"FsDirOptions"},"defaultValue":"{}"}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":203,"name":"exists","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"fs.ts","line":578,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L578"}],"signatures":[{"id":204,"name":"exists","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Check if a path exists."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { exists, BaseDirectory } from '@tauri-apps/api/fs';\n// Check if the `$APPDATA/avatar.png` file exists\nawait exists('avatar.png', { dir: BaseDirectory.AppData });\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"parameters":[{"id":205,"name":"path","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":206,"name":"options","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":134,"name":"FsOptions"},"defaultValue":"{}"}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":156,"name":"readBinaryFile","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"fs.ts","line":206,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L206"}],"signatures":[{"id":157,"name":"readBinaryFile","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Reads a file as byte array."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { readBinaryFile, BaseDirectory } from '@tauri-apps/api/fs';\n// Read the image file in the `$RESOURCEDIR/avatar.png` path\nconst contents = await readBinaryFile('avatar.png', { dir: BaseDirectory.Resource });\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":158,"name":"filePath","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":159,"name":"options","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":134,"name":"FsOptions"},"defaultValue":"{}"}],"type":{"type":"reference","typeArguments":[{"type":"reference","name":"Uint8Array","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array","qualifiedName":"Uint8Array","package":"typescript"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":177,"name":"readDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"fs.ts","line":411,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L411"}],"signatures":[{"id":178,"name":"readDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"List directory files."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { readDir, BaseDirectory } from '@tauri-apps/api/fs';\n// Reads the `$APPDATA/users` directory recursively\nconst entries = await readDir('users', { dir: BaseDirectory.AppData, recursive: true });\n\nfunction processEntries(entries) {\n for (const entry of entries) {\n console.log(`Entry: ${entry.path}`);\n if (entry.children) {\n processEntries(entry.children)\n }\n }\n}\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":179,"name":"dir","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":180,"name":"options","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":137,"name":"FsDirOptions"},"defaultValue":"{}"}],"type":{"type":"reference","typeArguments":[{"type":"array","elementType":{"type":"reference","id":147,"name":"FileEntry"}}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":152,"name":"readTextFile","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"fs.ts","line":181,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L181"}],"signatures":[{"id":153,"name":"readTextFile","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Reads a file as an UTF-8 encoded string."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { readTextFile, BaseDirectory } from '@tauri-apps/api/fs';\n// Read the text file in the `$APPCONFIG/app.conf` path\nconst contents = await readTextFile('app.conf', { dir: BaseDirectory.AppConfig });\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":154,"name":"filePath","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":155,"name":"options","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":134,"name":"FsOptions"},"defaultValue":"{}"}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":185,"name":"removeDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"fs.ts","line":468,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L468"}],"signatures":[{"id":186,"name":"removeDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Removes a directory.\nIf the directory is not empty and the "},{"kind":"code","text":"`recursive`"},{"kind":"text","text":" option isn't set to true, the promise will be rejected."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { removeDir, BaseDirectory } from '@tauri-apps/api/fs';\n// Remove the directory `$APPDATA/users`\nawait removeDir('users', { dir: BaseDirectory.AppData });\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":187,"name":"dir","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":188,"name":"options","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":137,"name":"FsDirOptions"},"defaultValue":"{}"}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":194,"name":"removeFile","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"fs.ts","line":524,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L524"}],"signatures":[{"id":195,"name":"removeFile","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Removes a file."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { removeFile, BaseDirectory } from '@tauri-apps/api/fs';\n// Remove the `$APPConfig/app.conf` file\nawait removeFile('app.conf', { dir: BaseDirectory.AppConfig });\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":196,"name":"file","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":197,"name":"options","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":134,"name":"FsOptions"},"defaultValue":"{}"}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":198,"name":"renameFile","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"fs.ts","line":551,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L551"}],"signatures":[{"id":199,"name":"renameFile","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Renames a file."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { renameFile, BaseDirectory } from '@tauri-apps/api/fs';\n// Rename the `$APPDATA/avatar.png` file\nawait renameFile('avatar.png', 'deleted.png', { dir: BaseDirectory.AppData });\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":200,"name":"oldPath","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":201,"name":"newPath","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":202,"name":"options","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":134,"name":"FsOptions"},"defaultValue":"{}"}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":169,"name":"writeBinaryFile","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"fs.ts","line":315,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L315"},{"fileName":"fs.ts","line":336,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L336"},{"fileName":"fs.ts","line":348,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L348"}],"signatures":[{"id":170,"name":"writeBinaryFile","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Writes a byte array content to a file."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { writeBinaryFile, BaseDirectory } from '@tauri-apps/api/fs';\n// Write a binary file to the `$APPDATA/avatar.png` path\nawait writeBinaryFile('avatar.png', new Uint8Array([]), { dir: BaseDirectory.AppData });\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":171,"name":"path","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":172,"name":"contents","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":143,"name":"BinaryFileContents"}},{"id":173,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Configuration object."}]},"type":{"type":"reference","id":134,"name":"FsOptions"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}},{"id":174,"name":"writeBinaryFile","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Writes a byte array content to a file."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { writeBinaryFile, BaseDirectory } from '@tauri-apps/api/fs';\n// Write a binary file to the `$APPDATA/avatar.png` path\nawait writeBinaryFile({ path: 'avatar.png', contents: new Uint8Array([]) }, { dir: BaseDirectory.AppData });\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":175,"name":"file","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The object containing the file path and contents."}]},"type":{"type":"reference","id":144,"name":"FsBinaryFileOption"}},{"id":176,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Configuration object."}]},"type":{"type":"reference","id":134,"name":"FsOptions"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":160,"name":"writeTextFile","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"fs.ts","line":233,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L233"},{"fileName":"fs.ts","line":251,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L251"},{"fileName":"fs.ts","line":263,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L263"}],"signatures":[{"id":161,"name":"writeTextFile","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Writes a UTF-8 text file."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { writeTextFile, BaseDirectory } from '@tauri-apps/api/fs';\n// Write a text file to the `$APPCONFIG/app.conf` path\nawait writeTextFile('app.conf', 'file contents', { dir: BaseDirectory.AppConfig });\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":162,"name":"path","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":163,"name":"contents","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":164,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","id":134,"name":"FsOptions"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}},{"id":165,"name":"writeTextFile","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Writes a UTF-8 text file."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { writeTextFile, BaseDirectory } from '@tauri-apps/api/fs';\n// Write a text file to the `$APPCONFIG/app.conf` path\nawait writeTextFile({ path: 'app.conf', contents: 'file contents' }, { dir: BaseDirectory.AppConfig });\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":166,"name":"file","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":140,"name":"FsTextFileOption"}},{"id":167,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","id":134,"name":"FsOptions"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"References","children":[151,168]},{"title":"Enumerations","children":[108]},{"title":"Interfaces","children":[147,144,137,134,140]},{"title":"Type Aliases","children":[143]},{"title":"Functions","children":[189,181,203,156,177,152,185,194,198,169,160]}],"sources":[{"fileName":"fs.ts","line":75,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/fs.ts#L75"}]},{"id":207,"name":"globalShortcut","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"Register global shortcuts.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.globalShortcut`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":".\n\nThe APIs must be added to ["},{"kind":"code","text":"`tauri.allowlist.globalShortcut`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#allowlistconfig.globalshortcut) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":":\n"},{"kind":"code","text":"```json\n{\n \"tauri\": {\n \"allowlist\": {\n \"globalShortcut\": {\n \"all\": true // enable all global shortcut APIs\n }\n }\n }\n}\n```"},{"kind":"text","text":"\nIt is recommended to allowlist only the APIs you use for optimal bundle size and security."}]},"children":[{"id":208,"name":"ShortcutHandler","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"globalShortcut.ts","line":29,"character":12,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/globalShortcut.ts#L29"}],"type":{"type":"reflection","declaration":{"id":209,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"globalShortcut.ts","line":29,"character":30,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/globalShortcut.ts#L29"}],"signatures":[{"id":210,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":211,"name":"shortcut","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"intrinsic","name":"void"}}]}}},{"id":220,"name":"isRegistered","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"globalShortcut.ts","line":101,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/globalShortcut.ts#L101"}],"signatures":[{"id":221,"name":"isRegistered","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Determines whether the given shortcut is registered by this application or not."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { isRegistered } from '@tauri-apps/api/globalShortcut';\nconst isRegistered = await isRegistered('CommandOrControl+P');\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":222,"name":"shortcut","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Array of shortcut definitions, modifiers and key separated by \"+\" e.g. CmdOrControl+Q"}]},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":212,"name":"register","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"globalShortcut.ts","line":46,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/globalShortcut.ts#L46"}],"signatures":[{"id":213,"name":"register","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Register a global shortcut."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { register } from '@tauri-apps/api/globalShortcut';\nawait register('CommandOrControl+Shift+C', () => {\n console.log('Shortcut triggered');\n});\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":214,"name":"shortcut","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Shortcut definition, modifiers and key separated by \"+\" e.g. CmdOrControl+Q"}]},"type":{"type":"intrinsic","name":"string"}},{"id":215,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Shortcut handler callback - takes the triggered shortcut as argument"}]},"type":{"type":"reference","id":208,"name":"ShortcutHandler"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":216,"name":"registerAll","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"globalShortcut.ts","line":75,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/globalShortcut.ts#L75"}],"signatures":[{"id":217,"name":"registerAll","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Register a collection of global shortcuts."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { registerAll } from '@tauri-apps/api/globalShortcut';\nawait registerAll(['CommandOrControl+Shift+C', 'Ctrl+Alt+F12'], (shortcut) => {\n console.log(`Shortcut ${shortcut} triggered`);\n});\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":218,"name":"shortcuts","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Array of shortcut definitions, modifiers and key separated by \"+\" e.g. CmdOrControl+Q"}]},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}},{"id":219,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Shortcut handler callback - takes the triggered shortcut as argument"}]},"type":{"type":"reference","id":208,"name":"ShortcutHandler"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":223,"name":"unregister","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"globalShortcut.ts","line":123,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/globalShortcut.ts#L123"}],"signatures":[{"id":224,"name":"unregister","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Unregister a global shortcut."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { unregister } from '@tauri-apps/api/globalShortcut';\nawait unregister('CmdOrControl+Space');\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":225,"name":"shortcut","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"shortcut definition, modifiers and key separated by \"+\" e.g. CmdOrControl+Q"}]},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":226,"name":"unregisterAll","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"globalShortcut.ts","line":143,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/globalShortcut.ts#L143"}],"signatures":[{"id":227,"name":"unregisterAll","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Unregisters all shortcuts registered by the application."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { unregisterAll } from '@tauri-apps/api/globalShortcut';\nawait unregisterAll();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Type Aliases","children":[208]},{"title":"Functions","children":[220,212,216,223,226]}],"sources":[{"fileName":"globalShortcut.ts","line":26,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/globalShortcut.ts#L26"}]},{"id":228,"name":"http","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"Access the HTTP client written in Rust.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.http`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":".\n\nThe APIs must be allowlisted on "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":":\n"},{"kind":"code","text":"```json\n{\n \"tauri\": {\n \"allowlist\": {\n \"http\": {\n \"all\": true, // enable all http APIs\n \"request\": true // enable HTTP request API\n }\n }\n }\n}\n```"},{"kind":"text","text":"\nIt is recommended to allowlist only the APIs you use for optimal bundle size and security.\n\n## Security\n\nThis API has a scope configuration that forces you to restrict the URLs and paths that can be accessed using glob patterns.\n\nFor instance, this scope configuration only allows making HTTP requests to the GitHub API for the "},{"kind":"code","text":"`tauri-apps`"},{"kind":"text","text":" organization:\n"},{"kind":"code","text":"```json\n{\n \"tauri\": {\n \"allowlist\": {\n \"http\": {\n \"scope\": [\"https://api.github.com/repos/tauri-apps/*\"]\n }\n }\n }\n}\n```"},{"kind":"text","text":"\nTrying to execute any API with a URL not configured on the scope results in a promise rejection due to denied access."}]},"children":[{"id":325,"name":"ResponseType","kind":8,"kindString":"Enumeration","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":328,"name":"Binary","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"http.ts","line":74,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L74"}],"type":{"type":"literal","value":3}},{"id":326,"name":"JSON","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"http.ts","line":72,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L72"}],"type":{"type":"literal","value":1}},{"id":327,"name":"Text","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"http.ts","line":73,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L73"}],"type":{"type":"literal","value":2}}],"groups":[{"title":"Enumeration Members","children":[328,326,327]}],"sources":[{"fileName":"http.ts","line":71,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L71"}]},{"id":256,"name":"Body","kind":128,"kindString":"Class","flags":{},"comment":{"summary":[{"kind":"text","text":"The body object to be used on POST and PUT requests."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":274,"name":"payload","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"http.ts","line":139,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L139"}],"type":{"type":"intrinsic","name":"unknown"}},{"id":273,"name":"type","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"http.ts","line":138,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L138"}],"type":{"type":"intrinsic","name":"string"}},{"id":266,"name":"bytes","kind":2048,"kindString":"Method","flags":{"isStatic":true},"sources":[{"fileName":"http.ts","line":230,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L230"}],"signatures":[{"id":267,"name":"bytes","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Creates a new byte array body."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { Body } from \"@tauri-apps/api/http\"\nBody.bytes(new Uint8Array([1, 2, 3]));\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The body object ready to be used on the POST and PUT requests."}]}]},"parameters":[{"id":268,"name":"bytes","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The body byte array."}]},"type":{"type":"union","types":[{"type":"reference","typeArguments":[{"type":"intrinsic","name":"number"}],"name":"Iterable","qualifiedName":"Iterable","package":"typescript"},{"type":"reference","name":"ArrayBuffer","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer","qualifiedName":"ArrayBuffer","package":"typescript"},{"type":"reference","typeArguments":[{"type":"intrinsic","name":"number"}],"name":"ArrayLike","qualifiedName":"ArrayLike","package":"typescript"}]}}],"type":{"type":"reference","id":256,"name":"Body"}}]},{"id":257,"name":"form","kind":2048,"kindString":"Method","flags":{"isStatic":true},"sources":[{"fileName":"http.ts","line":179,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L179"}],"signatures":[{"id":258,"name":"form","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Creates a new form data body. The form data is an object where each key is the entry name,\nand the value is either a string or a file object.\n\nBy default it sets the "},{"kind":"code","text":"`application/x-www-form-urlencoded`"},{"kind":"text","text":" Content-Type header,\nbut you can set it to "},{"kind":"code","text":"`multipart/form-data`"},{"kind":"text","text":" if the Cargo feature "},{"kind":"code","text":"`http-multipart`"},{"kind":"text","text":" is enabled.\n\nNote that a file path must be allowed in the "},{"kind":"code","text":"`fs`"},{"kind":"text","text":" allowlist scope."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { Body } from \"@tauri-apps/api/http\"\nconst body = Body.form({\n key: 'value',\n image: {\n file: '/path/to/file', // either a path or an array buffer of the file contents\n mime: 'image/jpeg', // optional\n fileName: 'image.jpg' // optional\n }\n});\n\n// alternatively, use a FormData:\nconst form = new FormData();\nform.append('key', 'value');\nform.append('image', file, 'image.png');\nconst formBody = Body.form(form);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The body object ready to be used on the POST and PUT requests."}]}]},"parameters":[{"id":259,"name":"data","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The body data."}]},"type":{"type":"reference","id":236,"name":"FormInput"}}],"type":{"type":"reference","id":256,"name":"Body"}}]},{"id":260,"name":"json","kind":2048,"kindString":"Method","flags":{"isStatic":true},"sources":[{"fileName":"http.ts","line":198,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L198"}],"signatures":[{"id":261,"name":"json","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Creates a new JSON body."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { Body } from \"@tauri-apps/api/http\"\nBody.json({\n registered: true,\n name: 'tauri'\n});\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The body object ready to be used on the POST and PUT requests."}]}]},"parameters":[{"id":262,"name":"data","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The body JSON object."}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"any"},{"type":"intrinsic","name":"any"}],"name":"Record","externalUrl":"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type","qualifiedName":"Record","package":"typescript"}}],"type":{"type":"reference","id":256,"name":"Body"}}]},{"id":263,"name":"text","kind":2048,"kindString":"Method","flags":{"isStatic":true},"sources":[{"fileName":"http.ts","line":214,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L214"}],"signatures":[{"id":264,"name":"text","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Creates a new UTF-8 string body."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { Body } from \"@tauri-apps/api/http\"\nBody.text('The body content as a string');\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The body object ready to be used on the POST and PUT requests."}]}]},"parameters":[{"id":265,"name":"value","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The body string."}]},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","id":256,"name":"Body"}}]}],"groups":[{"title":"Properties","children":[274,273]},{"title":"Methods","children":[266,257,260,263]}],"sources":[{"fileName":"http.ts","line":137,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L137"}]},{"id":275,"name":"Client","kind":128,"kindString":"Class","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":279,"name":"id","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"http.ts","line":316,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L316"}],"type":{"type":"intrinsic","name":"number"}},{"id":308,"name":"delete","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"http.ts","line":502,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L502"}],"signatures":[{"id":309,"name":"delete","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Makes a DELETE request."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getClient } from '@tauri-apps/api/http';\nconst client = await getClient();\nconst response = await client.delete('http://localhost:3003/users/1');\n```"}]}]},"typeParameter":[{"id":310,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":311,"name":"url","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":312,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","id":246,"name":"RequestOptions"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":313,"typeArguments":[{"type":"reference","id":310,"name":"T"}],"name":"Response"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":280,"name":"drop","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"http.ts","line":331,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L331"}],"signatures":[{"id":281,"name":"drop","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Drops the client instance."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getClient } from '@tauri-apps/api/http';\nconst client = await getClient();\nawait client.drop();\n```"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":286,"name":"get","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"http.ts","line":407,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L407"}],"signatures":[{"id":287,"name":"get","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Makes a GET request."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getClient, ResponseType } from '@tauri-apps/api/http';\nconst client = await getClient();\nconst response = await client.get('http://localhost:3003/users', {\n timeout: 30,\n // the expected response type\n responseType: ResponseType.JSON\n});\n```"}]}]},"typeParameter":[{"id":288,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":289,"name":"url","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":290,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","id":246,"name":"RequestOptions"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":313,"typeArguments":[{"type":"reference","id":288,"name":"T"}],"name":"Response"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":303,"name":"patch","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"http.ts","line":485,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L485"}],"signatures":[{"id":304,"name":"patch","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Makes a PATCH request."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getClient, Body } from '@tauri-apps/api/http';\nconst client = await getClient();\nconst response = await client.patch('http://localhost:3003/users/1', {\n body: Body.json({ email: 'contact@tauri.app' })\n});\n```"}]}]},"typeParameter":[{"id":305,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":306,"name":"url","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":307,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","id":246,"name":"RequestOptions"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":313,"typeArguments":[{"type":"reference","id":305,"name":"T"}],"name":"Response"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":291,"name":"post","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"http.ts","line":431,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L431"}],"signatures":[{"id":292,"name":"post","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Makes a POST request."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getClient, Body, ResponseType } from '@tauri-apps/api/http';\nconst client = await getClient();\nconst response = await client.post('http://localhost:3003/users', {\n body: Body.json({\n name: 'tauri',\n password: 'awesome'\n }),\n // in this case the server returns a simple string\n responseType: ResponseType.Text,\n});\n```"}]}]},"typeParameter":[{"id":293,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":294,"name":"url","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":295,"name":"body","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","id":256,"name":"Body"}},{"id":296,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","id":246,"name":"RequestOptions"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":313,"typeArguments":[{"type":"reference","id":293,"name":"T"}],"name":"Response"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":297,"name":"put","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"http.ts","line":461,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L461"}],"signatures":[{"id":298,"name":"put","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Makes a PUT request."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getClient, Body } from '@tauri-apps/api/http';\nconst client = await getClient();\nconst response = await client.put('http://localhost:3003/users/1', {\n body: Body.form({\n file: {\n file: '/home/tauri/avatar.png',\n mime: 'image/png',\n fileName: 'avatar.png'\n }\n })\n});\n```"}]}]},"typeParameter":[{"id":299,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":300,"name":"url","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":301,"name":"body","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","id":256,"name":"Body"}},{"id":302,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","id":246,"name":"RequestOptions"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":313,"typeArguments":[{"type":"reference","id":299,"name":"T"}],"name":"Response"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":282,"name":"request","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"http.ts","line":353,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L353"}],"signatures":[{"id":283,"name":"request","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Makes an HTTP request."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getClient } from '@tauri-apps/api/http';\nconst client = await getClient();\nconst response = await client.request({\n method: 'GET',\n url: 'http://localhost:3003/users',\n});\n```"}]}]},"typeParameter":[{"id":284,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":285,"name":"options","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":238,"name":"HttpOptions"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":313,"typeArguments":[{"type":"reference","id":284,"name":"T"}],"name":"Response"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Properties","children":[279]},{"title":"Methods","children":[308,280,286,303,291,297,282]}],"sources":[{"fileName":"http.ts","line":315,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L315"}]},{"id":313,"name":"Response","kind":128,"kindString":"Class","flags":{},"comment":{"summary":[{"kind":"text","text":"Response object."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":323,"name":"data","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The response data."}]},"sources":[{"fileName":"http.ts","line":299,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L299"}],"type":{"type":"reference","name":"T"}},{"id":321,"name":"headers","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The response headers."}]},"sources":[{"fileName":"http.ts","line":295,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L295"}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"},{"type":"intrinsic","name":"string"}],"name":"Record","externalUrl":"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type","qualifiedName":"Record","package":"typescript"}},{"id":320,"name":"ok","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"A boolean indicating whether the response was successful (status in the range 200–299) or not."}]},"sources":[{"fileName":"http.ts","line":293,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L293"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":322,"name":"rawHeaders","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The response raw headers."}]},"sources":[{"fileName":"http.ts","line":297,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L297"}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"},{"type":"array","elementType":{"type":"intrinsic","name":"string"}}],"name":"Record","externalUrl":"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type","qualifiedName":"Record","package":"typescript"}},{"id":319,"name":"status","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The response status code."}]},"sources":[{"fileName":"http.ts","line":291,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L291"}],"type":{"type":"intrinsic","name":"number"}},{"id":318,"name":"url","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The request URL."}]},"sources":[{"fileName":"http.ts","line":289,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L289"}],"type":{"type":"intrinsic","name":"string"}}],"groups":[{"title":"Properties","children":[323,321,320,322,319,318]}],"sources":[{"fileName":"http.ts","line":287,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L287"}],"typeParameters":[{"id":324,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}]},{"id":232,"name":"ClientOptions","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":234,"name":"connectTimeout","kind":1024,"kindString":"Property","flags":{"isOptional":true},"sources":[{"fileName":"http.ts","line":65,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L65"}],"type":{"type":"union","types":[{"type":"intrinsic","name":"number"},{"type":"reference","id":229,"name":"Duration"}]}},{"id":233,"name":"maxRedirections","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Defines the maximum number of redirects the client should follow.\nIf set to 0, no redirects will be followed."}]},"sources":[{"fileName":"http.ts","line":64,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L64"}],"type":{"type":"intrinsic","name":"number"}}],"groups":[{"title":"Properties","children":[234,233]}],"sources":[{"fileName":"http.ts","line":59,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L59"}]},{"id":229,"name":"Duration","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":231,"name":"nanos","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"http.ts","line":53,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L53"}],"type":{"type":"intrinsic","name":"number"}},{"id":230,"name":"secs","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"http.ts","line":52,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L52"}],"type":{"type":"intrinsic","name":"number"}}],"groups":[{"title":"Properties","children":[231,230]}],"sources":[{"fileName":"http.ts","line":51,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L51"}]},{"id":329,"name":"FilePart","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":330,"name":"file","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"http.ts","line":81,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L81"}],"type":{"type":"union","types":[{"type":"intrinsic","name":"string"},{"type":"reference","id":333,"name":"T"}]}},{"id":332,"name":"fileName","kind":1024,"kindString":"Property","flags":{"isOptional":true},"sources":[{"fileName":"http.ts","line":83,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L83"}],"type":{"type":"intrinsic","name":"string"}},{"id":331,"name":"mime","kind":1024,"kindString":"Property","flags":{"isOptional":true},"sources":[{"fileName":"http.ts","line":82,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L82"}],"type":{"type":"intrinsic","name":"string"}}],"groups":[{"title":"Properties","children":[330,332,331]}],"sources":[{"fileName":"http.ts","line":80,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L80"}],"typeParameters":[{"id":333,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}]},{"id":238,"name":"HttpOptions","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[{"kind":"text","text":"Options object sent to the backend."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":243,"name":"body","kind":1024,"kindString":"Property","flags":{"isOptional":true},"sources":[{"fileName":"http.ts","line":263,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L263"}],"type":{"type":"reference","id":256,"name":"Body"}},{"id":241,"name":"headers","kind":1024,"kindString":"Property","flags":{"isOptional":true},"sources":[{"fileName":"http.ts","line":261,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L261"}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"},{"type":"intrinsic","name":"any"}],"name":"Record","externalUrl":"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type","qualifiedName":"Record","package":"typescript"}},{"id":239,"name":"method","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"http.ts","line":259,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L259"}],"type":{"type":"reference","id":237,"name":"HttpVerb"}},{"id":242,"name":"query","kind":1024,"kindString":"Property","flags":{"isOptional":true},"sources":[{"fileName":"http.ts","line":262,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L262"}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"},{"type":"intrinsic","name":"any"}],"name":"Record","externalUrl":"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type","qualifiedName":"Record","package":"typescript"}},{"id":245,"name":"responseType","kind":1024,"kindString":"Property","flags":{"isOptional":true},"sources":[{"fileName":"http.ts","line":265,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L265"}],"type":{"type":"reference","id":325,"name":"ResponseType"}},{"id":244,"name":"timeout","kind":1024,"kindString":"Property","flags":{"isOptional":true},"sources":[{"fileName":"http.ts","line":264,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L264"}],"type":{"type":"union","types":[{"type":"intrinsic","name":"number"},{"type":"reference","id":229,"name":"Duration"}]}},{"id":240,"name":"url","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"http.ts","line":260,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L260"}],"type":{"type":"intrinsic","name":"string"}}],"groups":[{"title":"Properties","children":[243,241,239,242,245,244,240]}],"sources":[{"fileName":"http.ts","line":258,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L258"}]},{"id":247,"name":"FetchOptions","kind":4194304,"kindString":"Type alias","flags":{},"comment":{"summary":[{"kind":"text","text":"Options for the "},{"kind":"code","text":"`fetch`"},{"kind":"text","text":" API."}]},"sources":[{"fileName":"http.ts","line":271,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L271"}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":238,"name":"HttpOptions"},{"type":"literal","value":"url"}],"name":"Omit","externalUrl":"https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys","qualifiedName":"Omit","package":"typescript"}},{"id":236,"name":"FormInput","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"http.ts","line":88,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L88"}],"type":{"type":"union","types":[{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"},{"type":"reference","id":235,"name":"Part"}],"name":"Record","externalUrl":"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type","qualifiedName":"Record","package":"typescript"},{"type":"reference","name":"FormData","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/API/FormData","qualifiedName":"FormData","package":"typescript"}]}},{"id":237,"name":"HttpVerb","kind":4194304,"kindString":"Type alias","flags":{},"comment":{"summary":[{"kind":"text","text":"The request HTTP verb."}]},"sources":[{"fileName":"http.ts","line":242,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L242"}],"type":{"type":"union","types":[{"type":"literal","value":"GET"},{"type":"literal","value":"POST"},{"type":"literal","value":"PUT"},{"type":"literal","value":"DELETE"},{"type":"literal","value":"PATCH"},{"type":"literal","value":"HEAD"},{"type":"literal","value":"OPTIONS"},{"type":"literal","value":"CONNECT"},{"type":"literal","value":"TRACE"}]}},{"id":235,"name":"Part","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"http.ts","line":86,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L86"}],"type":{"type":"union","types":[{"type":"intrinsic","name":"string"},{"type":"reference","name":"Uint8Array","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array","qualifiedName":"Uint8Array","package":"typescript"},{"type":"reference","id":329,"typeArguments":[{"type":"reference","name":"Uint8Array","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array","qualifiedName":"Uint8Array","package":"typescript"}],"name":"FilePart"}]}},{"id":246,"name":"RequestOptions","kind":4194304,"kindString":"Type alias","flags":{},"comment":{"summary":[{"kind":"text","text":"Request options."}]},"sources":[{"fileName":"http.ts","line":269,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L269"}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":238,"name":"HttpOptions"},{"type":"union","types":[{"type":"literal","value":"method"},{"type":"literal","value":"url"}]}],"name":"Omit","externalUrl":"https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys","qualifiedName":"Omit","package":"typescript"}},{"id":251,"name":"fetch","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"http.ts","line":549,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L549"}],"signatures":[{"id":252,"name":"fetch","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Perform an HTTP request using the default client."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { fetch } from '@tauri-apps/api/http';\nconst response = await fetch('http://localhost:3003/users/2', {\n method: 'GET',\n timeout: 30,\n});\n```"}]}]},"typeParameter":[{"id":253,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":254,"name":"url","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":255,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","id":247,"name":"FetchOptions"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":313,"typeArguments":[{"type":"reference","id":253,"name":"T"}],"name":"Response"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":248,"name":"getClient","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"http.ts","line":525,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L525"}],"signatures":[{"id":249,"name":"getClient","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Creates a new client using the specified options."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getClient } from '@tauri-apps/api/http';\nconst client = await getClient();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to the client instance."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":250,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Client configuration."}]},"type":{"type":"reference","id":232,"name":"ClientOptions"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":275,"name":"Client"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Enumerations","children":[325]},{"title":"Classes","children":[256,275,313]},{"title":"Interfaces","children":[232,229,329,238]},{"title":"Type Aliases","children":[247,236,237,235,246]},{"title":"Functions","children":[251,248]}],"sources":[{"fileName":"http.ts","line":46,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/http.ts#L46"}]},{"id":334,"name":"mocks","kind":2,"kindString":"Module","flags":{},"children":[{"id":346,"name":"clearMocks","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"mocks.ts","line":171,"character":16,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/mocks.ts#L171"}],"signatures":[{"id":347,"name":"clearMocks","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Clears mocked functions/data injected by the other functions in this module.\nWhen using a test runner that doesn't provide a fresh window object for each test, calling this function will reset tauri specific properties.\n\n# Example\n\n"},{"kind":"code","text":"```js\nimport { mockWindows, clearMocks } from \"@tauri-apps/api/mocks\"\n\nafterEach(() => {\n clearMocks()\n})\n\ntest(\"mocked windows\", () => {\n mockWindows(\"main\", \"second\", \"third\");\n\n expect(window).toHaveProperty(\"__TAURI_METADATA__\")\n})\n\ntest(\"no mocked windows\", () => {\n expect(window).not.toHaveProperty(\"__TAURI_METADATA__\")\n})\n```"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"intrinsic","name":"void"}}]},{"id":335,"name":"mockIPC","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"mocks.ts","line":65,"character":16,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/mocks.ts#L65"}],"signatures":[{"id":336,"name":"mockIPC","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Intercepts all IPC requests with the given mock handler.\n\nThis function can be used when testing tauri frontend applications or when running the frontend in a Node.js context during static site generation.\n\n# Examples\n\nTesting setup using vitest:\n"},{"kind":"code","text":"```js\nimport { mockIPC, clearMocks } from \"@tauri-apps/api/mocks\"\nimport { invoke } from \"@tauri-apps/api/tauri\"\n\nafterEach(() => {\n clearMocks()\n})\n\ntest(\"mocked command\", () => {\n mockIPC((cmd, args) => {\n switch (cmd) {\n case \"add\":\n return (args.a as number) + (args.b as number);\n default:\n break;\n }\n });\n\n expect(invoke('add', { a: 12, b: 15 })).resolves.toBe(27);\n})\n```"},{"kind":"text","text":"\n\nThe callback function can also return a Promise:\n"},{"kind":"code","text":"```js\nimport { mockIPC, clearMocks } from \"@tauri-apps/api/mocks\"\nimport { invoke } from \"@tauri-apps/api/tauri\"\n\nafterEach(() => {\n clearMocks()\n})\n\ntest(\"mocked command\", () => {\n mockIPC((cmd, args) => {\n if(cmd === \"get_data\") {\n return fetch(\"https://example.com/data.json\")\n .then((response) => response.json())\n }\n });\n\n expect(invoke('get_data')).resolves.toBe({ foo: 'bar' });\n})\n```"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":337,"name":"cb","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":338,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"mocks.ts","line":66,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/mocks.ts#L66"}],"signatures":[{"id":339,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":340,"name":"cmd","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":341,"name":"args","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"},{"type":"intrinsic","name":"unknown"}],"name":"Record","externalUrl":"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type","qualifiedName":"Record","package":"typescript"}}],"type":{"type":"intrinsic","name":"any"}}]}}}],"type":{"type":"intrinsic","name":"void"}}]},{"id":342,"name":"mockWindows","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"mocks.ts","line":135,"character":16,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/mocks.ts#L135"}],"signatures":[{"id":343,"name":"mockWindows","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Mocks one or many window labels.\nIn non-tauri context it is required to call this function *before* using the "},{"kind":"code","text":"`@tauri-apps/api/window`"},{"kind":"text","text":" module.\n\nThis function only mocks the *presence* of windows,\nwindow properties (e.g. width and height) can be mocked like regular IPC calls using the "},{"kind":"code","text":"`mockIPC`"},{"kind":"text","text":" function.\n\n# Examples\n\n"},{"kind":"code","text":"```js\nimport { mockWindows } from \"@tauri-apps/api/mocks\";\nimport { getCurrent } from \"@tauri-apps/api/window\";\n\nmockWindows(\"main\", \"second\", \"third\");\n\nconst win = getCurrent();\n\nwin.label // \"main\"\n```"},{"kind":"text","text":"\n\n"},{"kind":"code","text":"```js\nimport { mockWindows } from \"@tauri-apps/api/mocks\";\n\nmockWindows(\"main\", \"second\", \"third\");\n\nmockIPC((cmd, args) => {\n if (cmd === \"tauri\") {\n if (\n args?.__tauriModule === \"Window\" &&\n args?.message?.cmd === \"manage\" &&\n args?.message?.data?.cmd?.type === \"close\"\n ) {\n console.log('closing window!');\n }\n }\n});\n\nconst { getCurrent } = await import(\"@tauri-apps/api/window\");\n\nconst win = getCurrent();\nawait win.close(); // this will cause the mocked IPC handler to log to the console.\n```"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":344,"name":"current","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Label of window this JavaScript context is running in."}]},"type":{"type":"intrinsic","name":"string"}},{"id":345,"name":"additionalWindows","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"comment":{"summary":[{"kind":"text","text":"Label of additional windows the app has."}]},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}}],"type":{"type":"intrinsic","name":"void"}}]}],"groups":[{"title":"Functions","children":[346,335,342]}],"sources":[{"fileName":"mocks.ts","line":5,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/mocks.ts#L5"}]},{"id":348,"name":"notification","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"Send toast notifications (brief auto-expiring OS window element) to your user.\nCan also be used with the Notification Web API.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.notification`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":".\n\nThe APIs must be added to ["},{"kind":"code","text":"`tauri.allowlist.notification`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#allowlistconfig.notification) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":":\n"},{"kind":"code","text":"```json\n{\n \"tauri\": {\n \"allowlist\": {\n \"notification\": {\n \"all\": true // enable all notification APIs\n }\n }\n }\n}\n```"},{"kind":"text","text":"\nIt is recommended to allowlist only the APIs you use for optimal bundle size and security."}]},"children":[{"id":349,"name":"Options","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[{"kind":"text","text":"Options to send a notification."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":351,"name":"body","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Optional notification body."}]},"sources":[{"fileName":"notification.ts","line":38,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/notification.ts#L38"}],"type":{"type":"intrinsic","name":"string"}},{"id":352,"name":"icon","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Optional notification icon."}]},"sources":[{"fileName":"notification.ts","line":40,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/notification.ts#L40"}],"type":{"type":"intrinsic","name":"string"}},{"id":353,"name":"sound","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Optional notification sound.\n\n#### Platform-specific\n\nEach OS has a different sound name so you will need to conditionally specify an appropriate sound\nbased on the OS in use, 'default' represents the default system sound. For a list of sounds see:\n- **Linux**: can be one of the sounds listed in "},{"kind":"inline-tag","tag":"@link","text":"https://0pointer.de/public/sound-naming-spec.html","target":"https://0pointer.de/public/sound-naming-spec.html"},{"kind":"text","text":"\n- **Windows**: can be one of the sounds listed in "},{"kind":"inline-tag","tag":"@link","text":"https://learn.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-audio","target":"https://learn.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-audio"},{"kind":"text","text":"\n but without the prefix, for example, if "},{"kind":"code","text":"`ms-winsoundevent:Notification.Default`"},{"kind":"text","text":" you would use "},{"kind":"code","text":"`Default`"},{"kind":"text","text":" and\n if "},{"kind":"code","text":"`ms-winsoundevent:Notification.Looping.Alarm2`"},{"kind":"text","text":", you would use "},{"kind":"code","text":"`Alarm2`"},{"kind":"text","text":".\n Windows 7 is not supported, if a sound is provided, it will play the default sound, otherwise it will be silent.\n- **macOS**: you can specify the name of the sound you'd like to play when the notification is shown.\nAny of the default sounds (under System Preferences > Sound) can be used, in addition to custom sound files.\nBe sure that the sound file is copied under the app bundle (e.g., "},{"kind":"code","text":"`YourApp.app/Contents/Resources`"},{"kind":"text","text":"), or one of the following locations:\n - "},{"kind":"code","text":"`~/Library/Sounds`"},{"kind":"text","text":"\n - "},{"kind":"code","text":"`/Library/Sounds`"},{"kind":"text","text":"\n - "},{"kind":"code","text":"`/Network/Library/Sounds`"},{"kind":"text","text":"\n - "},{"kind":"code","text":"`/System/Library/Sounds`"},{"kind":"text","text":"\n\n See the "},{"kind":"inline-tag","tag":"@link","text":"NSSound","target":"https://developer.apple.com/documentation/appkit/nssound"},{"kind":"text","text":" docs for more information."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.5.0"}]}]},"sources":[{"fileName":"notification.ts","line":65,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/notification.ts#L65"}],"type":{"type":"intrinsic","name":"string"}},{"id":350,"name":"title","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Notification title."}]},"sources":[{"fileName":"notification.ts","line":36,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/notification.ts#L36"}],"type":{"type":"intrinsic","name":"string"}}],"groups":[{"title":"Properties","children":[351,352,353,350]}],"sources":[{"fileName":"notification.ts","line":34,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/notification.ts#L34"}]},{"id":354,"name":"Permission","kind":4194304,"kindString":"Type alias","flags":{},"comment":{"summary":[{"kind":"text","text":"Possible permission values."}]},"sources":[{"fileName":"notification.ts","line":69,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/notification.ts#L69"}],"type":{"type":"union","types":[{"type":"literal","value":"granted"},{"type":"literal","value":"denied"},{"type":"literal","value":"default"}]}},{"id":360,"name":"isPermissionGranted","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"notification.ts","line":81,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/notification.ts#L81"}],"signatures":[{"id":361,"name":"isPermissionGranted","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Checks if the permission to send notifications is granted."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { isPermissionGranted } from '@tauri-apps/api/notification';\nconst permissionGranted = await isPermissionGranted();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":358,"name":"requestPermission","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"notification.ts","line":109,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/notification.ts#L109"}],"signatures":[{"id":359,"name":"requestPermission","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Requests the permission to send notifications."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { isPermissionGranted, requestPermission } from '@tauri-apps/api/notification';\nlet permissionGranted = await isPermissionGranted();\nif (!permissionGranted) {\n const permission = await requestPermission();\n permissionGranted = permission === 'granted';\n}\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to whether the user granted the permission or not."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"reference","id":354,"name":"Permission"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":355,"name":"sendNotification","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"notification.ts","line":131,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/notification.ts#L131"}],"signatures":[{"id":356,"name":"sendNotification","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sends a notification to the user."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { isPermissionGranted, requestPermission, sendNotification } from '@tauri-apps/api/notification';\nlet permissionGranted = await isPermissionGranted();\nif (!permissionGranted) {\n const permission = await requestPermission();\n permissionGranted = permission === 'granted';\n}\nif (permissionGranted) {\n sendNotification('Tauri is awesome!');\n sendNotification({ title: 'TAURI', body: 'Tauri is awesome!' });\n}\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":357,"name":"options","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"union","types":[{"type":"intrinsic","name":"string"},{"type":"reference","id":349,"name":"Options"}]}}],"type":{"type":"intrinsic","name":"void"}}]}],"groups":[{"title":"Interfaces","children":[349]},{"title":"Type Aliases","children":[354]},{"title":"Functions","children":[360,358,355]}],"sources":[{"fileName":"notification.ts","line":27,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/notification.ts#L27"}]},{"id":362,"name":"os","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"Provides operating system-related utility methods and properties.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.os`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":".\n\nThe APIs must be added to ["},{"kind":"code","text":"`tauri.allowlist.os`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#allowlistconfig.os) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":":\n"},{"kind":"code","text":"```json\n{\n \"tauri\": {\n \"allowlist\": {\n \"os\": {\n \"all\": true, // enable all Os APIs\n }\n }\n }\n}\n```"},{"kind":"text","text":"\nIt is recommended to allowlist only the APIs you use for optimal bundle size and security."}]},"children":[{"id":378,"name":"Arch","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"os.ts","line":43,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/os.ts#L43"}],"type":{"type":"union","types":[{"type":"literal","value":"x86"},{"type":"literal","value":"x86_64"},{"type":"literal","value":"arm"},{"type":"literal","value":"aarch64"},{"type":"literal","value":"mips"},{"type":"literal","value":"mips64"},{"type":"literal","value":"powerpc"},{"type":"literal","value":"powerpc64"},{"type":"literal","value":"riscv64"},{"type":"literal","value":"s390x"},{"type":"literal","value":"sparc64"}]}},{"id":377,"name":"OsType","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"os.ts","line":41,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/os.ts#L41"}],"type":{"type":"union","types":[{"type":"literal","value":"Linux"},{"type":"literal","value":"Darwin"},{"type":"literal","value":"Windows_NT"}]}},{"id":376,"name":"Platform","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"os.ts","line":29,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/os.ts#L29"}],"type":{"type":"union","types":[{"type":"literal","value":"linux"},{"type":"literal","value":"darwin"},{"type":"literal","value":"ios"},{"type":"literal","value":"freebsd"},{"type":"literal","value":"dragonfly"},{"type":"literal","value":"netbsd"},{"type":"literal","value":"openbsd"},{"type":"literal","value":"solaris"},{"type":"literal","value":"android"},{"type":"literal","value":"win32"}]}},{"id":363,"name":"EOL","kind":32,"kindString":"Variable","flags":{"isConst":true},"comment":{"summary":[{"kind":"text","text":"The operating system-specific end-of-line marker.\n- "},{"kind":"code","text":"`\\n`"},{"kind":"text","text":" on POSIX\n- "},{"kind":"code","text":"`\\r\\n`"},{"kind":"text","text":" on Windows"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"sources":[{"fileName":"os.ts","line":63,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/os.ts#L63"}],"type":{"type":"union","types":[{"type":"literal","value":"\n"},{"type":"literal","value":"\r\n"}]},"defaultValue":"..."},{"id":370,"name":"arch","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"os.ts","line":135,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/os.ts#L135"}],"signatures":[{"id":371,"name":"arch","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the operating system CPU architecture for which the tauri app was compiled.\nPossible values are "},{"kind":"code","text":"`'x86'`"},{"kind":"text","text":", "},{"kind":"code","text":"`'x86_64'`"},{"kind":"text","text":", "},{"kind":"code","text":"`'arm'`"},{"kind":"text","text":", "},{"kind":"code","text":"`'aarch64'`"},{"kind":"text","text":", "},{"kind":"code","text":"`'mips'`"},{"kind":"text","text":", "},{"kind":"code","text":"`'mips64'`"},{"kind":"text","text":", "},{"kind":"code","text":"`'powerpc'`"},{"kind":"text","text":", "},{"kind":"code","text":"`'powerpc64'`"},{"kind":"text","text":", "},{"kind":"code","text":"`'riscv64'`"},{"kind":"text","text":", "},{"kind":"code","text":"`'s390x'`"},{"kind":"text","text":", "},{"kind":"code","text":"`'sparc64'`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { arch } from '@tauri-apps/api/os';\nconst archName = await arch();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"reference","id":378,"name":"Arch"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":374,"name":"locale","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"os.ts","line":176,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/os.ts#L176"}],"signatures":[{"id":375,"name":"locale","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns a String with a "},{"kind":"code","text":"`BCP-47`"},{"kind":"text","text":" language tag inside. If the locale couldn’t be obtained, "},{"kind":"code","text":"`null`"},{"kind":"text","text":" is returned instead."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { locale } from '@tauri-apps/api/os';\nconst locale = await locale();\nif (locale) {\n // use the locale string here\n}\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.4.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"union","types":[{"type":"intrinsic","name":"string"},{"type":"literal","value":null}]}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":364,"name":"platform","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"os.ts","line":77,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/os.ts#L77"}],"signatures":[{"id":365,"name":"platform","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns a string identifying the operating system platform.\nThe value is set at compile time. Possible values are "},{"kind":"code","text":"`'linux'`"},{"kind":"text","text":", "},{"kind":"code","text":"`'darwin'`"},{"kind":"text","text":", "},{"kind":"code","text":"`'ios'`"},{"kind":"text","text":", "},{"kind":"code","text":"`'freebsd'`"},{"kind":"text","text":", "},{"kind":"code","text":"`'dragonfly'`"},{"kind":"text","text":", "},{"kind":"code","text":"`'netbsd'`"},{"kind":"text","text":", "},{"kind":"code","text":"`'openbsd'`"},{"kind":"text","text":", "},{"kind":"code","text":"`'solaris'`"},{"kind":"text","text":", "},{"kind":"code","text":"`'android'`"},{"kind":"text","text":", "},{"kind":"code","text":"`'win32'`"}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { platform } from '@tauri-apps/api/os';\nconst platformName = await platform();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"reference","id":376,"name":"Platform"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":372,"name":"tempdir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"os.ts","line":154,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/os.ts#L154"}],"signatures":[{"id":373,"name":"tempdir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the operating system's default directory for temporary files as a string."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { tempdir } from '@tauri-apps/api/os';\nconst tempdirPath = await tempdir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":368,"name":"type","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"os.ts","line":115,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/os.ts#L115"}],"signatures":[{"id":369,"name":"type","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns "},{"kind":"code","text":"`'Linux'`"},{"kind":"text","text":" on Linux, "},{"kind":"code","text":"`'Darwin'`"},{"kind":"text","text":" on macOS, and "},{"kind":"code","text":"`'Windows_NT'`"},{"kind":"text","text":" on Windows."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { type } from '@tauri-apps/api/os';\nconst osType = await type();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"reference","id":377,"name":"OsType"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":366,"name":"version","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"os.ts","line":96,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/os.ts#L96"}],"signatures":[{"id":367,"name":"version","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns a string identifying the kernel version."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { version } from '@tauri-apps/api/os';\nconst osVersion = await version();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Type Aliases","children":[378,377,376]},{"title":"Variables","children":[363]},{"title":"Functions","children":[370,374,364,372,368,366]}],"sources":[{"fileName":"os.ts","line":26,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/os.ts#L26"}]},{"id":379,"name":"path","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"The path module provides utilities for working with file and directory paths.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.path`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":".\n\nThe APIs must be added to ["},{"kind":"code","text":"`tauri.allowlist.path`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#allowlistconfig.path) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":":\n"},{"kind":"code","text":"```json\n{\n \"tauri\": {\n \"allowlist\": {\n \"path\": {\n \"all\": true, // enable all Path APIs\n }\n }\n }\n}\n```"},{"kind":"text","text":"\nIt is recommended to allowlist only the APIs you use for optimal bundle size and security."}]},"children":[{"id":1177,"name":"BaseDirectory","kind":8388608,"kindString":"Reference","flags":{},"sources":[{"fileName":"path.ts","line":839,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L839"}],"target":108},{"id":432,"name":"delimiter","kind":32,"kindString":"Variable","flags":{"isConst":true},"comment":{"summary":[{"kind":"text","text":"Provides the platform-specific path segment delimiter:\n- "},{"kind":"code","text":"`;`"},{"kind":"text","text":" on Windows\n- "},{"kind":"code","text":"`:`"},{"kind":"text","text":" on POSIX"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"sources":[{"fileName":"path.ts","line":660,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L660"}],"type":{"type":"union","types":[{"type":"literal","value":";"},{"type":"literal","value":":"}]},"defaultValue":"..."},{"id":431,"name":"sep","kind":32,"kindString":"Variable","flags":{"isConst":true},"comment":{"summary":[{"kind":"text","text":"Provides the platform-specific path segment separator:\n- "},{"kind":"code","text":"`\\` on Windows\n- `"},{"kind":"text","text":"/` on POSIX"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"sources":[{"fileName":"path.ts","line":651,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L651"}],"type":{"type":"union","types":[{"type":"literal","value":"\\"},{"type":"literal","value":"/"}]},"defaultValue":"..."},{"id":388,"name":"appCacheDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":117,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L117"}],"signatures":[{"id":389,"name":"appCacheDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the suggested directory for your app's cache files.\nResolves to "},{"kind":"code","text":"`${cacheDir}/${bundleIdentifier}`"},{"kind":"text","text":", where "},{"kind":"code","text":"`bundleIdentifier`"},{"kind":"text","text":" is the value ["},{"kind":"code","text":"`tauri.bundle.identifier`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#bundleconfig.identifier) is configured in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appCacheDir } from '@tauri-apps/api/path';\nconst appCacheDirPath = await appCacheDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.2.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":382,"name":"appConfigDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":51,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L51"}],"signatures":[{"id":383,"name":"appConfigDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the suggested directory for your app's config files.\nResolves to "},{"kind":"code","text":"`${configDir}/${bundleIdentifier}`"},{"kind":"text","text":", where "},{"kind":"code","text":"`bundleIdentifier`"},{"kind":"text","text":" is the value ["},{"kind":"code","text":"`tauri.bundle.identifier`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#bundleconfig.identifier) is configured in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appConfigDir } from '@tauri-apps/api/path';\nconst appConfigDirPath = await appConfigDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.2.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":384,"name":"appDataDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":73,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L73"}],"signatures":[{"id":385,"name":"appDataDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the suggested directory for your app's data files.\nResolves to "},{"kind":"code","text":"`${dataDir}/${bundleIdentifier}`"},{"kind":"text","text":", where "},{"kind":"code","text":"`bundleIdentifier`"},{"kind":"text","text":" is the value ["},{"kind":"code","text":"`tauri.bundle.identifier`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#bundleconfig.identifier) is configured in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appDataDir } from '@tauri-apps/api/path';\nconst appDataDirPath = await appDataDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.2.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":380,"name":"appDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":36,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L36"}],"signatures":[{"id":381,"name":"appDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the suggested directory for your app config files."}],"blockTags":[{"tag":"@deprecated","content":[{"kind":"text","text":"since 1.2.0: Will be removed in 2.0.0. Use "},{"kind":"inline-tag","tag":"@link","text":"appConfigDir","target":382},{"kind":"text","text":" or "},{"kind":"inline-tag","tag":"@link","text":"appDataDir","target":384},{"kind":"text","text":" instead."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":386,"name":"appLocalDataDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":95,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L95"}],"signatures":[{"id":387,"name":"appLocalDataDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the suggested directory for your app's local data files.\nResolves to "},{"kind":"code","text":"`${localDataDir}/${bundleIdentifier}`"},{"kind":"text","text":", where "},{"kind":"code","text":"`bundleIdentifier`"},{"kind":"text","text":" is the value ["},{"kind":"code","text":"`tauri.bundle.identifier`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#bundleconfig.identifier) is configured in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appLocalDataDir } from '@tauri-apps/api/path';\nconst appLocalDataDirPath = await appLocalDataDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.2.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":390,"name":"appLogDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":633,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L633"}],"signatures":[{"id":391,"name":"appLogDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the suggested directory for your app's log files.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`${configDir}/${bundleIdentifier}/logs`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`${homeDir}/Library/Logs/{bundleIdentifier}`"},{"kind":"text","text":"\n- **Windows:** Resolves to "},{"kind":"code","text":"`${configDir}/${bundleIdentifier}/logs`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appLogDir } from '@tauri-apps/api/path';\nconst appLogDirPath = await appLogDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.2.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":392,"name":"audioDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":144,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L144"}],"signatures":[{"id":393,"name":"audioDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's audio directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_MUSIC_DIR`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Music`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Music}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { audioDir } from '@tauri-apps/api/path';\nconst audioDirPath = await audioDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":448,"name":"basename","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":782,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L782"}],"signatures":[{"id":449,"name":"basename","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the last portion of a "},{"kind":"code","text":"`path`"},{"kind":"text","text":". Trailing directory separators are ignored."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { basename, resolveResource } from '@tauri-apps/api/path';\nconst resourcePath = await resolveResource('app.conf');\nconst base = await basename(resourcePath);\nassert(base === 'app.conf');\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":450,"name":"path","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":451,"name":"ext","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"An optional file extension to be removed from the returned path."}]},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":394,"name":"cacheDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":171,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L171"}],"signatures":[{"id":395,"name":"cacheDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's cache directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_CACHE_HOME`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$HOME/.cache`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Library/Caches`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_LocalAppData}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { cacheDir } from '@tauri-apps/api/path';\nconst cacheDirPath = await cacheDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":396,"name":"configDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":198,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L198"}],"signatures":[{"id":397,"name":"configDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's config directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_CONFIG_HOME`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$HOME/.config`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Library/Application Support`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_RoamingAppData}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { configDir } from '@tauri-apps/api/path';\nconst configDirPath = await configDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":398,"name":"dataDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":225,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L225"}],"signatures":[{"id":399,"name":"dataDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's data directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_DATA_HOME`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$HOME/.local/share`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Library/Application Support`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_RoamingAppData}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { dataDir } from '@tauri-apps/api/path';\nconst dataDirPath = await dataDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":400,"name":"desktopDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":252,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L252"}],"signatures":[{"id":401,"name":"desktopDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's desktop directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_DESKTOP_DIR`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Desktop`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Desktop}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { desktopDir } from '@tauri-apps/api/path';\nconst desktopPath = await desktopDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":442,"name":"dirname","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":736,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L736"}],"signatures":[{"id":443,"name":"dirname","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the directory name of a "},{"kind":"code","text":"`path`"},{"kind":"text","text":". Trailing directory separators are ignored."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { dirname, appDataDir } from '@tauri-apps/api/path';\nconst appDataDirPath = await appDataDir();\nconst dir = await dirname(appDataDirPath);\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":444,"name":"path","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":402,"name":"documentDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":279,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L279"}],"signatures":[{"id":403,"name":"documentDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's document directory."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { documentDir } from '@tauri-apps/api/path';\nconst documentDirPath = await documentDir();\n```"},{"kind":"text","text":"\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_DOCUMENTS_DIR`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Documents`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Documents}`"},{"kind":"text","text":"."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":404,"name":"downloadDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":306,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L306"}],"signatures":[{"id":405,"name":"downloadDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's download directory.\n\n#### Platform-specific\n\n- **Linux**: Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_DOWNLOAD_DIR`"},{"kind":"text","text":".\n- **macOS**: Resolves to "},{"kind":"code","text":"`$HOME/Downloads`"},{"kind":"text","text":".\n- **Windows**: Resolves to "},{"kind":"code","text":"`{FOLDERID_Downloads}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { downloadDir } from '@tauri-apps/api/path';\nconst downloadDirPath = await downloadDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":406,"name":"executableDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":333,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L333"}],"signatures":[{"id":407,"name":"executableDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's executable directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_BIN_HOME/../bin`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$XDG_DATA_HOME/../bin`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$HOME/.local/bin`"},{"kind":"text","text":".\n- **macOS:** Not supported.\n- **Windows:** Not supported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { executableDir } from '@tauri-apps/api/path';\nconst executableDirPath = await executableDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":445,"name":"extname","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":758,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L758"}],"signatures":[{"id":446,"name":"extname","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the extension of the "},{"kind":"code","text":"`path`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { extname, resolveResource } from '@tauri-apps/api/path';\nconst resourcePath = await resolveResource('app.conf');\nconst ext = await extname(resourcePath);\nassert(ext === 'conf');\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":447,"name":"path","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":408,"name":"fontDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":360,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L360"}],"signatures":[{"id":409,"name":"fontDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's font directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_DATA_HOME/fonts`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$HOME/.local/share/fonts`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Library/Fonts`"},{"kind":"text","text":".\n- **Windows:** Not supported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { fontDir } from '@tauri-apps/api/path';\nconst fontDirPath = await fontDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":410,"name":"homeDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":387,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L387"}],"signatures":[{"id":411,"name":"homeDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's home directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$HOME`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Profile}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { homeDir } from '@tauri-apps/api/path';\nconst homeDirPath = await homeDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":452,"name":"isAbsolute","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":803,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L803"}],"signatures":[{"id":453,"name":"isAbsolute","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns whether the path is absolute or not."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { isAbsolute } from '@tauri-apps/api/path';\nassert(await isAbsolute('/home/tauri'));\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":454,"name":"path","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":439,"name":"join","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":715,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L715"}],"signatures":[{"id":440,"name":"join","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Joins all given "},{"kind":"code","text":"`path`"},{"kind":"text","text":" segments together using the platform-specific separator as a delimiter, then normalizes the resulting path."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { join, appDataDir } from '@tauri-apps/api/path';\nconst appDataDirPath = await appDataDir();\nconst path = await join(appDataDirPath, 'users', 'tauri', 'avatar.png');\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":441,"name":"paths","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":412,"name":"localDataDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":414,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L414"}],"signatures":[{"id":413,"name":"localDataDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's local data directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_DATA_HOME`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$HOME/.local/share`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Library/Application Support`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_LocalAppData}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { localDataDir } from '@tauri-apps/api/path';\nconst localDataDirPath = await localDataDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":429,"name":"logDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":613,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L613"}],"signatures":[{"id":430,"name":"logDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the suggested log directory."}],"blockTags":[{"tag":"@deprecated","content":[{"kind":"text","text":"since 1.2.0: Will be removed in 2.0.0. Use "},{"kind":"inline-tag","tag":"@link","text":"appLogDir","target":390},{"kind":"text","text":" instead."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":436,"name":"normalize","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":694,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L694"}],"signatures":[{"id":437,"name":"normalize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Normalizes the given "},{"kind":"code","text":"`path`"},{"kind":"text","text":", resolving "},{"kind":"code","text":"`'..'`"},{"kind":"text","text":" and "},{"kind":"code","text":"`'.'`"},{"kind":"text","text":" segments and resolve symbolic links."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { normalize, appDataDir } from '@tauri-apps/api/path';\nconst appDataDirPath = await appDataDir();\nconst path = await normalize(appDataDirPath, '..', 'users', 'tauri', 'avatar.png');\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":438,"name":"path","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":414,"name":"pictureDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":441,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L441"}],"signatures":[{"id":415,"name":"pictureDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's picture directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_PICTURES_DIR`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Pictures`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Pictures}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { pictureDir } from '@tauri-apps/api/path';\nconst pictureDirPath = await pictureDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":416,"name":"publicDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":468,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L468"}],"signatures":[{"id":417,"name":"publicDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's public directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_PUBLICSHARE_DIR`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Public`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Public}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { publicDir } from '@tauri-apps/api/path';\nconst publicDirPath = await publicDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":433,"name":"resolve","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":673,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L673"}],"signatures":[{"id":434,"name":"resolve","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Resolves a sequence of "},{"kind":"code","text":"`paths`"},{"kind":"text","text":" or "},{"kind":"code","text":"`path`"},{"kind":"text","text":" segments into an absolute path."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { resolve, appDataDir } from '@tauri-apps/api/path';\nconst appDataDirPath = await appDataDir();\nconst path = await resolve(appDataDirPath, '..', 'users', 'tauri', 'avatar.png');\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":435,"name":"paths","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":420,"name":"resolveResource","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":515,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L515"}],"signatures":[{"id":421,"name":"resolveResource","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Resolve the path to a resource file."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { resolveResource } from '@tauri-apps/api/path';\nconst resourcePath = await resolveResource('script.sh');\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The full path to the resource."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":422,"name":"resourcePath","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The path to the resource.\nMust follow the same syntax as defined in "},{"kind":"code","text":"`tauri.conf.json > tauri > bundle > resources`"},{"kind":"text","text":", i.e. keeping subfolders and parent dir components ("},{"kind":"code","text":"`../`"},{"kind":"text","text":")."}]},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":418,"name":"resourceDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":490,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L490"}],"signatures":[{"id":419,"name":"resourceDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the application's resource directory.\nTo resolve a resource path, see the [[resolveResource | "},{"kind":"code","text":"`resolveResource API`"},{"kind":"text","text":"]]."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { resourceDir } from '@tauri-apps/api/path';\nconst resourceDirPath = await resourceDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":423,"name":"runtimeDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":542,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L542"}],"signatures":[{"id":424,"name":"runtimeDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's runtime directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_RUNTIME_DIR`"},{"kind":"text","text":".\n- **macOS:** Not supported.\n- **Windows:** Not supported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { runtimeDir } from '@tauri-apps/api/path';\nconst runtimeDirPath = await runtimeDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":425,"name":"templateDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":569,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L569"}],"signatures":[{"id":426,"name":"templateDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's template directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_TEMPLATES_DIR`"},{"kind":"text","text":".\n- **macOS:** Not supported.\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Templates}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { templateDir } from '@tauri-apps/api/path';\nconst templateDirPath = await templateDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":427,"name":"videoDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":596,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L596"}],"signatures":[{"id":428,"name":"videoDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's video directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_VIDEOS_DIR`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Movies`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Videos}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { videoDir } from '@tauri-apps/api/path';\nconst videoDirPath = await videoDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"References","children":[1177]},{"title":"Variables","children":[432,431]},{"title":"Functions","children":[388,382,384,380,386,390,392,448,394,396,398,400,442,402,404,406,445,408,410,452,439,412,429,436,414,416,433,420,418,423,425,427]}],"sources":[{"fileName":"path.ts","line":26,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L26"}]},{"id":455,"name":"process","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"Perform operations on the current process.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.process`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":"."}]},"children":[{"id":456,"name":"exit","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"process.ts","line":27,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/process.ts#L27"}],"signatures":[{"id":457,"name":"exit","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Exits immediately with the given "},{"kind":"code","text":"`exitCode`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { exit } from '@tauri-apps/api/process';\nawait exit(1);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":458,"name":"exitCode","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The exit code to use."}]},"type":{"type":"intrinsic","name":"number"},"defaultValue":"0"}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":459,"name":"relaunch","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"process.ts","line":49,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/process.ts#L49"}],"signatures":[{"id":460,"name":"relaunch","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Exits the current instance of the app then relaunches it."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { relaunch } from '@tauri-apps/api/process';\nawait relaunch();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Functions","children":[456,459]}],"sources":[{"fileName":"process.ts","line":12,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/process.ts#L12"}]},{"id":461,"name":"shell","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"Access the system shell.\nAllows you to spawn child processes and manage files and URLs using their default application.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.shell`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":".\n\nThe APIs must be added to ["},{"kind":"code","text":"`tauri.allowlist.shell`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#allowlistconfig.shell) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":":\n"},{"kind":"code","text":"```json\n{\n \"tauri\": {\n \"allowlist\": {\n \"shell\": {\n \"all\": true, // enable all shell APIs\n \"execute\": true, // enable process spawn APIs\n \"sidecar\": true, // enable spawning sidecars\n \"open\": true // enable opening files/URLs using the default program\n }\n }\n }\n}\n```"},{"kind":"text","text":"\nIt is recommended to allowlist only the APIs you use for optimal bundle size and security.\n\n## Security\n\nThis API has a scope configuration that forces you to restrict the programs and arguments that can be used.\n\n### Restricting access to the "},{"kind":"inline-tag","tag":"@link","text":"`open`","target":619},{"kind":"text","text":" API\n\nOn the allowlist, "},{"kind":"code","text":"`open: true`"},{"kind":"text","text":" means that the "},{"kind":"inline-tag","tag":"@link","text":"open","target":619},{"kind":"text","text":" API can be used with any URL,\nas the argument is validated with the "},{"kind":"code","text":"`^((mailto:\\w+)|(tel:\\w+)|(https?://\\w+)).+`"},{"kind":"text","text":" regex.\nYou can change that regex by changing the boolean value to a string, e.g. "},{"kind":"code","text":"`open: ^https://github.com/`"},{"kind":"text","text":".\n\n### Restricting access to the "},{"kind":"inline-tag","tag":"@link","text":"`Command`","target":462},{"kind":"text","text":" APIs\n\nThe "},{"kind":"code","text":"`shell`"},{"kind":"text","text":" allowlist object has a "},{"kind":"code","text":"`scope`"},{"kind":"text","text":" field that defines an array of CLIs that can be used.\nEach CLI is a configuration object "},{"kind":"code","text":"`{ name: string, cmd: string, sidecar?: bool, args?: boolean | Arg[] }`"},{"kind":"text","text":".\n\n- "},{"kind":"code","text":"`name`"},{"kind":"text","text":": the unique identifier of the command, passed to the "},{"kind":"inline-tag","tag":"@link","text":"Command constructor","target":468},{"kind":"text","text":".\nIf it's a sidecar, this must be the value defined on "},{"kind":"code","text":"`tauri.conf.json > tauri > bundle > externalBin`"},{"kind":"text","text":".\n- "},{"kind":"code","text":"`cmd`"},{"kind":"text","text":": the program that is executed on this configuration. If it's a sidecar, this value is ignored.\n- "},{"kind":"code","text":"`sidecar`"},{"kind":"text","text":": whether the object configures a sidecar or a system program.\n- "},{"kind":"code","text":"`args`"},{"kind":"text","text":": the arguments that can be passed to the program. By default no arguments are allowed.\n - "},{"kind":"code","text":"`true`"},{"kind":"text","text":" means that any argument list is allowed.\n - "},{"kind":"code","text":"`false`"},{"kind":"text","text":" means that no arguments are allowed.\n - otherwise an array can be configured. Each item is either a string representing the fixed argument value\n or a "},{"kind":"code","text":"`{ validator: string }`"},{"kind":"text","text":" that defines a regex validating the argument value.\n\n#### Example scope configuration\n\nCLI: "},{"kind":"code","text":"`git commit -m \"the commit message\"`"},{"kind":"text","text":"\n\nConfiguration:\n"},{"kind":"code","text":"```json\n{\n \"scope\": [\n {\n \"name\": \"run-git-commit\",\n \"cmd\": \"git\",\n \"args\": [\"commit\", \"-m\", { \"validator\": \"\\\\S+\" }]\n }\n ]\n}\n```"},{"kind":"text","text":"\nUsage:\n"},{"kind":"code","text":"```typescript\nimport { Command } from '@tauri-apps/api/shell'\nnew Command('run-git-commit', ['commit', '-m', 'the commit message'])\n```"},{"kind":"text","text":"\n\nTrying to execute any API with a program not configured on the scope results in a promise rejection due to denied access."}]},"children":[{"id":541,"name":"Child","kind":128,"kindString":"Class","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"children":[{"id":542,"name":"constructor","kind":512,"kindString":"Constructor","flags":{},"sources":[{"fileName":"shell.ts","line":325,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L325"}],"signatures":[{"id":543,"name":"new Child","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":544,"name":"pid","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"reference","id":541,"name":"Child"}}]},{"id":545,"name":"pid","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The child process "},{"kind":"code","text":"`pid`"},{"kind":"text","text":"."}]},"sources":[{"fileName":"shell.ts","line":323,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L323"}],"type":{"type":"intrinsic","name":"number"}},{"id":549,"name":"kill","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"shell.ts","line":361,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L361"}],"signatures":[{"id":550,"name":"kill","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Kills the child process."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":546,"name":"write","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"shell.ts","line":344,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L344"}],"signatures":[{"id":547,"name":"write","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Writes "},{"kind":"code","text":"`data`"},{"kind":"text","text":" to the "},{"kind":"code","text":"`stdin`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { Command } from '@tauri-apps/api/shell';\nconst command = new Command('node');\nconst child = await command.spawn();\nawait child.write('message');\nawait child.write([0, 1, 2, 3, 4, 5]);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":548,"name":"data","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The message to write, either a string or a byte array."}]},"type":{"type":"union","types":[{"type":"intrinsic","name":"string"},{"type":"reference","name":"Uint8Array","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array","qualifiedName":"Uint8Array","package":"typescript"}]}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Constructors","children":[542]},{"title":"Properties","children":[545]},{"title":"Methods","children":[549,546]}],"sources":[{"fileName":"shell.ts","line":321,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L321"}]},{"id":462,"name":"Command","kind":128,"kindString":"Class","flags":{},"comment":{"summary":[{"kind":"text","text":"The entry point for spawning child processes.\nIt emits the "},{"kind":"code","text":"`close`"},{"kind":"text","text":" and "},{"kind":"code","text":"`error`"},{"kind":"text","text":" events."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { Command } from '@tauri-apps/api/shell';\nconst command = new Command('node');\ncommand.on('close', data => {\n console.log(`command finished with code ${data.code} and signal ${data.signal}`)\n});\ncommand.on('error', error => console.error(`command error: \"${error}\"`));\ncommand.stdout.on('data', line => console.log(`command stdout: \"${line}\"`));\ncommand.stderr.on('data', line => console.log(`command stderr: \"${line}\"`));\n\nconst child = await command.spawn();\nconsole.log('pid:', child.pid);\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"children":[{"id":468,"name":"constructor","kind":512,"kindString":"Constructor","flags":{},"sources":[{"fileName":"shell.ts","line":413,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L413"}],"signatures":[{"id":469,"name":"new Command","kind":16384,"kindString":"Constructor signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Creates a new "},{"kind":"code","text":"`Command`"},{"kind":"text","text":" instance."}]},"parameters":[{"id":470,"name":"program","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The program name to execute.\nIt must be configured on "},{"kind":"code","text":"`tauri.conf.json > tauri > allowlist > shell > scope`"},{"kind":"text","text":"."}]},"type":{"type":"intrinsic","name":"string"}},{"id":471,"name":"args","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Program arguments."}]},"type":{"type":"union","types":[{"type":"intrinsic","name":"string"},{"type":"array","elementType":{"type":"intrinsic","name":"string"}}]},"defaultValue":"[]"},{"id":472,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Spawn options."}]},"type":{"type":"reference","id":628,"name":"SpawnOptions"}}],"type":{"type":"reference","id":462,"name":"Command"},"overwrites":{"type":"reference","id":553,"name":"EventEmitter.constructor"}}],"overwrites":{"type":"reference","id":552,"name":"EventEmitter.constructor"}},{"id":477,"name":"stderr","kind":1024,"kindString":"Property","flags":{"isReadonly":true},"comment":{"summary":[{"kind":"text","text":"Event emitter for the "},{"kind":"code","text":"`stderr`"},{"kind":"text","text":". Emits the "},{"kind":"code","text":"`data`"},{"kind":"text","text":" event."}]},"sources":[{"fileName":"shell.ts","line":403,"character":11,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L403"}],"type":{"type":"reference","id":551,"typeArguments":[{"type":"literal","value":"data"}],"name":"EventEmitter"},"defaultValue":"..."},{"id":476,"name":"stdout","kind":1024,"kindString":"Property","flags":{"isReadonly":true},"comment":{"summary":[{"kind":"text","text":"Event emitter for the "},{"kind":"code","text":"`stdout`"},{"kind":"text","text":". Emits the "},{"kind":"code","text":"`data`"},{"kind":"text","text":" event."}]},"sources":[{"fileName":"shell.ts","line":401,"character":11,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L401"}],"type":{"type":"reference","id":551,"typeArguments":[{"type":"literal","value":"data"}],"name":"EventEmitter"},"defaultValue":"..."},{"id":482,"name":"addListener","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"shell.ts","line":164,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L164"}],"signatures":[{"id":483,"name":"addListener","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Alias for "},{"kind":"code","text":"`emitter.on(eventName, listener)`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"parameters":[{"id":484,"name":"eventName","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"union","types":[{"type":"literal","value":"error"},{"type":"literal","value":"close"}]}},{"id":485,"name":"listener","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":486,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"shell.ts","line":164,"character":38,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L164"}],"signatures":[{"id":487,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":488,"name":"args","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"any"}}}],"type":{"type":"intrinsic","name":"void"}}]}}}],"type":{"type":"reference","id":462,"name":"Command"},"inheritedFrom":{"type":"reference","id":560,"name":"EventEmitter.addListener"}}],"inheritedFrom":{"type":"reference","id":559,"name":"EventEmitter.addListener"}},{"id":480,"name":"execute","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"shell.ts","line":489,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L489"}],"signatures":[{"id":481,"name":"execute","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Executes the command as a child process, waiting for it to finish and collecting all of its output."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { Command } from '@tauri-apps/api/shell';\nconst output = await new Command('echo', 'message').execute();\nassert(output.code === 0);\nassert(output.signal === null);\nassert(output.stdout === 'message');\nassert(output.stderr === '');\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to the child process output."}]}]},"type":{"type":"reference","typeArguments":[{"type":"reference","id":623,"name":"ChildProcess"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":524,"name":"listenerCount","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"shell.ts","line":272,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L272"}],"signatures":[{"id":525,"name":"listenerCount","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the number of listeners listening to the event named "},{"kind":"code","text":"`eventName`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"parameters":[{"id":526,"name":"eventName","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"union","types":[{"type":"literal","value":"error"},{"type":"literal","value":"close"}]}}],"type":{"type":"intrinsic","name":"number"},"inheritedFrom":{"type":"reference","id":602,"name":"EventEmitter.listenerCount"}}],"inheritedFrom":{"type":"reference","id":601,"name":"EventEmitter.listenerCount"}},{"id":510,"name":"off","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"shell.ts","line":221,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L221"}],"signatures":[{"id":511,"name":"off","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Removes the all specified listener from the listener array for the event eventName\nReturns a reference to the "},{"kind":"code","text":"`EventEmitter`"},{"kind":"text","text":", so that calls can be chained."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"parameters":[{"id":512,"name":"eventName","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"union","types":[{"type":"literal","value":"error"},{"type":"literal","value":"close"}]}},{"id":513,"name":"listener","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":514,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"shell.ts","line":221,"character":30,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L221"}],"signatures":[{"id":515,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":516,"name":"args","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"any"}}}],"type":{"type":"intrinsic","name":"void"}}]}}}],"type":{"type":"reference","id":462,"name":"Command"},"inheritedFrom":{"type":"reference","id":588,"name":"EventEmitter.off"}}],"inheritedFrom":{"type":"reference","id":587,"name":"EventEmitter.off"}},{"id":496,"name":"on","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"shell.ts","line":187,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L187"}],"signatures":[{"id":497,"name":"on","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Adds the "},{"kind":"code","text":"`listener`"},{"kind":"text","text":" function to the end of the listeners array for the\nevent named "},{"kind":"code","text":"`eventName`"},{"kind":"text","text":". No checks are made to see if the "},{"kind":"code","text":"`listener`"},{"kind":"text","text":" has\nalready been added. Multiple calls passing the same combination of "},{"kind":"code","text":"`eventName`"},{"kind":"text","text":"and "},{"kind":"code","text":"`listener`"},{"kind":"text","text":" will result in the "},{"kind":"code","text":"`listener`"},{"kind":"text","text":" being added, and called, multiple\ntimes.\n\nReturns a reference to the "},{"kind":"code","text":"`EventEmitter`"},{"kind":"text","text":", so that calls can be chained."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":498,"name":"eventName","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"union","types":[{"type":"literal","value":"error"},{"type":"literal","value":"close"}]}},{"id":499,"name":"listener","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":500,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"shell.ts","line":187,"character":29,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L187"}],"signatures":[{"id":501,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":502,"name":"args","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"any"}}}],"type":{"type":"intrinsic","name":"void"}}]}}}],"type":{"type":"reference","id":462,"name":"Command"},"inheritedFrom":{"type":"reference","id":574,"name":"EventEmitter.on"}}],"inheritedFrom":{"type":"reference","id":573,"name":"EventEmitter.on"}},{"id":503,"name":"once","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"shell.ts","line":206,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L206"}],"signatures":[{"id":504,"name":"once","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Adds a **one-time**"},{"kind":"code","text":"`listener`"},{"kind":"text","text":" function for the event named "},{"kind":"code","text":"`eventName`"},{"kind":"text","text":". The\nnext time "},{"kind":"code","text":"`eventName`"},{"kind":"text","text":" is triggered, this listener is removed and then invoked.\n\nReturns a reference to the "},{"kind":"code","text":"`EventEmitter`"},{"kind":"text","text":", so that calls can be chained."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"parameters":[{"id":505,"name":"eventName","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"union","types":[{"type":"literal","value":"error"},{"type":"literal","value":"close"}]}},{"id":506,"name":"listener","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":507,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"shell.ts","line":206,"character":31,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L206"}],"signatures":[{"id":508,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":509,"name":"args","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"any"}}}],"type":{"type":"intrinsic","name":"void"}}]}}}],"type":{"type":"reference","id":462,"name":"Command"},"inheritedFrom":{"type":"reference","id":581,"name":"EventEmitter.once"}}],"inheritedFrom":{"type":"reference","id":580,"name":"EventEmitter.once"}},{"id":527,"name":"prependListener","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"shell.ts","line":289,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L289"}],"signatures":[{"id":528,"name":"prependListener","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Adds the "},{"kind":"code","text":"`listener`"},{"kind":"text","text":" function to the _beginning_ of the listeners array for the\nevent named "},{"kind":"code","text":"`eventName`"},{"kind":"text","text":". No checks are made to see if the "},{"kind":"code","text":"`listener`"},{"kind":"text","text":" has\nalready been added. Multiple calls passing the same combination of "},{"kind":"code","text":"`eventName`"},{"kind":"text","text":"and "},{"kind":"code","text":"`listener`"},{"kind":"text","text":" will result in the "},{"kind":"code","text":"`listener`"},{"kind":"text","text":" being added, and called, multiple\ntimes.\n\nReturns a reference to the "},{"kind":"code","text":"`EventEmitter`"},{"kind":"text","text":", so that calls can be chained."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"parameters":[{"id":529,"name":"eventName","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"union","types":[{"type":"literal","value":"error"},{"type":"literal","value":"close"}]}},{"id":530,"name":"listener","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":531,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"shell.ts","line":289,"character":42,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L289"}],"signatures":[{"id":532,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":533,"name":"args","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"any"}}}],"type":{"type":"intrinsic","name":"void"}}]}}}],"type":{"type":"reference","id":462,"name":"Command"},"inheritedFrom":{"type":"reference","id":605,"name":"EventEmitter.prependListener"}}],"inheritedFrom":{"type":"reference","id":604,"name":"EventEmitter.prependListener"}},{"id":534,"name":"prependOnceListener","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"shell.ts","line":308,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L308"}],"signatures":[{"id":535,"name":"prependOnceListener","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Adds a **one-time**"},{"kind":"code","text":"`listener`"},{"kind":"text","text":" function for the event named "},{"kind":"code","text":"`eventName`"},{"kind":"text","text":" to the_beginning_ of the listeners array. The next time "},{"kind":"code","text":"`eventName`"},{"kind":"text","text":" is triggered, this\nlistener is removed, and then invoked.\n\nReturns a reference to the "},{"kind":"code","text":"`EventEmitter`"},{"kind":"text","text":", so that calls can be chained."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"parameters":[{"id":536,"name":"eventName","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"union","types":[{"type":"literal","value":"error"},{"type":"literal","value":"close"}]}},{"id":537,"name":"listener","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":538,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"shell.ts","line":308,"character":46,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L308"}],"signatures":[{"id":539,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":540,"name":"args","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"any"}}}],"type":{"type":"intrinsic","name":"void"}}]}}}],"type":{"type":"reference","id":462,"name":"Command"},"inheritedFrom":{"type":"reference","id":612,"name":"EventEmitter.prependOnceListener"}}],"inheritedFrom":{"type":"reference","id":611,"name":"EventEmitter.prependOnceListener"}},{"id":517,"name":"removeAllListeners","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"shell.ts","line":238,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L238"}],"signatures":[{"id":518,"name":"removeAllListeners","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Removes all listeners, or those of the specified eventName.\n\nReturns a reference to the "},{"kind":"code","text":"`EventEmitter`"},{"kind":"text","text":", so that calls can be chained."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"parameters":[{"id":519,"name":"event","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"union","types":[{"type":"literal","value":"error"},{"type":"literal","value":"close"}]}}],"type":{"type":"reference","id":462,"name":"Command"},"inheritedFrom":{"type":"reference","id":595,"name":"EventEmitter.removeAllListeners"}}],"inheritedFrom":{"type":"reference","id":594,"name":"EventEmitter.removeAllListeners"}},{"id":489,"name":"removeListener","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"shell.ts","line":173,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L173"}],"signatures":[{"id":490,"name":"removeListener","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Alias for "},{"kind":"code","text":"`emitter.off(eventName, listener)`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"parameters":[{"id":491,"name":"eventName","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"union","types":[{"type":"literal","value":"error"},{"type":"literal","value":"close"}]}},{"id":492,"name":"listener","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":493,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"shell.ts","line":173,"character":41,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L173"}],"signatures":[{"id":494,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":495,"name":"args","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"any"}}}],"type":{"type":"intrinsic","name":"void"}}]}}}],"type":{"type":"reference","id":462,"name":"Command"},"inheritedFrom":{"type":"reference","id":567,"name":"EventEmitter.removeListener"}}],"inheritedFrom":{"type":"reference","id":566,"name":"EventEmitter.removeListener"}},{"id":478,"name":"spawn","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"shell.ts","line":451,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L451"}],"signatures":[{"id":479,"name":"spawn","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Executes the command as a child process, returning a handle to it."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to the child process handle."}]}]},"type":{"type":"reference","typeArguments":[{"type":"reference","id":541,"name":"Child"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":463,"name":"sidecar","kind":2048,"kindString":"Method","flags":{"isStatic":true},"sources":[{"fileName":"shell.ts","line":436,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L436"}],"signatures":[{"id":464,"name":"sidecar","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Creates a command to execute the given sidecar program."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { Command } from '@tauri-apps/api/shell';\nconst command = Command.sidecar('my-sidecar');\nconst output = await command.execute();\n```"}]}]},"parameters":[{"id":465,"name":"program","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The program to execute.\nIt must be configured on "},{"kind":"code","text":"`tauri.conf.json > tauri > allowlist > shell > scope`"},{"kind":"text","text":"."}]},"type":{"type":"intrinsic","name":"string"}},{"id":466,"name":"args","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"union","types":[{"type":"intrinsic","name":"string"},{"type":"array","elementType":{"type":"intrinsic","name":"string"}}]},"defaultValue":"[]"},{"id":467,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","id":628,"name":"SpawnOptions"}}],"type":{"type":"reference","id":462,"name":"Command"}}]}],"groups":[{"title":"Constructors","children":[468]},{"title":"Properties","children":[477,476]},{"title":"Methods","children":[482,480,524,510,496,503,527,534,517,489,478,463]}],"sources":[{"fileName":"shell.ts","line":393,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L393"}],"extendedTypes":[{"type":"reference","id":551,"typeArguments":[{"type":"union","types":[{"type":"literal","value":"close"},{"type":"literal","value":"error"}]}],"name":"EventEmitter"}]},{"id":551,"name":"EventEmitter","kind":128,"kindString":"Class","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":552,"name":"constructor","kind":512,"kindString":"Constructor","flags":{},"signatures":[{"id":553,"name":"new EventEmitter","kind":16384,"kindString":"Constructor signature","flags":{},"typeParameter":[{"id":554,"name":"E","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","id":551,"typeArguments":[{"type":"reference","id":554,"name":"E"}],"name":"EventEmitter"}}]},{"id":559,"name":"addListener","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"shell.ts","line":164,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L164"}],"signatures":[{"id":560,"name":"addListener","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Alias for "},{"kind":"code","text":"`emitter.on(eventName, listener)`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"parameters":[{"id":561,"name":"eventName","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":554,"name":"E"}},{"id":562,"name":"listener","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":563,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"shell.ts","line":164,"character":38,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L164"}],"signatures":[{"id":564,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":565,"name":"args","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"any"}}}],"type":{"type":"intrinsic","name":"void"}}]}}}],"type":{"type":"reference","id":551,"typeArguments":[{"type":"reference","id":554,"name":"E"}],"name":"EventEmitter"}}]},{"id":601,"name":"listenerCount","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"shell.ts","line":272,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L272"}],"signatures":[{"id":602,"name":"listenerCount","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the number of listeners listening to the event named "},{"kind":"code","text":"`eventName`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"parameters":[{"id":603,"name":"eventName","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":554,"name":"E"}}],"type":{"type":"intrinsic","name":"number"}}]},{"id":587,"name":"off","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"shell.ts","line":221,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L221"}],"signatures":[{"id":588,"name":"off","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Removes the all specified listener from the listener array for the event eventName\nReturns a reference to the "},{"kind":"code","text":"`EventEmitter`"},{"kind":"text","text":", so that calls can be chained."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"parameters":[{"id":589,"name":"eventName","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":554,"name":"E"}},{"id":590,"name":"listener","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":591,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"shell.ts","line":221,"character":30,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L221"}],"signatures":[{"id":592,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":593,"name":"args","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"any"}}}],"type":{"type":"intrinsic","name":"void"}}]}}}],"type":{"type":"reference","id":551,"typeArguments":[{"type":"reference","id":554,"name":"E"}],"name":"EventEmitter"}}]},{"id":573,"name":"on","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"shell.ts","line":187,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L187"}],"signatures":[{"id":574,"name":"on","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Adds the "},{"kind":"code","text":"`listener`"},{"kind":"text","text":" function to the end of the listeners array for the\nevent named "},{"kind":"code","text":"`eventName`"},{"kind":"text","text":". No checks are made to see if the "},{"kind":"code","text":"`listener`"},{"kind":"text","text":" has\nalready been added. Multiple calls passing the same combination of "},{"kind":"code","text":"`eventName`"},{"kind":"text","text":"and "},{"kind":"code","text":"`listener`"},{"kind":"text","text":" will result in the "},{"kind":"code","text":"`listener`"},{"kind":"text","text":" being added, and called, multiple\ntimes.\n\nReturns a reference to the "},{"kind":"code","text":"`EventEmitter`"},{"kind":"text","text":", so that calls can be chained."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":575,"name":"eventName","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":554,"name":"E"}},{"id":576,"name":"listener","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":577,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"shell.ts","line":187,"character":29,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L187"}],"signatures":[{"id":578,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":579,"name":"args","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"any"}}}],"type":{"type":"intrinsic","name":"void"}}]}}}],"type":{"type":"reference","id":551,"typeArguments":[{"type":"reference","id":554,"name":"E"}],"name":"EventEmitter"}}]},{"id":580,"name":"once","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"shell.ts","line":206,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L206"}],"signatures":[{"id":581,"name":"once","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Adds a **one-time**"},{"kind":"code","text":"`listener`"},{"kind":"text","text":" function for the event named "},{"kind":"code","text":"`eventName`"},{"kind":"text","text":". The\nnext time "},{"kind":"code","text":"`eventName`"},{"kind":"text","text":" is triggered, this listener is removed and then invoked.\n\nReturns a reference to the "},{"kind":"code","text":"`EventEmitter`"},{"kind":"text","text":", so that calls can be chained."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"parameters":[{"id":582,"name":"eventName","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":554,"name":"E"}},{"id":583,"name":"listener","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":584,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"shell.ts","line":206,"character":31,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L206"}],"signatures":[{"id":585,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":586,"name":"args","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"any"}}}],"type":{"type":"intrinsic","name":"void"}}]}}}],"type":{"type":"reference","id":551,"typeArguments":[{"type":"reference","id":554,"name":"E"}],"name":"EventEmitter"}}]},{"id":604,"name":"prependListener","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"shell.ts","line":289,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L289"}],"signatures":[{"id":605,"name":"prependListener","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Adds the "},{"kind":"code","text":"`listener`"},{"kind":"text","text":" function to the _beginning_ of the listeners array for the\nevent named "},{"kind":"code","text":"`eventName`"},{"kind":"text","text":". No checks are made to see if the "},{"kind":"code","text":"`listener`"},{"kind":"text","text":" has\nalready been added. Multiple calls passing the same combination of "},{"kind":"code","text":"`eventName`"},{"kind":"text","text":"and "},{"kind":"code","text":"`listener`"},{"kind":"text","text":" will result in the "},{"kind":"code","text":"`listener`"},{"kind":"text","text":" being added, and called, multiple\ntimes.\n\nReturns a reference to the "},{"kind":"code","text":"`EventEmitter`"},{"kind":"text","text":", so that calls can be chained."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"parameters":[{"id":606,"name":"eventName","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":554,"name":"E"}},{"id":607,"name":"listener","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":608,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"shell.ts","line":289,"character":42,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L289"}],"signatures":[{"id":609,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":610,"name":"args","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"any"}}}],"type":{"type":"intrinsic","name":"void"}}]}}}],"type":{"type":"reference","id":551,"typeArguments":[{"type":"reference","id":554,"name":"E"}],"name":"EventEmitter"}}]},{"id":611,"name":"prependOnceListener","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"shell.ts","line":308,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L308"}],"signatures":[{"id":612,"name":"prependOnceListener","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Adds a **one-time**"},{"kind":"code","text":"`listener`"},{"kind":"text","text":" function for the event named "},{"kind":"code","text":"`eventName`"},{"kind":"text","text":" to the_beginning_ of the listeners array. The next time "},{"kind":"code","text":"`eventName`"},{"kind":"text","text":" is triggered, this\nlistener is removed, and then invoked.\n\nReturns a reference to the "},{"kind":"code","text":"`EventEmitter`"},{"kind":"text","text":", so that calls can be chained."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"parameters":[{"id":613,"name":"eventName","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":554,"name":"E"}},{"id":614,"name":"listener","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":615,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"shell.ts","line":308,"character":46,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L308"}],"signatures":[{"id":616,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":617,"name":"args","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"any"}}}],"type":{"type":"intrinsic","name":"void"}}]}}}],"type":{"type":"reference","id":551,"typeArguments":[{"type":"reference","id":554,"name":"E"}],"name":"EventEmitter"}}]},{"id":594,"name":"removeAllListeners","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"shell.ts","line":238,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L238"}],"signatures":[{"id":595,"name":"removeAllListeners","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Removes all listeners, or those of the specified eventName.\n\nReturns a reference to the "},{"kind":"code","text":"`EventEmitter`"},{"kind":"text","text":", so that calls can be chained."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"parameters":[{"id":596,"name":"event","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","id":554,"name":"E"}}],"type":{"type":"reference","id":551,"typeArguments":[{"type":"reference","id":554,"name":"E"}],"name":"EventEmitter"}}]},{"id":566,"name":"removeListener","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"shell.ts","line":173,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L173"}],"signatures":[{"id":567,"name":"removeListener","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Alias for "},{"kind":"code","text":"`emitter.off(eventName, listener)`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"parameters":[{"id":568,"name":"eventName","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":554,"name":"E"}},{"id":569,"name":"listener","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":570,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"shell.ts","line":173,"character":41,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L173"}],"signatures":[{"id":571,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":572,"name":"args","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"any"}}}],"type":{"type":"intrinsic","name":"void"}}]}}}],"type":{"type":"reference","id":551,"typeArguments":[{"type":"reference","id":554,"name":"E"}],"name":"EventEmitter"}}]}],"groups":[{"title":"Constructors","children":[552]},{"title":"Methods","children":[559,601,587,573,580,604,611,594,566]}],"sources":[{"fileName":"shell.ts","line":153,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L153"}],"typeParameters":[{"id":618,"name":"E","kind":131072,"kindString":"Type parameter","flags":{},"type":{"type":"intrinsic","name":"string"}}],"extendedBy":[{"type":"reference","id":462,"name":"Command"}]},{"id":623,"name":"ChildProcess","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":624,"name":"code","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Exit code of the process. "},{"kind":"code","text":"`null`"},{"kind":"text","text":" if the process was terminated by a signal on Unix."}]},"sources":[{"fileName":"shell.ts","line":109,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L109"}],"type":{"type":"union","types":[{"type":"literal","value":null},{"type":"intrinsic","name":"number"}]}},{"id":625,"name":"signal","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"If the process was terminated by a signal, represents that signal."}]},"sources":[{"fileName":"shell.ts","line":111,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L111"}],"type":{"type":"union","types":[{"type":"literal","value":null},{"type":"intrinsic","name":"number"}]}},{"id":627,"name":"stderr","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The data that the process wrote to "},{"kind":"code","text":"`stderr`"},{"kind":"text","text":"."}]},"sources":[{"fileName":"shell.ts","line":115,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L115"}],"type":{"type":"intrinsic","name":"string"}},{"id":626,"name":"stdout","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The data that the process wrote to "},{"kind":"code","text":"`stdout`"},{"kind":"text","text":"."}]},"sources":[{"fileName":"shell.ts","line":113,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L113"}],"type":{"type":"intrinsic","name":"string"}}],"groups":[{"title":"Properties","children":[624,625,627,626]}],"sources":[{"fileName":"shell.ts","line":107,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L107"}]},{"id":628,"name":"SpawnOptions","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":629,"name":"cwd","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Current working directory."}]},"sources":[{"fileName":"shell.ts","line":88,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L88"}],"type":{"type":"intrinsic","name":"string"}},{"id":631,"name":"encoding","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Character encoding for stdout/stderr"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"sources":[{"fileName":"shell.ts","line":96,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L96"}],"type":{"type":"intrinsic","name":"string"}},{"id":630,"name":"env","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Environment variables. set to "},{"kind":"code","text":"`null`"},{"kind":"text","text":" to clear the process env."}]},"sources":[{"fileName":"shell.ts","line":90,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L90"}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"},{"type":"intrinsic","name":"string"}],"name":"Record","externalUrl":"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type","qualifiedName":"Record","package":"typescript"}}],"groups":[{"title":"Properties","children":[629,631,630]}],"sources":[{"fileName":"shell.ts","line":86,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L86"}]},{"id":619,"name":"open","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"shell.ts","line":564,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L564"}],"signatures":[{"id":620,"name":"open","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Opens a path or URL with the system's default app,\nor the one specified with "},{"kind":"code","text":"`openWith`"},{"kind":"text","text":".\n\nThe "},{"kind":"code","text":"`openWith`"},{"kind":"text","text":" value must be one of "},{"kind":"code","text":"`firefox`"},{"kind":"text","text":", "},{"kind":"code","text":"`google chrome`"},{"kind":"text","text":", "},{"kind":"code","text":"`chromium`"},{"kind":"text","text":" "},{"kind":"code","text":"`safari`"},{"kind":"text","text":",\n"},{"kind":"code","text":"`open`"},{"kind":"text","text":", "},{"kind":"code","text":"`start`"},{"kind":"text","text":", "},{"kind":"code","text":"`xdg-open`"},{"kind":"text","text":", "},{"kind":"code","text":"`gio`"},{"kind":"text","text":", "},{"kind":"code","text":"`gnome-open`"},{"kind":"text","text":", "},{"kind":"code","text":"`kde-open`"},{"kind":"text","text":" or "},{"kind":"code","text":"`wslview`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { open } from '@tauri-apps/api/shell';\n// opens the given URL on the default browser:\nawait open('https://github.com/tauri-apps/tauri');\n// opens the given URL using `firefox`:\nawait open('https://github.com/tauri-apps/tauri', 'firefox');\n// opens a file using the default program:\nawait open('/path/to/file');\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":621,"name":"path","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The path or URL to open.\nThis value is matched against the string regex defined on "},{"kind":"code","text":"`tauri.conf.json > tauri > allowlist > shell > open`"},{"kind":"text","text":",\nwhich defaults to "},{"kind":"code","text":"`^((mailto:\\w+)|(tel:\\w+)|(https?://\\w+)).+`"},{"kind":"text","text":"."}]},"type":{"type":"intrinsic","name":"string"}},{"id":622,"name":"openWith","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The app to open the file or URL with.\nDefaults to the system default application for the specified path type."}]},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Classes","children":[541,462,551]},{"title":"Interfaces","children":[623,628]},{"title":"Functions","children":[619]}],"sources":[{"fileName":"shell.ts","line":80,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L80"}]},{"id":632,"name":"tauri","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"Invoke your custom commands.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.tauri`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":"."}]},"children":[{"id":633,"name":"InvokeArgs","kind":4194304,"kindString":"Type alias","flags":{},"comment":{"summary":[{"kind":"text","text":"Command arguments."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"sources":[{"fileName":"tauri.ts","line":66,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/tauri.ts#L66"}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"},{"type":"intrinsic","name":"unknown"}],"name":"Record","externalUrl":"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type","qualifiedName":"Record","package":"typescript"}},{"id":646,"name":"convertFileSrc","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"tauri.ts","line":132,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/tauri.ts#L132"}],"signatures":[{"id":647,"name":"convertFileSrc","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Convert a device file path to an URL that can be loaded by the webview.\nNote that "},{"kind":"code","text":"`asset:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`https://asset.localhost`"},{"kind":"text","text":" must be added to ["},{"kind":"code","text":"`tauri.security.csp`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#securityconfig.csp) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":".\nExample CSP value: "},{"kind":"code","text":"`\"csp\": \"default-src 'self'; img-src 'self' asset: https://asset.localhost\"`"},{"kind":"text","text":" to use the asset protocol on image sources.\n\nAdditionally, "},{"kind":"code","text":"`asset`"},{"kind":"text","text":" must be added to ["},{"kind":"code","text":"`tauri.allowlist.protocol`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#allowlistconfig.protocol)\nin "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" and its access scope must be defined on the "},{"kind":"code","text":"`assetScope`"},{"kind":"text","text":" array on the same "},{"kind":"code","text":"`protocol`"},{"kind":"text","text":" object."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appDataDir, join } from '@tauri-apps/api/path';\nimport { convertFileSrc } from '@tauri-apps/api/tauri';\nconst appDataDirPath = await appDataDir();\nconst filePath = await join(appDataDirPath, 'assets/video.mp4');\nconst assetUrl = convertFileSrc(filePath);\n\nconst video = document.getElementById('my-video');\nconst source = document.createElement('source');\nsource.type = 'video/mp4';\nsource.src = assetUrl;\nvideo.appendChild(source);\nvideo.load();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"the URL that can be used as source on the webview."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":648,"name":"filePath","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The file path."}]},"type":{"type":"intrinsic","name":"string"}},{"id":649,"name":"protocol","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The protocol to use. Defaults to "},{"kind":"code","text":"`asset`"},{"kind":"text","text":". You only need to set this when using a custom protocol."}]},"type":{"type":"intrinsic","name":"string"},"defaultValue":"'asset'"}],"type":{"type":"intrinsic","name":"string"}}]},{"id":641,"name":"invoke","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"tauri.ts","line":82,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/tauri.ts#L82"}],"signatures":[{"id":642,"name":"invoke","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sends a message to the backend."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { invoke } from '@tauri-apps/api/tauri';\nawait invoke('login', { user: 'tauri', password: 'poiwe3h4r5ip3yrhtew9ty' });\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving or rejecting to the backend response."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"typeParameter":[{"id":643,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":644,"name":"cmd","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The command name."}]},"type":{"type":"intrinsic","name":"string"}},{"id":645,"name":"args","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The optional arguments to pass to the command."}]},"type":{"type":"reference","id":633,"name":"InvokeArgs"},"defaultValue":"{}"}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":643,"name":"T"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":634,"name":"transformCallback","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"tauri.ts","line":39,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/tauri.ts#L39"}],"signatures":[{"id":635,"name":"transformCallback","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Transforms a callback function to a string identifier that can be passed to the backend.\nThe backend uses the identifier to "},{"kind":"code","text":"`eval()`"},{"kind":"text","text":" the callback."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"A unique identifier associated with the callback function."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":636,"name":"callback","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reflection","declaration":{"id":637,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"tauri.ts","line":40,"character":13,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/tauri.ts#L40"}],"signatures":[{"id":638,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":639,"name":"response","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"intrinsic","name":"void"}}]}}},{"id":640,"name":"once","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"boolean"},"defaultValue":"false"}],"type":{"type":"intrinsic","name":"number"}}]}],"groups":[{"title":"Type Aliases","children":[633]},{"title":"Functions","children":[646,641,634]}],"sources":[{"fileName":"tauri.ts","line":13,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/tauri.ts#L13"}]},{"id":650,"name":"updater","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"Customize the auto updater flow.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.updater`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":"."}]},"children":[{"id":655,"name":"UpdateManifest","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":658,"name":"body","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"updater.ts","line":34,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/updater.ts#L34"}],"type":{"type":"intrinsic","name":"string"}},{"id":657,"name":"date","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"updater.ts","line":33,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/updater.ts#L33"}],"type":{"type":"intrinsic","name":"string"}},{"id":656,"name":"version","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"updater.ts","line":32,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/updater.ts#L32"}],"type":{"type":"intrinsic","name":"string"}}],"groups":[{"title":"Properties","children":[658,657,656]}],"sources":[{"fileName":"updater.ts","line":31,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/updater.ts#L31"}]},{"id":659,"name":"UpdateResult","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":660,"name":"manifest","kind":1024,"kindString":"Property","flags":{"isOptional":true},"sources":[{"fileName":"updater.ts","line":41,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/updater.ts#L41"}],"type":{"type":"reference","id":655,"name":"UpdateManifest"}},{"id":661,"name":"shouldUpdate","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"updater.ts","line":42,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/updater.ts#L42"}],"type":{"type":"intrinsic","name":"boolean"}}],"groups":[{"title":"Properties","children":[660,661]}],"sources":[{"fileName":"updater.ts","line":40,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/updater.ts#L40"}]},{"id":652,"name":"UpdateStatusResult","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":653,"name":"error","kind":1024,"kindString":"Property","flags":{"isOptional":true},"sources":[{"fileName":"updater.ts","line":24,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/updater.ts#L24"}],"type":{"type":"intrinsic","name":"string"}},{"id":654,"name":"status","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"updater.ts","line":25,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/updater.ts#L25"}],"type":{"type":"reference","id":651,"name":"UpdateStatus"}}],"groups":[{"title":"Properties","children":[653,654]}],"sources":[{"fileName":"updater.ts","line":23,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/updater.ts#L23"}]},{"id":651,"name":"UpdateStatus","kind":4194304,"kindString":"Type alias","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"sources":[{"fileName":"updater.ts","line":18,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/updater.ts#L18"}],"type":{"type":"union","types":[{"type":"literal","value":"PENDING"},{"type":"literal","value":"ERROR"},{"type":"literal","value":"DONE"},{"type":"literal","value":"UPTODATE"}]}},{"id":670,"name":"checkUpdate","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"updater.ts","line":146,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/updater.ts#L146"}],"signatures":[{"id":671,"name":"checkUpdate","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Checks if an update is available."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { checkUpdate } from '@tauri-apps/api/updater';\nconst update = await checkUpdate();\n// now run installUpdate() if needed\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"Promise resolving to the update status."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"reference","id":659,"name":"UpdateResult"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":668,"name":"installUpdate","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"updater.ts","line":87,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/updater.ts#L87"}],"signatures":[{"id":669,"name":"installUpdate","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Install the update if there's one available."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { checkUpdate, installUpdate } from '@tauri-apps/api/updater';\nconst update = await checkUpdate();\nif (update.shouldUpdate) {\n console.log(`Installing update ${update.manifest?.version}, ${update.manifest?.date}, ${update.manifest.body}`);\n await installUpdate();\n}\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":662,"name":"onUpdaterEvent","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"updater.ts","line":63,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/updater.ts#L63"}],"signatures":[{"id":663,"name":"onUpdaterEvent","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to an updater event."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { onUpdaterEvent } from \"@tauri-apps/api/updater\";\nconst unlisten = await onUpdaterEvent(({ error, status }) => {\n console.log('Updater event', error, status);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.2"}]}]},"parameters":[{"id":664,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":665,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"updater.ts","line":64,"character":11,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/updater.ts#L64"}],"signatures":[{"id":666,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":667,"name":"status","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":652,"name":"UpdateStatusResult"}}],"type":{"type":"intrinsic","name":"void"}}]}}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":1174,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Interfaces","children":[655,659,652]},{"title":"Type Aliases","children":[651]},{"title":"Functions","children":[670,668,662]}],"sources":[{"fileName":"updater.ts","line":12,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/updater.ts#L12"}]},{"id":672,"name":"window","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"Provides APIs to create windows, communicate with other windows and manipulate the current window.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.window`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":".\n\nThe APIs must be added to ["},{"kind":"code","text":"`tauri.allowlist.window`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#allowlistconfig.window) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":":\n"},{"kind":"code","text":"```json\n{\n \"tauri\": {\n \"allowlist\": {\n \"window\": {\n \"all\": true, // enable all window APIs\n \"create\": true, // enable window creation\n \"center\": true,\n \"requestUserAttention\": true,\n \"setResizable\": true,\n \"setMaximizable\": true,\n \"setMinimizable\": true,\n \"setClosable\": true,\n \"setTitle\": true,\n \"maximize\": true,\n \"unmaximize\": true,\n \"minimize\": true,\n \"unminimize\": true,\n \"show\": true,\n \"hide\": true,\n \"close\": true,\n \"setDecorations\": true,\n \"setAlwaysOnTop\": true,\n \"setContentProtected\": true,\n \"setSize\": true,\n \"setMinSize\": true,\n \"setMaxSize\": true,\n \"setPosition\": true,\n \"setFullscreen\": true,\n \"setFocus\": true,\n \"setIcon\": true,\n \"setSkipTaskbar\": true,\n \"setCursorGrab\": true,\n \"setCursorVisible\": true,\n \"setCursorIcon\": true,\n \"setCursorPosition\": true,\n \"setIgnoreCursorEvents\": true,\n \"startDragging\": true,\n \"print\": true\n }\n }\n }\n}\n```"},{"kind":"text","text":"\nIt is recommended to allowlist only the APIs you use for optimal bundle size and security.\n\n## Window events\n\nEvents can be listened to using "},{"kind":"code","text":"`appWindow.listen`"},{"kind":"text","text":":\n"},{"kind":"code","text":"```typescript\nimport { appWindow } from \"@tauri-apps/api/window\";\nappWindow.listen(\"my-window-event\", ({ event, payload }) => { });\n```"}]},"children":[{"id":1103,"name":"UserAttentionType","kind":8,"kindString":"Enumeration","flags":{},"comment":{"summary":[{"kind":"text","text":"Attention type to request on a window."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":1104,"name":"Critical","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"#### Platform-specific\n- **macOS:** Bounces the dock icon until the application is in focus.\n- **Windows:** Flashes both the window and the taskbar button until the application is in focus."}]},"sources":[{"fileName":"window.ts","line":228,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L228"}],"type":{"type":"literal","value":1}},{"id":1105,"name":"Informational","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"#### Platform-specific\n- **macOS:** Bounces the dock icon once.\n- **Windows:** Flashes the taskbar button until the application is in focus."}]},"sources":[{"fileName":"window.ts","line":234,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L234"}],"type":{"type":"literal","value":2}}],"groups":[{"title":"Enumeration Members","children":[1104,1105]}],"sources":[{"fileName":"window.ts","line":222,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L222"}]},{"id":1048,"name":"CloseRequestedEvent","kind":128,"kindString":"Class","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.2"}]}]},"children":[{"id":1049,"name":"constructor","kind":512,"kindString":"Constructor","flags":{},"sources":[{"fileName":"window.ts","line":2179,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2179"}],"signatures":[{"id":1050,"name":"new CloseRequestedEvent","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":1051,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":1163,"typeArguments":[{"type":"literal","value":null}],"name":"Event"}}],"type":{"type":"reference","id":1048,"name":"CloseRequestedEvent"}}]},{"id":1052,"name":"event","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name"}]},"sources":[{"fileName":"window.ts","line":2172,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2172"}],"type":{"type":"reference","id":73,"name":"EventName"}},{"id":1054,"name":"id","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Event identifier used to unlisten"}]},"sources":[{"fileName":"window.ts","line":2176,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2176"}],"type":{"type":"intrinsic","name":"number"}},{"id":1053,"name":"windowLabel","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The label of the window that emitted this event."}]},"sources":[{"fileName":"window.ts","line":2174,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2174"}],"type":{"type":"intrinsic","name":"string"}},{"id":1058,"name":"isPreventDefault","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":2189,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2189"}],"signatures":[{"id":1059,"name":"isPreventDefault","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"intrinsic","name":"boolean"}}]},{"id":1056,"name":"preventDefault","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":2185,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2185"}],"signatures":[{"id":1057,"name":"preventDefault","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"intrinsic","name":"void"}}]}],"groups":[{"title":"Constructors","children":[1049]},{"title":"Properties","children":[1052,1054,1053]},{"title":"Methods","children":[1058,1056]}],"sources":[{"fileName":"window.ts","line":2170,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2170"}]},{"id":1084,"name":"LogicalPosition","kind":128,"kindString":"Class","flags":{},"comment":{"summary":[{"kind":"text","text":"A position represented in logical pixels."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":1085,"name":"constructor","kind":512,"kindString":"Constructor","flags":{},"sources":[{"fileName":"window.ts","line":166,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L166"}],"signatures":[{"id":1086,"name":"new LogicalPosition","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":1087,"name":"x","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}},{"id":1088,"name":"y","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"reference","id":1084,"name":"LogicalPosition"}}]},{"id":1089,"name":"type","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":162,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L162"}],"type":{"type":"intrinsic","name":"string"},"defaultValue":"'Logical'"},{"id":1090,"name":"x","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":163,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L163"}],"type":{"type":"intrinsic","name":"number"}},{"id":1091,"name":"y","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":164,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L164"}],"type":{"type":"intrinsic","name":"number"}}],"groups":[{"title":"Constructors","children":[1085]},{"title":"Properties","children":[1089,1090,1091]}],"sources":[{"fileName":"window.ts","line":161,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L161"}]},{"id":1065,"name":"LogicalSize","kind":128,"kindString":"Class","flags":{},"comment":{"summary":[{"kind":"text","text":"A size represented in logical pixels."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":1066,"name":"constructor","kind":512,"kindString":"Constructor","flags":{},"sources":[{"fileName":"window.ts","line":120,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L120"}],"signatures":[{"id":1067,"name":"new LogicalSize","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":1068,"name":"width","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}},{"id":1069,"name":"height","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"reference","id":1065,"name":"LogicalSize"}}]},{"id":1072,"name":"height","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":118,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L118"}],"type":{"type":"intrinsic","name":"number"}},{"id":1070,"name":"type","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":116,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L116"}],"type":{"type":"intrinsic","name":"string"},"defaultValue":"'Logical'"},{"id":1071,"name":"width","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":117,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L117"}],"type":{"type":"intrinsic","name":"number"}}],"groups":[{"title":"Constructors","children":[1066]},{"title":"Properties","children":[1072,1070,1071]}],"sources":[{"fileName":"window.ts","line":115,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L115"}]},{"id":1092,"name":"PhysicalPosition","kind":128,"kindString":"Class","flags":{},"comment":{"summary":[{"kind":"text","text":"A position represented in physical pixels."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":1093,"name":"constructor","kind":512,"kindString":"Constructor","flags":{},"sources":[{"fileName":"window.ts","line":182,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L182"}],"signatures":[{"id":1094,"name":"new PhysicalPosition","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":1095,"name":"x","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}},{"id":1096,"name":"y","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"reference","id":1092,"name":"PhysicalPosition"}}]},{"id":1097,"name":"type","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":178,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L178"}],"type":{"type":"intrinsic","name":"string"},"defaultValue":"'Physical'"},{"id":1098,"name":"x","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":179,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L179"}],"type":{"type":"intrinsic","name":"number"}},{"id":1099,"name":"y","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":180,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L180"}],"type":{"type":"intrinsic","name":"number"}},{"id":1100,"name":"toLogical","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":197,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L197"}],"signatures":[{"id":1101,"name":"toLogical","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Converts the physical position to a logical one."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst factor = await appWindow.scaleFactor();\nconst position = await appWindow.innerPosition();\nconst logical = position.toLogical(factor);\n```"}]}]},"parameters":[{"id":1102,"name":"scaleFactor","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"reference","id":1084,"name":"LogicalPosition"}}]}],"groups":[{"title":"Constructors","children":[1093]},{"title":"Properties","children":[1097,1098,1099]},{"title":"Methods","children":[1100]}],"sources":[{"fileName":"window.ts","line":177,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L177"}]},{"id":1073,"name":"PhysicalSize","kind":128,"kindString":"Class","flags":{},"comment":{"summary":[{"kind":"text","text":"A size represented in physical pixels."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":1074,"name":"constructor","kind":512,"kindString":"Constructor","flags":{},"sources":[{"fileName":"window.ts","line":136,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L136"}],"signatures":[{"id":1075,"name":"new PhysicalSize","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":1076,"name":"width","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}},{"id":1077,"name":"height","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"reference","id":1073,"name":"PhysicalSize"}}]},{"id":1080,"name":"height","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":134,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L134"}],"type":{"type":"intrinsic","name":"number"}},{"id":1078,"name":"type","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":132,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L132"}],"type":{"type":"intrinsic","name":"string"},"defaultValue":"'Physical'"},{"id":1079,"name":"width","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":133,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L133"}],"type":{"type":"intrinsic","name":"number"}},{"id":1081,"name":"toLogical","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":151,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L151"}],"signatures":[{"id":1082,"name":"toLogical","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Converts the physical size to a logical one."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst factor = await appWindow.scaleFactor();\nconst size = await appWindow.innerSize();\nconst logical = size.toLogical(factor);\n```"}]}]},"parameters":[{"id":1083,"name":"scaleFactor","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"reference","id":1065,"name":"LogicalSize"}}]}],"groups":[{"title":"Constructors","children":[1074]},{"title":"Properties","children":[1080,1078,1079]},{"title":"Methods","children":[1081]}],"sources":[{"fileName":"window.ts","line":131,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L131"}]},{"id":675,"name":"WebviewWindow","kind":128,"kindString":"Class","flags":{},"comment":{"summary":[{"kind":"text","text":"Create new webview windows and get a handle to existing ones.\n\nWindows are identified by a *label* a unique identifier that can be used to reference it later.\nIt may only contain alphanumeric characters "},{"kind":"code","text":"`a-zA-Z`"},{"kind":"text","text":" plus the following special characters "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\n// loading embedded asset:\nconst webview = new WebviewWindow('theUniqueLabel', {\n url: 'path/to/page.html'\n});\n// alternatively, load a remote URL:\nconst webview = new WebviewWindow('theUniqueLabel', {\n url: 'https://github.com/tauri-apps/tauri'\n});\n\nwebview.once('tauri://created', function () {\n // webview window successfully created\n});\nwebview.once('tauri://error', function (e) {\n // an error happened creating the webview window\n});\n\n// emit an event to the backend\nawait webview.emit(\"some event\", \"data\");\n// listen to an event from the backend\nconst unlisten = await webview.listen(\"event name\", e => {});\nunlisten();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.2"}]}]},"children":[{"id":681,"name":"constructor","kind":512,"kindString":"Constructor","flags":{},"sources":[{"fileName":"window.ts","line":2247,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2247"}],"signatures":[{"id":682,"name":"new WebviewWindow","kind":16384,"kindString":"Constructor signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Creates a new WebviewWindow."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { WebviewWindow } from '@tauri-apps/api/window';\nconst webview = new WebviewWindow('my-label', {\n url: 'https://github.com/tauri-apps/tauri'\n});\nwebview.once('tauri://created', function () {\n // webview window successfully created\n});\nwebview.once('tauri://error', function (e) {\n // an error happened creating the webview window\n});\n```"},{"kind":"text","text":"\n\n*"}]},{"tag":"@returns","content":[{"kind":"text","text":"The WebviewWindow instance to communicate with the webview."}]}]},"parameters":[{"id":683,"name":"label","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The unique webview window label. Must be alphanumeric: "},{"kind":"code","text":"`a-zA-Z-/:_`"},{"kind":"text","text":"."}]},"type":{"type":"intrinsic","name":"string"}},{"id":684,"name":"options","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":1131,"name":"WindowOptions"},"defaultValue":"{}"}],"type":{"type":"reference","id":675,"name":"WebviewWindow"},"overwrites":{"type":"reference","name":"WindowManager.constructor"}}],"overwrites":{"type":"reference","name":"WindowManager.constructor"}},{"id":831,"name":"label","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The window label. It is a unique identifier for the window, can be used to reference it later."}]},"sources":[{"fileName":"window.ts","line":318,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L318"}],"type":{"type":"intrinsic","name":"string"},"inheritedFrom":{"type":"reference","name":"WindowManager.label"}},{"id":832,"name":"listeners","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Local event listeners."}]},"sources":[{"fileName":"window.ts","line":320,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L320"}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"},{"type":"array","elementType":{"type":"reference","id":1169,"typeArguments":[{"type":"intrinsic","name":"any"}],"name":"EventCallback"}}],"name":"Record","externalUrl":"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type","qualifiedName":"Record","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.listeners"}},{"id":719,"name":"center","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":926,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L926"}],"signatures":[{"id":720,"name":"center","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Centers the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.center();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.center"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.center"}},{"id":753,"name":"close","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1326,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1326"}],"signatures":[{"id":754,"name":"close","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Closes the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.close();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.close"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.close"}},{"id":843,"name":"emit","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":430,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L430"}],"signatures":[{"id":844,"name":"emit","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Emits an event to the backend and all Tauri windows.\nThe event will have this window's "},{"kind":"inline-tag","tag":"@link","text":"label","target":831},{"kind":"text","text":" as "},{"kind":"inline-tag","tag":"@link","text":"Event.windowLabel | source window label"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.emit('window-loaded', { loggedIn: true, token: 'authToken' });\n```"},{"kind":"text","text":"\n\nThis function can also be used to communicate between windows:\n"},{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.listen('sync-data', (event) => { });\n\n// on another window...\nimport { WebviewWindow } from '@tauri-apps/api/window';\nconst otherWindow = WebviewWindow.getByLabel('other')\nawait otherWindow.emit('sync-data');\n```"},{"kind":"text","text":"\n\nGlobal listeners are also triggered:\n"},{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nimport { listen } from '@tauri-apps/api/event';\nawait listen('ping', (event) => { });\n\nawait appWindow.emit('ping');\n```"}]}]},"parameters":[{"id":845,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"intrinsic","name":"string"}},{"id":846,"name":"payload","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Event payload."}]},"type":{"type":"intrinsic","name":"unknown"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.emit"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.emit"}},{"id":751,"name":"hide","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1301,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1301"}],"signatures":[{"id":752,"name":"hide","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets the window visibility to false."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.hide();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.hide"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.hide"}},{"id":687,"name":"innerPosition","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":500,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L500"}],"signatures":[{"id":688,"name":"innerPosition","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"The position of the top-left hand corner of the window's client area relative to the top-left hand corner of the desktop."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst position = await appWindow.innerPosition();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The window's inner position."}]}]},"type":{"type":"reference","typeArguments":[{"type":"reference","id":1092,"name":"PhysicalPosition"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.innerPosition"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.innerPosition"}},{"id":691,"name":"innerSize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":551,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L551"}],"signatures":[{"id":692,"name":"innerSize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"The physical size of the window's client area.\nThe client area is the content of the window, excluding the title bar and borders."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst size = await appWindow.innerSize();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The window's inner size."}]}]},"type":{"type":"reference","typeArguments":[{"type":"reference","id":1073,"name":"PhysicalSize"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.innerSize"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.innerSize"}},{"id":711,"name":"isClosable","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":819,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L819"}],"signatures":[{"id":712,"name":"isClosable","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window’s native close button state.\n\n#### Platform-specific\n\n- **Linux / iOS / Android:** Unsupported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst closable = await appWindow.isClosable();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"Whether the window's native close button is enabled or not."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.isClosable"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.isClosable"}},{"id":703,"name":"isDecorated","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":704,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L704"}],"signatures":[{"id":704,"name":"isDecorated","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current decorated state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst decorated = await appWindow.isDecorated();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"Whether the window is decorated or not."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.isDecorated"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.isDecorated"}},{"id":701,"name":"isFocused","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":679,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L679"}],"signatures":[{"id":702,"name":"isFocused","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current focus state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst focused = await appWindow.isFocused();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"Whether the window is focused or not."}]},{"tag":"@since","content":[{"kind":"text","text":"1.4"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.isFocused"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.isFocused"}},{"id":695,"name":"isFullscreen","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":602,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L602"}],"signatures":[{"id":696,"name":"isFullscreen","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current fullscreen state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst fullscreen = await appWindow.isFullscreen();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"Whether the window is in fullscreen mode or not."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.isFullscreen"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.isFullscreen"}},{"id":707,"name":"isMaximizable","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":759,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L759"}],"signatures":[{"id":708,"name":"isMaximizable","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window’s native maximize button state.\n\n#### Platform-specific\n\n- **Linux / iOS / Android:** Unsupported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst maximizable = await appWindow.isMaximizable();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"Whether the window's native maximize button is enabled or not."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.isMaximizable"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.isMaximizable"}},{"id":699,"name":"isMaximized","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":652,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L652"}],"signatures":[{"id":700,"name":"isMaximized","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current maximized state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst maximized = await appWindow.isMaximized();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"Whether the window is maximized or not."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.isMaximized"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.isMaximized"}},{"id":709,"name":"isMinimizable","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":789,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L789"}],"signatures":[{"id":710,"name":"isMinimizable","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window’s native minimize button state.\n\n#### Platform-specific\n\n- **Linux / iOS / Android:** Unsupported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst minimizable = await appWindow.isMinimizable();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"Whether the window's native minimize button is enabled or not."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.isMinimizable"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.isMinimizable"}},{"id":697,"name":"isMinimized","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":627,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L627"}],"signatures":[{"id":698,"name":"isMinimized","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current minimized state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst minimized = await appWindow.isMinimized();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.3.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.isMinimized"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.isMinimized"}},{"id":705,"name":"isResizable","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":729,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L729"}],"signatures":[{"id":706,"name":"isResizable","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current resizable state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst resizable = await appWindow.isResizable();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"Whether the window is resizable or not."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.isResizable"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.isResizable"}},{"id":713,"name":"isVisible","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":844,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L844"}],"signatures":[{"id":714,"name":"isVisible","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current visible state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst visible = await appWindow.isVisible();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"Whether the window is visible or not."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.isVisible"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.isVisible"}},{"id":833,"name":"listen","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":351,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L351"}],"signatures":[{"id":834,"name":"listen","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to an event emitted by the backend or webview.\nThe event must either be a global event or an event targetting this window.\n\nSee "},{"kind":"inline-tag","tag":"@link","text":"`emit`","target":843},{"kind":"text","text":" for more information."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst unlisten = await appWindow.listen('state-changed', (event) => {\n console.log(`Got error: ${payload}`);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"},{"kind":"text","text":"\n\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event."}]}]},"typeParameter":[{"id":835,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":836,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"reference","id":73,"name":"EventName"}},{"id":837,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event handler."}]},"type":{"type":"reference","id":1169,"typeArguments":[{"type":"reference","id":835,"name":"T"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":1174,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.listen"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.listen"}},{"id":739,"name":"maximize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1151,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1151"}],"signatures":[{"id":740,"name":"maximize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Maximizes the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.maximize();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.maximize"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.maximize"}},{"id":745,"name":"minimize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1226,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1226"}],"signatures":[{"id":746,"name":"minimize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Minimizes the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.minimize();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.minimize"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.minimize"}},{"id":810,"name":"onCloseRequested","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1978,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1978"}],"signatures":[{"id":811,"name":"onCloseRequested","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to window close requested. Emitted when the user requests to closes the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from \"@tauri-apps/api/window\";\nimport { confirm } from '@tauri-apps/api/dialog';\nconst unlisten = await appWindow.onCloseRequested(async (event) => {\n const confirmed = await confirm('Are you sure?');\n if (!confirmed) {\n // user did not confirm closing the window; let's prevent it\n event.preventDefault();\n }\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.2"}]}]},"parameters":[{"id":812,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":813,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"window.ts","line":1979,"character":13,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1979"}],"signatures":[{"id":814,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":815,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":1048,"name":"CloseRequestedEvent"}}],"type":{"type":"union","types":[{"type":"intrinsic","name":"void"},{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}]}}]}}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":1174,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.onCloseRequested"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.onCloseRequested"}},{"id":825,"name":"onFileDropEvent","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":2112,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2112"}],"signatures":[{"id":826,"name":"onFileDropEvent","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to a file drop event.\nThe listener is triggered when the user hovers the selected files on the window,\ndrops the files or cancels the operation."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from \"@tauri-apps/api/window\";\nconst unlisten = await appWindow.onFileDropEvent((event) => {\n if (event.payload.type === 'hover') {\n console.log('User hovering', event.payload.paths);\n } else if (event.payload.type === 'drop') {\n console.log('User dropped', event.payload.paths);\n } else {\n console.log('File drop cancelled');\n }\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.2"}]}]},"parameters":[{"id":827,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":1169,"typeArguments":[{"type":"reference","id":1122,"name":"FileDropEvent"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":1174,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.onFileDropEvent"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.onFileDropEvent"}},{"id":816,"name":"onFocusChanged","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":2011,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2011"}],"signatures":[{"id":817,"name":"onFocusChanged","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to window focus change."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from \"@tauri-apps/api/window\";\nconst unlisten = await appWindow.onFocusChanged(({ payload: focused }) => {\n console.log('Focus changed, window is focused? ' + focused);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.2"}]}]},"parameters":[{"id":818,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":1169,"typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":1174,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.onFocusChanged"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.onFocusChanged"}},{"id":822,"name":"onMenuClicked","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":2081,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2081"}],"signatures":[{"id":823,"name":"onMenuClicked","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to the window menu item click. The payload is the item id."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from \"@tauri-apps/api/window\";\nconst unlisten = await appWindow.onMenuClicked(({ payload: menuId }) => {\n console.log('Menu clicked: ' + menuId);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.2"}]}]},"parameters":[{"id":824,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":1169,"typeArguments":[{"type":"intrinsic","name":"string"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":1174,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.onMenuClicked"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.onMenuClicked"}},{"id":807,"name":"onMoved","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1946,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1946"}],"signatures":[{"id":808,"name":"onMoved","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to window move."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from \"@tauri-apps/api/window\";\nconst unlisten = await appWindow.onMoved(({ payload: position }) => {\n console.log('Window moved', position);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.2"}]}]},"parameters":[{"id":809,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":1169,"typeArguments":[{"type":"reference","id":1092,"name":"PhysicalPosition"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":1174,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.onMoved"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.onMoved"}},{"id":804,"name":"onResized","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1920,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1920"}],"signatures":[{"id":805,"name":"onResized","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to window resize."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from \"@tauri-apps/api/window\";\nconst unlisten = await appWindow.onResized(({ payload: size }) => {\n console.log('Window resized', size);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.2"}]}]},"parameters":[{"id":806,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":1169,"typeArguments":[{"type":"reference","id":1073,"name":"PhysicalSize"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":1174,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.onResized"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.onResized"}},{"id":819,"name":"onScaleChanged","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":2053,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2053"}],"signatures":[{"id":820,"name":"onScaleChanged","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to window scale change. Emitted when the window's scale factor has changed.\nThe following user actions can cause DPI changes:\n- Changing the display's resolution.\n- Changing the display's scale factor (e.g. in Control Panel on Windows).\n- Moving the window to a display with a different scale factor."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from \"@tauri-apps/api/window\";\nconst unlisten = await appWindow.onScaleChanged(({ payload }) => {\n console.log('Scale changed', payload.scaleFactor, payload.size);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.2"}]}]},"parameters":[{"id":821,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":1169,"typeArguments":[{"type":"reference","id":1119,"name":"ScaleFactorChanged"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":1174,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.onScaleChanged"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.onScaleChanged"}},{"id":828,"name":"onThemeChanged","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":2162,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2162"}],"signatures":[{"id":829,"name":"onThemeChanged","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to the system theme change."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from \"@tauri-apps/api/window\";\nconst unlisten = await appWindow.onThemeChanged(({ payload: theme }) => {\n console.log('New theme: ' + theme);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.2"}]}]},"parameters":[{"id":830,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":1169,"typeArguments":[{"type":"reference","id":1112,"name":"Theme"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":1174,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.onThemeChanged"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.onThemeChanged"}},{"id":838,"name":"once","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":386,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L386"}],"signatures":[{"id":839,"name":"once","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to an one-off event.\nSee "},{"kind":"inline-tag","tag":"@link","text":"`listen`","target":833},{"kind":"text","text":" for more information."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst unlisten = await appWindow.once('initialized', (event) => {\n console.log(`Window initialized!`);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"},{"kind":"text","text":"\n\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event."}]}]},"typeParameter":[{"id":840,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":841,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"intrinsic","name":"string"}},{"id":842,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event handler."}]},"type":{"type":"reference","id":1169,"typeArguments":[{"type":"reference","id":840,"name":"T"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":1174,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.once"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.once"}},{"id":689,"name":"outerPosition","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":525,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L525"}],"signatures":[{"id":690,"name":"outerPosition","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"The position of the top-left hand corner of the window relative to the top-left hand corner of the desktop."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst position = await appWindow.outerPosition();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The window's outer position."}]}]},"type":{"type":"reference","typeArguments":[{"type":"reference","id":1092,"name":"PhysicalPosition"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.outerPosition"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.outerPosition"}},{"id":693,"name":"outerSize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":577,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L577"}],"signatures":[{"id":694,"name":"outerSize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"The physical size of the entire window.\nThese dimensions include the title bar and borders. If you don't want that (and you usually don't), use inner_size instead."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst size = await appWindow.outerSize();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The window's outer size."}]}]},"type":{"type":"reference","typeArguments":[{"type":"reference","id":1073,"name":"PhysicalSize"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.outerSize"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.outerSize"}},{"id":721,"name":"requestUserAttention","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":962,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L962"}],"signatures":[{"id":722,"name":"requestUserAttention","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Requests user attention to the window, this has no effect if the application\nis already focused. How requesting for user attention manifests is platform dependent,\nsee "},{"kind":"code","text":"`UserAttentionType`"},{"kind":"text","text":" for details.\n\nProviding "},{"kind":"code","text":"`null`"},{"kind":"text","text":" will unset the request for user attention. Unsetting the request for\nuser attention might not be done automatically by the WM when the window receives input.\n\n#### Platform-specific\n\n- **macOS:** "},{"kind":"code","text":"`null`"},{"kind":"text","text":" has no effect.\n- **Linux:** Urgency levels have the same effect."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.requestUserAttention();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":723,"name":"requestType","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"union","types":[{"type":"literal","value":null},{"type":"reference","id":1103,"name":"UserAttentionType"}]}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.requestUserAttention"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.requestUserAttention"}},{"id":685,"name":"scaleFactor","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":475,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L475"}],"signatures":[{"id":686,"name":"scaleFactor","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"The scale factor that can be used to map physical pixels to logical pixels."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst factor = await appWindow.scaleFactor();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The window's monitor scale factor."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"number"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.scaleFactor"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.scaleFactor"}},{"id":758,"name":"setAlwaysOnTop","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1379,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1379"}],"signatures":[{"id":759,"name":"setAlwaysOnTop","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Whether the window should always be on top of other windows."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setAlwaysOnTop(true);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":760,"name":"alwaysOnTop","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Whether the window should always be on top of other windows or not."}]},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setAlwaysOnTop"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setAlwaysOnTop"}},{"id":733,"name":"setClosable","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1098,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1098"}],"signatures":[{"id":734,"name":"setClosable","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets whether the window's native close button is enabled or not.\n\n#### Platform-specific\n\n- **Linux:** GTK+ will do its best to convince the window manager not to show a close button. Depending on the system, this function may not have any effect when called on a window that is already visible\n- **iOS / Android:** Unsupported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setClosable(false);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":735,"name":"closable","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setClosable"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setClosable"}},{"id":761,"name":"setContentProtected","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1407,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1407"}],"signatures":[{"id":762,"name":"setContentProtected","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Prevents the window contents from being captured by other apps."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setContentProtected(true);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"1.2.0"}]}]},"parameters":[{"id":763,"name":"protected_","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setContentProtected"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setContentProtected"}},{"id":787,"name":"setCursorGrab","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1727,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1727"}],"signatures":[{"id":788,"name":"setCursorGrab","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Grabs the cursor, preventing it from leaving the window.\n\nThere's no guarantee that the cursor will be hidden. You should\nhide it by yourself if you want so.\n\n#### Platform-specific\n\n- **Linux:** Unsupported.\n- **macOS:** This locks the cursor in a fixed location, which looks visually awkward."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setCursorGrab(true);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":789,"name":"grab","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"code","text":"`true`"},{"kind":"text","text":" to grab the cursor icon, "},{"kind":"code","text":"`false`"},{"kind":"text","text":" to release it."}]},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setCursorGrab"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setCursorGrab"}},{"id":793,"name":"setCursorIcon","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1787,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1787"}],"signatures":[{"id":794,"name":"setCursorIcon","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Modifies the cursor icon of the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setCursorIcon('help');\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":795,"name":"icon","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The new cursor icon."}]},"type":{"type":"reference","id":673,"name":"CursorIcon"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setCursorIcon"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setCursorIcon"}},{"id":796,"name":"setCursorPosition","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1814,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1814"}],"signatures":[{"id":797,"name":"setCursorPosition","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Changes the position of the cursor in window coordinates."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow, LogicalPosition } from '@tauri-apps/api/window';\nawait appWindow.setCursorPosition(new LogicalPosition(600, 300));\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":798,"name":"position","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The new cursor position."}]},"type":{"type":"union","types":[{"type":"reference","id":1092,"name":"PhysicalPosition"},{"type":"reference","id":1084,"name":"LogicalPosition"}]}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setCursorPosition"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setCursorPosition"}},{"id":790,"name":"setCursorVisible","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1760,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1760"}],"signatures":[{"id":791,"name":"setCursorVisible","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Modifies the cursor's visibility.\n\n#### Platform-specific\n\n- **Windows:** The cursor is only hidden within the confines of the window.\n- **macOS:** The cursor is hidden as long as the window has input focus, even if the cursor is\n outside of the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setCursorVisible(false);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":792,"name":"visible","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"If "},{"kind":"code","text":"`false`"},{"kind":"text","text":", this will hide the cursor. If "},{"kind":"code","text":"`true`"},{"kind":"text","text":", this will show the cursor."}]},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setCursorVisible"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setCursorVisible"}},{"id":755,"name":"setDecorations","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1352,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1352"}],"signatures":[{"id":756,"name":"setDecorations","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Whether the window should have borders and bars."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setDecorations(false);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":757,"name":"decorations","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Whether the window should have borders and bars."}]},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setDecorations"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setDecorations"}},{"id":779,"name":"setFocus","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1625,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1625"}],"signatures":[{"id":780,"name":"setFocus","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Bring the window to front and focus."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setFocus();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setFocus"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setFocus"}},{"id":776,"name":"setFullscreen","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1599,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1599"}],"signatures":[{"id":777,"name":"setFullscreen","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets the window fullscreen state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setFullscreen(true);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":778,"name":"fullscreen","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Whether the window should go to fullscreen or not."}]},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setFullscreen"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setFullscreen"}},{"id":781,"name":"setIcon","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1658,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1658"}],"signatures":[{"id":782,"name":"setIcon","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets the window icon."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setIcon('/tauri/awesome.png');\n```"},{"kind":"text","text":"\n\nNote that you need the "},{"kind":"code","text":"`icon-ico`"},{"kind":"text","text":" or "},{"kind":"code","text":"`icon-png`"},{"kind":"text","text":" Cargo features to use this API.\nTo enable it, change your Cargo.toml file:\n"},{"kind":"code","text":"```toml\n[dependencies]\ntauri = { version = \"...\", features = [\"...\", \"icon-png\"] }\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":783,"name":"icon","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Icon bytes or path to the icon file."}]},"type":{"type":"union","types":[{"type":"intrinsic","name":"string"},{"type":"reference","name":"Uint8Array","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array","qualifiedName":"Uint8Array","package":"typescript"}]}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setIcon"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setIcon"}},{"id":799,"name":"setIgnoreCursorEvents","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1858,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1858"}],"signatures":[{"id":800,"name":"setIgnoreCursorEvents","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Changes the cursor events behavior."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setIgnoreCursorEvents(true);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":801,"name":"ignore","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"code","text":"`true`"},{"kind":"text","text":" to ignore the cursor events; "},{"kind":"code","text":"`false`"},{"kind":"text","text":" to process them as usual."}]},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setIgnoreCursorEvents"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setIgnoreCursorEvents"}},{"id":770,"name":"setMaxSize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1514,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1514"}],"signatures":[{"id":771,"name":"setMaxSize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets the window maximum inner size. If the "},{"kind":"code","text":"`size`"},{"kind":"text","text":" argument is undefined, the constraint is unset."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow, LogicalSize } from '@tauri-apps/api/window';\nawait appWindow.setMaxSize(new LogicalSize(600, 500));\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":772,"name":"size","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The logical or physical inner size, or "},{"kind":"code","text":"`null`"},{"kind":"text","text":" to unset the constraint."}]},"type":{"type":"union","types":[{"type":"intrinsic","name":"undefined"},{"type":"literal","value":null},{"type":"reference","id":1073,"name":"PhysicalSize"},{"type":"reference","id":1065,"name":"LogicalSize"}]}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setMaxSize"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setMaxSize"}},{"id":727,"name":"setMaximizable","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1033,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1033"}],"signatures":[{"id":728,"name":"setMaximizable","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets whether the window's native maximize button is enabled or not.\nIf resizable is set to false, this setting is ignored.\n\n#### Platform-specific\n\n- **macOS:** Disables the \"zoom\" button in the window titlebar, which is also used to enter fullscreen mode.\n- **Linux / iOS / Android:** Unsupported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setMaximizable(false);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":729,"name":"maximizable","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setMaximizable"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setMaximizable"}},{"id":767,"name":"setMinSize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1472,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1472"}],"signatures":[{"id":768,"name":"setMinSize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets the window minimum inner size. If the "},{"kind":"code","text":"`size`"},{"kind":"text","text":" argument is not provided, the constraint is unset."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow, PhysicalSize } from '@tauri-apps/api/window';\nawait appWindow.setMinSize(new PhysicalSize(600, 500));\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":769,"name":"size","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The logical or physical inner size, or "},{"kind":"code","text":"`null`"},{"kind":"text","text":" to unset the constraint."}]},"type":{"type":"union","types":[{"type":"intrinsic","name":"undefined"},{"type":"literal","value":null},{"type":"reference","id":1073,"name":"PhysicalSize"},{"type":"reference","id":1065,"name":"LogicalSize"}]}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setMinSize"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setMinSize"}},{"id":730,"name":"setMinimizable","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1065,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1065"}],"signatures":[{"id":731,"name":"setMinimizable","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets whether the window's native minimize button is enabled or not.\n\n#### Platform-specific\n\n- **Linux / iOS / Android:** Unsupported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setMinimizable(false);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":732,"name":"minimizable","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setMinimizable"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setMinimizable"}},{"id":773,"name":"setPosition","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1556,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1556"}],"signatures":[{"id":774,"name":"setPosition","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets the window outer position."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow, LogicalPosition } from '@tauri-apps/api/window';\nawait appWindow.setPosition(new LogicalPosition(600, 500));\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":775,"name":"position","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The new position, in logical or physical pixels."}]},"type":{"type":"union","types":[{"type":"reference","id":1092,"name":"PhysicalPosition"},{"type":"reference","id":1084,"name":"LogicalPosition"}]}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setPosition"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setPosition"}},{"id":724,"name":"setResizable","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":999,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L999"}],"signatures":[{"id":725,"name":"setResizable","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Updates the window resizable flag."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setResizable(false);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":726,"name":"resizable","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setResizable"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setResizable"}},{"id":764,"name":"setSize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1434,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1434"}],"signatures":[{"id":765,"name":"setSize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Resizes the window with a new inner size."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow, LogicalSize } from '@tauri-apps/api/window';\nawait appWindow.setSize(new LogicalSize(600, 500));\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":766,"name":"size","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The logical or physical inner size."}]},"type":{"type":"union","types":[{"type":"reference","id":1073,"name":"PhysicalSize"},{"type":"reference","id":1065,"name":"LogicalSize"}]}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setSize"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setSize"}},{"id":784,"name":"setSkipTaskbar","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1692,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1692"}],"signatures":[{"id":785,"name":"setSkipTaskbar","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Whether the window icon should be hidden from the taskbar or not.\n\n#### Platform-specific\n\n- **macOS:** Unsupported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setSkipTaskbar(true);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":786,"name":"skip","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"true to hide window icon, false to show it."}]},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setSkipTaskbar"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setSkipTaskbar"}},{"id":736,"name":"setTitle","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1125,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1125"}],"signatures":[{"id":737,"name":"setTitle","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets the window title."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setTitle('Tauri');\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":738,"name":"title","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The new title"}]},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setTitle"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setTitle"}},{"id":749,"name":"show","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1276,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1276"}],"signatures":[{"id":750,"name":"show","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets the window visibility to true."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.show();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.show"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.show"}},{"id":802,"name":"startDragging","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1884,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1884"}],"signatures":[{"id":803,"name":"startDragging","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Starts dragging the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.startDragging();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.startDragging"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.startDragging"}},{"id":717,"name":"theme","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":899,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L899"}],"signatures":[{"id":718,"name":"theme","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current theme.\n\n#### Platform-specific\n\n- **macOS:** Theme was introduced on macOS 10.14. Returns "},{"kind":"code","text":"`light`"},{"kind":"text","text":" on macOS 10.13 and below."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst theme = await appWindow.theme();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The window theme."}]}]},"type":{"type":"reference","typeArguments":[{"type":"union","types":[{"type":"literal","value":null},{"type":"reference","id":1112,"name":"Theme"}]}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.theme"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.theme"}},{"id":715,"name":"title","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":869,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L869"}],"signatures":[{"id":716,"name":"title","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current title."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst title = await appWindow.title();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.3.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.title"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.title"}},{"id":743,"name":"toggleMaximize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1201,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1201"}],"signatures":[{"id":744,"name":"toggleMaximize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Toggles the window maximized state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.toggleMaximize();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.toggleMaximize"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.toggleMaximize"}},{"id":741,"name":"unmaximize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1176,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1176"}],"signatures":[{"id":742,"name":"unmaximize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Unmaximizes the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.unmaximize();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.unmaximize"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.unmaximize"}},{"id":747,"name":"unminimize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1251,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L1251"}],"signatures":[{"id":748,"name":"unminimize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Unminimizes the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.unminimize();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.unminimize"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.unminimize"}},{"id":676,"name":"getByLabel","kind":2048,"kindString":"Method","flags":{"isStatic":true},"sources":[{"fileName":"window.ts","line":2279,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2279"}],"signatures":[{"id":677,"name":"getByLabel","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the WebviewWindow for the webview associated with the given label."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { WebviewWindow } from '@tauri-apps/api/window';\nconst mainWindow = WebviewWindow.getByLabel('main');\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The WebviewWindow instance to communicate with the webview or null if the webview doesn't exist."}]}]},"parameters":[{"id":678,"name":"label","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The webview window label."}]},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"union","types":[{"type":"literal","value":null},{"type":"reference","id":675,"name":"WebviewWindow"}]}}]},{"id":679,"name":"getFocusedWindow","kind":2048,"kindString":"Method","flags":{"isStatic":true},"sources":[{"fileName":"window.ts","line":2299,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2299"}],"signatures":[{"id":680,"name":"getFocusedWindow","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the focused window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { WebviewWindow } from '@tauri-apps/api/window';\nconst focusedWindow = WebviewWindow.getFocusedWindow();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The WebviewWindow instance to communicate with the webview or "},{"kind":"code","text":"`undefined`"},{"kind":"text","text":" if there is not any focused window."}]},{"tag":"@since","content":[{"kind":"text","text":"1.4"}]}]},"type":{"type":"reference","typeArguments":[{"type":"union","types":[{"type":"literal","value":null},{"type":"reference","id":675,"name":"WebviewWindow"}]}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Constructors","children":[681]},{"title":"Properties","children":[831,832]},{"title":"Methods","children":[719,753,843,751,687,691,711,703,701,695,707,699,709,697,705,713,833,739,745,810,825,816,822,807,804,819,828,838,689,693,721,685,758,733,761,787,793,796,790,755,779,776,781,799,770,727,767,730,773,724,764,784,736,749,802,717,715,743,741,747,676,679]}],"sources":[{"fileName":"window.ts","line":2227,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2227"}],"extendedTypes":[{"type":"reference","name":"WindowManager"}]},{"id":1114,"name":"Monitor","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[{"kind":"text","text":"Allows you to retrieve information about a given monitor."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":1115,"name":"name","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Human-readable name of the monitor"}]},"sources":[{"fileName":"window.ts","line":83,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L83"}],"type":{"type":"union","types":[{"type":"literal","value":null},{"type":"intrinsic","name":"string"}]}},{"id":1117,"name":"position","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"the Top-left corner position of the monitor relative to the larger full screen area."}]},"sources":[{"fileName":"window.ts","line":87,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L87"}],"type":{"type":"reference","id":1092,"name":"PhysicalPosition"}},{"id":1118,"name":"scaleFactor","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The scale factor that can be used to map physical pixels to logical pixels."}]},"sources":[{"fileName":"window.ts","line":89,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L89"}],"type":{"type":"intrinsic","name":"number"}},{"id":1116,"name":"size","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The monitor's resolution."}]},"sources":[{"fileName":"window.ts","line":85,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L85"}],"type":{"type":"reference","id":1073,"name":"PhysicalSize"}}],"groups":[{"title":"Properties","children":[1115,1117,1118,1116]}],"sources":[{"fileName":"window.ts","line":81,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L81"}]},{"id":1119,"name":"ScaleFactorChanged","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[{"kind":"text","text":"The payload for the "},{"kind":"code","text":"`scaleChange`"},{"kind":"text","text":" event."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.2"}]}]},"children":[{"id":1120,"name":"scaleFactor","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The new window scale factor."}]},"sources":[{"fileName":"window.ts","line":99,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L99"}],"type":{"type":"intrinsic","name":"number"}},{"id":1121,"name":"size","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The new window size"}]},"sources":[{"fileName":"window.ts","line":101,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L101"}],"type":{"type":"reference","id":1073,"name":"PhysicalSize"}}],"groups":[{"title":"Properties","children":[1120,1121]}],"sources":[{"fileName":"window.ts","line":97,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L97"}]},{"id":1131,"name":"WindowOptions","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[{"kind":"text","text":"Configuration for the window to create."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":1157,"name":"acceptFirstMouse","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether clicking an inactive window also clicks through to the webview on macOS."}]},"sources":[{"fileName":"window.ts","line":2410,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2410"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":1150,"name":"alwaysOnTop","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window should always be on top of other windows or not."}]},"sources":[{"fileName":"window.ts","line":2382,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2382"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":1133,"name":"center","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Show window in the center of the screen.."}]},"sources":[{"fileName":"window.ts","line":2344,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2344"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":1162,"name":"closable","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window's native close button is enabled or not. Defaults to "},{"kind":"code","text":"`true`"},{"kind":"text","text":"."}]},"sources":[{"fileName":"window.ts","line":2433,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2433"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":1151,"name":"contentProtected","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Prevents the window contents from being captured by other apps."}]},"sources":[{"fileName":"window.ts","line":2384,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2384"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":1149,"name":"decorations","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window should have borders and bars or not."}]},"sources":[{"fileName":"window.ts","line":2380,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2380"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":1153,"name":"fileDropEnabled","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the file drop is enabled or not on the webview. By default it is enabled.\n\nDisabling it is required to use drag and drop on the frontend on Windows."}]},"sources":[{"fileName":"window.ts","line":2392,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2392"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":1145,"name":"focus","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window will be initially focused or not."}]},"sources":[{"fileName":"window.ts","line":2368,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2368"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":1144,"name":"fullscreen","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window is in fullscreen mode or not."}]},"sources":[{"fileName":"window.ts","line":2366,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2366"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":1137,"name":"height","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The initial height."}]},"sources":[{"fileName":"window.ts","line":2352,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2352"}],"type":{"type":"intrinsic","name":"number"}},{"id":1156,"name":"hiddenTitle","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"If "},{"kind":"code","text":"`true`"},{"kind":"text","text":", sets the window title to be hidden on macOS."}]},"sources":[{"fileName":"window.ts","line":2406,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2406"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":1141,"name":"maxHeight","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The maximum height. Only applies if "},{"kind":"code","text":"`maxWidth`"},{"kind":"text","text":" is also set."}]},"sources":[{"fileName":"window.ts","line":2360,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2360"}],"type":{"type":"intrinsic","name":"number"}},{"id":1140,"name":"maxWidth","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The maximum width. Only applies if "},{"kind":"code","text":"`maxHeight`"},{"kind":"text","text":" is also set."}]},"sources":[{"fileName":"window.ts","line":2358,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2358"}],"type":{"type":"intrinsic","name":"number"}},{"id":1160,"name":"maximizable","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window's native maximize button is enabled or not. Defaults to "},{"kind":"code","text":"`true`"},{"kind":"text","text":"."}]},"sources":[{"fileName":"window.ts","line":2425,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2425"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":1147,"name":"maximized","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window should be maximized upon creation or not."}]},"sources":[{"fileName":"window.ts","line":2376,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2376"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":1139,"name":"minHeight","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The minimum height. Only applies if "},{"kind":"code","text":"`minWidth`"},{"kind":"text","text":" is also set."}]},"sources":[{"fileName":"window.ts","line":2356,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2356"}],"type":{"type":"intrinsic","name":"number"}},{"id":1138,"name":"minWidth","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The minimum width. Only applies if "},{"kind":"code","text":"`minHeight`"},{"kind":"text","text":" is also set."}]},"sources":[{"fileName":"window.ts","line":2354,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2354"}],"type":{"type":"intrinsic","name":"number"}},{"id":1161,"name":"minimizable","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window's native minimize button is enabled or not. Defaults to "},{"kind":"code","text":"`true`"},{"kind":"text","text":"."}]},"sources":[{"fileName":"window.ts","line":2429,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2429"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":1142,"name":"resizable","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window is resizable or not."}]},"sources":[{"fileName":"window.ts","line":2362,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2362"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":1152,"name":"skipTaskbar","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether or not the window icon should be added to the taskbar."}]},"sources":[{"fileName":"window.ts","line":2386,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2386"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":1158,"name":"tabbingIdentifier","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Defines the window [tabbing identifier](https://developer.apple.com/documentation/appkit/nswindow/1644704-tabbingidentifier) on macOS.\n\nWindows with the same tabbing identifier will be grouped together.\nIf the tabbing identifier is not set, automatic tabbing will be disabled."}]},"sources":[{"fileName":"window.ts","line":2417,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2417"}],"type":{"type":"intrinsic","name":"string"}},{"id":1154,"name":"theme","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The initial window theme. Defaults to the system theme.\n\nOnly implemented on Windows and macOS 10.14+."}]},"sources":[{"fileName":"window.ts","line":2398,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2398"}],"type":{"type":"reference","id":1112,"name":"Theme"}},{"id":1143,"name":"title","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Window title."}]},"sources":[{"fileName":"window.ts","line":2364,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2364"}],"type":{"type":"intrinsic","name":"string"}},{"id":1155,"name":"titleBarStyle","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The style of the macOS title bar."}]},"sources":[{"fileName":"window.ts","line":2402,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2402"}],"type":{"type":"reference","id":1113,"name":"TitleBarStyle"}},{"id":1146,"name":"transparent","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window is transparent or not.\nNote that on "},{"kind":"code","text":"`macOS`"},{"kind":"text","text":" this requires the "},{"kind":"code","text":"`macos-private-api`"},{"kind":"text","text":" feature flag, enabled under "},{"kind":"code","text":"`tauri.conf.json > tauri > macOSPrivateApi`"},{"kind":"text","text":".\nWARNING: Using private APIs on "},{"kind":"code","text":"`macOS`"},{"kind":"text","text":" prevents your application from being accepted to the "},{"kind":"code","text":"`App Store`"},{"kind":"text","text":"."}]},"sources":[{"fileName":"window.ts","line":2374,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2374"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":1132,"name":"url","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Remote URL or local file path to open.\n\n- URL such as "},{"kind":"code","text":"`https://github.com/tauri-apps`"},{"kind":"text","text":" is opened directly on a Tauri window.\n- data: URL such as "},{"kind":"code","text":"`data:text/html,...`"},{"kind":"text","text":" is only supported with the "},{"kind":"code","text":"`window-data-url`"},{"kind":"text","text":" Cargo feature for the "},{"kind":"code","text":"`tauri`"},{"kind":"text","text":" dependency.\n- local file path or route such as "},{"kind":"code","text":"`/path/to/page.html`"},{"kind":"text","text":" or "},{"kind":"code","text":"`/users`"},{"kind":"text","text":" is appended to the application URL (the devServer URL on development, or "},{"kind":"code","text":"`tauri://localhost/`"},{"kind":"text","text":" and "},{"kind":"code","text":"`https://tauri.localhost/`"},{"kind":"text","text":" on production)."}]},"sources":[{"fileName":"window.ts","line":2342,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2342"}],"type":{"type":"intrinsic","name":"string"}},{"id":1159,"name":"userAgent","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The user agent for the webview."}]},"sources":[{"fileName":"window.ts","line":2421,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2421"}],"type":{"type":"intrinsic","name":"string"}},{"id":1148,"name":"visible","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window should be immediately visible upon creation or not."}]},"sources":[{"fileName":"window.ts","line":2378,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2378"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":1136,"name":"width","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The initial width."}]},"sources":[{"fileName":"window.ts","line":2350,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2350"}],"type":{"type":"intrinsic","name":"number"}},{"id":1134,"name":"x","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The initial vertical position. Only applies if "},{"kind":"code","text":"`y`"},{"kind":"text","text":" is also set."}]},"sources":[{"fileName":"window.ts","line":2346,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2346"}],"type":{"type":"intrinsic","name":"number"}},{"id":1135,"name":"y","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The initial horizontal position. Only applies if "},{"kind":"code","text":"`x`"},{"kind":"text","text":" is also set."}]},"sources":[{"fileName":"window.ts","line":2348,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2348"}],"type":{"type":"intrinsic","name":"number"}}],"groups":[{"title":"Properties","children":[1157,1150,1133,1162,1151,1149,1153,1145,1144,1137,1156,1141,1140,1160,1147,1139,1138,1161,1142,1152,1158,1154,1143,1155,1146,1132,1159,1148,1136,1134,1135]}],"sources":[{"fileName":"window.ts","line":2334,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2334"}]},{"id":673,"name":"CursorIcon","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"window.ts","line":237,"character":12,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L237"}],"type":{"type":"union","types":[{"type":"literal","value":"default"},{"type":"literal","value":"crosshair"},{"type":"literal","value":"hand"},{"type":"literal","value":"arrow"},{"type":"literal","value":"move"},{"type":"literal","value":"text"},{"type":"literal","value":"wait"},{"type":"literal","value":"help"},{"type":"literal","value":"progress"},{"type":"literal","value":"notAllowed"},{"type":"literal","value":"contextMenu"},{"type":"literal","value":"cell"},{"type":"literal","value":"verticalText"},{"type":"literal","value":"alias"},{"type":"literal","value":"copy"},{"type":"literal","value":"noDrop"},{"type":"literal","value":"grab"},{"type":"literal","value":"grabbing"},{"type":"literal","value":"allScroll"},{"type":"literal","value":"zoomIn"},{"type":"literal","value":"zoomOut"},{"type":"literal","value":"eResize"},{"type":"literal","value":"nResize"},{"type":"literal","value":"neResize"},{"type":"literal","value":"nwResize"},{"type":"literal","value":"sResize"},{"type":"literal","value":"seResize"},{"type":"literal","value":"swResize"},{"type":"literal","value":"wResize"},{"type":"literal","value":"ewResize"},{"type":"literal","value":"nsResize"},{"type":"literal","value":"neswResize"},{"type":"literal","value":"nwseResize"},{"type":"literal","value":"colResize"},{"type":"literal","value":"rowResize"}]}},{"id":1122,"name":"FileDropEvent","kind":4194304,"kindString":"Type alias","flags":{},"comment":{"summary":[{"kind":"text","text":"The file drop event types."}]},"sources":[{"fileName":"window.ts","line":105,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L105"}],"type":{"type":"union","types":[{"type":"reflection","declaration":{"id":1123,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"children":[{"id":1125,"name":"paths","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":106,"character":21,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L106"}],"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}},{"id":1124,"name":"type","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":106,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L106"}],"type":{"type":"literal","value":"hover"}}],"groups":[{"title":"Properties","children":[1125,1124]}],"sources":[{"fileName":"window.ts","line":106,"character":4,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L106"}]}},{"type":"reflection","declaration":{"id":1126,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"children":[{"id":1128,"name":"paths","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":107,"character":20,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L107"}],"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}},{"id":1127,"name":"type","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":107,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L107"}],"type":{"type":"literal","value":"drop"}}],"groups":[{"title":"Properties","children":[1128,1127]}],"sources":[{"fileName":"window.ts","line":107,"character":4,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L107"}]}},{"type":"reflection","declaration":{"id":1129,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"children":[{"id":1130,"name":"type","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":108,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L108"}],"type":{"type":"literal","value":"cancel"}}],"groups":[{"title":"Properties","children":[1130]}],"sources":[{"fileName":"window.ts","line":108,"character":4,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L108"}]}}]}},{"id":1112,"name":"Theme","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"window.ts","line":73,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L73"}],"type":{"type":"union","types":[{"type":"literal","value":"light"},{"type":"literal","value":"dark"}]}},{"id":1113,"name":"TitleBarStyle","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"window.ts","line":74,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L74"}],"type":{"type":"union","types":[{"type":"literal","value":"visible"},{"type":"literal","value":"transparent"},{"type":"literal","value":"overlay"}]}},{"id":1064,"name":"appWindow","kind":32,"kindString":"Variable","flags":{},"comment":{"summary":[{"kind":"text","text":"The WebviewWindow for the current window."}]},"sources":[{"fileName":"window.ts","line":2310,"character":4,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2310"}],"type":{"type":"reference","id":675,"name":"WebviewWindow"}},{"id":1110,"name":"availableMonitors","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"window.ts","line":2515,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2515"}],"signatures":[{"id":1111,"name":"availableMonitors","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the list of all the monitors available on the system."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { availableMonitors } from '@tauri-apps/api/window';\nconst monitors = availableMonitors();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"array","elementType":{"type":"reference","id":1114,"name":"Monitor"}}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":1106,"name":"currentMonitor","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"window.ts","line":2466,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2466"}],"signatures":[{"id":1107,"name":"currentMonitor","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the monitor on which the window currently resides.\nReturns "},{"kind":"code","text":"`null`"},{"kind":"text","text":" if current monitor can't be detected."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { currentMonitor } from '@tauri-apps/api/window';\nconst monitor = currentMonitor();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"union","types":[{"type":"reference","id":1114,"name":"Monitor"},{"type":"literal","value":null}]}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":1062,"name":"getAll","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"window.ts","line":295,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L295"}],"signatures":[{"id":1063,"name":"getAll","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets a list of instances of "},{"kind":"code","text":"`WebviewWindow`"},{"kind":"text","text":" for all available webview windows."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"array","elementType":{"type":"reference","id":675,"name":"WebviewWindow"}}}]},{"id":1060,"name":"getCurrent","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"window.ts","line":283,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L283"}],"signatures":[{"id":1061,"name":"getCurrent","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Get an instance of "},{"kind":"code","text":"`WebviewWindow`"},{"kind":"text","text":" for the current webview window."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","id":675,"name":"WebviewWindow"}}]},{"id":1108,"name":"primaryMonitor","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"window.ts","line":2491,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2491"}],"signatures":[{"id":1109,"name":"primaryMonitor","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the primary monitor of the system.\nReturns "},{"kind":"code","text":"`null`"},{"kind":"text","text":" if it can't identify any monitor as a primary one."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { primaryMonitor } from '@tauri-apps/api/window';\nconst monitor = primaryMonitor();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"union","types":[{"type":"reference","id":1114,"name":"Monitor"},{"type":"literal","value":null}]}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Enumerations","children":[1103]},{"title":"Classes","children":[1048,1084,1065,1092,1073,675]},{"title":"Interfaces","children":[1114,1119,1131]},{"title":"Type Aliases","children":[673,1122,1112,1113]},{"title":"Variables","children":[1064]},{"title":"Functions","children":[1110,1106,1062,1060,1108]}],"sources":[{"fileName":"window.ts","line":68,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L68"}]}],"groups":[{"title":"Modules","children":[1,12,24,30,72,107,207,228,334,348,362,379,455,461,632,650,672]}]} \ No newline at end of file +{"id":0,"name":"@tauri-apps/api","kind":1,"flags":{},"originalName":"","children":[{"id":1,"name":"event","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"The event system allows you to emit events to the backend and listen to events from it.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.event`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":"."}]},"children":[{"id":36,"name":"TauriEvent","kind":8,"kindString":"Enumeration","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"children":[{"id":49,"name":"MENU","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":59,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L59"}],"type":{"type":"literal","value":"tauri://menu"}},{"id":43,"name":"WINDOW_BLUR","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":53,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L53"}],"type":{"type":"literal","value":"tauri://blur"}},{"id":39,"name":"WINDOW_CLOSE_REQUESTED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":49,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L49"}],"type":{"type":"literal","value":"tauri://close-requested"}},{"id":40,"name":"WINDOW_CREATED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":50,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L50"}],"type":{"type":"literal","value":"tauri://window-created"}},{"id":41,"name":"WINDOW_DESTROYED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":51,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L51"}],"type":{"type":"literal","value":"tauri://destroyed"}},{"id":46,"name":"WINDOW_FILE_DROP","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":56,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L56"}],"type":{"type":"literal","value":"tauri://file-drop"}},{"id":48,"name":"WINDOW_FILE_DROP_CANCELLED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":58,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L58"}],"type":{"type":"literal","value":"tauri://file-drop-cancelled"}},{"id":47,"name":"WINDOW_FILE_DROP_HOVER","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":57,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L57"}],"type":{"type":"literal","value":"tauri://file-drop-hover"}},{"id":42,"name":"WINDOW_FOCUS","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":52,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L52"}],"type":{"type":"literal","value":"tauri://focus"}},{"id":38,"name":"WINDOW_MOVED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":48,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L48"}],"type":{"type":"literal","value":"tauri://move"}},{"id":37,"name":"WINDOW_RESIZED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":47,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L47"}],"type":{"type":"literal","value":"tauri://resize"}},{"id":44,"name":"WINDOW_SCALE_FACTOR_CHANGED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":54,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L54"}],"type":{"type":"literal","value":"tauri://scale-change"}},{"id":45,"name":"WINDOW_THEME_CHANGED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":55,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L55"}],"type":{"type":"literal","value":"tauri://theme-changed"}}],"groups":[{"title":"Enumeration Members","children":[49,43,39,40,41,46,48,47,42,38,37,44,45]}],"sources":[{"fileName":"event.ts","line":46,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L46"}]},{"id":2,"name":"Event","kind":256,"kindString":"Interface","flags":{},"children":[{"id":3,"name":"event","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name"}]},"sources":[{"fileName":"event.ts","line":16,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L16"}],"type":{"type":"reference","id":16,"name":"EventName"}},{"id":5,"name":"id","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Event identifier used to unlisten"}]},"sources":[{"fileName":"event.ts","line":20,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L20"}],"type":{"type":"intrinsic","name":"number"}},{"id":6,"name":"payload","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Event payload"}]},"sources":[{"fileName":"event.ts","line":22,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L22"}],"type":{"type":"reference","id":7,"name":"T"}},{"id":4,"name":"windowLabel","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The label of the window that emitted this event."}]},"sources":[{"fileName":"event.ts","line":18,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L18"}],"type":{"type":"intrinsic","name":"string"}}],"groups":[{"title":"Properties","children":[3,5,6,4]}],"sources":[{"fileName":"event.ts","line":14,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L14"}],"typeParameters":[{"id":7,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}]},{"id":17,"name":"Options","kind":256,"kindString":"Interface","flags":{},"children":[{"id":18,"name":"target","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Label of the window the function targets.\n\nWhen listening to events and using this value,\nonly events triggered by the window with the given label are received.\n\nWhen emitting events, only the window with the given label will receive it."}]},"sources":[{"fileName":"event.ts","line":40,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L40"}],"type":{"type":"intrinsic","name":"string"}}],"groups":[{"title":"Properties","children":[18]}],"sources":[{"fileName":"event.ts","line":31,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L31"}]},{"id":8,"name":"EventCallback","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"event.ts","line":25,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L25"}],"typeParameters":[{"id":12,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"type":{"type":"reflection","declaration":{"id":9,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"event.ts","line":25,"character":24,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L25"}],"signatures":[{"id":10,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":11,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":2,"typeArguments":[{"type":"reference","id":12,"name":"T"}],"name":"Event"}}],"type":{"type":"intrinsic","name":"void"}}]}}},{"id":16,"name":"EventName","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"event.ts","line":29,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L29"}],"type":{"type":"union","types":[{"type":"template-literal","head":"","tail":[[{"type":"reference","id":36,"name":"TauriEvent"},""]]},{"type":"intersection","types":[{"type":"intrinsic","name":"string"},{"type":"reference","typeArguments":[{"type":"intrinsic","name":"never"},{"type":"intrinsic","name":"never"}],"name":"Record","externalUrl":"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type","qualifiedName":"Record","package":"typescript"}]}]}},{"id":13,"name":"UnlistenFn","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"event.ts","line":27,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L27"}],"type":{"type":"reflection","declaration":{"id":14,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"event.ts","line":27,"character":18,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L27"}],"signatures":[{"id":15,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"intrinsic","name":"void"}}]}}},{"id":31,"name":"emit","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"event.ts","line":164,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L164"}],"signatures":[{"id":32,"name":"emit","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Emits an event to the backend and all Tauri windows."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { emit } from '@tauri-apps/api/event';\nawait emit('frontend-loaded', { loggedIn: true, token: 'authToken' });\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":33,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"intrinsic","name":"string"}},{"id":34,"name":"payload","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"unknown"}},{"id":35,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","id":17,"name":"Options"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":19,"name":"listen","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"event.ts","line":99,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L99"}],"signatures":[{"id":20,"name":"listen","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to an event. The event can be either global or window-specific.\nSee "},{"kind":"inline-tag","tag":"@link","text":"windowLabel","target":4},{"kind":"text","text":" to check the event source."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { listen } from '@tauri-apps/api/event';\nconst unlisten = await listen('error', (event) => {\n console.log(`Got error in window ${event.windowLabel}, payload: ${event.payload}`);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"typeParameter":[{"id":21,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":22,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"reference","id":16,"name":"EventName"}},{"id":23,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event handler callback."}]},"type":{"type":"reference","id":8,"typeArguments":[{"type":"reference","id":21,"name":"T"}],"name":"EventCallback"}},{"id":24,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","id":17,"name":"Options"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":13,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":25,"name":"once","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"event.ts","line":137,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L137"}],"signatures":[{"id":26,"name":"once","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to an one-off event. See "},{"kind":"inline-tag","tag":"@link","text":"listen","target":19},{"kind":"text","text":" for more information."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { once } from '@tauri-apps/api/event';\ninterface LoadedPayload {\n loggedIn: boolean,\n token: string\n}\nconst unlisten = await once('loaded', (event) => {\n console.log(`App is loaded, loggedIn: ${event.payload.loggedIn}, token: ${event.payload.token}`);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"typeParameter":[{"id":27,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":28,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"reference","id":16,"name":"EventName"}},{"id":29,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":8,"typeArguments":[{"type":"reference","id":27,"name":"T"}],"name":"EventCallback"}},{"id":30,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","id":17,"name":"Options"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":13,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Enumerations","children":[36]},{"title":"Interfaces","children":[2,17]},{"title":"Type Aliases","children":[8,16,13]},{"title":"Functions","children":[31,19,25]}],"sources":[{"fileName":"event.ts","line":12,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/event.ts#L12"}]},{"id":50,"name":"mocks","kind":2,"kindString":"Module","flags":{},"children":[{"id":62,"name":"clearMocks","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"mocks.ts","line":163,"character":16,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/mocks.ts#L163"}],"signatures":[{"id":63,"name":"clearMocks","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Clears mocked functions/data injected by the other functions in this module.\nWhen using a test runner that doesn't provide a fresh window object for each test, calling this function will reset tauri specific properties.\n\n# Example\n\n"},{"kind":"code","text":"```js\nimport { mockWindows, clearMocks } from \"@tauri-apps/api/mocks\"\n\nafterEach(() => {\n clearMocks()\n})\n\ntest(\"mocked windows\", () => {\n mockWindows(\"main\", \"second\", \"third\");\n\n expect(window.__TAURI_INTERNALS__).toHaveProperty(\"metadata\")\n})\n\ntest(\"no mocked windows\", () => {\n expect(window.__TAURI_INTERNALS__).not.toHaveProperty(\"metadata\")\n})\n```"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"intrinsic","name":"void"}}]},{"id":51,"name":"mockIPC","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"mocks.ts","line":65,"character":16,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/mocks.ts#L65"}],"signatures":[{"id":52,"name":"mockIPC","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Intercepts all IPC requests with the given mock handler.\n\nThis function can be used when testing tauri frontend applications or when running the frontend in a Node.js context during static site generation.\n\n# Examples\n\nTesting setup using vitest:\n"},{"kind":"code","text":"```js\nimport { mockIPC, clearMocks } from \"@tauri-apps/api/mocks\"\nimport { invoke } from \"@tauri-apps/api/primitives\"\n\nafterEach(() => {\n clearMocks()\n})\n\ntest(\"mocked command\", () => {\n mockIPC((cmd, payload) => {\n switch (cmd) {\n case \"add\":\n return (payload.a as number) + (payload.b as number);\n default:\n break;\n }\n });\n\n expect(invoke('add', { a: 12, b: 15 })).resolves.toBe(27);\n})\n```"},{"kind":"text","text":"\n\nThe callback function can also return a Promise:\n"},{"kind":"code","text":"```js\nimport { mockIPC, clearMocks } from \"@tauri-apps/api/mocks\"\nimport { invoke } from \"@tauri-apps/api/primitives\"\n\nafterEach(() => {\n clearMocks()\n})\n\ntest(\"mocked command\", () => {\n mockIPC((cmd, payload) => {\n if(cmd === \"get_data\") {\n return fetch(\"https://example.com/data.json\")\n .then((response) => response.json())\n }\n });\n\n expect(invoke('get_data')).resolves.toBe({ foo: 'bar' });\n})\n```"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":53,"name":"cb","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":54,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"mocks.ts","line":66,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/mocks.ts#L66"}],"signatures":[{"id":55,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":56,"name":"cmd","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":57,"name":"payload","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"},{"type":"intrinsic","name":"unknown"}],"name":"Record","externalUrl":"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type","qualifiedName":"Record","package":"typescript"}}],"type":{"type":"intrinsic","name":"any"}}]}}}],"type":{"type":"intrinsic","name":"void"}}]},{"id":58,"name":"mockWindows","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"mocks.ts","line":127,"character":16,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/mocks.ts#L127"}],"signatures":[{"id":59,"name":"mockWindows","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Mocks one or many window labels.\nIn non-tauri context it is required to call this function *before* using the "},{"kind":"code","text":"`@tauri-apps/api/window`"},{"kind":"text","text":" module.\n\nThis function only mocks the *presence* of windows,\nwindow properties (e.g. width and height) can be mocked like regular IPC calls using the "},{"kind":"code","text":"`mockIPC`"},{"kind":"text","text":" function.\n\n# Examples\n\n"},{"kind":"code","text":"```js\nimport { mockWindows } from \"@tauri-apps/api/mocks\";\nimport { getCurrent } from \"@tauri-apps/api/window\";\n\nmockWindows(\"main\", \"second\", \"third\");\n\nconst win = getCurrent();\n\nwin.label // \"main\"\n```"},{"kind":"text","text":"\n\n"},{"kind":"code","text":"```js\nimport { mockWindows } from \"@tauri-apps/api/mocks\";\n\nmockWindows(\"main\", \"second\", \"third\");\n\nmockIPC((cmd, args) => {\n if (cmd === \"plugin:event|emit\") {\n console.log('emit event', args?.event, args?.payload);\n }\n});\n\nconst { emit } = await import(\"@tauri-apps/api/event\");\nawait emit('loaded'); // this will cause the mocked IPC handler to log to the console.\n```"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":60,"name":"current","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Label of window this JavaScript context is running in."}]},"type":{"type":"intrinsic","name":"string"}},{"id":61,"name":"additionalWindows","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"comment":{"summary":[{"kind":"text","text":"Label of additional windows the app has."}]},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}}],"type":{"type":"intrinsic","name":"void"}}]}],"groups":[{"title":"Functions","children":[62,51,58]}],"sources":[{"fileName":"mocks.ts","line":5,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/mocks.ts#L5"}]},{"id":64,"name":"path","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"The path module provides utilities for working with file and directory paths.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.path`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":".\n\nIt is recommended to allowlist only the APIs you use for optimal bundle size and security."}]},"children":[{"id":65,"name":"BaseDirectory","kind":8,"kindString":"Enumeration","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"children":[{"id":81,"name":"AppCache","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":35,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L35"}],"type":{"type":"literal","value":16}},{"id":78,"name":"AppConfig","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":32,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L32"}],"type":{"type":"literal","value":13}},{"id":79,"name":"AppData","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":33,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L33"}],"type":{"type":"literal","value":14}},{"id":80,"name":"AppLocalData","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":34,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L34"}],"type":{"type":"literal","value":15}},{"id":82,"name":"AppLog","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":36,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L36"}],"type":{"type":"literal","value":17}},{"id":66,"name":"Audio","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":20,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L20"}],"type":{"type":"literal","value":1}},{"id":67,"name":"Cache","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":21,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L21"}],"type":{"type":"literal","value":2}},{"id":68,"name":"Config","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":22,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L22"}],"type":{"type":"literal","value":3}},{"id":69,"name":"Data","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":23,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L23"}],"type":{"type":"literal","value":4}},{"id":83,"name":"Desktop","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":38,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L38"}],"type":{"type":"literal","value":18}},{"id":71,"name":"Document","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":25,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L25"}],"type":{"type":"literal","value":6}},{"id":72,"name":"Download","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":26,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L26"}],"type":{"type":"literal","value":7}},{"id":84,"name":"Executable","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":39,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L39"}],"type":{"type":"literal","value":19}},{"id":85,"name":"Font","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":40,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L40"}],"type":{"type":"literal","value":20}},{"id":86,"name":"Home","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":41,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L41"}],"type":{"type":"literal","value":21}},{"id":70,"name":"LocalData","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":24,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L24"}],"type":{"type":"literal","value":5}},{"id":73,"name":"Picture","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":27,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L27"}],"type":{"type":"literal","value":8}},{"id":74,"name":"Public","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":28,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L28"}],"type":{"type":"literal","value":9}},{"id":76,"name":"Resource","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":30,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L30"}],"type":{"type":"literal","value":11}},{"id":87,"name":"Runtime","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":42,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L42"}],"type":{"type":"literal","value":22}},{"id":77,"name":"Temp","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":31,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L31"}],"type":{"type":"literal","value":12}},{"id":88,"name":"Template","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":43,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L43"}],"type":{"type":"literal","value":23}},{"id":75,"name":"Video","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":29,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L29"}],"type":{"type":"literal","value":10}}],"groups":[{"title":"Enumeration Members","children":[81,78,79,80,82,66,67,68,69,83,71,72,84,85,86,70,73,74,76,87,77,88,75]}],"sources":[{"fileName":"path.ts","line":19,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L19"}]},{"id":95,"name":"appCacheDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":108,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L108"}],"signatures":[{"id":96,"name":"appCacheDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the suggested directory for your app's cache files.\nResolves to "},{"kind":"code","text":"`${cacheDir}/${bundleIdentifier}`"},{"kind":"text","text":", where "},{"kind":"code","text":"`bundleIdentifier`"},{"kind":"text","text":" is the value ["},{"kind":"code","text":"`tauri.bundle.identifier`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#bundleconfig.identifier) is configured in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appCacheDir } from '@tauri-apps/api/path';\nconst appCacheDirPath = await appCacheDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.2.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":89,"name":"appConfigDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":57,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L57"}],"signatures":[{"id":90,"name":"appConfigDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the suggested directory for your app's config files.\nResolves to "},{"kind":"code","text":"`${configDir}/${bundleIdentifier}`"},{"kind":"text","text":", where "},{"kind":"code","text":"`bundleIdentifier`"},{"kind":"text","text":" is the value ["},{"kind":"code","text":"`tauri.bundle.identifier`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#bundleconfig.identifier) is configured in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appConfigDir } from '@tauri-apps/api/path';\nconst appConfigDirPath = await appConfigDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.2.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":91,"name":"appDataDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":74,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L74"}],"signatures":[{"id":92,"name":"appDataDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the suggested directory for your app's data files.\nResolves to "},{"kind":"code","text":"`${dataDir}/${bundleIdentifier}`"},{"kind":"text","text":", where "},{"kind":"code","text":"`bundleIdentifier`"},{"kind":"text","text":" is the value ["},{"kind":"code","text":"`tauri.bundle.identifier`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#bundleconfig.identifier) is configured in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appDataDir } from '@tauri-apps/api/path';\nconst appDataDirPath = await appDataDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.2.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":93,"name":"appLocalDataDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":91,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L91"}],"signatures":[{"id":94,"name":"appLocalDataDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the suggested directory for your app's local data files.\nResolves to "},{"kind":"code","text":"`${localDataDir}/${bundleIdentifier}`"},{"kind":"text","text":", where "},{"kind":"code","text":"`bundleIdentifier`"},{"kind":"text","text":" is the value ["},{"kind":"code","text":"`tauri.bundle.identifier`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#bundleconfig.identifier) is configured in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appLocalDataDir } from '@tauri-apps/api/path';\nconst appLocalDataDirPath = await appLocalDataDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.2.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":97,"name":"appLogDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":520,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L520"}],"signatures":[{"id":98,"name":"appLogDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the suggested directory for your app's log files.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`${configDir}/${bundleIdentifier}/logs`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`${homeDir}/Library/Logs/{bundleIdentifier}`"},{"kind":"text","text":"\n- **Windows:** Resolves to "},{"kind":"code","text":"`${configDir}/${bundleIdentifier}/logs`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appLogDir } from '@tauri-apps/api/path';\nconst appLogDirPath = await appLogDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.2.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":99,"name":"audioDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":130,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L130"}],"signatures":[{"id":100,"name":"audioDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's audio directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_MUSIC_DIR`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Music`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Music}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { audioDir } from '@tauri-apps/api/path';\nconst audioDirPath = await audioDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":155,"name":"basename","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":653,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L653"}],"signatures":[{"id":156,"name":"basename","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the last portion of a "},{"kind":"code","text":"`path`"},{"kind":"text","text":". Trailing directory separators are ignored."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { basename, resolveResource } from '@tauri-apps/api/path';\nconst resourcePath = await resolveResource('app.conf');\nconst base = await basename(resourcePath);\nassert(base === 'app.conf');\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":157,"name":"path","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":158,"name":"ext","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"An optional file extension to be removed from the returned path."}]},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":101,"name":"cacheDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":152,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L152"}],"signatures":[{"id":102,"name":"cacheDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's cache directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_CACHE_HOME`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$HOME/.cache`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Library/Caches`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_LocalAppData}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { cacheDir } from '@tauri-apps/api/path';\nconst cacheDirPath = await cacheDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":103,"name":"configDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":174,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L174"}],"signatures":[{"id":104,"name":"configDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's config directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_CONFIG_HOME`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$HOME/.config`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Library/Application Support`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_RoamingAppData}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { configDir } from '@tauri-apps/api/path';\nconst configDirPath = await configDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":105,"name":"dataDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":196,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L196"}],"signatures":[{"id":106,"name":"dataDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's data directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_DATA_HOME`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$HOME/.local/share`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Library/Application Support`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_RoamingAppData}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { dataDir } from '@tauri-apps/api/path';\nconst dataDirPath = await dataDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":138,"name":"delimiter","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":560,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L560"}],"signatures":[{"id":139,"name":"delimiter","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the platform-specific path segment delimiter:\n- "},{"kind":"code","text":"`;`"},{"kind":"text","text":" on Windows\n- "},{"kind":"code","text":"`:`"},{"kind":"text","text":" on POSIX"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"intrinsic","name":"string"}}]},{"id":107,"name":"desktopDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":218,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L218"}],"signatures":[{"id":108,"name":"desktopDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's desktop directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_DESKTOP_DIR`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Desktop`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Desktop}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { desktopDir } from '@tauri-apps/api/path';\nconst desktopPath = await desktopDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":149,"name":"dirname","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":619,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L619"}],"signatures":[{"id":150,"name":"dirname","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the directory name of a "},{"kind":"code","text":"`path`"},{"kind":"text","text":". Trailing directory separators are ignored."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { dirname, appDataDir } from '@tauri-apps/api/path';\nconst appDataDirPath = await appDataDir();\nconst dir = await dirname(appDataDirPath);\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":151,"name":"path","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":109,"name":"documentDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":240,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L240"}],"signatures":[{"id":110,"name":"documentDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's document directory."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { documentDir } from '@tauri-apps/api/path';\nconst documentDirPath = await documentDir();\n```"},{"kind":"text","text":"\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_DOCUMENTS_DIR`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Documents`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Documents}`"},{"kind":"text","text":"."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":111,"name":"downloadDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":262,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L262"}],"signatures":[{"id":112,"name":"downloadDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's download directory.\n\n#### Platform-specific\n\n- **Linux**: Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_DOWNLOAD_DIR`"},{"kind":"text","text":".\n- **macOS**: Resolves to "},{"kind":"code","text":"`$HOME/Downloads`"},{"kind":"text","text":".\n- **Windows**: Resolves to "},{"kind":"code","text":"`{FOLDERID_Downloads}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { downloadDir } from '@tauri-apps/api/path';\nconst downloadDirPath = await downloadDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":113,"name":"executableDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":284,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L284"}],"signatures":[{"id":114,"name":"executableDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's executable directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_BIN_HOME/../bin`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$XDG_DATA_HOME/../bin`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$HOME/.local/bin`"},{"kind":"text","text":".\n- **macOS:** Not supported.\n- **Windows:** Not supported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { executableDir } from '@tauri-apps/api/path';\nconst executableDirPath = await executableDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":152,"name":"extname","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":635,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L635"}],"signatures":[{"id":153,"name":"extname","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the extension of the "},{"kind":"code","text":"`path`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { extname, resolveResource } from '@tauri-apps/api/path';\nconst resourcePath = await resolveResource('app.conf');\nconst ext = await extname(resourcePath);\nassert(ext === 'conf');\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":154,"name":"path","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":115,"name":"fontDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":306,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L306"}],"signatures":[{"id":116,"name":"fontDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's font directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_DATA_HOME/fonts`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$HOME/.local/share/fonts`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Library/Fonts`"},{"kind":"text","text":".\n- **Windows:** Not supported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { fontDir } from '@tauri-apps/api/path';\nconst fontDirPath = await fontDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":117,"name":"homeDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":328,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L328"}],"signatures":[{"id":118,"name":"homeDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's home directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$HOME`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Profile}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { homeDir } from '@tauri-apps/api/path';\nconst homeDirPath = await homeDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":159,"name":"isAbsolute","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":667,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L667"}],"signatures":[{"id":160,"name":"isAbsolute","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns whether the path is absolute or not."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { isAbsolute } from '@tauri-apps/api/path';\nassert(await isAbsolute('/home/tauri'));\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":161,"name":"path","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":146,"name":"join","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":604,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L604"}],"signatures":[{"id":147,"name":"join","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Joins all given "},{"kind":"code","text":"`path`"},{"kind":"text","text":" segments together using the platform-specific separator as a delimiter, then normalizes the resulting path."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { join, appDataDir } from '@tauri-apps/api/path';\nconst appDataDirPath = await appDataDir();\nconst path = await join(appDataDirPath, 'users', 'tauri', 'avatar.png');\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":148,"name":"paths","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":119,"name":"localDataDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":350,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L350"}],"signatures":[{"id":120,"name":"localDataDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's local data directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_DATA_HOME`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$HOME/.local/share`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Library/Application Support`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_LocalAppData}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { localDataDir } from '@tauri-apps/api/path';\nconst localDataDirPath = await localDataDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":143,"name":"normalize","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":589,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L589"}],"signatures":[{"id":144,"name":"normalize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Normalizes the given "},{"kind":"code","text":"`path`"},{"kind":"text","text":", resolving "},{"kind":"code","text":"`'..'`"},{"kind":"text","text":" and "},{"kind":"code","text":"`'.'`"},{"kind":"text","text":" segments and resolve symbolic links."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { normalize, appDataDir } from '@tauri-apps/api/path';\nconst appDataDirPath = await appDataDir();\nconst path = await normalize(appDataDirPath, '..', 'users', 'tauri', 'avatar.png');\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":145,"name":"path","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":121,"name":"pictureDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":372,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L372"}],"signatures":[{"id":122,"name":"pictureDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's picture directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_PICTURES_DIR`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Pictures`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Pictures}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { pictureDir } from '@tauri-apps/api/path';\nconst pictureDirPath = await pictureDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":123,"name":"publicDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":394,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L394"}],"signatures":[{"id":124,"name":"publicDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's public directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_PUBLICSHARE_DIR`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Public`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Public}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { publicDir } from '@tauri-apps/api/path';\nconst publicDirPath = await publicDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":140,"name":"resolve","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":574,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L574"}],"signatures":[{"id":141,"name":"resolve","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Resolves a sequence of "},{"kind":"code","text":"`paths`"},{"kind":"text","text":" or "},{"kind":"code","text":"`path`"},{"kind":"text","text":" segments into an absolute path."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { resolve, appDataDir } from '@tauri-apps/api/path';\nconst appDataDirPath = await appDataDir();\nconst path = await resolve(appDataDirPath, '..', 'users', 'tauri', 'avatar.png');\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":142,"name":"paths","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":127,"name":"resolveResource","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":431,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L431"}],"signatures":[{"id":128,"name":"resolveResource","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Resolve the path to a resource file."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { resolveResource } from '@tauri-apps/api/path';\nconst resourcePath = await resolveResource('script.sh');\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The full path to the resource."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":129,"name":"resourcePath","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The path to the resource.\nMust follow the same syntax as defined in "},{"kind":"code","text":"`tauri.conf.json > tauri > bundle > resources`"},{"kind":"text","text":", i.e. keeping subfolders and parent dir components ("},{"kind":"code","text":"`../`"},{"kind":"text","text":")."}]},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":125,"name":"resourceDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":411,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L411"}],"signatures":[{"id":126,"name":"resourceDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the application's resource directory.\nTo resolve a resource path, see the [[resolveResource | "},{"kind":"code","text":"`resolveResource API`"},{"kind":"text","text":"]]."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { resourceDir } from '@tauri-apps/api/path';\nconst resourceDirPath = await resourceDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":130,"name":"runtimeDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":454,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L454"}],"signatures":[{"id":131,"name":"runtimeDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's runtime directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_RUNTIME_DIR`"},{"kind":"text","text":".\n- **macOS:** Not supported.\n- **Windows:** Not supported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { runtimeDir } from '@tauri-apps/api/path';\nconst runtimeDirPath = await runtimeDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":136,"name":"sep","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":549,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L549"}],"signatures":[{"id":137,"name":"sep","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the platform-specific path segment separator:\n- "},{"kind":"code","text":"`\\` on Windows\n- `"},{"kind":"text","text":"/` on POSIX"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"intrinsic","name":"string"}}]},{"id":162,"name":"tempDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":536,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L536"}],"signatures":[{"id":163,"name":"tempDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns a temporary directory."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { tempDir } from '@tauri-apps/api/path';\nconst temp = await tempDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":164,"name":"path","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":132,"name":"templateDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":476,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L476"}],"signatures":[{"id":133,"name":"templateDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's template directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_TEMPLATES_DIR`"},{"kind":"text","text":".\n- **macOS:** Not supported.\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Templates}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { templateDir } from '@tauri-apps/api/path';\nconst templateDirPath = await templateDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":134,"name":"videoDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":498,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L498"}],"signatures":[{"id":135,"name":"videoDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's video directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_VIDEOS_DIR`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Movies`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Videos}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { videoDir } from '@tauri-apps/api/path';\nconst videoDirPath = await videoDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Enumerations","children":[65]},{"title":"Functions","children":[95,89,91,93,97,99,155,101,103,105,138,107,149,109,111,113,152,115,117,159,146,119,143,121,123,140,127,125,130,136,162,132,134]}],"sources":[{"fileName":"path.ts","line":14,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L14"}]},{"id":165,"name":"window","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"Provides APIs to create windows, communicate with other windows and manipulate the current window.\n\n## Window events\n\nEvents can be listened to using "},{"kind":"inline-tag","tag":"@link","text":"listen","target":189},{"kind":"text","text":":\n"},{"kind":"code","text":"```typescript\nimport { getCurrent } from \"@tauri-apps/api/window\";\ngetCurrent().listen(\"my-window-event\", ({ event, payload }) => { });\n```"}]},"children":[{"id":381,"name":"Effect","kind":8,"kindString":"Enumeration","flags":{},"comment":{"summary":[{"kind":"text","text":"Platform-specific window effects"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"2.0"}]}]},"children":[{"id":403,"name":"Acrylic","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"**Windows 10/11**\n\n## Notes\n\nThis effect has bad performance when resizing/dragging the window on Windows 10 v1903+ and Windows 11 build 22000."}]},"sources":[{"fileName":"window.ts","line":1947,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1947"}],"type":{"type":"literal","value":"acrylic"}},{"id":382,"name":"AppearanceBased","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"A default material appropriate for the view's effectiveAppearance. **macOS 10.14-**"}],"blockTags":[{"tag":"@deprecated","content":[{"kind":"text","text":"since macOS 10.14. You should instead choose an appropriate semantic material."}]}]},"sources":[{"fileName":"window.ts","line":1847,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1847"}],"type":{"type":"literal","value":"appearanceBased"}},{"id":402,"name":"Blur","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"**Windows 7/10/11(22H1) Only**\n\n## Notes\n\nThis effect has bad performance when resizing/dragging the window on Windows 11 build 22621."}]},"sources":[{"fileName":"window.ts","line":1939,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1939"}],"type":{"type":"literal","value":"blur"}},{"id":398,"name":"ContentBackground","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"**macOS 10.14+**"}]},"sources":[{"fileName":"window.ts","line":1919,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1919"}],"type":{"type":"literal","value":"contentBackground"}},{"id":384,"name":"Dark","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"**macOS 10.14-**"}],"blockTags":[{"tag":"@deprecated","content":[{"kind":"text","text":"since macOS 10.14. Use a semantic material instead."}]}]},"sources":[{"fileName":"window.ts","line":1859,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1859"}],"type":{"type":"literal","value":"dark"}},{"id":396,"name":"FullScreenUI","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"**macOS 10.14+**"}]},"sources":[{"fileName":"window.ts","line":1911,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1911"}],"type":{"type":"literal","value":"fullScreenUI"}},{"id":392,"name":"HeaderView","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"**macOS 10.14+**"}]},"sources":[{"fileName":"window.ts","line":1895,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1895"}],"type":{"type":"literal","value":"headerView"}},{"id":395,"name":"HudWindow","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"**macOS 10.14+**"}]},"sources":[{"fileName":"window.ts","line":1907,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1907"}],"type":{"type":"literal","value":"hudWindow"}},{"id":383,"name":"Light","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"**macOS 10.14-**"}],"blockTags":[{"tag":"@deprecated","content":[{"kind":"text","text":"since macOS 10.14. Use a semantic material instead."}]}]},"sources":[{"fileName":"window.ts","line":1853,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1853"}],"type":{"type":"literal","value":"light"}},{"id":385,"name":"MediumLight","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"**macOS 10.14-**"}],"blockTags":[{"tag":"@deprecated","content":[{"kind":"text","text":"since macOS 10.14. Use a semantic material instead."}]}]},"sources":[{"fileName":"window.ts","line":1865,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1865"}],"type":{"type":"literal","value":"mediumLight"}},{"id":389,"name":"Menu","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"**macOS 10.11+**"}]},"sources":[{"fileName":"window.ts","line":1883,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1883"}],"type":{"type":"literal","value":"menu"}},{"id":401,"name":"Mica","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"**Windows 11 Only**"}]},"sources":[{"fileName":"window.ts","line":1931,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1931"}],"type":{"type":"literal","value":"mica"}},{"id":390,"name":"Popover","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"**macOS 10.11+**"}]},"sources":[{"fileName":"window.ts","line":1887,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1887"}],"type":{"type":"literal","value":"popover"}},{"id":388,"name":"Selection","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"**macOS 10.10+**"}]},"sources":[{"fileName":"window.ts","line":1879,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1879"}],"type":{"type":"literal","value":"selection"}},{"id":393,"name":"Sheet","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"**macOS 10.14+**"}]},"sources":[{"fileName":"window.ts","line":1899,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1899"}],"type":{"type":"literal","value":"sheet"}},{"id":391,"name":"Sidebar","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"**macOS 10.11+**"}]},"sources":[{"fileName":"window.ts","line":1891,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1891"}],"type":{"type":"literal","value":"sidebar"}},{"id":404,"name":"Tabbed","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"Tabbed effect that matches the system dark perefence **Windows 11 Only**"}]},"sources":[{"fileName":"window.ts","line":1951,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1951"}],"type":{"type":"literal","value":"tabbed"}},{"id":405,"name":"TabbedDark","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"Tabbed effect with dark mode but only if dark mode is enabled on the system **Windows 11 Only**"}]},"sources":[{"fileName":"window.ts","line":1955,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1955"}],"type":{"type":"literal","value":"tabbedDark"}},{"id":406,"name":"TabbedLight","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"Tabbed effect with light mode **Windows 11 Only**"}]},"sources":[{"fileName":"window.ts","line":1959,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1959"}],"type":{"type":"literal","value":"tabbedLight"}},{"id":387,"name":"Titlebar","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"**macOS 10.10+**"}]},"sources":[{"fileName":"window.ts","line":1875,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1875"}],"type":{"type":"literal","value":"titlebar"}},{"id":397,"name":"Tooltip","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"**macOS 10.14+**"}]},"sources":[{"fileName":"window.ts","line":1915,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1915"}],"type":{"type":"literal","value":"tooltip"}},{"id":386,"name":"UltraDark","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"**macOS 10.14-**"}],"blockTags":[{"tag":"@deprecated","content":[{"kind":"text","text":"since macOS 10.14. Use a semantic material instead."}]}]},"sources":[{"fileName":"window.ts","line":1871,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1871"}],"type":{"type":"literal","value":"ultraDark"}},{"id":400,"name":"UnderPageBackground","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"**macOS 10.14+**"}]},"sources":[{"fileName":"window.ts","line":1927,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1927"}],"type":{"type":"literal","value":"underPageBackground"}},{"id":399,"name":"UnderWindowBackground","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"**macOS 10.14+**"}]},"sources":[{"fileName":"window.ts","line":1923,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1923"}],"type":{"type":"literal","value":"underWindowBackground"}},{"id":394,"name":"WindowBackground","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"**macOS 10.14+**"}]},"sources":[{"fileName":"window.ts","line":1903,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1903"}],"type":{"type":"literal","value":"windowBackground"}}],"groups":[{"title":"Enumeration Members","children":[403,382,402,398,384,396,392,395,383,385,389,401,390,388,393,391,404,405,406,387,397,386,400,399,394]}],"sources":[{"fileName":"window.ts","line":1841,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1841"}]},{"id":407,"name":"EffectState","kind":8,"kindString":"Enumeration","flags":{},"comment":{"summary":[{"kind":"text","text":"Window effect state **macOS only**"}],"blockTags":[{"tag":"@see","content":[{"kind":"text","text":"https://developer.apple.com/documentation/appkit/nsvisualeffectview/state"}]},{"tag":"@since","content":[{"kind":"text","text":"2.0"}]}]},"children":[{"id":409,"name":"Active","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"Make window effect state always active **macOS only**"}]},"sources":[{"fileName":"window.ts","line":1977,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1977"}],"type":{"type":"literal","value":"active"}},{"id":408,"name":"FollowsWindowActiveState","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"Make window effect state follow the window's active state **macOS only**"}]},"sources":[{"fileName":"window.ts","line":1973,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1973"}],"type":{"type":"literal","value":"followsWindowActiveState"}},{"id":410,"name":"Inactive","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"Make window effect state always inactive **macOS only**"}]},"sources":[{"fileName":"window.ts","line":1981,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1981"}],"type":{"type":"literal","value":"inactive"}}],"groups":[{"title":"Enumeration Members","children":[409,408,410]}],"sources":[{"fileName":"window.ts","line":1969,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1969"}]},{"id":378,"name":"UserAttentionType","kind":8,"kindString":"Enumeration","flags":{},"comment":{"summary":[{"kind":"text","text":"Attention type to request on a window."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"children":[{"id":379,"name":"Critical","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"#### Platform-specific\n- **macOS:** Bounces the dock icon until the application is in focus.\n- **Windows:** Flashes both the window and the taskbar button until the application is in focus."}]},"sources":[{"fileName":"window.ts","line":77,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L77"}],"type":{"type":"literal","value":1}},{"id":380,"name":"Informational","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"#### Platform-specific\n- **macOS:** Bounces the dock icon once.\n- **Windows:** Flashes the taskbar button until the application is in focus."}]},"sources":[{"fileName":"window.ts","line":83,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L83"}],"type":{"type":"literal","value":2}}],"groups":[{"title":"Enumeration Members","children":[379,380]}],"sources":[{"fileName":"window.ts","line":71,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L71"}]},{"id":362,"name":"CloseRequestedEvent","kind":128,"kindString":"Class","flags":{},"children":[{"id":363,"name":"constructor","kind":512,"kindString":"Constructor","flags":{},"sources":[{"fileName":"window.ts","line":95,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L95"}],"signatures":[{"id":364,"name":"new CloseRequestedEvent","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":365,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":2,"typeArguments":[{"type":"literal","value":null}],"name":"Event"}}],"type":{"type":"reference","id":362,"name":"CloseRequestedEvent"}}]},{"id":366,"name":"event","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name"}]},"sources":[{"fileName":"window.ts","line":88,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L88"}],"type":{"type":"reference","id":16,"name":"EventName"}},{"id":368,"name":"id","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Event identifier used to unlisten"}]},"sources":[{"fileName":"window.ts","line":92,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L92"}],"type":{"type":"intrinsic","name":"number"}},{"id":367,"name":"windowLabel","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The label of the window that emitted this event."}]},"sources":[{"fileName":"window.ts","line":90,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L90"}],"type":{"type":"intrinsic","name":"string"}},{"id":372,"name":"isPreventDefault","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":105,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L105"}],"signatures":[{"id":373,"name":"isPreventDefault","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"intrinsic","name":"boolean"}}]},{"id":370,"name":"preventDefault","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":101,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L101"}],"signatures":[{"id":371,"name":"preventDefault","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"intrinsic","name":"void"}}]}],"groups":[{"title":"Constructors","children":[363]},{"title":"Properties","children":[366,368,367]},{"title":"Methods","children":[372,370]}],"sources":[{"fileName":"window.ts","line":86,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L86"}]},{"id":490,"name":"LogicalPosition","kind":128,"kindString":"Class","flags":{},"comment":{"summary":[{"kind":"text","text":"A position represented in logical pixels."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"children":[{"id":491,"name":"constructor","kind":512,"kindString":"Constructor","flags":{},"sources":[{"fileName":"dpi.ts","line":62,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L62"}],"signatures":[{"id":492,"name":"new LogicalPosition","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":493,"name":"x","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}},{"id":494,"name":"y","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"reference","id":490,"name":"LogicalPosition"}}]},{"id":495,"name":"type","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"dpi.ts","line":58,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L58"}],"type":{"type":"intrinsic","name":"string"},"defaultValue":"'Logical'"},{"id":496,"name":"x","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"dpi.ts","line":59,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L59"}],"type":{"type":"intrinsic","name":"number"}},{"id":497,"name":"y","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"dpi.ts","line":60,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L60"}],"type":{"type":"intrinsic","name":"number"}}],"groups":[{"title":"Constructors","children":[491]},{"title":"Properties","children":[495,496,497]}],"sources":[{"fileName":"dpi.ts","line":57,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L57"}]},{"id":471,"name":"LogicalSize","kind":128,"kindString":"Class","flags":{},"comment":{"summary":[{"kind":"text","text":"A size represented in logical pixels."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"children":[{"id":472,"name":"constructor","kind":512,"kindString":"Constructor","flags":{},"sources":[{"fileName":"dpi.ts","line":15,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L15"}],"signatures":[{"id":473,"name":"new LogicalSize","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":474,"name":"width","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}},{"id":475,"name":"height","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"reference","id":471,"name":"LogicalSize"}}]},{"id":478,"name":"height","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"dpi.ts","line":13,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L13"}],"type":{"type":"intrinsic","name":"number"}},{"id":476,"name":"type","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"dpi.ts","line":11,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L11"}],"type":{"type":"intrinsic","name":"string"},"defaultValue":"'Logical'"},{"id":477,"name":"width","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"dpi.ts","line":12,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L12"}],"type":{"type":"intrinsic","name":"number"}}],"groups":[{"title":"Constructors","children":[472]},{"title":"Properties","children":[478,476,477]}],"sources":[{"fileName":"dpi.ts","line":10,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L10"}]},{"id":498,"name":"PhysicalPosition","kind":128,"kindString":"Class","flags":{},"comment":{"summary":[{"kind":"text","text":"A position represented in physical pixels."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"children":[{"id":499,"name":"constructor","kind":512,"kindString":"Constructor","flags":{},"sources":[{"fileName":"dpi.ts","line":78,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L78"}],"signatures":[{"id":500,"name":"new PhysicalPosition","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":501,"name":"x","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}},{"id":502,"name":"y","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"reference","id":498,"name":"PhysicalPosition"}}]},{"id":503,"name":"type","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"dpi.ts","line":74,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L74"}],"type":{"type":"intrinsic","name":"string"},"defaultValue":"'Physical'"},{"id":504,"name":"x","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"dpi.ts","line":75,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L75"}],"type":{"type":"intrinsic","name":"number"}},{"id":505,"name":"y","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"dpi.ts","line":76,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L76"}],"type":{"type":"intrinsic","name":"number"}},{"id":506,"name":"toLogical","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"dpi.ts","line":94,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L94"}],"signatures":[{"id":507,"name":"toLogical","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Converts the physical position to a logical one."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nconst appWindow = getCurrent();\nconst factor = await appWindow.scaleFactor();\nconst position = await appWindow.innerPosition();\nconst logical = position.toLogical(factor);\n```"}]}]},"parameters":[{"id":508,"name":"scaleFactor","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"reference","id":490,"name":"LogicalPosition"}}]}],"groups":[{"title":"Constructors","children":[499]},{"title":"Properties","children":[503,504,505]},{"title":"Methods","children":[506]}],"sources":[{"fileName":"dpi.ts","line":73,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L73"}]},{"id":479,"name":"PhysicalSize","kind":128,"kindString":"Class","flags":{},"comment":{"summary":[{"kind":"text","text":"A size represented in physical pixels."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"children":[{"id":480,"name":"constructor","kind":512,"kindString":"Constructor","flags":{},"sources":[{"fileName":"dpi.ts","line":31,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L31"}],"signatures":[{"id":481,"name":"new PhysicalSize","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":482,"name":"width","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}},{"id":483,"name":"height","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"reference","id":479,"name":"PhysicalSize"}}]},{"id":486,"name":"height","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"dpi.ts","line":29,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L29"}],"type":{"type":"intrinsic","name":"number"}},{"id":484,"name":"type","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"dpi.ts","line":27,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L27"}],"type":{"type":"intrinsic","name":"string"},"defaultValue":"'Physical'"},{"id":485,"name":"width","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"dpi.ts","line":28,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L28"}],"type":{"type":"intrinsic","name":"number"}},{"id":487,"name":"toLogical","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"dpi.ts","line":47,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L47"}],"signatures":[{"id":488,"name":"toLogical","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Converts the physical size to a logical one."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nconst appWindow = getCurrent();\nconst factor = await appWindow.scaleFactor();\nconst size = await appWindow.innerSize();\nconst logical = size.toLogical(factor);\n```"}]}]},"parameters":[{"id":489,"name":"scaleFactor","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"reference","id":471,"name":"LogicalSize"}}]}],"groups":[{"title":"Constructors","children":[480]},{"title":"Properties","children":[486,484,485]},{"title":"Methods","children":[487]}],"sources":[{"fileName":"dpi.ts","line":26,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L26"}]},{"id":173,"name":"Window","kind":128,"kindString":"Class","flags":{},"comment":{"summary":[{"kind":"text","text":"Create new webview window or get a handle to an existing one.\n\nWindows are identified by a *label* a unique identifier that can be used to reference it later.\nIt may only contain alphanumeric characters "},{"kind":"code","text":"`a-zA-Z`"},{"kind":"text","text":" plus the following special characters "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\n// loading embedded asset:\nconst appWindow = new Window('theUniqueLabel', {\n url: 'path/to/page.html'\n});\n// alternatively, load a remote URL:\nconst appWindow = new Window('theUniqueLabel', {\n url: 'https://github.com/tauri-apps/tauri'\n});\n\nappWindow.once('tauri://created', function () {\n // window successfully created\n});\nappWindow.once('tauri://error', function (e) {\n // an error happened creating the window\n});\n\n// emit an event to the backend\nawait appWindow.emit(\"some event\", \"data\");\n// listen to an event from the backend\nconst unlisten = await appWindow.listen(\"event name\", e => {});\nunlisten();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"children":[{"id":183,"name":"constructor","kind":512,"kindString":"Constructor","flags":{},"sources":[{"fileName":"window.ts","line":245,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L245"}],"signatures":[{"id":184,"name":"new Window","kind":16384,"kindString":"Constructor signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Creates a new Window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { Window } from '@tauri-apps/api/window';\nconst appWindow = new Window('my-label', {\n url: 'https://github.com/tauri-apps/tauri'\n});\nappWindow.once('tauri://created', function () {\n // window successfully created\n});\nappWindow.once('tauri://error', function (e) {\n // an error happened creating the window\n});\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The "},{"kind":"inline-tag","tag":"@link","text":"Window","target":173},{"kind":"text","text":" instance to communicate with the webview."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":185,"name":"label","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The unique webview window label. Must be alphanumeric: "},{"kind":"code","text":"`a-zA-Z-/:_`"},{"kind":"text","text":"."}]},"type":{"type":"intrinsic","name":"string"}},{"id":186,"name":"options","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":436,"name":"WindowOptions"},"defaultValue":"{}"}],"type":{"type":"reference","id":173,"name":"Window"}}]},{"id":187,"name":"label","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The window label. It is a unique identifier for the window, can be used to reference it later."}]},"sources":[{"fileName":"window.ts","line":219,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L219"}],"type":{"type":"intrinsic","name":"string"}},{"id":188,"name":"listeners","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Local event listeners."}]},"sources":[{"fileName":"window.ts","line":222,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L222"}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"},{"type":"array","elementType":{"type":"reference","id":8,"typeArguments":[{"type":"intrinsic","name":"any"}],"name":"EventCallback"}}],"name":"Record","externalUrl":"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type","qualifiedName":"Record","package":"typescript"}},{"id":242,"name":"center","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":767,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L767"}],"signatures":[{"id":243,"name":"center","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Centers the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().center();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":287,"name":"clearEffects","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1135,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1135"}],"signatures":[{"id":288,"name":"clearEffects","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Clear any applied effects if possible."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"2.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":276,"name":"close","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1064,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1064"}],"signatures":[{"id":277,"name":"close","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Closes the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().close();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":199,"name":"emit","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":401,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L401"}],"signatures":[{"id":200,"name":"emit","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Emits an event to the backend, tied to the webview window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().emit('window-loaded', { loggedIn: true, token: 'authToken' });\n```"}]}]},"parameters":[{"id":201,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"intrinsic","name":"string"}},{"id":202,"name":"payload","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Event payload."}]},"type":{"type":"intrinsic","name":"unknown"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":274,"name":"hide","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1046,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1046"}],"signatures":[{"id":275,"name":"hide","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets the window visibility to false."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().hide();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":210,"name":"innerPosition","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":458,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L458"}],"signatures":[{"id":211,"name":"innerPosition","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"The position of the top-left hand corner of the window's client area relative to the top-left hand corner of the desktop."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nconst position = await getCurrent().innerPosition();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The window's inner position."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"reference","id":498,"name":"PhysicalPosition"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":214,"name":"innerSize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":495,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L495"}],"signatures":[{"id":215,"name":"innerSize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"The physical size of the window's client area.\nThe client area is the content of the window, excluding the title bar and borders."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nconst size = await getCurrent().innerSize();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The window's inner size."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"reference","id":479,"name":"PhysicalSize"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":234,"name":"isClosable","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":689,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L689"}],"signatures":[{"id":235,"name":"isClosable","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window’s native close button state.\n\n#### Platform-specific\n\n- **iOS / Android:** Unsupported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nconst closable = await getCurrent().isClosable();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"Whether the window's native close button is enabled or not."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":226,"name":"isDecorated","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":608,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L608"}],"signatures":[{"id":227,"name":"isDecorated","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current decorated state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nconst decorated = await getCurrent().isDecorated();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"Whether the window is decorated or not."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":224,"name":"isFocused","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":590,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L590"}],"signatures":[{"id":225,"name":"isFocused","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current focus state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nconst focused = await getCurrent().isFocused();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"Whether the window is focused or not."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":218,"name":"isFullscreen","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":538,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L538"}],"signatures":[{"id":219,"name":"isFullscreen","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current fullscreen state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nconst fullscreen = await getCurrent().isFullscreen();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"Whether the window is in fullscreen mode or not."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":230,"name":"isMaximizable","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":647,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L647"}],"signatures":[{"id":231,"name":"isMaximizable","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window’s native maximize button state.\n\n#### Platform-specific\n\n- **Linux / iOS / Android:** Unsupported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nconst maximizable = await getCurrent().isMaximizable();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"Whether the window's native maximize button is enabled or not."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":222,"name":"isMaximized","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":572,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L572"}],"signatures":[{"id":223,"name":"isMaximized","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current maximized state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nconst maximized = await getCurrent().isMaximized();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"Whether the window is maximized or not."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":232,"name":"isMinimizable","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":668,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L668"}],"signatures":[{"id":233,"name":"isMinimizable","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window’s native minimize button state.\n\n#### Platform-specific\n\n- **Linux / iOS / Android:** Unsupported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nconst minimizable = await getCurrent().isMinimizable();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"Whether the window's native minimize button is enabled or not."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":220,"name":"isMinimized","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":554,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L554"}],"signatures":[{"id":221,"name":"isMinimized","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current minimized state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nconst minimized = await getCurrent().isMinimized();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":228,"name":"isResizable","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":626,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L626"}],"signatures":[{"id":229,"name":"isResizable","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current resizable state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nconst resizable = await getCurrent().isResizable();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"Whether the window is resizable or not."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":236,"name":"isVisible","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":707,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L707"}],"signatures":[{"id":237,"name":"isVisible","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current visible state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nconst visible = await getCurrent().isVisible();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"Whether the window is visible or not."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":189,"name":"listen","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":344,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L344"}],"signatures":[{"id":190,"name":"listen","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to an event emitted by the backend that is tied to the webview window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nconst unlisten = await getCurrent().listen('state-changed', (event) => {\n console.log(`Got error: ${payload}`);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"typeParameter":[{"id":191,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":192,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"reference","id":16,"name":"EventName"}},{"id":193,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event handler."}]},"type":{"type":"reference","id":8,"typeArguments":[{"type":"reference","id":191,"name":"T"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":13,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":262,"name":"maximize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":938,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L938"}],"signatures":[{"id":263,"name":"maximize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Maximizes the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().maximize();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":268,"name":"minimize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":992,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L992"}],"signatures":[{"id":269,"name":"minimize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Minimizes the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().minimize();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":341,"name":"onCloseRequested","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1640,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1640"}],"signatures":[{"id":342,"name":"onCloseRequested","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to window close requested. Emitted when the user requests to closes the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from \"@tauri-apps/api/window\";\nimport { confirm } from '@tauri-apps/api/dialog';\nconst unlisten = await getCurrent().onCloseRequested(async (event) => {\n const confirmed = await confirm('Are you sure?');\n if (!confirmed) {\n // user did not confirm closing the window; let's prevent it\n event.preventDefault();\n }\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":343,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":344,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"window.ts","line":1641,"character":13,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1641"}],"signatures":[{"id":345,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":346,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":362,"name":"CloseRequestedEvent"}}],"type":{"type":"union","types":[{"type":"intrinsic","name":"void"},{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}]}}]}}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":13,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":356,"name":"onFileDropEvent","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1774,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1774"}],"signatures":[{"id":357,"name":"onFileDropEvent","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to a file drop event.\nThe listener is triggered when the user hovers the selected files on the window,\ndrops the files or cancels the operation."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from \"@tauri-apps/api/window\";\nconst unlisten = await getCurrent().onFileDropEvent((event) => {\n if (event.payload.type === 'hover') {\n console.log('User hovering', event.payload.paths);\n } else if (event.payload.type === 'drop') {\n console.log('User dropped', event.payload.paths);\n } else {\n console.log('File drop cancelled');\n }\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":358,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":8,"typeArguments":[{"type":"reference","id":427,"name":"FileDropEvent"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":13,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":347,"name":"onFocusChanged","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1673,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1673"}],"signatures":[{"id":348,"name":"onFocusChanged","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to window focus change."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from \"@tauri-apps/api/window\";\nconst unlisten = await getCurrent().onFocusChanged(({ payload: focused }) => {\n console.log('Focus changed, window is focused? ' + focused);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":349,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":8,"typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":13,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":353,"name":"onMenuClicked","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1743,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1743"}],"signatures":[{"id":354,"name":"onMenuClicked","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to the window menu item click. The payload is the item id."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from \"@tauri-apps/api/window\";\nconst unlisten = await getCurrent().onMenuClicked(({ payload: menuId }) => {\n console.log('Menu clicked: ' + menuId);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":355,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":8,"typeArguments":[{"type":"intrinsic","name":"string"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":13,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":338,"name":"onMoved","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1608,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1608"}],"signatures":[{"id":339,"name":"onMoved","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to window move."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from \"@tauri-apps/api/window\";\nconst unlisten = await getCurrent().onMoved(({ payload: position }) => {\n console.log('Window moved', position);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":340,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":8,"typeArguments":[{"type":"reference","id":498,"name":"PhysicalPosition"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":13,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":335,"name":"onResized","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1582,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1582"}],"signatures":[{"id":336,"name":"onResized","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to window resize."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from \"@tauri-apps/api/window\";\nconst unlisten = await getCurrent().onResized(({ payload: size }) => {\n console.log('Window resized', size);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":337,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":8,"typeArguments":[{"type":"reference","id":479,"name":"PhysicalSize"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":13,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":350,"name":"onScaleChanged","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1715,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1715"}],"signatures":[{"id":351,"name":"onScaleChanged","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to window scale change. Emitted when the window's scale factor has changed.\nThe following user actions can cause DPI changes:\n- Changing the display's resolution.\n- Changing the display's scale factor (e.g. in Control Panel on Windows).\n- Moving the window to a display with a different scale factor."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from \"@tauri-apps/api/window\";\nconst unlisten = await getCurrent().onScaleChanged(({ payload }) => {\n console.log('Scale changed', payload.scaleFactor, payload.size);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":352,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":8,"typeArguments":[{"type":"reference","id":424,"name":"ScaleFactorChanged"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":13,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":359,"name":"onThemeChanged","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1824,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1824"}],"signatures":[{"id":360,"name":"onThemeChanged","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to the system theme change."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from \"@tauri-apps/api/window\";\nconst unlisten = await getCurrent().onThemeChanged(({ payload: theme }) => {\n console.log('New theme: ' + theme);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":361,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":8,"typeArguments":[{"type":"reference","id":422,"name":"Theme"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":13,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":194,"name":"once","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":379,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L379"}],"signatures":[{"id":195,"name":"once","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to an one-off event emitted by the backend that is tied to the webview window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nconst unlisten = await getCurrent().once('initialized', (event) => {\n console.log(`Window initialized!`);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"typeParameter":[{"id":196,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":197,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"intrinsic","name":"string"}},{"id":198,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event handler."}]},"type":{"type":"reference","id":8,"typeArguments":[{"type":"reference","id":196,"name":"T"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":13,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":212,"name":"outerPosition","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":476,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L476"}],"signatures":[{"id":213,"name":"outerPosition","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"The position of the top-left hand corner of the window relative to the top-left hand corner of the desktop."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nconst position = await getCurrent().outerPosition();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The window's outer position."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"reference","id":498,"name":"PhysicalPosition"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":216,"name":"outerSize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":517,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L517"}],"signatures":[{"id":217,"name":"outerSize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"The physical size of the entire window.\nThese dimensions include the title bar and borders. If you don't want that (and you usually don't), use inner_size instead."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nconst size = await getCurrent().outerSize();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The window's outer size."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"reference","id":479,"name":"PhysicalSize"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":244,"name":"requestUserAttention","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":796,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L796"}],"signatures":[{"id":245,"name":"requestUserAttention","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Requests user attention to the window, this has no effect if the application\nis already focused. How requesting for user attention manifests is platform dependent,\nsee "},{"kind":"code","text":"`UserAttentionType`"},{"kind":"text","text":" for details.\n\nProviding "},{"kind":"code","text":"`null`"},{"kind":"text","text":" will unset the request for user attention. Unsetting the request for\nuser attention might not be done automatically by the WM when the window receives input.\n\n#### Platform-specific\n\n- **macOS:** "},{"kind":"code","text":"`null`"},{"kind":"text","text":" has no effect.\n- **Linux:** Urgency levels have the same effect."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().requestUserAttention();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":246,"name":"requestType","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"union","types":[{"type":"literal","value":null},{"type":"reference","id":378,"name":"UserAttentionType"}]}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":208,"name":"scaleFactor","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":440,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L440"}],"signatures":[{"id":209,"name":"scaleFactor","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"The scale factor that can be used to map physical pixels to logical pixels."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nconst factor = await getCurrent().scaleFactor();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The window's monitor scale factor."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"number"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":289,"name":"setAlwaysOnTop","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1155,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1155"}],"signatures":[{"id":290,"name":"setAlwaysOnTop","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Whether the window should always be on top of other windows."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().setAlwaysOnTop(true);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":291,"name":"alwaysOnTop","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Whether the window should always be on top of other windows or not."}]},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":256,"name":"setClosable","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":899,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L899"}],"signatures":[{"id":257,"name":"setClosable","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets whether the window's native close button is enabled or not.\n\n#### Platform-specific\n\n- **Linux:** GTK+ will do its best to convince the window manager not to show a close button. Depending on the system, this function may not have any effect when called on a window that is already visible\n- **iOS / Android:** Unsupported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().setClosable(false);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":258,"name":"closable","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":292,"name":"setContentProtected","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1174,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1174"}],"signatures":[{"id":293,"name":"setContentProtected","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Prevents the window contents from being captured by other apps."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().setContentProtected(true);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":294,"name":"protected_","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":318,"name":"setCursorGrab","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1432,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1432"}],"signatures":[{"id":319,"name":"setCursorGrab","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Grabs the cursor, preventing it from leaving the window.\n\nThere's no guarantee that the cursor will be hidden. You should\nhide it by yourself if you want so.\n\n#### Platform-specific\n\n- **Linux:** Unsupported.\n- **macOS:** This locks the cursor in a fixed location, which looks visually awkward."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().setCursorGrab(true);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":320,"name":"grab","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"code","text":"`true`"},{"kind":"text","text":" to grab the cursor icon, "},{"kind":"code","text":"`false`"},{"kind":"text","text":" to release it."}]},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":324,"name":"setCursorIcon","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1478,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1478"}],"signatures":[{"id":325,"name":"setCursorIcon","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Modifies the cursor icon of the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().setCursorIcon('help');\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":326,"name":"icon","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The new cursor icon."}]},"type":{"type":"reference","id":171,"name":"CursorIcon"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":327,"name":"setCursorPosition","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1498,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1498"}],"signatures":[{"id":328,"name":"setCursorPosition","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Changes the position of the cursor in window coordinates."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent, LogicalPosition } from '@tauri-apps/api/window';\nawait getCurrent().setCursorPosition(new LogicalPosition(600, 300));\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":329,"name":"position","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The new cursor position."}]},"type":{"type":"union","types":[{"type":"reference","id":490,"name":"LogicalPosition"},{"type":"reference","id":498,"name":"PhysicalPosition"}]}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":321,"name":"setCursorVisible","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1458,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1458"}],"signatures":[{"id":322,"name":"setCursorVisible","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Modifies the cursor's visibility.\n\n#### Platform-specific\n\n- **Windows:** The cursor is only hidden within the confines of the window.\n- **macOS:** The cursor is hidden as long as the window has input focus, even if the cursor is\n outside of the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().setCursorVisible(false);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":323,"name":"visible","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"If "},{"kind":"code","text":"`false`"},{"kind":"text","text":", this will hide the cursor. If "},{"kind":"code","text":"`true`"},{"kind":"text","text":", this will show the cursor."}]},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":278,"name":"setDecorations","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1083,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1083"}],"signatures":[{"id":279,"name":"setDecorations","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Whether the window should have borders and bars."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().setDecorations(false);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":280,"name":"decorations","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Whether the window should have borders and bars."}]},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":284,"name":"setEffects","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1123,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1123"}],"signatures":[{"id":285,"name":"setEffects","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Set window effects."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"2.0"}]}]},"parameters":[{"id":286,"name":"effects","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":417,"name":"Effects"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":310,"name":"setFocus","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1354,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1354"}],"signatures":[{"id":311,"name":"setFocus","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Bring the window to front and focus."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().setFocus();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":307,"name":"setFullscreen","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1335,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1335"}],"signatures":[{"id":308,"name":"setFullscreen","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets the window fullscreen state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().setFullscreen(true);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":309,"name":"fullscreen","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Whether the window should go to fullscreen or not."}]},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":312,"name":"setIcon","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1380,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1380"}],"signatures":[{"id":313,"name":"setIcon","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets the window icon."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().setIcon('/tauri/awesome.png');\n```"},{"kind":"text","text":"\n\nNote that you need the "},{"kind":"code","text":"`icon-ico`"},{"kind":"text","text":" or "},{"kind":"code","text":"`icon-png`"},{"kind":"text","text":" Cargo features to use this API.\nTo enable it, change your Cargo.toml file:\n"},{"kind":"code","text":"```toml\n[dependencies]\ntauri = { version = \"...\", features = [\"...\", \"icon-png\"] }\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":314,"name":"icon","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Icon bytes or path to the icon file."}]},"type":{"type":"union","types":[{"type":"intrinsic","name":"string"},{"type":"reference","name":"Uint8Array","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array","qualifiedName":"Uint8Array","package":"typescript"}]}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":330,"name":"setIgnoreCursorEvents","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1536,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1536"}],"signatures":[{"id":331,"name":"setIgnoreCursorEvents","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Changes the cursor events behavior."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().setIgnoreCursorEvents(true);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":332,"name":"ignore","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"code","text":"`true`"},{"kind":"text","text":" to ignore the cursor events; "},{"kind":"code","text":"`false`"},{"kind":"text","text":" to process them as usual."}]},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":301,"name":"setMaxSize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1262,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1262"}],"signatures":[{"id":302,"name":"setMaxSize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets the window maximum inner size. If the "},{"kind":"code","text":"`size`"},{"kind":"text","text":" argument is undefined, the constraint is unset."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent, LogicalSize } from '@tauri-apps/api/window';\nawait getCurrent().setMaxSize(new LogicalSize(600, 500));\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":303,"name":"size","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The logical or physical inner size, or "},{"kind":"code","text":"`null`"},{"kind":"text","text":" to unset the constraint."}]},"type":{"type":"union","types":[{"type":"intrinsic","name":"undefined"},{"type":"literal","value":null},{"type":"reference","id":471,"name":"LogicalSize"},{"type":"reference","id":479,"name":"PhysicalSize"}]}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":250,"name":"setMaximizable","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":852,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L852"}],"signatures":[{"id":251,"name":"setMaximizable","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets whether the window's native maximize button is enabled or not.\nIf resizable is set to false, this setting is ignored.\n\n#### Platform-specific\n\n- **macOS:** Disables the \"zoom\" button in the window titlebar, which is also used to enter fullscreen mode.\n- **Linux / iOS / Android:** Unsupported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().setMaximizable(false);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":252,"name":"maximizable","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":298,"name":"setMinSize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1226,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1226"}],"signatures":[{"id":299,"name":"setMinSize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets the window minimum inner size. If the "},{"kind":"code","text":"`size`"},{"kind":"text","text":" argument is not provided, the constraint is unset."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent, PhysicalSize } from '@tauri-apps/api/window';\nawait getCurrent().setMinSize(new PhysicalSize(600, 500));\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":300,"name":"size","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The logical or physical inner size, or "},{"kind":"code","text":"`null`"},{"kind":"text","text":" to unset the constraint."}]},"type":{"type":"union","types":[{"type":"intrinsic","name":"undefined"},{"type":"literal","value":null},{"type":"reference","id":471,"name":"LogicalSize"},{"type":"reference","id":479,"name":"PhysicalSize"}]}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":253,"name":"setMinimizable","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":875,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L875"}],"signatures":[{"id":254,"name":"setMinimizable","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets whether the window's native minimize button is enabled or not.\n\n#### Platform-specific\n\n- **Linux / iOS / Android:** Unsupported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().setMinimizable(false);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":255,"name":"minimizable","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":304,"name":"setPosition","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1298,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1298"}],"signatures":[{"id":305,"name":"setPosition","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets the window outer position."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent, LogicalPosition } from '@tauri-apps/api/window';\nawait getCurrent().setPosition(new LogicalPosition(600, 500));\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":306,"name":"position","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The new position, in logical or physical pixels."}]},"type":{"type":"union","types":[{"type":"reference","id":490,"name":"LogicalPosition"},{"type":"reference","id":498,"name":"PhysicalPosition"}]}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":247,"name":"setResizable","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":827,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L827"}],"signatures":[{"id":248,"name":"setResizable","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Updates the window resizable flag."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().setResizable(false);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":249,"name":"resizable","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":281,"name":"setShadow","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1111,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1111"}],"signatures":[{"id":282,"name":"setShadow","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Whether or not the window should have shadow.\n\n#### Platform-specific\n\n- **Windows:**\n - "},{"kind":"code","text":"`false`"},{"kind":"text","text":" has no effect on decorated window, shadows are always ON.\n - "},{"kind":"code","text":"`true`"},{"kind":"text","text":" will make ndecorated window have a 1px white border,\nand on Windows 11, it will have a rounded corners.\n- **Linux:** Unsupported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().setShadow(false);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":283,"name":"enable","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":295,"name":"setSize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1194,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1194"}],"signatures":[{"id":296,"name":"setSize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Resizes the window with a new inner size."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent, LogicalSize } from '@tauri-apps/api/window';\nawait getCurrent().setSize(new LogicalSize(600, 500));\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":297,"name":"size","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The logical or physical inner size."}]},"type":{"type":"union","types":[{"type":"reference","id":471,"name":"LogicalSize"},{"type":"reference","id":479,"name":"PhysicalSize"}]}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":315,"name":"setSkipTaskbar","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1404,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1404"}],"signatures":[{"id":316,"name":"setSkipTaskbar","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Whether the window icon should be hidden from the taskbar or not.\n\n#### Platform-specific\n\n- **macOS:** Unsupported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().setSkipTaskbar(true);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":317,"name":"skip","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"true to hide window icon, false to show it."}]},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":259,"name":"setTitle","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":919,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L919"}],"signatures":[{"id":260,"name":"setTitle","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets the window title."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().setTitle('Tauri');\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":261,"name":"title","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The new title"}]},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":272,"name":"show","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1028,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1028"}],"signatures":[{"id":273,"name":"show","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets the window visibility to true."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().show();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":333,"name":"startDragging","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1555,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1555"}],"signatures":[{"id":334,"name":"startDragging","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Starts dragging the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().startDragging();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":240,"name":"theme","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":746,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L746"}],"signatures":[{"id":241,"name":"theme","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current theme.\n\n#### Platform-specific\n\n- **macOS:** Theme was introduced on macOS 10.14. Returns "},{"kind":"code","text":"`light`"},{"kind":"text","text":" on macOS 10.13 and below."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nconst theme = await getCurrent().theme();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The window theme."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"union","types":[{"type":"literal","value":null},{"type":"reference","id":422,"name":"Theme"}]}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":238,"name":"title","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":723,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L723"}],"signatures":[{"id":239,"name":"title","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current title."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nconst title = await getCurrent().title();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":266,"name":"toggleMaximize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":974,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L974"}],"signatures":[{"id":267,"name":"toggleMaximize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Toggles the window maximized state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().toggleMaximize();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":264,"name":"unmaximize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":956,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L956"}],"signatures":[{"id":265,"name":"unmaximize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Unmaximizes the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().unmaximize();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":270,"name":"unminimize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1010,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1010"}],"signatures":[{"id":271,"name":"unminimize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Unminimizes the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { getCurrent } from '@tauri-apps/api/window';\nawait getCurrent().unminimize();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":179,"name":"getAll","kind":2048,"kindString":"Method","flags":{"isStatic":true},"sources":[{"fileName":"window.ts","line":298,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L298"}],"signatures":[{"id":180,"name":"getAll","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets a list of instances of "},{"kind":"code","text":"`Window`"},{"kind":"text","text":" for all available windows."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"array","elementType":{"type":"reference","id":173,"name":"Window"}}}]},{"id":174,"name":"getByLabel","kind":2048,"kindString":"Method","flags":{"isStatic":true},"sources":[{"fileName":"window.ts","line":276,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L276"}],"signatures":[{"id":175,"name":"getByLabel","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the Window for the webview associated with the given label."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { Window } from '@tauri-apps/api/window';\nconst mainWindow = Window.getByLabel('main');\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The Window instance to communicate with the webview or null if the webview doesn't exist."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"parameters":[{"id":176,"name":"label","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The webview window label."}]},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"union","types":[{"type":"literal","value":null},{"type":"reference","id":173,"name":"Window"}]}}]},{"id":177,"name":"getCurrent","kind":2048,"kindString":"Method","flags":{"isStatic":true},"sources":[{"fileName":"window.ts","line":289,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L289"}],"signatures":[{"id":178,"name":"getCurrent","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Get an instance of "},{"kind":"code","text":"`Window`"},{"kind":"text","text":" for the current window."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","id":173,"name":"Window"}}]},{"id":181,"name":"getFocusedWindow","kind":2048,"kindString":"Method","flags":{"isStatic":true},"sources":[{"fileName":"window.ts","line":314,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L314"}],"signatures":[{"id":182,"name":"getFocusedWindow","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the focused window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { Window } from '@tauri-apps/api/window';\nconst focusedWindow = Window.getFocusedWindow();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The Window instance to communicate with the webview or "},{"kind":"code","text":"`undefined`"},{"kind":"text","text":" if there is not any focused window."}]},{"tag":"@since","content":[{"kind":"text","text":"1.4"}]}]},"type":{"type":"reference","typeArguments":[{"type":"union","types":[{"type":"literal","value":null},{"type":"reference","id":173,"name":"Window"}]}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Constructors","children":[183]},{"title":"Properties","children":[187,188]},{"title":"Methods","children":[242,287,276,199,274,210,214,234,226,224,218,230,222,232,220,228,236,189,262,268,341,356,347,353,338,335,350,359,194,212,216,244,208,289,256,292,318,324,327,321,278,284,310,307,312,330,301,250,298,253,304,247,281,295,315,259,272,333,240,238,266,264,270,179,174,177,181]}],"sources":[{"fileName":"window.ts","line":217,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L217"}]},{"id":417,"name":"Effects","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[{"kind":"text","text":"The window effects configuration object"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"2.0"}]}]},"children":[{"id":421,"name":"color","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Window effect color. Affects "},{"kind":"inline-tag","tag":"@link","text":"Blur","target":402},{"kind":"text","text":" and "},{"kind":"inline-tag","tag":"@link","text":"Acrylic","target":403},{"kind":"text","text":" only\non Windows 10 v1903+. Doesn't have any effect on Windows 7 or Windows 11."}]},"sources":[{"fileName":"window.ts","line":2006,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2006"}],"type":{"type":"reference","id":470,"name":"Color"}},{"id":418,"name":"effects","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"List of Window effects to apply to the Window.\nConflicting effects will apply the first one and ignore the rest."}]},"sources":[{"fileName":"window.ts","line":1993,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1993"}],"type":{"type":"array","elementType":{"type":"reference","id":381,"name":"Effect"}}},{"id":420,"name":"radius","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Window effect corner radius **macOS Only**"}]},"sources":[{"fileName":"window.ts","line":2001,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2001"}],"type":{"type":"intrinsic","name":"number"}},{"id":419,"name":"state","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Window effect state **macOS Only**"}]},"sources":[{"fileName":"window.ts","line":1997,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1997"}],"type":{"type":"reference","id":407,"name":"EffectState"}}],"groups":[{"title":"Properties","children":[421,418,420,419]}],"sources":[{"fileName":"window.ts","line":1988,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1988"}]},{"id":166,"name":"Monitor","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[{"kind":"text","text":"Allows you to retrieve information about a given monitor."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"children":[{"id":167,"name":"name","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Human-readable name of the monitor"}]},"sources":[{"fileName":"window.ts","line":36,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L36"}],"type":{"type":"union","types":[{"type":"literal","value":null},{"type":"intrinsic","name":"string"}]}},{"id":169,"name":"position","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"the Top-left corner position of the monitor relative to the larger full screen area."}]},"sources":[{"fileName":"window.ts","line":40,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L40"}],"type":{"type":"reference","id":498,"name":"PhysicalPosition"}},{"id":170,"name":"scaleFactor","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The scale factor that can be used to map physical pixels to logical pixels."}]},"sources":[{"fileName":"window.ts","line":42,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L42"}],"type":{"type":"intrinsic","name":"number"}},{"id":168,"name":"size","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The monitor's resolution."}]},"sources":[{"fileName":"window.ts","line":38,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L38"}],"type":{"type":"reference","id":479,"name":"PhysicalSize"}}],"groups":[{"title":"Properties","children":[167,169,170,168]}],"sources":[{"fileName":"window.ts","line":34,"character":17,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L34"}]},{"id":424,"name":"ScaleFactorChanged","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[{"kind":"text","text":"The payload for the "},{"kind":"code","text":"`scaleChange`"},{"kind":"text","text":" event."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"children":[{"id":425,"name":"scaleFactor","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The new window scale factor."}]},"sources":[{"fileName":"window.ts","line":55,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L55"}],"type":{"type":"intrinsic","name":"number"}},{"id":426,"name":"size","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The new window size"}]},"sources":[{"fileName":"window.ts","line":57,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L57"}],"type":{"type":"reference","id":479,"name":"PhysicalSize"}}],"groups":[{"title":"Properties","children":[425,426]}],"sources":[{"fileName":"window.ts","line":53,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L53"}]},{"id":436,"name":"WindowOptions","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[{"kind":"text","text":"Configuration for the window to create."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"children":[{"id":463,"name":"acceptFirstMouse","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether clicking an inactive window also clicks through to the webview on macOS."}]},"sources":[{"fileName":"window.ts","line":2104,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2104"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":455,"name":"alwaysOnTop","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window should always be on top of other windows or not."}]},"sources":[{"fileName":"window.ts","line":2062,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2062"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":438,"name":"center","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Show window in the center of the screen.."}]},"sources":[{"fileName":"window.ts","line":2024,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2024"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":469,"name":"closable","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window's native close button is enabled or not. Defaults to "},{"kind":"code","text":"`true`"},{"kind":"text","text":"."}]},"sources":[{"fileName":"window.ts","line":2135,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2135"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":456,"name":"contentProtected","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Prevents the window contents from being captured by other apps."}]},"sources":[{"fileName":"window.ts","line":2064,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2064"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":454,"name":"decorations","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window should have borders and bars or not."}]},"sources":[{"fileName":"window.ts","line":2060,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2060"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":459,"name":"fileDropEnabled","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the file drop is enabled or not on the webview. By default it is enabled.\n\nDisabling it is required to use drag and drop on the frontend on Windows."}]},"sources":[{"fileName":"window.ts","line":2086,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2086"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":450,"name":"focus","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window will be initially focused or not."}]},"sources":[{"fileName":"window.ts","line":2048,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2048"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":449,"name":"fullscreen","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window is in fullscreen mode or not."}]},"sources":[{"fileName":"window.ts","line":2046,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2046"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":442,"name":"height","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The initial height."}]},"sources":[{"fileName":"window.ts","line":2032,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2032"}],"type":{"type":"intrinsic","name":"number"}},{"id":462,"name":"hiddenTitle","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"If "},{"kind":"code","text":"`true`"},{"kind":"text","text":", sets the window title to be hidden on macOS."}]},"sources":[{"fileName":"window.ts","line":2100,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2100"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":466,"name":"incognito","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether or not the webview should be launched in incognito mode.\n\n#### Platform-specific\n\n- **Android:** Unsupported."}]},"sources":[{"fileName":"window.ts","line":2123,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2123"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":446,"name":"maxHeight","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The maximum height. Only applies if "},{"kind":"code","text":"`maxWidth`"},{"kind":"text","text":" is also set."}]},"sources":[{"fileName":"window.ts","line":2040,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2040"}],"type":{"type":"intrinsic","name":"number"}},{"id":445,"name":"maxWidth","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The maximum width. Only applies if "},{"kind":"code","text":"`maxHeight`"},{"kind":"text","text":" is also set."}]},"sources":[{"fileName":"window.ts","line":2038,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2038"}],"type":{"type":"intrinsic","name":"number"}},{"id":467,"name":"maximizable","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window's native maximize button is enabled or not. Defaults to "},{"kind":"code","text":"`true`"},{"kind":"text","text":"."}]},"sources":[{"fileName":"window.ts","line":2127,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2127"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":452,"name":"maximized","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window should be maximized upon creation or not."}]},"sources":[{"fileName":"window.ts","line":2056,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2056"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":444,"name":"minHeight","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The minimum height. Only applies if "},{"kind":"code","text":"`minWidth`"},{"kind":"text","text":" is also set."}]},"sources":[{"fileName":"window.ts","line":2036,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2036"}],"type":{"type":"intrinsic","name":"number"}},{"id":443,"name":"minWidth","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The minimum width. Only applies if "},{"kind":"code","text":"`minHeight`"},{"kind":"text","text":" is also set."}]},"sources":[{"fileName":"window.ts","line":2034,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2034"}],"type":{"type":"intrinsic","name":"number"}},{"id":468,"name":"minimizable","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window's native minimize button is enabled or not. Defaults to "},{"kind":"code","text":"`true`"},{"kind":"text","text":"."}]},"sources":[{"fileName":"window.ts","line":2131,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2131"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":447,"name":"resizable","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window is resizable or not."}]},"sources":[{"fileName":"window.ts","line":2042,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2042"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":458,"name":"shadow","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether or not the window has shadow.\n\n#### Platform-specific\n\n- **Windows:**\n - "},{"kind":"code","text":"`false`"},{"kind":"text","text":" has no effect on decorated window, shadows are always ON.\n - "},{"kind":"code","text":"`true`"},{"kind":"text","text":" will make ndecorated window have a 1px white border,\nand on Windows 11, it will have a rounded corners.\n- **Linux:** Unsupported."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"sources":[{"fileName":"window.ts","line":2080,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2080"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":457,"name":"skipTaskbar","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether or not the window icon should be added to the taskbar."}]},"sources":[{"fileName":"window.ts","line":2066,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2066"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":464,"name":"tabbingIdentifier","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Defines the window [tabbing identifier](https://developer.apple.com/documentation/appkit/nswindow/1644704-tabbingidentifier) on macOS.\n\nWindows with the same tabbing identifier will be grouped together.\nIf the tabbing identifier is not set, automatic tabbing will be disabled."}]},"sources":[{"fileName":"window.ts","line":2111,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2111"}],"type":{"type":"intrinsic","name":"string"}},{"id":460,"name":"theme","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The initial window theme. Defaults to the system theme.\n\nOnly implemented on Windows and macOS 10.14+."}]},"sources":[{"fileName":"window.ts","line":2092,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2092"}],"type":{"type":"reference","id":422,"name":"Theme"}},{"id":448,"name":"title","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Window title."}]},"sources":[{"fileName":"window.ts","line":2044,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2044"}],"type":{"type":"intrinsic","name":"string"}},{"id":461,"name":"titleBarStyle","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The style of the macOS title bar."}]},"sources":[{"fileName":"window.ts","line":2096,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2096"}],"type":{"type":"reference","id":423,"name":"TitleBarStyle"}},{"id":451,"name":"transparent","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window is transparent or not.\nNote that on "},{"kind":"code","text":"`macOS`"},{"kind":"text","text":" this requires the "},{"kind":"code","text":"`macos-private-api`"},{"kind":"text","text":" feature flag, enabled under "},{"kind":"code","text":"`tauri.conf.json > tauri > macOSPrivateApi`"},{"kind":"text","text":".\nWARNING: Using private APIs on "},{"kind":"code","text":"`macOS`"},{"kind":"text","text":" prevents your application from being accepted to the "},{"kind":"code","text":"`App Store`"},{"kind":"text","text":"."}]},"sources":[{"fileName":"window.ts","line":2054,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2054"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":437,"name":"url","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Remote URL or local file path to open.\n\n- URL such as "},{"kind":"code","text":"`https://github.com/tauri-apps`"},{"kind":"text","text":" is opened directly on a Tauri window.\n- data: URL such as "},{"kind":"code","text":"`data:text/html,...`"},{"kind":"text","text":" is only supported with the "},{"kind":"code","text":"`window-data-url`"},{"kind":"text","text":" Cargo feature for the "},{"kind":"code","text":"`tauri`"},{"kind":"text","text":" dependency.\n- local file path or route such as "},{"kind":"code","text":"`/path/to/page.html`"},{"kind":"text","text":" or "},{"kind":"code","text":"`/users`"},{"kind":"text","text":" is appended to the application URL (the devServer URL on development, or "},{"kind":"code","text":"`tauri://localhost/`"},{"kind":"text","text":" and "},{"kind":"code","text":"`https://tauri.localhost/`"},{"kind":"text","text":" on production)."}]},"sources":[{"fileName":"window.ts","line":2022,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2022"}],"type":{"type":"intrinsic","name":"string"}},{"id":465,"name":"userAgent","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The user agent for the webview."}]},"sources":[{"fileName":"window.ts","line":2115,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2115"}],"type":{"type":"intrinsic","name":"string"}},{"id":453,"name":"visible","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window should be immediately visible upon creation or not."}]},"sources":[{"fileName":"window.ts","line":2058,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2058"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":441,"name":"width","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The initial width."}]},"sources":[{"fileName":"window.ts","line":2030,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2030"}],"type":{"type":"intrinsic","name":"number"}},{"id":439,"name":"x","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The initial vertical position. Only applies if "},{"kind":"code","text":"`y`"},{"kind":"text","text":" is also set."}]},"sources":[{"fileName":"window.ts","line":2026,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2026"}],"type":{"type":"intrinsic","name":"number"}},{"id":440,"name":"y","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The initial horizontal position. Only applies if "},{"kind":"code","text":"`x`"},{"kind":"text","text":" is also set."}]},"sources":[{"fileName":"window.ts","line":2028,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2028"}],"type":{"type":"intrinsic","name":"number"}}],"groups":[{"title":"Properties","children":[463,455,438,469,456,454,459,450,449,442,462,466,446,445,467,452,444,443,468,447,458,457,464,460,448,461,451,437,465,453,441,439,440]}],"sources":[{"fileName":"window.ts","line":2014,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2014"}]},{"id":470,"name":"Color","kind":4194304,"kindString":"Type alias","flags":{},"comment":{"summary":[{"kind":"text","text":"an array RGBA colors. Each value has minimum of 0 and maximum of 255."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"2.0"}]}]},"sources":[{"fileName":"window.ts","line":1834,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1834"}],"type":{"type":"tuple","elements":[{"type":"intrinsic","name":"number"},{"type":"intrinsic","name":"number"},{"type":"intrinsic","name":"number"},{"type":"intrinsic","name":"number"}]}},{"id":171,"name":"CursorIcon","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"window.ts","line":110,"character":12,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L110"}],"type":{"type":"union","types":[{"type":"literal","value":"default"},{"type":"literal","value":"crosshair"},{"type":"literal","value":"hand"},{"type":"literal","value":"arrow"},{"type":"literal","value":"move"},{"type":"literal","value":"text"},{"type":"literal","value":"wait"},{"type":"literal","value":"help"},{"type":"literal","value":"progress"},{"type":"literal","value":"notAllowed"},{"type":"literal","value":"contextMenu"},{"type":"literal","value":"cell"},{"type":"literal","value":"verticalText"},{"type":"literal","value":"alias"},{"type":"literal","value":"copy"},{"type":"literal","value":"noDrop"},{"type":"literal","value":"grab"},{"type":"literal","value":"grabbing"},{"type":"literal","value":"allScroll"},{"type":"literal","value":"zoomIn"},{"type":"literal","value":"zoomOut"},{"type":"literal","value":"eResize"},{"type":"literal","value":"nResize"},{"type":"literal","value":"neResize"},{"type":"literal","value":"nwResize"},{"type":"literal","value":"sResize"},{"type":"literal","value":"seResize"},{"type":"literal","value":"swResize"},{"type":"literal","value":"wResize"},{"type":"literal","value":"ewResize"},{"type":"literal","value":"nsResize"},{"type":"literal","value":"neswResize"},{"type":"literal","value":"nwseResize"},{"type":"literal","value":"colResize"},{"type":"literal","value":"rowResize"}]}},{"id":427,"name":"FileDropEvent","kind":4194304,"kindString":"Type alias","flags":{},"comment":{"summary":[{"kind":"text","text":"The file drop event types."}]},"sources":[{"fileName":"window.ts","line":61,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L61"}],"type":{"type":"union","types":[{"type":"reflection","declaration":{"id":428,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"children":[{"id":430,"name":"paths","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":62,"character":21,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L62"}],"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}},{"id":429,"name":"type","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":62,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L62"}],"type":{"type":"literal","value":"hover"}}],"groups":[{"title":"Properties","children":[430,429]}],"sources":[{"fileName":"window.ts","line":62,"character":4,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L62"}]}},{"type":"reflection","declaration":{"id":431,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"children":[{"id":433,"name":"paths","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":63,"character":20,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L63"}],"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}},{"id":432,"name":"type","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":63,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L63"}],"type":{"type":"literal","value":"drop"}}],"groups":[{"title":"Properties","children":[433,432]}],"sources":[{"fileName":"window.ts","line":63,"character":4,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L63"}]}},{"type":"reflection","declaration":{"id":434,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"children":[{"id":435,"name":"type","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":64,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L64"}],"type":{"type":"literal","value":"cancel"}}],"groups":[{"title":"Properties","children":[435]}],"sources":[{"fileName":"window.ts","line":64,"character":4,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L64"}]}}]}},{"id":422,"name":"Theme","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"window.ts","line":45,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L45"}],"type":{"type":"union","types":[{"type":"literal","value":"light"},{"type":"literal","value":"dark"}]}},{"id":423,"name":"TitleBarStyle","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"window.ts","line":46,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L46"}],"type":{"type":"union","types":[{"type":"literal","value":"visible"},{"type":"literal","value":"transparent"},{"type":"literal","value":"overlay"}]}},{"id":415,"name":"availableMonitors","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"window.ts","line":2201,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2201"}],"signatures":[{"id":416,"name":"availableMonitors","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the list of all the monitors available on the system."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { availableMonitors } from '@tauri-apps/api/window';\nconst monitors = availableMonitors();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"array","elementType":{"type":"reference","id":166,"name":"Monitor"}}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":411,"name":"currentMonitor","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"window.ts","line":2168,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2168"}],"signatures":[{"id":412,"name":"currentMonitor","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the monitor on which the window currently resides.\nReturns "},{"kind":"code","text":"`null`"},{"kind":"text","text":" if current monitor can't be detected."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { currentMonitor } from '@tauri-apps/api/window';\nconst monitor = currentMonitor();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"union","types":[{"type":"reference","id":166,"name":"Monitor"},{"type":"literal","value":null}]}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":376,"name":"getAll","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"window.ts","line":168,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L168"}],"signatures":[{"id":377,"name":"getAll","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets a list of instances of "},{"kind":"code","text":"`Window`"},{"kind":"text","text":" for all available windows."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"array","elementType":{"type":"reference","id":173,"name":"Window"}}}]},{"id":374,"name":"getCurrent","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"window.ts","line":156,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L156"}],"signatures":[{"id":375,"name":"getCurrent","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Get an instance of "},{"kind":"code","text":"`Window`"},{"kind":"text","text":" for the current window."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","id":173,"name":"Window"}}]},{"id":413,"name":"primaryMonitor","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"window.ts","line":2185,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2185"}],"signatures":[{"id":414,"name":"primaryMonitor","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the primary monitor of the system.\nReturns "},{"kind":"code","text":"`null`"},{"kind":"text","text":" if it can't identify any monitor as a primary one."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { primaryMonitor } from '@tauri-apps/api/window';\nconst monitor = primaryMonitor();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"union","types":[{"type":"reference","id":166,"name":"Monitor"},{"type":"literal","value":null}]}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Enumerations","children":[381,407,378]},{"title":"Classes","children":[362,490,471,498,479,173]},{"title":"Interfaces","children":[417,166,424,436]},{"title":"Type Aliases","children":[470,171,427,422,423]},{"title":"Functions","children":[415,411,376,374,413]}],"sources":[{"fileName":"window.ts","line":19,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L19"}]}],"groups":[{"title":"Modules","children":[1,50,64,165]}]} \ No newline at end of file diff --git a/docs/api/js/mocks.md b/docs/api/js/mocks.md index 96018ed9c6c..0d9d7cf7542 100644 --- a/docs/api/js/mocks.md +++ b/docs/api/js/mocks.md @@ -21,11 +21,11 @@ afterEach(() => { test("mocked windows", () => { mockWindows("main", "second", "third"); - expect(window).toHaveProperty("__TAURI_METADATA__") + expect(window.__TAURI_INTERNALS__).toHaveProperty("metadata") }) test("no mocked windows", () => { - expect(window).not.toHaveProperty("__TAURI_METADATA__") + expect(window.__TAURI_INTERNALS__).not.toHaveProperty("metadata") }) ``` @@ -46,17 +46,17 @@ This function can be used when testing tauri frontend applications or when runni Testing setup using vitest: ```js import { mockIPC, clearMocks } from "@tauri-apps/api/mocks" -import { invoke } from "@tauri-apps/api/tauri" +import { invoke } from "@tauri-apps/api/primitives" afterEach(() => { clearMocks() }) test("mocked command", () => { - mockIPC((cmd, args) => { + mockIPC((cmd, payload) => { switch (cmd) { case "add": - return (args.a as number) + (args.b as number); + return (payload.a as number) + (payload.b as number); default: break; } @@ -69,14 +69,14 @@ test("mocked command", () => { The callback function can also return a Promise: ```js import { mockIPC, clearMocks } from "@tauri-apps/api/mocks" -import { invoke } from "@tauri-apps/api/tauri" +import { invoke } from "@tauri-apps/api/primitives" afterEach(() => { clearMocks() }) test("mocked command", () => { - mockIPC((cmd, args) => { + mockIPC((cmd, payload) => { if(cmd === "get_data") { return fetch("https://example.com/data.json") .then((response) => response.json()) @@ -93,7 +93,7 @@ test("mocked command", () => { | Name | Type | | :------ | :------ | -| `cb` | (`cmd`: `string`, `args`: [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )<`string`, `unknown`\>) => `any` | +| `cb` | (`cmd`: `string`, `payload`: [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )<`string`, `unknown`\>) => `any` | **Returns: **`void` @@ -126,21 +126,13 @@ import { mockWindows } from "@tauri-apps/api/mocks"; mockWindows("main", "second", "third"); mockIPC((cmd, args) => { - if (cmd === "tauri") { - if ( - args?.__tauriModule === "Window" && - args?.message?.cmd === "manage" && - args?.message?.data?.cmd?.type === "close" - ) { - console.log('closing window!'); - } + if (cmd === "plugin:event|emit") { + console.log('emit event', args?.event, args?.payload); } }); -const { getCurrent } = await import("@tauri-apps/api/window"); - -const win = getCurrent(); -await win.close(); // this will cause the mocked IPC handler to log to the console. +const { emit } = await import("@tauri-apps/api/event"); +await emit('loaded'); // this will cause the mocked IPC handler to log to the console. ``` **Since**: 1.0.0 diff --git a/docs/api/js/notification.md b/docs/api/js/notification.md deleted file mode 100644 index b47b3f0172d..00000000000 --- a/docs/api/js/notification.md +++ /dev/null @@ -1,166 +0,0 @@ -# notification - -Send toast notifications (brief auto-expiring OS window element) to your user. -Can also be used with the Notification Web API. - -This package is also accessible with `window.__TAURI__.notification` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`. - -The APIs must be added to [`tauri.allowlist.notification`](https://tauri.app/v1/api/config/#allowlistconfig.notification) in `tauri.conf.json`: -```json -{ - "tauri": { - "allowlist": { - "notification": { - "all": true // enable all notification APIs - } - } - } -} -``` -It is recommended to allowlist only the APIs you use for optimal bundle size and security. - -## Interfaces - -### `Options` - -Options to send a notification. - -**Since**: 1.0.0 - -#### Properties - -##### `body` - -> `Optional` **body**: `string` - -Optional notification body. - -**Defined in:** [notification.ts:38](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/notification.ts#L38) - -##### `icon` - -> `Optional` **icon**: `string` - -Optional notification icon. - -**Defined in:** [notification.ts:40](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/notification.ts#L40) - -##### `sound` - -> `Optional` **sound**: `string` - -Optional notification sound. - -#### Platform-specific - -Each OS has a different sound name so you will need to conditionally specify an appropriate sound -based on the OS in use, 'default' represents the default system sound. For a list of sounds see: -- **Linux**: can be one of the sounds listed in [https://0pointer.de/public/sound-naming-spec.html](https://0pointer.de/public/sound-naming-spec.html) -- **Windows**: can be one of the sounds listed in [https://learn.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-audio](https://learn.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-audio) - but without the prefix, for example, if `ms-winsoundevent:Notification.Default` you would use `Default` and - if `ms-winsoundevent:Notification.Looping.Alarm2`, you would use `Alarm2`. - Windows 7 is not supported, if a sound is provided, it will play the default sound, otherwise it will be silent. -- **macOS**: you can specify the name of the sound you'd like to play when the notification is shown. -Any of the default sounds (under System Preferences > Sound) can be used, in addition to custom sound files. -Be sure that the sound file is copied under the app bundle (e.g., `YourApp.app/Contents/Resources`), or one of the following locations: - - `~/Library/Sounds` - - `/Library/Sounds` - - `/Network/Library/Sounds` - - `/System/Library/Sounds` - - See the [NSSound](https://developer.apple.com/documentation/appkit/nssound) docs for more information. - -**Since**: 1.5.0 - -**Defined in:** [notification.ts:65](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/notification.ts#L65) - -##### `title` - -> **title**: `string` - -Notification title. - -**Defined in:** [notification.ts:36](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/notification.ts#L36) - -## Type Aliases - -### `Permission` - -> **Permission**: `"granted"` \| `"denied"` \| `"default"` - -Possible permission values. - -**Defined in:** [notification.ts:69](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/notification.ts#L69) - -## Functions - -### `isPermissionGranted` - -> **isPermissionGranted**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`boolean`\> - -Checks if the permission to send notifications is granted. - -**Example** - -```typescript -import { isPermissionGranted } from '@tauri-apps/api/notification'; -const permissionGranted = await isPermissionGranted(); -``` - -**Since**: 1.0.0 - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`boolean`\> - -### `requestPermission` - -> **requestPermission**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Permission`](notification.md#permission)\> - -Requests the permission to send notifications. - -**Example** - -```typescript -import { isPermissionGranted, requestPermission } from '@tauri-apps/api/notification'; -let permissionGranted = await isPermissionGranted(); -if (!permissionGranted) { - const permission = await requestPermission(); - permissionGranted = permission === 'granted'; -} -``` - -**Since**: 1.0.0 - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Permission`](notification.md#permission)\> - -A promise resolving to whether the user granted the permission or not. - -### `sendNotification` - -> **sendNotification**(`options`: `string` \| [`Options`](notification.md#options)): `void` - -Sends a notification to the user. - -**Example** - -```typescript -import { isPermissionGranted, requestPermission, sendNotification } from '@tauri-apps/api/notification'; -let permissionGranted = await isPermissionGranted(); -if (!permissionGranted) { - const permission = await requestPermission(); - permissionGranted = permission === 'granted'; -} -if (permissionGranted) { - sendNotification('Tauri is awesome!'); - sendNotification({ title: 'TAURI', body: 'Tauri is awesome!' }); -} -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `options` | `string` \| [`Options`](notification.md#options) | - -**Returns: **`void` diff --git a/docs/api/js/os.md b/docs/api/js/os.md deleted file mode 100644 index c4823611b90..00000000000 --- a/docs/api/js/os.md +++ /dev/null @@ -1,162 +0,0 @@ -# os - -Provides operating system-related utility methods and properties. - -This package is also accessible with `window.__TAURI__.os` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`. - -The APIs must be added to [`tauri.allowlist.os`](https://tauri.app/v1/api/config/#allowlistconfig.os) in `tauri.conf.json`: -```json -{ - "tauri": { - "allowlist": { - "os": { - "all": true, // enable all Os APIs - } - } - } -} -``` -It is recommended to allowlist only the APIs you use for optimal bundle size and security. - -## Type Aliases - -### `Arch` - -> **Arch**: `"x86"` \| `"x86_64"` \| `"arm"` \| `"aarch64"` \| `"mips"` \| `"mips64"` \| `"powerpc"` \| `"powerpc64"` \| `"riscv64"` \| `"s390x"` \| `"sparc64"` - -**Defined in:** [os.ts:43](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/os.ts#L43) - -### `OsType` - -> **OsType**: `"Linux"` \| `"Darwin"` \| `"Windows_NT"` - -**Defined in:** [os.ts:41](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/os.ts#L41) - -### `Platform` - -> **Platform**: `"linux"` \| `"darwin"` \| `"ios"` \| `"freebsd"` \| `"dragonfly"` \| `"netbsd"` \| `"openbsd"` \| `"solaris"` \| `"android"` \| `"win32"` - -**Defined in:** [os.ts:29](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/os.ts#L29) - -## Variables - -### `EOL` - -> `Const` **EOL**: `"\n"` \| `"\r\n"` - -The operating system-specific end-of-line marker. -- `\n` on POSIX -- `\r\n` on Windows - -**Since**: 1.0.0 - -**Defined in:** [os.ts:63](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/os.ts#L63) - -## Functions - -### `arch` - -> **arch**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Arch`](os.md#arch)\> - -Returns the operating system CPU architecture for which the tauri app was compiled. -Possible values are `'x86'`, `'x86_64'`, `'arm'`, `'aarch64'`, `'mips'`, `'mips64'`, `'powerpc'`, `'powerpc64'`, `'riscv64'`, `'s390x'`, `'sparc64'`. - -**Example** - -```typescript -import { arch } from '@tauri-apps/api/os'; -const archName = await arch(); -``` - -**Since**: 1.0.0 - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Arch`](os.md#arch)\> - -### `locale` - -> **locale**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string` \| `null`\> - -Returns a String with a `BCP-47` language tag inside. If the locale couldn’t be obtained, `null` is returned instead. - -**Example** - -```typescript -import { locale } from '@tauri-apps/api/os'; -const locale = await locale(); -if (locale) { - // use the locale string here -} -``` - -**Since**: 1.4.0 - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string` \| `null`\> - -### `platform` - -> **platform**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Platform`](os.md#platform)\> - -Returns a string identifying the operating system platform. -The value is set at compile time. Possible values are `'linux'`, `'darwin'`, `'ios'`, `'freebsd'`, `'dragonfly'`, `'netbsd'`, `'openbsd'`, `'solaris'`, `'android'`, `'win32'` - -**Example** - -```typescript -import { platform } from '@tauri-apps/api/os'; -const platformName = await platform(); -``` - -**Since**: 1.0.0 - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Platform`](os.md#platform)\> - -### `tempdir` - -> **tempdir**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> - -Returns the operating system's default directory for temporary files as a string. - -**Example** - -```typescript -import { tempdir } from '@tauri-apps/api/os'; -const tempdirPath = await tempdir(); -``` - -**Since**: 1.0.0 - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> - -### `type` - -> **type**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`OsType`](os.md#ostype)\> - -Returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows. - -**Example** - -```typescript -import { type } from '@tauri-apps/api/os'; -const osType = await type(); -``` - -**Since**: 1.0.0 - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`OsType`](os.md#ostype)\> - -### `version` - -> **version**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> - -Returns a string identifying the kernel version. - -**Example** - -```typescript -import { version } from '@tauri-apps/api/os'; -const osVersion = await version(); -``` - -**Since**: 1.0.0 - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> diff --git a/docs/api/js/path.md b/docs/api/js/path.md index 9c691c82193..3685317197a 100644 --- a/docs/api/js/path.md +++ b/docs/api/js/path.md @@ -4,51 +4,41 @@ The path module provides utilities for working with file and directory paths. This package is also accessible with `window.__TAURI__.path` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`. -The APIs must be added to [`tauri.allowlist.path`](https://tauri.app/v1/api/config/#allowlistconfig.path) in `tauri.conf.json`: -```json -{ - "tauri": { - "allowlist": { - "path": { - "all": true, // enable all Path APIs - } - } - } -} -``` It is recommended to allowlist only the APIs you use for optimal bundle size and security. -## References +## Enumerations ### `BaseDirectory` -Re-exports [BaseDirectory](fs.md#basedirectory) - -## Variables - -### `delimiter` - -> `Const` **delimiter**: `";"` \| `":"` - -Provides the platform-specific path segment delimiter: -- `;` on Windows -- `:` on POSIX - -**Since**: 1.0.0 - -**Defined in:** [path.ts:660](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L660) - -### `sep` - -> `Const` **sep**: `"\\"` \| `"/"` +**Since**: 2.0.0 -Provides the platform-specific path segment separator: -- `\` on Windows -- `/` on POSIX - -**Since**: 1.0.0 +#### Enumeration Members -**Defined in:** [path.ts:651](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/path.ts#L651) +| Name | Type | Defined in | +| :------ | :------ | :------ | +| | `16` | [path.ts:35](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L35) | +| | `13` | [path.ts:32](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L32) | +| | `14` | [path.ts:33](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L33) | +| | `15` | [path.ts:34](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L34) | +| | `17` | [path.ts:36](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L36) | +| | `1` | [path.ts:20](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L20) | +| | `2` | [path.ts:21](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L21) | +| | `3` | [path.ts:22](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L22) | +| | `4` | [path.ts:23](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L23) | +| | `18` | [path.ts:38](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L38) | +| | `6` | [path.ts:25](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L25) | +| | `7` | [path.ts:26](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L26) | +| | `19` | [path.ts:39](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L39) | +| | `20` | [path.ts:40](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L40) | +| | `21` | [path.ts:41](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L41) | +| | `5` | [path.ts:24](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L24) | +| | `8` | [path.ts:27](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L27) | +| | `9` | [path.ts:28](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L28) | +| | `11` | [path.ts:30](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L30) | +| | `22` | [path.ts:42](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L42) | +| | `12` | [path.ts:31](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L31) | +| | `23` | [path.ts:43](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L43) | +| | `10` | [path.ts:29](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/path.ts#L29) | ## Functions @@ -106,20 +96,6 @@ const appDataDirPath = await appDataDir(); **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> -### `appDir` - -> **appDir**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> - -Returns the path to the suggested directory for your app config files. - -**Deprecated** - -since 1.2.0: Will be removed in 2.0.0. Use [appConfigDir](path.md#appconfigdir) or [appDataDir](path.md#appdatadir) instead. - -**Since**: 1.0.0 - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> - ### `appLocalDataDir` > **appLocalDataDir**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> @@ -279,6 +255,18 @@ const dataDirPath = await dataDir(); **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> +### `delimiter` + +> **delimiter**(): `string` + +Returns the platform-specific path segment delimiter: +- `;` on Windows +- `:` on POSIX + +**Since**: 2.0.0 + +**Returns: **`string` + ### `desktopDir` > **desktopDir**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> @@ -536,20 +524,6 @@ const localDataDirPath = await localDataDir(); **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> -### `logDir` - -> **logDir**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> - -Returns the path to the suggested log directory. - -**Deprecated** - -since 1.2.0: Will be removed in 2.0.0. Use [appLogDir](path.md#applogdir) instead. - -**Since**: 1.0.0 - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> - ### `normalize` > **normalize**(`path`: `string`): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> @@ -710,6 +684,41 @@ const runtimeDirPath = await runtimeDir(); **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> +### `sep` + +> **sep**(): `string` + +Returns the platform-specific path segment separator: +- `\` on Windows +- `/` on POSIX + +**Since**: 2.0.0 + +**Returns: **`string` + +### `tempDir` + +> **tempDir**(`path`: `string`): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> + +Returns a temporary directory. + +**Example** + +```typescript +import { tempDir } from '@tauri-apps/api/path'; +const temp = await tempDir(); +``` + +**Since**: 2.0.0 + +**Parameters** + +| Name | Type | +| :------ | :------ | +| `path` | `string` | + +**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> + ### `templateDir` > **templateDir**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> diff --git a/docs/api/js/process.md b/docs/api/js/process.md deleted file mode 100644 index dda206c2342..00000000000 --- a/docs/api/js/process.md +++ /dev/null @@ -1,51 +0,0 @@ -# process - -Perform operations on the current process. - -This package is also accessible with `window.__TAURI__.process` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`. - -## Functions - -### `exit` - -> **exit**(`exitCode?`: `number`): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -Exits immediately with the given `exitCode`. - -**Example** - -```typescript -import { exit } from '@tauri-apps/api/process'; -await exit(1); -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `exitCode` | `number` | `0` | The exit code to use. | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -A promise indicating the success or failure of the operation. - -### `relaunch` - -> **relaunch**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -Exits the current instance of the app then relaunches it. - -**Example** - -```typescript -import { relaunch } from '@tauri-apps/api/process'; -await relaunch(); -``` - -**Since**: 1.0.0 - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -A promise indicating the success or failure of the operation. diff --git a/docs/api/js/shell.md b/docs/api/js/shell.md deleted file mode 100644 index 2aa2de52d42..00000000000 --- a/docs/api/js/shell.md +++ /dev/null @@ -1,735 +0,0 @@ -# shell - -Access the system shell. -Allows you to spawn child processes and manage files and URLs using their default application. - -This package is also accessible with `window.__TAURI__.shell` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`. - -The APIs must be added to [`tauri.allowlist.shell`](https://tauri.app/v1/api/config/#allowlistconfig.shell) in `tauri.conf.json`: -```json -{ - "tauri": { - "allowlist": { - "shell": { - "all": true, // enable all shell APIs - "execute": true, // enable process spawn APIs - "sidecar": true, // enable spawning sidecars - "open": true // enable opening files/URLs using the default program - } - } - } -} -``` -It is recommended to allowlist only the APIs you use for optimal bundle size and security. - -## Security - -This API has a scope configuration that forces you to restrict the programs and arguments that can be used. - -### Restricting access to the [`open`](shell.md#open) API - -On the allowlist, `open: true` means that the [open](shell.md#open) API can be used with any URL, -as the argument is validated with the `^((mailto:\w+)|(tel:\w+)|(https?://\w+)).+` regex. -You can change that regex by changing the boolean value to a string, e.g. `open: ^https://github.com/`. - -### Restricting access to the [`Command`](shell.md#command) APIs - -The `shell` allowlist object has a `scope` field that defines an array of CLIs that can be used. -Each CLI is a configuration object `{ name: string, cmd: string, sidecar?: bool, args?: boolean | Arg[] }`. - -- `name`: the unique identifier of the command, passed to the [Command constructor](shell.md#constructor). -If it's a sidecar, this must be the value defined on `tauri.conf.json > tauri > bundle > externalBin`. -- `cmd`: the program that is executed on this configuration. If it's a sidecar, this value is ignored. -- `sidecar`: whether the object configures a sidecar or a system program. -- `args`: the arguments that can be passed to the program. By default no arguments are allowed. - - `true` means that any argument list is allowed. - - `false` means that no arguments are allowed. - - otherwise an array can be configured. Each item is either a string representing the fixed argument value - or a `{ validator: string }` that defines a regex validating the argument value. - -#### Example scope configuration - -CLI: `git commit -m "the commit message"` - -Configuration: -```json -{ - "scope": [ - { - "name": "run-git-commit", - "cmd": "git", - "args": ["commit", "-m", { "validator": "\\S+" }] - } - ] -} -``` -Usage: -```typescript -import { Command } from '@tauri-apps/api/shell' -new Command('run-git-commit', ['commit', '-m', 'the commit message']) -``` - -Trying to execute any API with a program not configured on the scope results in a promise rejection due to denied access. - -## Classes - -### `Child` - -**Since**: 1.1.0 - -#### Constructors - -##### `constructor` - -> **new Child**(`pid`: `number`): [`Child`](shell.md#child) - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `pid` | `number` | - -**Defined in:** [shell.ts:325](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L325) - -#### Properties - -##### `pid` - -> **pid**: `number` - -The child process `pid`. - -**Defined in:** [shell.ts:323](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L323) - -#### Methods - -##### `kill` - -> **kill**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -Kills the child process. - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -A promise indicating the success or failure of the operation. - -##### `write` - -> **write**(`data`: `string` \| [`Uint8Array`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array )): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -Writes `data` to the `stdin`. - -**Example** - -```typescript -import { Command } from '@tauri-apps/api/shell'; -const command = new Command('node'); -const child = await command.spawn(); -await child.write('message'); -await child.write([0, 1, 2, 3, 4, 5]); -``` - -**Parameters** - -| Name | Type | Description | -| :------ | :------ | :------ | -| `data` | `string` \| [`Uint8Array`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array ) | The message to write, either a string or a byte array. | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -A promise indicating the success or failure of the operation. - -### `Command` - -The entry point for spawning child processes. -It emits the `close` and `error` events. - -**Example** - -```typescript -import { Command } from '@tauri-apps/api/shell'; -const command = new Command('node'); -command.on('close', data => { - console.log(`command finished with code ${data.code} and signal ${data.signal}`) -}); -command.on('error', error => console.error(`command error: "${error}"`)); -command.stdout.on('data', line => console.log(`command stdout: "${line}"`)); -command.stderr.on('data', line => console.log(`command stderr: "${line}"`)); - -const child = await command.spawn(); -console.log('pid:', child.pid); -``` - -**Since**: 1.1.0 - -**Hierarchy** - -- [`EventEmitter`](shell.md#eventemitter)<`"close"` \| `"error"`\> - - **Command** - -#### Constructors - -##### `constructor` - -> **new Command**(`program`: `string`, `args?`: `string` \| `string`[], `options?`: [`SpawnOptions`](shell.md#spawnoptions)): [`Command`](shell.md#command) - -Creates a new `Command` instance. - -**Parameters** - -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `program` | `string` | `undefined` | The program name to execute.
It must be configured on `tauri.conf.json > tauri > allowlist > shell > scope`. | -| `args` | `string` \| `string`[] | `[]` | Program arguments. | -| `options?` | [`SpawnOptions`](shell.md#spawnoptions) | `undefined` | Spawn options. | - -**Overrides:** [EventEmitter](shell.md#eventemitter).[constructor](shell.md#constructor) - -**Defined in:** [shell.ts:413](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L413) - -#### Properties - -##### `stderr` - -> `Readonly` **stderr**: [`EventEmitter`](shell.md#eventemitter)<`"data"`\> - -Event emitter for the `stderr`. Emits the `data` event. - -**Defined in:** [shell.ts:403](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L403) - -##### `stdout` - -> `Readonly` **stdout**: [`EventEmitter`](shell.md#eventemitter)<`"data"`\> - -Event emitter for the `stdout`. Emits the `data` event. - -**Defined in:** [shell.ts:401](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L401) - -#### Methods - -##### `addListener` - -> **addListener**(`eventName`: `"error"` \| `"close"`, `listener`: `fn`): [`Command`](shell.md#command) - -Alias for `emitter.on(eventName, listener)`. - -**Since**: 1.1.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `eventName` | `"error"` \| `"close"` | -| `listener` | (...`args`: `any`[]) => `void` | - -**Returns: **[`Command`](shell.md#command) - -##### `execute` - -> **execute**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`ChildProcess`](shell.md#childprocess)\> - -Executes the command as a child process, waiting for it to finish and collecting all of its output. - -**Example** - -```typescript -import { Command } from '@tauri-apps/api/shell'; -const output = await new Command('echo', 'message').execute(); -assert(output.code === 0); -assert(output.signal === null); -assert(output.stdout === 'message'); -assert(output.stderr === ''); -``` - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`ChildProcess`](shell.md#childprocess)\> - -A promise resolving to the child process output. - -##### `listenerCount` - -> **listenerCount**(`eventName`: `"error"` \| `"close"`): `number` - -Returns the number of listeners listening to the event named `eventName`. - -**Since**: 1.1.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `eventName` | `"error"` \| `"close"` | - -**Returns: **`number` - -##### `off` - -> **off**(`eventName`: `"error"` \| `"close"`, `listener`: `fn`): [`Command`](shell.md#command) - -Removes the all specified listener from the listener array for the event eventName -Returns a reference to the `EventEmitter`, so that calls can be chained. - -**Since**: 1.1.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `eventName` | `"error"` \| `"close"` | -| `listener` | (...`args`: `any`[]) => `void` | - -**Returns: **[`Command`](shell.md#command) - -##### `on` - -> **on**(`eventName`: `"error"` \| `"close"`, `listener`: `fn`): [`Command`](shell.md#command) - -Adds the `listener` function to the end of the listeners array for the -event named `eventName`. No checks are made to see if the `listener` has -already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple -times. - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `eventName` | `"error"` \| `"close"` | -| `listener` | (...`args`: `any`[]) => `void` | - -**Returns: **[`Command`](shell.md#command) - -##### `once` - -> **once**(`eventName`: `"error"` \| `"close"`, `listener`: `fn`): [`Command`](shell.md#command) - -Adds a **one-time**`listener` function for the event named `eventName`. The -next time `eventName` is triggered, this listener is removed and then invoked. - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -**Since**: 1.1.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `eventName` | `"error"` \| `"close"` | -| `listener` | (...`args`: `any`[]) => `void` | - -**Returns: **[`Command`](shell.md#command) - -##### `prependListener` - -> **prependListener**(`eventName`: `"error"` \| `"close"`, `listener`: `fn`): [`Command`](shell.md#command) - -Adds the `listener` function to the _beginning_ of the listeners array for the -event named `eventName`. No checks are made to see if the `listener` has -already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple -times. - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -**Since**: 1.1.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `eventName` | `"error"` \| `"close"` | -| `listener` | (...`args`: `any`[]) => `void` | - -**Returns: **[`Command`](shell.md#command) - -##### `prependOnceListener` - -> **prependOnceListener**(`eventName`: `"error"` \| `"close"`, `listener`: `fn`): [`Command`](shell.md#command) - -Adds a **one-time**`listener` function for the event named `eventName` to the_beginning_ of the listeners array. The next time `eventName` is triggered, this -listener is removed, and then invoked. - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -**Since**: 1.1.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `eventName` | `"error"` \| `"close"` | -| `listener` | (...`args`: `any`[]) => `void` | - -**Returns: **[`Command`](shell.md#command) - -##### `removeAllListeners` - -> **removeAllListeners**(`event?`: `"error"` \| `"close"`): [`Command`](shell.md#command) - -Removes all listeners, or those of the specified eventName. - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -**Since**: 1.1.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `event?` | `"error"` \| `"close"` | - -**Returns: **[`Command`](shell.md#command) - -##### `removeListener` - -> **removeListener**(`eventName`: `"error"` \| `"close"`, `listener`: `fn`): [`Command`](shell.md#command) - -Alias for `emitter.off(eventName, listener)`. - -**Since**: 1.1.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `eventName` | `"error"` \| `"close"` | -| `listener` | (...`args`: `any`[]) => `void` | - -**Returns: **[`Command`](shell.md#command) - -##### `spawn` - -> **spawn**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Child`](shell.md#child)\> - -Executes the command as a child process, returning a handle to it. - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Child`](shell.md#child)\> - -A promise resolving to the child process handle. - -##### `sidecar` - -> `Static` **sidecar**(`program`: `string`, `args?`: `string` \| `string`[], `options?`: [`SpawnOptions`](shell.md#spawnoptions)): [`Command`](shell.md#command) - -Creates a command to execute the given sidecar program. - -**Example** - -```typescript -import { Command } from '@tauri-apps/api/shell'; -const command = Command.sidecar('my-sidecar'); -const output = await command.execute(); -``` - -**Parameters** - -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `program` | `string` | `undefined` | The program to execute.
It must be configured on `tauri.conf.json > tauri > allowlist > shell > scope`. | -| `args` | `string` \| `string`[] | `[]` | - | -| `options?` | [`SpawnOptions`](shell.md#spawnoptions) | `undefined` | - | - -**Returns: **[`Command`](shell.md#command) - -### `EventEmitter` - -**Since**: 1.0.0 - -**Type parameters** - -- `E` *extends* `string` - -**Hierarchy** - -- **EventEmitter** - - [`Command`](shell.md#command) - -#### Constructors - -##### `constructor` - -> **new EventEmitter**<`E`\>(): [`EventEmitter`](shell.md#eventemitter)<`E`\> - -**Type parameters** - -- `E` *extends* `string` - -#### Methods - -##### `addListener` - -> **addListener**(`eventName`: `E`, `listener`: `fn`): [`EventEmitter`](shell.md#eventemitter)<`E`\> - -Alias for `emitter.on(eventName, listener)`. - -**Since**: 1.1.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `eventName` | `E` | -| `listener` | (...`args`: `any`[]) => `void` | - -**Returns: **[`EventEmitter`](shell.md#eventemitter)<`E`\> - -##### `listenerCount` - -> **listenerCount**(`eventName`: `E`): `number` - -Returns the number of listeners listening to the event named `eventName`. - -**Since**: 1.1.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `eventName` | `E` | - -**Returns: **`number` - -##### `off` - -> **off**(`eventName`: `E`, `listener`: `fn`): [`EventEmitter`](shell.md#eventemitter)<`E`\> - -Removes the all specified listener from the listener array for the event eventName -Returns a reference to the `EventEmitter`, so that calls can be chained. - -**Since**: 1.1.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `eventName` | `E` | -| `listener` | (...`args`: `any`[]) => `void` | - -**Returns: **[`EventEmitter`](shell.md#eventemitter)<`E`\> - -##### `on` - -> **on**(`eventName`: `E`, `listener`: `fn`): [`EventEmitter`](shell.md#eventemitter)<`E`\> - -Adds the `listener` function to the end of the listeners array for the -event named `eventName`. No checks are made to see if the `listener` has -already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple -times. - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `eventName` | `E` | -| `listener` | (...`args`: `any`[]) => `void` | - -**Returns: **[`EventEmitter`](shell.md#eventemitter)<`E`\> - -##### `once` - -> **once**(`eventName`: `E`, `listener`: `fn`): [`EventEmitter`](shell.md#eventemitter)<`E`\> - -Adds a **one-time**`listener` function for the event named `eventName`. The -next time `eventName` is triggered, this listener is removed and then invoked. - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -**Since**: 1.1.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `eventName` | `E` | -| `listener` | (...`args`: `any`[]) => `void` | - -**Returns: **[`EventEmitter`](shell.md#eventemitter)<`E`\> - -##### `prependListener` - -> **prependListener**(`eventName`: `E`, `listener`: `fn`): [`EventEmitter`](shell.md#eventemitter)<`E`\> - -Adds the `listener` function to the _beginning_ of the listeners array for the -event named `eventName`. No checks are made to see if the `listener` has -already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple -times. - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -**Since**: 1.1.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `eventName` | `E` | -| `listener` | (...`args`: `any`[]) => `void` | - -**Returns: **[`EventEmitter`](shell.md#eventemitter)<`E`\> - -##### `prependOnceListener` - -> **prependOnceListener**(`eventName`: `E`, `listener`: `fn`): [`EventEmitter`](shell.md#eventemitter)<`E`\> - -Adds a **one-time**`listener` function for the event named `eventName` to the_beginning_ of the listeners array. The next time `eventName` is triggered, this -listener is removed, and then invoked. - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -**Since**: 1.1.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `eventName` | `E` | -| `listener` | (...`args`: `any`[]) => `void` | - -**Returns: **[`EventEmitter`](shell.md#eventemitter)<`E`\> - -##### `removeAllListeners` - -> **removeAllListeners**(`event?`: `E`): [`EventEmitter`](shell.md#eventemitter)<`E`\> - -Removes all listeners, or those of the specified eventName. - -Returns a reference to the `EventEmitter`, so that calls can be chained. - -**Since**: 1.1.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `event?` | `E` | - -**Returns: **[`EventEmitter`](shell.md#eventemitter)<`E`\> - -##### `removeListener` - -> **removeListener**(`eventName`: `E`, `listener`: `fn`): [`EventEmitter`](shell.md#eventemitter)<`E`\> - -Alias for `emitter.off(eventName, listener)`. - -**Since**: 1.1.0 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `eventName` | `E` | -| `listener` | (...`args`: `any`[]) => `void` | - -**Returns: **[`EventEmitter`](shell.md#eventemitter)<`E`\> - -## Interfaces - -### `ChildProcess` - -**Since**: 1.0.0 - -#### Properties - -##### `code` - -> **code**: `null` \| `number` - -Exit code of the process. `null` if the process was terminated by a signal on Unix. - -**Defined in:** [shell.ts:109](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L109) - -##### `signal` - -> **signal**: `null` \| `number` - -If the process was terminated by a signal, represents that signal. - -**Defined in:** [shell.ts:111](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L111) - -##### `stderr` - -> **stderr**: `string` - -The data that the process wrote to `stderr`. - -**Defined in:** [shell.ts:115](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L115) - -##### `stdout` - -> **stdout**: `string` - -The data that the process wrote to `stdout`. - -**Defined in:** [shell.ts:113](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L113) - -### `SpawnOptions` - -**Since**: 1.0.0 - -#### Properties - -##### `cwd` - -> `Optional` **cwd**: `string` - -Current working directory. - -**Defined in:** [shell.ts:88](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L88) - -##### `encoding` - -> `Optional` **encoding**: `string` - -Character encoding for stdout/stderr - -**Since**: 1.1.0 - -**Defined in:** [shell.ts:96](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L96) - -##### `env` - -> `Optional` **env**: [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )<`string`, `string`\> - -Environment variables. set to `null` to clear the process env. - -**Defined in:** [shell.ts:90](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/shell.ts#L90) - -## Functions - -### `open` - -> **open**(`path`: `string`, `openWith?`: `string`): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -Opens a path or URL with the system's default app, -or the one specified with `openWith`. - -The `openWith` value must be one of `firefox`, `google chrome`, `chromium` `safari`, -`open`, `start`, `xdg-open`, `gio`, `gnome-open`, `kde-open` or `wslview`. - -**Example** - -```typescript -import { open } from '@tauri-apps/api/shell'; -// opens the given URL on the default browser: -await open('https://github.com/tauri-apps/tauri'); -// opens the given URL using `firefox`: -await open('https://github.com/tauri-apps/tauri', 'firefox'); -// opens a file using the default program: -await open('/path/to/file'); -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | Description | -| :------ | :------ | :------ | -| `path` | `string` | The path or URL to open.
This value is matched against the string regex defined on `tauri.conf.json > tauri > allowlist > shell > open`,
which defaults to `^((mailto:\w+)\|(tel:\w+)\|(https?://\w+)).+`. | -| `openWith?` | `string` | The app to open the file or URL with.
Defaults to the system default application for the specified path type. | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> diff --git a/docs/api/js/tauri.md b/docs/api/js/tauri.md deleted file mode 100644 index 4e95a9a71e6..00000000000 --- a/docs/api/js/tauri.md +++ /dev/null @@ -1,110 +0,0 @@ -# tauri - -Invoke your custom commands. - -This package is also accessible with `window.__TAURI__.tauri` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`. - -## Type Aliases - -### `InvokeArgs` - -> **InvokeArgs**: [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )<`string`, `unknown`\> - -Command arguments. - -**Since**: 1.0.0 - -**Defined in:** [tauri.ts:66](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/tauri.ts#L66) - -## Functions - -### `convertFileSrc` - -> **convertFileSrc**(`filePath`: `string`, `protocol?`: `string`): `string` - -Convert a device file path to an URL that can be loaded by the webview. -Note that `asset:` and `https://asset.localhost` must be added to [`tauri.security.csp`](https://tauri.app/v1/api/config/#securityconfig.csp) in `tauri.conf.json`. -Example CSP value: `"csp": "default-src 'self'; img-src 'self' asset: https://asset.localhost"` to use the asset protocol on image sources. - -Additionally, `asset` must be added to [`tauri.allowlist.protocol`](https://tauri.app/v1/api/config/#allowlistconfig.protocol) -in `tauri.conf.json` and its access scope must be defined on the `assetScope` array on the same `protocol` object. - -**Example** - -```typescript -import { appDataDir, join } from '@tauri-apps/api/path'; -import { convertFileSrc } from '@tauri-apps/api/tauri'; -const appDataDirPath = await appDataDir(); -const filePath = await join(appDataDirPath, 'assets/video.mp4'); -const assetUrl = convertFileSrc(filePath); - -const video = document.getElementById('my-video'); -const source = document.createElement('source'); -source.type = 'video/mp4'; -source.src = assetUrl; -video.appendChild(source); -video.load(); -``` - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `filePath` | `string` | `undefined` | The file path. | -| `protocol` | `string` | `'asset'` | The protocol to use. Defaults to `asset`. You only need to set this when using a custom protocol. | - -**Returns: **`string` - -the URL that can be used as source on the webview. - -### `invoke` - -> **invoke**<`T`\>(`cmd`: `string`, `args?`: [`InvokeArgs`](tauri.md#invokeargs)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`T`\> - -Sends a message to the backend. - -**Example** - -```typescript -import { invoke } from '@tauri-apps/api/tauri'; -await invoke('login', { user: 'tauri', password: 'poiwe3h4r5ip3yrhtew9ty' }); -``` - -**Since**: 1.0.0 - -**Type parameters** - -- `T` - -**Parameters** - -| Name | Type | Description | -| :------ | :------ | :------ | -| `cmd` | `string` | The command name. | -| `args` | [`InvokeArgs`](tauri.md#invokeargs) | The optional arguments to pass to the command. | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`T`\> - -A promise resolving or rejecting to the backend response. - -### `transformCallback` - -> **transformCallback**(`callback?`: `fn`, `once?`: `boolean`): `number` - -Transforms a callback function to a string identifier that can be passed to the backend. -The backend uses the identifier to `eval()` the callback. - -**Since**: 1.0.0 - -**Parameters** - -| Name | Type | Default value | -| :------ | :------ | :------ | -| `callback?` | (`response`: `any`) => `void` | `undefined` | -| `once` | `boolean` | `false` | - -**Returns: **`number` - -A unique identifier associated with the callback function. diff --git a/docs/api/js/updater.md b/docs/api/js/updater.md deleted file mode 100644 index e94a0300b7f..00000000000 --- a/docs/api/js/updater.md +++ /dev/null @@ -1,153 +0,0 @@ -# updater - -Customize the auto updater flow. - -This package is also accessible with `window.__TAURI__.updater` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`. - -## Interfaces - -### `UpdateManifest` - -**Since**: 1.0.0 - -#### Properties - -##### `body` - -> **body**: `string` - -**Defined in:** [updater.ts:34](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/updater.ts#L34) - -##### `date` - -> **date**: `string` - -**Defined in:** [updater.ts:33](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/updater.ts#L33) - -##### `version` - -> **version**: `string` - -**Defined in:** [updater.ts:32](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/updater.ts#L32) - -### `UpdateResult` - -**Since**: 1.0.0 - -#### Properties - -##### `manifest` - -> `Optional` **manifest**: [`UpdateManifest`](updater.md#updatemanifest) - -**Defined in:** [updater.ts:41](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/updater.ts#L41) - -##### `shouldUpdate` - -> **shouldUpdate**: `boolean` - -**Defined in:** [updater.ts:42](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/updater.ts#L42) - -### `UpdateStatusResult` - -**Since**: 1.0.0 - -#### Properties - -##### `error` - -> `Optional` **error**: `string` - -**Defined in:** [updater.ts:24](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/updater.ts#L24) - -##### `status` - -> **status**: [`UpdateStatus`](updater.md#updatestatus) - -**Defined in:** [updater.ts:25](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/updater.ts#L25) - -## Type Aliases - -### `UpdateStatus` - -> **UpdateStatus**: `"PENDING"` \| `"ERROR"` \| `"DONE"` \| `"UPTODATE"` - -**Since**: 1.0.0 - -**Defined in:** [updater.ts:18](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/updater.ts#L18) - -## Functions - -### `checkUpdate` - -> **checkUpdate**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`UpdateResult`](updater.md#updateresult)\> - -Checks if an update is available. - -**Example** - -```typescript -import { checkUpdate } from '@tauri-apps/api/updater'; -const update = await checkUpdate(); -// now run installUpdate() if needed -``` - -**Since**: 1.0.0 - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`UpdateResult`](updater.md#updateresult)\> - -Promise resolving to the update status. - -### `installUpdate` - -> **installUpdate**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -Install the update if there's one available. - -**Example** - -```typescript -import { checkUpdate, installUpdate } from '@tauri-apps/api/updater'; -const update = await checkUpdate(); -if (update.shouldUpdate) { - console.log(`Installing update ${update.manifest?.version}, ${update.manifest?.date}, ${update.manifest.body}`); - await installUpdate(); -} -``` - -**Since**: 1.0.0 - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> - -A promise indicating the success or failure of the operation. - -### `onUpdaterEvent` - -> **onUpdaterEvent**(`handler`: `fn`): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`UnlistenFn`](event.md#unlistenfn)\> - -Listen to an updater event. - -**Example** - -```typescript -import { onUpdaterEvent } from "@tauri-apps/api/updater"; -const unlisten = await onUpdaterEvent(({ error, status }) => { - console.log('Updater event', error, status); -}); - -// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted -unlisten(); -``` - -**Since**: 1.0.2 - -**Parameters** - -| Name | Type | -| :------ | :------ | -| `handler` | (`status`: [`UpdateStatusResult`](updater.md#updatestatusresult)) => `void` | - -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`UnlistenFn`](event.md#unlistenfn)\> - -A promise resolving to a function to unlisten to the event. -Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted. diff --git a/docs/api/js/window.md b/docs/api/js/window.md index a373db7daf5..74fa36cb825 100644 --- a/docs/api/js/window.md +++ b/docs/api/js/window.md @@ -2,84 +2,87 @@ Provides APIs to create windows, communicate with other windows and manipulate the current window. -This package is also accessible with `window.__TAURI__.window` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`. - -The APIs must be added to [`tauri.allowlist.window`](https://tauri.app/v1/api/config/#allowlistconfig.window) in `tauri.conf.json`: -```json -{ - "tauri": { - "allowlist": { - "window": { - "all": true, // enable all window APIs - "create": true, // enable window creation - "center": true, - "requestUserAttention": true, - "setResizable": true, - "setMaximizable": true, - "setMinimizable": true, - "setClosable": true, - "setTitle": true, - "maximize": true, - "unmaximize": true, - "minimize": true, - "unminimize": true, - "show": true, - "hide": true, - "close": true, - "setDecorations": true, - "setAlwaysOnTop": true, - "setContentProtected": true, - "setSize": true, - "setMinSize": true, - "setMaxSize": true, - "setPosition": true, - "setFullscreen": true, - "setFocus": true, - "setIcon": true, - "setSkipTaskbar": true, - "setCursorGrab": true, - "setCursorVisible": true, - "setCursorIcon": true, - "setCursorPosition": true, - "setIgnoreCursorEvents": true, - "startDragging": true, - "print": true - } - } - } -} -``` -It is recommended to allowlist only the APIs you use for optimal bundle size and security. - ## Window events -Events can be listened to using `appWindow.listen`: +Events can be listened to using [listen](window.md#listen): ```typescript -import { appWindow } from "@tauri-apps/api/window"; -appWindow.listen("my-window-event", ({ event, payload }) => { }); +import { getCurrent } from "@tauri-apps/api/window"; +getCurrent().listen("my-window-event", ({ event, payload }) => { }); ``` ## Enumerations +### `Effect` + +Platform-specific window effects + +**Since**: 2.0 + +#### Enumeration Members + +| Name | Type | Description | Defined in | +| :------ | :------ | :------ | :------ | +| | `"acrylic"` | **Windows 10/11**

## Notes

This effect has bad performance when resizing/dragging the window on Windows 10 v1903+ and Windows 11 build 22000. | [window.ts:1947](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1947) | +| | `"appearanceBased"` | A default material appropriate for the view's effectiveAppearance. **macOS 10.14-**

**Deprecated**

since macOS 10.14. You should instead choose an appropriate semantic material. | [window.ts:1847](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1847) | +| | `"blur"` | **Windows 7/10/11(22H1) Only**

## Notes

This effect has bad performance when resizing/dragging the window on Windows 11 build 22621. | [window.ts:1939](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1939) | +| | `"contentBackground"` | **macOS 10.14+** | [window.ts:1919](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1919) | +| | `"dark"` | **macOS 10.14-**

**Deprecated**

since macOS 10.14. Use a semantic material instead. | [window.ts:1859](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1859) | +| | `"fullScreenUI"` | **macOS 10.14+** | [window.ts:1911](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1911) | +| | `"headerView"` | **macOS 10.14+** | [window.ts:1895](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1895) | +| | `"hudWindow"` | **macOS 10.14+** | [window.ts:1907](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1907) | +| | `"light"` | **macOS 10.14-**

**Deprecated**

since macOS 10.14. Use a semantic material instead. | [window.ts:1853](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1853) | +| | `"mediumLight"` | **macOS 10.14-**

**Deprecated**

since macOS 10.14. Use a semantic material instead. | [window.ts:1865](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1865) | +| | `"menu"` | **macOS 10.11+** | [window.ts:1883](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1883) | +| | `"mica"` | **Windows 11 Only** | [window.ts:1931](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1931) | +| | `"popover"` | **macOS 10.11+** | [window.ts:1887](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1887) | +| | `"selection"` | **macOS 10.10+** | [window.ts:1879](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1879) | +| | `"sheet"` | **macOS 10.14+** | [window.ts:1899](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1899) | +| | `"sidebar"` | **macOS 10.11+** | [window.ts:1891](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1891) | +| | `"tabbed"` | Tabbed effect that matches the system dark perefence **Windows 11 Only** | [window.ts:1951](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1951) | +| | `"tabbedDark"` | Tabbed effect with dark mode but only if dark mode is enabled on the system **Windows 11 Only** | [window.ts:1955](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1955) | +| | `"tabbedLight"` | Tabbed effect with light mode **Windows 11 Only** | [window.ts:1959](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1959) | +| | `"titlebar"` | **macOS 10.10+** | [window.ts:1875](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1875) | +| | `"tooltip"` | **macOS 10.14+** | [window.ts:1915](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1915) | +| | `"ultraDark"` | **macOS 10.14-**

**Deprecated**

since macOS 10.14. Use a semantic material instead. | [window.ts:1871](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1871) | +| | `"underPageBackground"` | **macOS 10.14+** | [window.ts:1927](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1927) | +| | `"underWindowBackground"` | **macOS 10.14+** | [window.ts:1923](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1923) | +| | `"windowBackground"` | **macOS 10.14+** | [window.ts:1903](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1903) | + +### `EffectState` + +Window effect state **macOS only** + +**See** + +https://developer.apple.com/documentation/appkit/nsvisualeffectview/state + +**Since**: 2.0 + +#### Enumeration Members + +| Name | Type | Description | Defined in | +| :------ | :------ | :------ | :------ | +| | `"active"` | Make window effect state always active **macOS only** | [window.ts:1977](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1977) | +| | `"followsWindowActiveState"` | Make window effect state follow the window's active state **macOS only** | [window.ts:1973](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1973) | +| | `"inactive"` | Make window effect state always inactive **macOS only** | [window.ts:1981](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1981) | + ### `UserAttentionType` Attention type to request on a window. -**Since**: 1.0.0 +**Since**: 2.0.0 #### Enumeration Members | Name | Type | Description | Defined in | | :------ | :------ | :------ | :------ | -| | `1` | #### Platform-specific
- **macOS:** Bounces the dock icon until the application is in focus.
- **Windows:** Flashes both the window and the taskbar button until the application is in focus. | [window.ts:228](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L228) | -| | `2` | #### Platform-specific
- **macOS:** Bounces the dock icon once.
- **Windows:** Flashes the taskbar button until the application is in focus. | [window.ts:234](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L234) | +| | `1` | #### Platform-specific
- **macOS:** Bounces the dock icon until the application is in focus.
- **Windows:** Flashes both the window and the taskbar button until the application is in focus. | [window.ts:77](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L77) | +| | `2` | #### Platform-specific
- **macOS:** Bounces the dock icon once.
- **Windows:** Flashes the taskbar button until the application is in focus. | [window.ts:83](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L83) | ## Classes ### `CloseRequestedEvent` -**Since**: 1.0.2 - #### Constructors ##### `constructor` @@ -92,7 +95,7 @@ Attention type to request on a window. | :------ | :------ | | `event` | [`Event`](event.md#event)<`null`\> | -**Defined in:** [window.ts:2179](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2179) +**Defined in:** [window.ts:95](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L95) #### Properties @@ -102,7 +105,7 @@ Attention type to request on a window. Event name -**Defined in:** [window.ts:2172](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2172) +**Defined in:** [window.ts:88](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L88) ##### `id` @@ -110,7 +113,7 @@ Event name Event identifier used to unlisten -**Defined in:** [window.ts:2176](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2176) +**Defined in:** [window.ts:92](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L92) ##### `windowLabel` @@ -118,7 +121,7 @@ Event identifier used to unlisten The label of the window that emitted this event. -**Defined in:** [window.ts:2174](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2174) +**Defined in:** [window.ts:90](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L90) #### Methods @@ -138,7 +141,7 @@ The label of the window that emitted this event. A position represented in logical pixels. -**Since**: 1.0.0 +**Since**: 2.0.0 #### Constructors @@ -153,7 +156,7 @@ A position represented in logical pixels. | `x` | `number` | | `y` | `number` | -**Defined in:** [window.ts:166](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L166) +**Defined in:** [dpi.ts:62](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L62) #### Properties @@ -161,25 +164,25 @@ A position represented in logical pixels. > **type**: `string` = `'Logical'` -**Defined in:** [window.ts:162](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L162) +**Defined in:** [dpi.ts:58](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L58) ##### `x` > **x**: `number` -**Defined in:** [window.ts:163](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L163) +**Defined in:** [dpi.ts:59](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L59) ##### `y` > **y**: `number` -**Defined in:** [window.ts:164](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L164) +**Defined in:** [dpi.ts:60](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L60) ### `LogicalSize` A size represented in logical pixels. -**Since**: 1.0.0 +**Since**: 2.0.0 #### Constructors @@ -194,7 +197,7 @@ A size represented in logical pixels. | `width` | `number` | | `height` | `number` | -**Defined in:** [window.ts:120](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L120) +**Defined in:** [dpi.ts:15](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L15) #### Properties @@ -202,25 +205,25 @@ A size represented in logical pixels. > **height**: `number` -**Defined in:** [window.ts:118](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L118) +**Defined in:** [dpi.ts:13](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L13) ##### `type` > **type**: `string` = `'Logical'` -**Defined in:** [window.ts:116](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L116) +**Defined in:** [dpi.ts:11](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L11) ##### `width` > **width**: `number` -**Defined in:** [window.ts:117](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L117) +**Defined in:** [dpi.ts:12](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L12) ### `PhysicalPosition` A position represented in physical pixels. -**Since**: 1.0.0 +**Since**: 2.0.0 #### Constructors @@ -235,7 +238,7 @@ A position represented in physical pixels. | `x` | `number` | | `y` | `number` | -**Defined in:** [window.ts:182](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L182) +**Defined in:** [dpi.ts:78](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L78) #### Properties @@ -243,19 +246,19 @@ A position represented in physical pixels. > **type**: `string` = `'Physical'` -**Defined in:** [window.ts:178](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L178) +**Defined in:** [dpi.ts:74](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L74) ##### `x` > **x**: `number` -**Defined in:** [window.ts:179](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L179) +**Defined in:** [dpi.ts:75](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L75) ##### `y` > **y**: `number` -**Defined in:** [window.ts:180](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L180) +**Defined in:** [dpi.ts:76](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L76) #### Methods @@ -268,7 +271,8 @@ Converts the physical position to a logical one. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; +import { getCurrent } from '@tauri-apps/api/window'; +const appWindow = getCurrent(); const factor = await appWindow.scaleFactor(); const position = await appWindow.innerPosition(); const logical = position.toLogical(factor); @@ -286,7 +290,7 @@ const logical = position.toLogical(factor); A size represented in physical pixels. -**Since**: 1.0.0 +**Since**: 2.0.0 #### Constructors @@ -301,7 +305,7 @@ A size represented in physical pixels. | `width` | `number` | | `height` | `number` | -**Defined in:** [window.ts:136](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L136) +**Defined in:** [dpi.ts:31](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L31) #### Properties @@ -309,19 +313,19 @@ A size represented in physical pixels. > **height**: `number` -**Defined in:** [window.ts:134](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L134) +**Defined in:** [dpi.ts:29](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L29) ##### `type` > **type**: `string` = `'Physical'` -**Defined in:** [window.ts:132](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L132) +**Defined in:** [dpi.ts:27](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L27) ##### `width` > **width**: `number` -**Defined in:** [window.ts:133](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L133) +**Defined in:** [dpi.ts:28](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/dpi.ts#L28) #### Methods @@ -334,7 +338,8 @@ Converts the physical size to a logical one. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; +import { getCurrent } from '@tauri-apps/api/window'; +const appWindow = getCurrent(); const factor = await appWindow.scaleFactor(); const size = await appWindow.innerSize(); const logical = size.toLogical(factor); @@ -348,9 +353,9 @@ const logical = size.toLogical(factor); **Returns: **[`LogicalSize`](window.md#logicalsize) -### `WebviewWindow` +### `Window` -Create new webview windows and get a handle to existing ones. +Create new webview window or get a handle to an existing one. Windows are identified by a *label* a unique identifier that can be used to reference it later. It may only contain alphanumeric characters `a-zA-Z` plus the following special characters `-`, `/`, `:` and `_`. @@ -359,59 +364,54 @@ It may only contain alphanumeric characters `a-zA-Z` plus the following special ```typescript // loading embedded asset: -const webview = new WebviewWindow('theUniqueLabel', { +const appWindow = new Window('theUniqueLabel', { url: 'path/to/page.html' }); // alternatively, load a remote URL: -const webview = new WebviewWindow('theUniqueLabel', { +const appWindow = new Window('theUniqueLabel', { url: 'https://github.com/tauri-apps/tauri' }); -webview.once('tauri://created', function () { - // webview window successfully created +appWindow.once('tauri://created', function () { + // window successfully created }); -webview.once('tauri://error', function (e) { - // an error happened creating the webview window +appWindow.once('tauri://error', function (e) { + // an error happened creating the window }); // emit an event to the backend -await webview.emit("some event", "data"); +await appWindow.emit("some event", "data"); // listen to an event from the backend -const unlisten = await webview.listen("event name", e => {}); +const unlisten = await appWindow.listen("event name", e => {}); unlisten(); ``` -**Since**: 1.0.2 - -**Hierarchy** - -- `WindowManager` - - **WebviewWindow** +**Since**: 2.0.0 #### Constructors ##### `constructor` -> **new WebviewWindow**(`label`: `string`, `options?`: [`WindowOptions`](window.md#windowoptions)): [`WebviewWindow`](window.md#webviewwindow) +> **new Window**(`label`: `string`, `options?`: [`WindowOptions`](window.md#windowoptions)): [`Window`](window.md#window) -Creates a new WebviewWindow. +Creates a new Window. **Example** ```typescript -import { WebviewWindow } from '@tauri-apps/api/window'; -const webview = new WebviewWindow('my-label', { +import { Window } from '@tauri-apps/api/window'; +const appWindow = new Window('my-label', { url: 'https://github.com/tauri-apps/tauri' }); -webview.once('tauri://created', function () { - // webview window successfully created +appWindow.once('tauri://created', function () { + // window successfully created }); -webview.once('tauri://error', function (e) { - // an error happened creating the webview window +appWindow.once('tauri://error', function (e) { + // an error happened creating the window }); ``` -* +**Since**: 2.0.0 **Parameters** @@ -420,9 +420,7 @@ webview.once('tauri://error', function (e) { | `label` | `string` | The unique webview window label. Must be alphanumeric: `a-zA-Z-/:_`. | | `options` | [`WindowOptions`](window.md#windowoptions) | - | -**Overrides:** WindowManager.constructor - -**Defined in:** [window.ts:2247](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2247) +**Defined in:** [window.ts:245](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L245) #### Properties @@ -432,9 +430,7 @@ webview.once('tauri://error', function (e) { The window label. It is a unique identifier for the window, can be used to reference it later. -**Inherited from:** WindowManager.label - -**Defined in:** [window.ts:318](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L318) +**Defined in:** [window.ts:219](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L219) ##### `listeners` @@ -442,9 +438,7 @@ The window label. It is a unique identifier for the window, can be used to refer Local event listeners. -**Inherited from:** WindowManager.listeners - -**Defined in:** [window.ts:320](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L320) +**Defined in:** [window.ts:222](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L222) #### Methods @@ -457,14 +451,26 @@ Centers the window. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.center(); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().center(); ``` +**Since**: 2.0.0 + **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> A promise indicating the success or failure of the operation. +##### `clearEffects` + +> **clearEffects**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> + +Clear any applied effects if possible. + +**Since**: 2.0 + +**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> + ##### `close` > **close**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> @@ -474,10 +480,12 @@ Closes the window. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.close(); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().close(); ``` +**Since**: 2.0.0 + **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> A promise indicating the success or failure of the operation. @@ -486,34 +494,13 @@ A promise indicating the success or failure of the operation. > **emit**(`event`: `string`, `payload?`: `unknown`): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> -Emits an event to the backend and all Tauri windows. -The event will have this window's [label](window.md#label) as Event.windowLabel | source window label. +Emits an event to the backend, tied to the webview window. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.emit('window-loaded', { loggedIn: true, token: 'authToken' }); -``` - -This function can also be used to communicate between windows: -```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.listen('sync-data', (event) => { }); - -// on another window... -import { WebviewWindow } from '@tauri-apps/api/window'; -const otherWindow = WebviewWindow.getByLabel('other') -await otherWindow.emit('sync-data'); -``` - -Global listeners are also triggered: -```typescript -import { appWindow } from '@tauri-apps/api/window'; -import { listen } from '@tauri-apps/api/event'; -await listen('ping', (event) => { }); - -await appWindow.emit('ping'); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().emit('window-loaded', { loggedIn: true, token: 'authToken' }); ``` **Parameters** @@ -534,10 +521,12 @@ Sets the window visibility to false. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.hide(); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().hide(); ``` +**Since**: 2.0.0 + **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> A promise indicating the success or failure of the operation. @@ -551,10 +540,12 @@ The position of the top-left hand corner of the window's client area relative to **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -const position = await appWindow.innerPosition(); +import { getCurrent } from '@tauri-apps/api/window'; +const position = await getCurrent().innerPosition(); ``` +**Since**: 2.0.0 + **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`PhysicalPosition`](window.md#physicalposition)\> The window's inner position. @@ -569,10 +560,12 @@ The client area is the content of the window, excluding the title bar and border **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -const size = await appWindow.innerSize(); +import { getCurrent } from '@tauri-apps/api/window'; +const size = await getCurrent().innerSize(); ``` +**Since**: 2.0.0 + **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`PhysicalSize`](window.md#physicalsize)\> The window's inner size. @@ -585,13 +578,13 @@ Gets the window’s native close button state. #### Platform-specific -- **Linux / iOS / Android:** Unsupported. +- **iOS / Android:** Unsupported. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -const closable = await appWindow.isClosable(); +import { getCurrent } from '@tauri-apps/api/window'; +const closable = await getCurrent().isClosable(); ``` **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`boolean`\> @@ -607,10 +600,12 @@ Gets the window's current decorated state. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -const decorated = await appWindow.isDecorated(); +import { getCurrent } from '@tauri-apps/api/window'; +const decorated = await getCurrent().isDecorated(); ``` +**Since**: 2.0.0 + **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`boolean`\> Whether the window is decorated or not. @@ -624,11 +619,11 @@ Gets the window's current focus state. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -const focused = await appWindow.isFocused(); +import { getCurrent } from '@tauri-apps/api/window'; +const focused = await getCurrent().isFocused(); ``` -**Since**: 1.4 +**Since**: 2.0.0 **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`boolean`\> @@ -643,10 +638,12 @@ Gets the window's current fullscreen state. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -const fullscreen = await appWindow.isFullscreen(); +import { getCurrent } from '@tauri-apps/api/window'; +const fullscreen = await getCurrent().isFullscreen(); ``` +**Since**: 2.0.0 + **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`boolean`\> Whether the window is in fullscreen mode or not. @@ -664,8 +661,8 @@ Gets the window’s native maximize button state. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -const maximizable = await appWindow.isMaximizable(); +import { getCurrent } from '@tauri-apps/api/window'; +const maximizable = await getCurrent().isMaximizable(); ``` **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`boolean`\> @@ -681,10 +678,12 @@ Gets the window's current maximized state. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -const maximized = await appWindow.isMaximized(); +import { getCurrent } from '@tauri-apps/api/window'; +const maximized = await getCurrent().isMaximized(); ``` +**Since**: 2.0.0 + **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`boolean`\> Whether the window is maximized or not. @@ -702,8 +701,8 @@ Gets the window’s native minimize button state. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -const minimizable = await appWindow.isMinimizable(); +import { getCurrent } from '@tauri-apps/api/window'; +const minimizable = await getCurrent().isMinimizable(); ``` **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`boolean`\> @@ -719,11 +718,11 @@ Gets the window's current minimized state. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -const minimized = await appWindow.isMinimized(); +import { getCurrent } from '@tauri-apps/api/window'; +const minimized = await getCurrent().isMinimized(); ``` -**Since**: 1.3.0 +**Since**: 2.0.0 **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`boolean`\> @@ -736,10 +735,12 @@ Gets the window's current resizable state. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -const resizable = await appWindow.isResizable(); +import { getCurrent } from '@tauri-apps/api/window'; +const resizable = await getCurrent().isResizable(); ``` +**Since**: 2.0.0 + **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`boolean`\> Whether the window is resizable or not. @@ -753,10 +754,12 @@ Gets the window's current visible state. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -const visible = await appWindow.isVisible(); +import { getCurrent } from '@tauri-apps/api/window'; +const visible = await getCurrent().isVisible(); ``` +**Since**: 2.0.0 + **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`boolean`\> Whether the window is visible or not. @@ -765,16 +768,13 @@ Whether the window is visible or not. > **listen**<`T`\>(`event`: [`EventName`](event.md#eventname), `handler`: [`EventCallback`](event.md#eventcallback)<`T`\>): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`UnlistenFn`](event.md#unlistenfn)\> -Listen to an event emitted by the backend or webview. -The event must either be a global event or an event targetting this window. - -See [`emit`](window.md#emit) for more information. +Listen to an event emitted by the backend that is tied to the webview window. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -const unlisten = await appWindow.listen('state-changed', (event) => { +import { getCurrent } from '@tauri-apps/api/window'; +const unlisten = await getCurrent().listen('state-changed', (event) => { console.log(`Got error: ${payload}`); }); @@ -782,7 +782,7 @@ const unlisten = await appWindow.listen('state-changed', (event) => { unlisten(); ``` -Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted. +**Since**: 2.0.0 **Type parameters** @@ -798,6 +798,7 @@ Note that removing the listener is required if your listener goes out of scope e **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`UnlistenFn`](event.md#unlistenfn)\> A promise resolving to a function to unlisten to the event. +Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted. ##### `maximize` @@ -808,10 +809,12 @@ Maximizes the window. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.maximize(); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().maximize(); ``` +**Since**: 2.0.0 + **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> A promise indicating the success or failure of the operation. @@ -825,10 +828,12 @@ Minimizes the window. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.minimize(); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().minimize(); ``` +**Since**: 2.0.0 + **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> A promise indicating the success or failure of the operation. @@ -842,9 +847,9 @@ Listen to window close requested. Emitted when the user requests to closes the w **Example** ```typescript -import { appWindow } from "@tauri-apps/api/window"; +import { getCurrent } from "@tauri-apps/api/window"; import { confirm } from '@tauri-apps/api/dialog'; -const unlisten = await appWindow.onCloseRequested(async (event) => { +const unlisten = await getCurrent().onCloseRequested(async (event) => { const confirmed = await confirm('Are you sure?'); if (!confirmed) { // user did not confirm closing the window; let's prevent it @@ -856,7 +861,7 @@ const unlisten = await appWindow.onCloseRequested(async (event) => { unlisten(); ``` -**Since**: 1.0.2 +**Since**: 2.0.0 **Parameters** @@ -880,8 +885,8 @@ drops the files or cancels the operation. **Example** ```typescript -import { appWindow } from "@tauri-apps/api/window"; -const unlisten = await appWindow.onFileDropEvent((event) => { +import { getCurrent } from "@tauri-apps/api/window"; +const unlisten = await getCurrent().onFileDropEvent((event) => { if (event.payload.type === 'hover') { console.log('User hovering', event.payload.paths); } else if (event.payload.type === 'drop') { @@ -895,7 +900,7 @@ const unlisten = await appWindow.onFileDropEvent((event) => { unlisten(); ``` -**Since**: 1.0.2 +**Since**: 2.0.0 **Parameters** @@ -917,8 +922,8 @@ Listen to window focus change. **Example** ```typescript -import { appWindow } from "@tauri-apps/api/window"; -const unlisten = await appWindow.onFocusChanged(({ payload: focused }) => { +import { getCurrent } from "@tauri-apps/api/window"; +const unlisten = await getCurrent().onFocusChanged(({ payload: focused }) => { console.log('Focus changed, window is focused? ' + focused); }); @@ -926,7 +931,7 @@ const unlisten = await appWindow.onFocusChanged(({ payload: focused }) => { unlisten(); ``` -**Since**: 1.0.2 +**Since**: 2.0.0 **Parameters** @@ -948,8 +953,8 @@ Listen to the window menu item click. The payload is the item id. **Example** ```typescript -import { appWindow } from "@tauri-apps/api/window"; -const unlisten = await appWindow.onMenuClicked(({ payload: menuId }) => { +import { getCurrent } from "@tauri-apps/api/window"; +const unlisten = await getCurrent().onMenuClicked(({ payload: menuId }) => { console.log('Menu clicked: ' + menuId); }); @@ -957,7 +962,7 @@ const unlisten = await appWindow.onMenuClicked(({ payload: menuId }) => { unlisten(); ``` -**Since**: 1.0.2 +**Since**: 2.0.0 **Parameters** @@ -979,8 +984,8 @@ Listen to window move. **Example** ```typescript -import { appWindow } from "@tauri-apps/api/window"; -const unlisten = await appWindow.onMoved(({ payload: position }) => { +import { getCurrent } from "@tauri-apps/api/window"; +const unlisten = await getCurrent().onMoved(({ payload: position }) => { console.log('Window moved', position); }); @@ -988,7 +993,7 @@ const unlisten = await appWindow.onMoved(({ payload: position }) => { unlisten(); ``` -**Since**: 1.0.2 +**Since**: 2.0.0 **Parameters** @@ -1010,8 +1015,8 @@ Listen to window resize. **Example** ```typescript -import { appWindow } from "@tauri-apps/api/window"; -const unlisten = await appWindow.onResized(({ payload: size }) => { +import { getCurrent } from "@tauri-apps/api/window"; +const unlisten = await getCurrent().onResized(({ payload: size }) => { console.log('Window resized', size); }); @@ -1019,7 +1024,7 @@ const unlisten = await appWindow.onResized(({ payload: size }) => { unlisten(); ``` -**Since**: 1.0.2 +**Since**: 2.0.0 **Parameters** @@ -1045,8 +1050,8 @@ The following user actions can cause DPI changes: **Example** ```typescript -import { appWindow } from "@tauri-apps/api/window"; -const unlisten = await appWindow.onScaleChanged(({ payload }) => { +import { getCurrent } from "@tauri-apps/api/window"; +const unlisten = await getCurrent().onScaleChanged(({ payload }) => { console.log('Scale changed', payload.scaleFactor, payload.size); }); @@ -1054,7 +1059,7 @@ const unlisten = await appWindow.onScaleChanged(({ payload }) => { unlisten(); ``` -**Since**: 1.0.2 +**Since**: 2.0.0 **Parameters** @@ -1076,8 +1081,8 @@ Listen to the system theme change. **Example** ```typescript -import { appWindow } from "@tauri-apps/api/window"; -const unlisten = await appWindow.onThemeChanged(({ payload: theme }) => { +import { getCurrent } from "@tauri-apps/api/window"; +const unlisten = await getCurrent().onThemeChanged(({ payload: theme }) => { console.log('New theme: ' + theme); }); @@ -1085,7 +1090,7 @@ const unlisten = await appWindow.onThemeChanged(({ payload: theme }) => { unlisten(); ``` -**Since**: 1.0.2 +**Since**: 2.0.0 **Parameters** @@ -1102,14 +1107,13 @@ Note that removing the listener is required if your listener goes out of scope e > **once**<`T`\>(`event`: `string`, `handler`: [`EventCallback`](event.md#eventcallback)<`T`\>): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`UnlistenFn`](event.md#unlistenfn)\> -Listen to an one-off event. -See [`listen`](window.md#listen) for more information. +Listen to an one-off event emitted by the backend that is tied to the webview window. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -const unlisten = await appWindow.once('initialized', (event) => { +import { getCurrent } from '@tauri-apps/api/window'; +const unlisten = await getCurrent().once('initialized', (event) => { console.log(`Window initialized!`); }); @@ -1117,7 +1121,7 @@ const unlisten = await appWindow.once('initialized', (event) => { unlisten(); ``` -Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted. +**Since**: 2.0.0 **Type parameters** @@ -1133,6 +1137,7 @@ Note that removing the listener is required if your listener goes out of scope e **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`UnlistenFn`](event.md#unlistenfn)\> A promise resolving to a function to unlisten to the event. +Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted. ##### `outerPosition` @@ -1143,10 +1148,12 @@ The position of the top-left hand corner of the window relative to the top-left **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -const position = await appWindow.outerPosition(); +import { getCurrent } from '@tauri-apps/api/window'; +const position = await getCurrent().outerPosition(); ``` +**Since**: 2.0.0 + **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`PhysicalPosition`](window.md#physicalposition)\> The window's outer position. @@ -1161,10 +1168,12 @@ These dimensions include the title bar and borders. If you don't want that (and **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -const size = await appWindow.outerSize(); +import { getCurrent } from '@tauri-apps/api/window'; +const size = await getCurrent().outerSize(); ``` +**Since**: 2.0.0 + **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`PhysicalSize`](window.md#physicalsize)\> The window's outer size. @@ -1188,10 +1197,12 @@ user attention might not be done automatically by the WM when the window receive **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.requestUserAttention(); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().requestUserAttention(); ``` +**Since**: 2.0.0 + **Parameters** | Name | Type | @@ -1211,10 +1222,12 @@ The scale factor that can be used to map physical pixels to logical pixels. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -const factor = await appWindow.scaleFactor(); +import { getCurrent } from '@tauri-apps/api/window'; +const factor = await getCurrent().scaleFactor(); ``` +**Since**: 2.0.0 + **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`number`\> The window's monitor scale factor. @@ -1228,10 +1241,12 @@ Whether the window should always be on top of other windows. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.setAlwaysOnTop(true); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().setAlwaysOnTop(true); ``` +**Since**: 2.0.0 + **Parameters** | Name | Type | Description | @@ -1256,8 +1271,8 @@ Sets whether the window's native close button is enabled or not. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.setClosable(false); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().setClosable(false); ``` **Parameters** @@ -1279,11 +1294,11 @@ Prevents the window contents from being captured by other apps. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.setContentProtected(true); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().setContentProtected(true); ``` -**Since**: 1.2.0 +**Since**: 2.0.0 **Parameters** @@ -1312,10 +1327,12 @@ hide it by yourself if you want so. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.setCursorGrab(true); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().setCursorGrab(true); ``` +**Since**: 2.0.0 + **Parameters** | Name | Type | Description | @@ -1335,10 +1352,12 @@ Modifies the cursor icon of the window. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.setCursorIcon('help'); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().setCursorIcon('help'); ``` +**Since**: 2.0.0 + **Parameters** | Name | Type | Description | @@ -1351,22 +1370,24 @@ A promise indicating the success or failure of the operation. ##### `setCursorPosition` -> **setCursorPosition**(`position`: [`PhysicalPosition`](window.md#physicalposition) \| [`LogicalPosition`](window.md#logicalposition)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> +> **setCursorPosition**(`position`: [`LogicalPosition`](window.md#logicalposition) \| [`PhysicalPosition`](window.md#physicalposition)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> Changes the position of the cursor in window coordinates. **Example** ```typescript -import { appWindow, LogicalPosition } from '@tauri-apps/api/window'; -await appWindow.setCursorPosition(new LogicalPosition(600, 300)); +import { getCurrent, LogicalPosition } from '@tauri-apps/api/window'; +await getCurrent().setCursorPosition(new LogicalPosition(600, 300)); ``` +**Since**: 2.0.0 + **Parameters** | Name | Type | Description | | :------ | :------ | :------ | -| `position` | [`PhysicalPosition`](window.md#physicalposition) \| [`LogicalPosition`](window.md#logicalposition) | The new cursor position. | +| `position` | [`LogicalPosition`](window.md#logicalposition) \| [`PhysicalPosition`](window.md#physicalposition) | The new cursor position. | **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> @@ -1387,10 +1408,12 @@ Modifies the cursor's visibility. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.setCursorVisible(false); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().setCursorVisible(false); ``` +**Since**: 2.0.0 + **Parameters** | Name | Type | Description | @@ -1410,10 +1433,12 @@ Whether the window should have borders and bars. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.setDecorations(false); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().setDecorations(false); ``` +**Since**: 2.0.0 + **Parameters** | Name | Type | Description | @@ -1424,6 +1449,22 @@ await appWindow.setDecorations(false); A promise indicating the success or failure of the operation. +##### `setEffects` + +> **setEffects**(`effects`: [`Effects`](window.md#effects)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> + +Set window effects. + +**Since**: 2.0 + +**Parameters** + +| Name | Type | +| :------ | :------ | +| `effects` | [`Effects`](window.md#effects) | + +**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> + ##### `setFocus` > **setFocus**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> @@ -1433,10 +1474,12 @@ Bring the window to front and focus. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.setFocus(); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().setFocus(); ``` +**Since**: 2.0.0 + **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> A promise indicating the success or failure of the operation. @@ -1450,10 +1493,12 @@ Sets the window fullscreen state. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.setFullscreen(true); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().setFullscreen(true); ``` +**Since**: 2.0.0 + **Parameters** | Name | Type | Description | @@ -1473,8 +1518,8 @@ Sets the window icon. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.setIcon('/tauri/awesome.png'); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().setIcon('/tauri/awesome.png'); ``` Note that you need the `icon-ico` or `icon-png` Cargo features to use this API. @@ -1484,6 +1529,8 @@ To enable it, change your Cargo.toml file: tauri = { version = "...", features = ["...", "icon-png"] } ``` +**Since**: 2.0.0 + **Parameters** | Name | Type | Description | @@ -1503,10 +1550,12 @@ Changes the cursor events behavior. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.setIgnoreCursorEvents(true); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().setIgnoreCursorEvents(true); ``` +**Since**: 2.0.0 + **Parameters** | Name | Type | Description | @@ -1519,22 +1568,24 @@ A promise indicating the success or failure of the operation. ##### `setMaxSize` -> **setMaxSize**(`size`: `undefined` \| `null` \| [`PhysicalSize`](window.md#physicalsize) \| [`LogicalSize`](window.md#logicalsize)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> +> **setMaxSize**(`size`: `undefined` \| `null` \| [`LogicalSize`](window.md#logicalsize) \| [`PhysicalSize`](window.md#physicalsize)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> Sets the window maximum inner size. If the `size` argument is undefined, the constraint is unset. **Example** ```typescript -import { appWindow, LogicalSize } from '@tauri-apps/api/window'; -await appWindow.setMaxSize(new LogicalSize(600, 500)); +import { getCurrent, LogicalSize } from '@tauri-apps/api/window'; +await getCurrent().setMaxSize(new LogicalSize(600, 500)); ``` +**Since**: 2.0.0 + **Parameters** | Name | Type | Description | | :------ | :------ | :------ | -| `size` | `undefined` \| `null` \| [`PhysicalSize`](window.md#physicalsize) \| [`LogicalSize`](window.md#logicalsize) | The logical or physical inner size, or `null` to unset the constraint. | +| `size` | `undefined` \| `null` \| [`LogicalSize`](window.md#logicalsize) \| [`PhysicalSize`](window.md#physicalsize) | The logical or physical inner size, or `null` to unset the constraint. | **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> @@ -1555,8 +1606,8 @@ If resizable is set to false, this setting is ignored. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.setMaximizable(false); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().setMaximizable(false); ``` **Parameters** @@ -1571,22 +1622,24 @@ A promise indicating the success or failure of the operation. ##### `setMinSize` -> **setMinSize**(`size`: `undefined` \| `null` \| [`PhysicalSize`](window.md#physicalsize) \| [`LogicalSize`](window.md#logicalsize)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> +> **setMinSize**(`size`: `undefined` \| `null` \| [`LogicalSize`](window.md#logicalsize) \| [`PhysicalSize`](window.md#physicalsize)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> Sets the window minimum inner size. If the `size` argument is not provided, the constraint is unset. **Example** ```typescript -import { appWindow, PhysicalSize } from '@tauri-apps/api/window'; -await appWindow.setMinSize(new PhysicalSize(600, 500)); +import { getCurrent, PhysicalSize } from '@tauri-apps/api/window'; +await getCurrent().setMinSize(new PhysicalSize(600, 500)); ``` +**Since**: 2.0.0 + **Parameters** | Name | Type | Description | | :------ | :------ | :------ | -| `size` | `undefined` \| `null` \| [`PhysicalSize`](window.md#physicalsize) \| [`LogicalSize`](window.md#logicalsize) | The logical or physical inner size, or `null` to unset the constraint. | +| `size` | `undefined` \| `null` \| [`LogicalSize`](window.md#logicalsize) \| [`PhysicalSize`](window.md#physicalsize) | The logical or physical inner size, or `null` to unset the constraint. | **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> @@ -1605,8 +1658,8 @@ Sets whether the window's native minimize button is enabled or not. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.setMinimizable(false); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().setMinimizable(false); ``` **Parameters** @@ -1621,22 +1674,24 @@ A promise indicating the success or failure of the operation. ##### `setPosition` -> **setPosition**(`position`: [`PhysicalPosition`](window.md#physicalposition) \| [`LogicalPosition`](window.md#logicalposition)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> +> **setPosition**(`position`: [`LogicalPosition`](window.md#logicalposition) \| [`PhysicalPosition`](window.md#physicalposition)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> Sets the window outer position. **Example** ```typescript -import { appWindow, LogicalPosition } from '@tauri-apps/api/window'; -await appWindow.setPosition(new LogicalPosition(600, 500)); +import { getCurrent, LogicalPosition } from '@tauri-apps/api/window'; +await getCurrent().setPosition(new LogicalPosition(600, 500)); ``` +**Since**: 2.0.0 + **Parameters** | Name | Type | Description | | :------ | :------ | :------ | -| `position` | [`PhysicalPosition`](window.md#physicalposition) \| [`LogicalPosition`](window.md#logicalposition) | The new position, in logical or physical pixels. | +| `position` | [`LogicalPosition`](window.md#logicalposition) \| [`PhysicalPosition`](window.md#physicalposition) | The new position, in logical or physical pixels. | **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> @@ -1651,10 +1706,12 @@ Updates the window resizable flag. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.setResizable(false); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().setResizable(false); ``` +**Since**: 2.0.0 + **Parameters** | Name | Type | @@ -1665,24 +1722,59 @@ await appWindow.setResizable(false); A promise indicating the success or failure of the operation. +##### `setShadow` + +> **setShadow**(`enable`: `boolean`): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> + +Whether or not the window should have shadow. + +#### Platform-specific + +- **Windows:** + - `false` has no effect on decorated window, shadows are always ON. + - `true` will make ndecorated window have a 1px white border, +and on Windows 11, it will have a rounded corners. +- **Linux:** Unsupported. + +**Example** + +```typescript +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().setShadow(false); +``` + +**Since**: 2.0.0 + +**Parameters** + +| Name | Type | +| :------ | :------ | +| `enable` | `boolean` | + +**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> + +A promise indicating the success or failure of the operation. + ##### `setSize` -> **setSize**(`size`: [`PhysicalSize`](window.md#physicalsize) \| [`LogicalSize`](window.md#logicalsize)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> +> **setSize**(`size`: [`LogicalSize`](window.md#logicalsize) \| [`PhysicalSize`](window.md#physicalsize)): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> Resizes the window with a new inner size. **Example** ```typescript -import { appWindow, LogicalSize } from '@tauri-apps/api/window'; -await appWindow.setSize(new LogicalSize(600, 500)); +import { getCurrent, LogicalSize } from '@tauri-apps/api/window'; +await getCurrent().setSize(new LogicalSize(600, 500)); ``` +**Since**: 2.0.0 + **Parameters** | Name | Type | Description | | :------ | :------ | :------ | -| `size` | [`PhysicalSize`](window.md#physicalsize) \| [`LogicalSize`](window.md#logicalsize) | The logical or physical inner size. | +| `size` | [`LogicalSize`](window.md#logicalsize) \| [`PhysicalSize`](window.md#physicalsize) | The logical or physical inner size. | **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> @@ -1701,10 +1793,12 @@ Whether the window icon should be hidden from the taskbar or not. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.setSkipTaskbar(true); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().setSkipTaskbar(true); ``` +**Since**: 2.0.0 + **Parameters** | Name | Type | Description | @@ -1724,10 +1818,12 @@ Sets the window title. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.setTitle('Tauri'); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().setTitle('Tauri'); ``` +**Since**: 2.0.0 + **Parameters** | Name | Type | Description | @@ -1747,10 +1843,12 @@ Sets the window visibility to true. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.show(); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().show(); ``` +**Since**: 2.0.0 + **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> A promise indicating the success or failure of the operation. @@ -1764,10 +1862,12 @@ Starts dragging the window. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.startDragging(); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().startDragging(); ``` +**Since**: 2.0.0 + **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> A promise indicating the success or failure of the operation. @@ -1785,10 +1885,12 @@ Gets the window's current theme. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -const theme = await appWindow.theme(); +import { getCurrent } from '@tauri-apps/api/window'; +const theme = await getCurrent().theme(); ``` +**Since**: 2.0.0 + **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`null` \| [`Theme`](window.md#theme)\> The window theme. @@ -1802,11 +1904,11 @@ Gets the window's current title. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -const title = await appWindow.title(); +import { getCurrent } from '@tauri-apps/api/window'; +const title = await getCurrent().title(); ``` -**Since**: 1.3.0 +**Since**: 2.0.0 **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`string`\> @@ -1819,10 +1921,12 @@ Toggles the window maximized state. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.toggleMaximize(); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().toggleMaximize(); ``` +**Since**: 2.0.0 + **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> A promise indicating the success or failure of the operation. @@ -1836,10 +1940,12 @@ Unmaximizes the window. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.unmaximize(); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().unmaximize(); ``` +**Since**: 2.0.0 + **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> A promise indicating the success or failure of the operation. @@ -1853,63 +1959,129 @@ Unminimizes the window. **Example** ```typescript -import { appWindow } from '@tauri-apps/api/window'; -await appWindow.unminimize(); +import { getCurrent } from '@tauri-apps/api/window'; +await getCurrent().unminimize(); ``` +**Since**: 2.0.0 + **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`void`\> A promise indicating the success or failure of the operation. +##### `getAll` + +> `Static` **getAll**(): [`Window`](window.md#window)[] + +Gets a list of instances of `Window` for all available windows. + +**Since**: 2.0.0 + +**Returns: **[`Window`](window.md#window)[] + ##### `getByLabel` -> `Static` **getByLabel**(`label`: `string`): `null` \| [`WebviewWindow`](window.md#webviewwindow) +> `Static` **getByLabel**(`label`: `string`): `null` \| [`Window`](window.md#window) -Gets the WebviewWindow for the webview associated with the given label. +Gets the Window for the webview associated with the given label. **Example** ```typescript -import { WebviewWindow } from '@tauri-apps/api/window'; -const mainWindow = WebviewWindow.getByLabel('main'); +import { Window } from '@tauri-apps/api/window'; +const mainWindow = Window.getByLabel('main'); ``` +**Since**: 2.0.0 + **Parameters** | Name | Type | Description | | :------ | :------ | :------ | | `label` | `string` | The webview window label. | -**Returns: **`null` \| [`WebviewWindow`](window.md#webviewwindow) +**Returns: **`null` \| [`Window`](window.md#window) + +The Window instance to communicate with the webview or null if the webview doesn't exist. + +##### `getCurrent` + +> `Static` **getCurrent**(): [`Window`](window.md#window) -The WebviewWindow instance to communicate with the webview or null if the webview doesn't exist. +Get an instance of `Window` for the current window. + +**Since**: 2.0.0 + +**Returns: **[`Window`](window.md#window) ##### `getFocusedWindow` -> `Static` **getFocusedWindow**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`null` \| [`WebviewWindow`](window.md#webviewwindow)\> +> `Static` **getFocusedWindow**(): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`null` \| [`Window`](window.md#window)\> Gets the focused window. **Example** ```typescript -import { WebviewWindow } from '@tauri-apps/api/window'; -const focusedWindow = WebviewWindow.getFocusedWindow(); +import { Window } from '@tauri-apps/api/window'; +const focusedWindow = Window.getFocusedWindow(); ``` **Since**: 1.4 -**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`null` \| [`WebviewWindow`](window.md#webviewwindow)\> +**Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`null` \| [`Window`](window.md#window)\> -The WebviewWindow instance to communicate with the webview or `undefined` if there is not any focused window. +The Window instance to communicate with the webview or `undefined` if there is not any focused window. ## Interfaces +### `Effects` + +The window effects configuration object + +**Since**: 2.0 + +#### Properties + +##### `color` + +> `Optional` **color**: [`Color`](window.md#color) + +Window effect color. Affects [Blur](window.md#blur) and [Acrylic](window.md#acrylic) only +on Windows 10 v1903+. Doesn't have any effect on Windows 7 or Windows 11. + +**Defined in:** [window.ts:2006](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2006) + +##### `effects` + +> **effects**: [`Effect`](window.md#effect)[] + +List of Window effects to apply to the Window. +Conflicting effects will apply the first one and ignore the rest. + +**Defined in:** [window.ts:1993](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1993) + +##### `radius` + +> `Optional` **radius**: `number` + +Window effect corner radius **macOS Only** + +**Defined in:** [window.ts:2001](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2001) + +##### `state` + +> `Optional` **state**: [`EffectState`](window.md#effectstate) + +Window effect state **macOS Only** + +**Defined in:** [window.ts:1997](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1997) + ### `Monitor` Allows you to retrieve information about a given monitor. -**Since**: 1.0.0 +**Since**: 2.0.0 #### Properties @@ -1919,7 +2091,7 @@ Allows you to retrieve information about a given monitor. Human-readable name of the monitor -**Defined in:** [window.ts:83](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L83) +**Defined in:** [window.ts:36](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L36) ##### `position` @@ -1927,7 +2099,7 @@ Human-readable name of the monitor the Top-left corner position of the monitor relative to the larger full screen area. -**Defined in:** [window.ts:87](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L87) +**Defined in:** [window.ts:40](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L40) ##### `scaleFactor` @@ -1935,7 +2107,7 @@ the Top-left corner position of the monitor relative to the larger full screen a The scale factor that can be used to map physical pixels to logical pixels. -**Defined in:** [window.ts:89](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L89) +**Defined in:** [window.ts:42](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L42) ##### `size` @@ -1943,13 +2115,13 @@ The scale factor that can be used to map physical pixels to logical pixels. The monitor's resolution. -**Defined in:** [window.ts:85](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L85) +**Defined in:** [window.ts:38](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L38) ### `ScaleFactorChanged` The payload for the `scaleChange` event. -**Since**: 1.0.2 +**Since**: 2.0.0 #### Properties @@ -1959,7 +2131,7 @@ The payload for the `scaleChange` event. The new window scale factor. -**Defined in:** [window.ts:99](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L99) +**Defined in:** [window.ts:55](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L55) ##### `size` @@ -1967,13 +2139,13 @@ The new window scale factor. The new window size -**Defined in:** [window.ts:101](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L101) +**Defined in:** [window.ts:57](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L57) ### `WindowOptions` Configuration for the window to create. -**Since**: 1.0.0 +**Since**: 2.0.0 #### Properties @@ -1983,7 +2155,7 @@ Configuration for the window to create. Whether clicking an inactive window also clicks through to the webview on macOS. -**Defined in:** [window.ts:2410](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2410) +**Defined in:** [window.ts:2104](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2104) ##### `alwaysOnTop` @@ -1991,7 +2163,7 @@ Whether clicking an inactive window also clicks through to the webview on macOS. Whether the window should always be on top of other windows or not. -**Defined in:** [window.ts:2382](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2382) +**Defined in:** [window.ts:2062](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2062) ##### `center` @@ -1999,7 +2171,7 @@ Whether the window should always be on top of other windows or not. Show window in the center of the screen.. -**Defined in:** [window.ts:2344](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2344) +**Defined in:** [window.ts:2024](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2024) ##### `closable` @@ -2007,7 +2179,7 @@ Show window in the center of the screen.. Whether the window's native close button is enabled or not. Defaults to `true`. -**Defined in:** [window.ts:2433](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2433) +**Defined in:** [window.ts:2135](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2135) ##### `contentProtected` @@ -2015,7 +2187,7 @@ Whether the window's native close button is enabled or not. Defaults to `true`. Prevents the window contents from being captured by other apps. -**Defined in:** [window.ts:2384](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2384) +**Defined in:** [window.ts:2064](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2064) ##### `decorations` @@ -2023,7 +2195,7 @@ Prevents the window contents from being captured by other apps. Whether the window should have borders and bars or not. -**Defined in:** [window.ts:2380](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2380) +**Defined in:** [window.ts:2060](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2060) ##### `fileDropEnabled` @@ -2033,7 +2205,7 @@ Whether the file drop is enabled or not on the webview. By default it is enabled Disabling it is required to use drag and drop on the frontend on Windows. -**Defined in:** [window.ts:2392](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2392) +**Defined in:** [window.ts:2086](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2086) ##### `focus` @@ -2041,7 +2213,7 @@ Disabling it is required to use drag and drop on the frontend on Windows. Whether the window will be initially focused or not. -**Defined in:** [window.ts:2368](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2368) +**Defined in:** [window.ts:2048](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2048) ##### `fullscreen` @@ -2049,7 +2221,7 @@ Whether the window will be initially focused or not. Whether the window is in fullscreen mode or not. -**Defined in:** [window.ts:2366](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2366) +**Defined in:** [window.ts:2046](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2046) ##### `height` @@ -2057,7 +2229,7 @@ Whether the window is in fullscreen mode or not. The initial height. -**Defined in:** [window.ts:2352](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2352) +**Defined in:** [window.ts:2032](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2032) ##### `hiddenTitle` @@ -2065,7 +2237,19 @@ The initial height. If `true`, sets the window title to be hidden on macOS. -**Defined in:** [window.ts:2406](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2406) +**Defined in:** [window.ts:2100](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2100) + +##### `incognito` + +> `Optional` **incognito**: `boolean` + +Whether or not the webview should be launched in incognito mode. + +#### Platform-specific + +- **Android:** Unsupported. + +**Defined in:** [window.ts:2123](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2123) ##### `maxHeight` @@ -2073,7 +2257,7 @@ If `true`, sets the window title to be hidden on macOS. The maximum height. Only applies if `maxWidth` is also set. -**Defined in:** [window.ts:2360](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2360) +**Defined in:** [window.ts:2040](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2040) ##### `maxWidth` @@ -2081,7 +2265,7 @@ The maximum height. Only applies if `maxWidth` is also set. The maximum width. Only applies if `maxHeight` is also set. -**Defined in:** [window.ts:2358](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2358) +**Defined in:** [window.ts:2038](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2038) ##### `maximizable` @@ -2089,7 +2273,7 @@ The maximum width. Only applies if `maxHeight` is also set. Whether the window's native maximize button is enabled or not. Defaults to `true`. -**Defined in:** [window.ts:2425](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2425) +**Defined in:** [window.ts:2127](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2127) ##### `maximized` @@ -2097,7 +2281,7 @@ Whether the window's native maximize button is enabled or not. Defaults to `true Whether the window should be maximized upon creation or not. -**Defined in:** [window.ts:2376](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2376) +**Defined in:** [window.ts:2056](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2056) ##### `minHeight` @@ -2105,7 +2289,7 @@ Whether the window should be maximized upon creation or not. The minimum height. Only applies if `minWidth` is also set. -**Defined in:** [window.ts:2356](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2356) +**Defined in:** [window.ts:2036](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2036) ##### `minWidth` @@ -2113,7 +2297,7 @@ The minimum height. Only applies if `minWidth` is also set. The minimum width. Only applies if `minHeight` is also set. -**Defined in:** [window.ts:2354](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2354) +**Defined in:** [window.ts:2034](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2034) ##### `minimizable` @@ -2121,7 +2305,7 @@ The minimum width. Only applies if `minHeight` is also set. Whether the window's native minimize button is enabled or not. Defaults to `true`. -**Defined in:** [window.ts:2429](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2429) +**Defined in:** [window.ts:2131](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2131) ##### `resizable` @@ -2129,7 +2313,25 @@ Whether the window's native minimize button is enabled or not. Defaults to `true Whether the window is resizable or not. -**Defined in:** [window.ts:2362](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2362) +**Defined in:** [window.ts:2042](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2042) + +##### `shadow` + +> `Optional` **shadow**: `boolean` + +Whether or not the window has shadow. + +#### Platform-specific + +- **Windows:** + - `false` has no effect on decorated window, shadows are always ON. + - `true` will make ndecorated window have a 1px white border, +and on Windows 11, it will have a rounded corners. +- **Linux:** Unsupported. + +**Since**: 2.0.0 + +**Defined in:** [window.ts:2080](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2080) ##### `skipTaskbar` @@ -2137,7 +2339,7 @@ Whether the window is resizable or not. Whether or not the window icon should be added to the taskbar. -**Defined in:** [window.ts:2386](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2386) +**Defined in:** [window.ts:2066](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2066) ##### `tabbingIdentifier` @@ -2148,7 +2350,7 @@ Defines the window [tabbing identifier](https://developer.apple.com/documentatio Windows with the same tabbing identifier will be grouped together. If the tabbing identifier is not set, automatic tabbing will be disabled. -**Defined in:** [window.ts:2417](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2417) +**Defined in:** [window.ts:2111](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2111) ##### `theme` @@ -2158,7 +2360,7 @@ The initial window theme. Defaults to the system theme. Only implemented on Windows and macOS 10.14+. -**Defined in:** [window.ts:2398](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2398) +**Defined in:** [window.ts:2092](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2092) ##### `title` @@ -2166,7 +2368,7 @@ Only implemented on Windows and macOS 10.14+. Window title. -**Defined in:** [window.ts:2364](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2364) +**Defined in:** [window.ts:2044](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2044) ##### `titleBarStyle` @@ -2174,7 +2376,7 @@ Window title. The style of the macOS title bar. -**Defined in:** [window.ts:2402](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2402) +**Defined in:** [window.ts:2096](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2096) ##### `transparent` @@ -2184,7 +2386,7 @@ Whether the window is transparent or not. Note that on `macOS` this requires the `macos-private-api` feature flag, enabled under `tauri.conf.json > tauri > macOSPrivateApi`. WARNING: Using private APIs on `macOS` prevents your application from being accepted to the `App Store`. -**Defined in:** [window.ts:2374](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2374) +**Defined in:** [window.ts:2054](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2054) ##### `url` @@ -2196,7 +2398,7 @@ Remote URL or local file path to open. - data: URL such as `data:text/html,...` is only supported with the `window-data-url` Cargo feature for the `tauri` dependency. - local file path or route such as `/path/to/page.html` or `/users` is appended to the application URL (the devServer URL on development, or `tauri://localhost/` and `https://tauri.localhost/` on production). -**Defined in:** [window.ts:2342](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2342) +**Defined in:** [window.ts:2022](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2022) ##### `userAgent` @@ -2204,7 +2406,7 @@ Remote URL or local file path to open. The user agent for the webview. -**Defined in:** [window.ts:2421](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2421) +**Defined in:** [window.ts:2115](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2115) ##### `visible` @@ -2212,7 +2414,7 @@ The user agent for the webview. Whether the window should be immediately visible upon creation or not. -**Defined in:** [window.ts:2378](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2378) +**Defined in:** [window.ts:2058](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2058) ##### `width` @@ -2220,7 +2422,7 @@ Whether the window should be immediately visible upon creation or not. The initial width. -**Defined in:** [window.ts:2350](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2350) +**Defined in:** [window.ts:2030](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2030) ##### `x` @@ -2228,7 +2430,7 @@ The initial width. The initial vertical position. Only applies if `y` is also set. -**Defined in:** [window.ts:2346](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2346) +**Defined in:** [window.ts:2026](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2026) ##### `y` @@ -2236,15 +2438,25 @@ The initial vertical position. Only applies if `y` is also set. The initial horizontal position. Only applies if `x` is also set. -**Defined in:** [window.ts:2348](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2348) +**Defined in:** [window.ts:2028](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L2028) ## Type Aliases +### `Color` + +> **Color**: [`number`, `number`, `number`, `number`] + +an array RGBA colors. Each value has minimum of 0 and maximum of 255. + +**Since**: 2.0 + +**Defined in:** [window.ts:1834](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L1834) + ### `CursorIcon` > **CursorIcon**: `"default"` \| `"crosshair"` \| `"hand"` \| `"arrow"` \| `"move"` \| `"text"` \| `"wait"` \| `"help"` \| `"progress"` \| `"notAllowed"` \| `"contextMenu"` \| `"cell"` \| `"verticalText"` \| `"alias"` \| `"copy"` \| `"noDrop"` \| `"grab"` \| `"grabbing"` \| `"allScroll"` \| `"zoomIn"` \| `"zoomOut"` \| `"eResize"` \| `"nResize"` \| `"neResize"` \| `"nwResize"` \| `"sResize"` \| `"seResize"` \| `"swResize"` \| `"wResize"` \| `"ewResize"` \| `"nsResize"` \| `"neswResize"` \| `"nwseResize"` \| `"colResize"` \| `"rowResize"` -**Defined in:** [window.ts:237](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L237) +**Defined in:** [window.ts:110](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L110) ### `FileDropEvent` @@ -2252,29 +2464,19 @@ The initial horizontal position. Only applies if `x` is also set. The file drop event types. -**Defined in:** [window.ts:105](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L105) +**Defined in:** [window.ts:61](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L61) ### `Theme` > **Theme**: `"light"` \| `"dark"` -**Defined in:** [window.ts:73](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L73) +**Defined in:** [window.ts:45](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L45) ### `TitleBarStyle` > **TitleBarStyle**: `"visible"` \| `"transparent"` \| `"overlay"` -**Defined in:** [window.ts:74](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L74) - -## Variables - -### `appWindow` - -> **appWindow**: [`WebviewWindow`](window.md#webviewwindow) - -The WebviewWindow for the current window. - -**Defined in:** [window.ts:2310](https://github.com/tauri-apps/tauri/blob/a3277a2/tooling/api/src/window.ts#L2310) +**Defined in:** [window.ts:46](https://github.com/tauri-apps/tauri/blob/ed32257/tooling/api/src/window.ts#L46) ## Functions @@ -2291,7 +2493,7 @@ import { availableMonitors } from '@tauri-apps/api/window'; const monitors = availableMonitors(); ``` -**Since**: 1.0.0 +**Since**: 2.0.0 **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Monitor`](window.md#monitor)[]\> @@ -2309,29 +2511,29 @@ import { currentMonitor } from '@tauri-apps/api/window'; const monitor = currentMonitor(); ``` -**Since**: 1.0.0 +**Since**: 2.0.0 **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Monitor`](window.md#monitor) \| `null`\> ### `getAll` -> **getAll**(): [`WebviewWindow`](window.md#webviewwindow)[] +> **getAll**(): [`Window`](window.md#window)[] -Gets a list of instances of `WebviewWindow` for all available webview windows. +Gets a list of instances of `Window` for all available windows. -**Since**: 1.0.0 +**Since**: 2.0.0 -**Returns: **[`WebviewWindow`](window.md#webviewwindow)[] +**Returns: **[`Window`](window.md#window)[] ### `getCurrent` -> **getCurrent**(): [`WebviewWindow`](window.md#webviewwindow) +> **getCurrent**(): [`Window`](window.md#window) -Get an instance of `WebviewWindow` for the current webview window. +Get an instance of `Window` for the current window. -**Since**: 1.0.0 +**Since**: 2.0.0 -**Returns: **[`WebviewWindow`](window.md#webviewwindow) +**Returns: **[`Window`](window.md#window) ### `primaryMonitor` @@ -2347,6 +2549,6 @@ import { primaryMonitor } from '@tauri-apps/api/window'; const monitor = primaryMonitor(); ``` -**Since**: 1.0.0 +**Since**: 2.0.0 **Returns: **[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<[`Monitor`](window.md#monitor) \| `null`\>