# CrabNebula Products Full Documentation > CrabNebula is built on the vision of enabling individuals, entrepreneurs and businesses to sustainably build, develop and distribute their apps to the universe. # Cloud # CrabNebula Cloud **CrabNebula Cloud is a way to distribute apps across multiple platforms and architectures all from one unified platform.** Using the power of our Rust-powered CLI, you can automate uploading and releasing your app from your CI pipeline of choice or directly from your computer. ## Getting Started CrabNebula Cloud is comprised up of two components: - **[Cloud Platform](https://crabnebula.cloud/)**: Manage all of your organizations, apps, and releases from a centralized web app. - **[Command Line Interface (CLI)](/cloud/cli/install)**: A tool to automate uploading and releasing your app binary. [**Download it from our CDN**](https://crabnebula.cloud/crabnebula/cn-cli/releases). :::tip The CLI offers a quick way to create your first organization and set up your Tauri application with support to auto-updates via CrabNebula Cloud.
See the [bootstrap](/cloud/cli/bootstrap) documentation for more information. ::: To begin using CrabNebula Cloud go to http://crabnebula.cloud/. There you can use your GitHub or GitLab account to sign up for the platform. The next step will be to create an organization. ## Set up an Organization Application, billing, members, and organization-specific settings are managed at the organization level. Organizations allow a user to collaborate in multiple organizations and for apps to be shared with multiple users. When you first create an account you will be asked to create a new organization with the following information: - **Organization's name**: The public name of the organization apps belong to - **Organization's slug**: A unique identifier for the organization :::note At this time you cannot delete or modify an organization's name. ::: Once you have created the organization, you can start using CrabNebula Cloud right away. The platform is free for everyone — there is no trial period, no subscription, and no payment details required. See the [Billing & Usage](/cloud/org-management/billing) page for usage guidelines. Afterwards you will be able invite other users to join the organization. For more information on how to do this, see [Invite a Member](/cloud/org-management/invite-member). ## Create an Application An application represents a single app distributed to users. A single application can support multiple platforms and architectures. - **Name**: A human-readable name for the application. This is shown on the application's market page. - **Slug**: An identifier for your application. - **Visibility**: If an application is "Public" then a market page is created where end users are able to download the application. - **Description** (optional): A description that is shown on the application's market page. - **Application Type**: Allows you to specify the type of application you are creating. - **Tauri (v1)**: A [first generation Tauri](https://v1.tauri.app/) app. - **Tauri (v2)**: A [second generation Tauri](https://tauri.app/) app. - **Packager**: An app that is packaged with [cargo-packager](/packager). - **Other**: Any generic app/asset. :::tip[Looking for Multiple Environments?] If you would like different environments or distribution channels for your application (such as separate beta and release channels), you can use the `--channel` argument when [drafting a release](/cloud/cli/create-draft) or a separate application to represent each of those environments. ::: After creating an application, you will be able to manage the application from the dedicated [Application Overview page](/cloud/org-management/application-pages#application-overview-page). ## Create a Release Creating a release is done with the [CrabNebula Cloud CLI](/cloud/cli/install). After building an app locally or in a CI environment, follow these steps to create, upload, publish and finally fetch said release of the app: :::warn[API Key Required] You will need to [create an API key](/cloud/org-management/create-api-key) before moving to the release management process. ::: 1. [Create a Release Draft](/cloud/cli/create-draft) 2. [Upload Assets](/cloud/cli/upload-assets) 3. [Publish a Release](/cloud/cli/publish-release) 4. [Fetch Latest Release](/cloud/cli/fetch-latest-release) The whole release process can be automated in your CI pipeline. For more information on how to do this, have a look at the [Continuous Integration](/cloud/ci/overview) page which features sample GitHub Action workflows. # Packager On this page you will find an overview of how to configure [**Packager**](/packager) auto-updater with **CrabNebula Cloud**. This will allow you to automatically update your application as soon as you publish a new release on Cloud without having to manually handle the update process. :::tip A more in depth explanation for Packager can be found in this [guide](/cloud/guides/packager-auto-updater/). Detailed documentation for the updater can be found in the [docs](/packager/updater/) and the [GitHub repository](https://github.com/crabnebula-dev/cargo-packager/tree/main/crates/updater). ::: Packager includes a built-in updater which can be configured to automatically update your application as soon as you publish a new release on Cloud. Start off by adding the `cargo-packager-updater` dependency to your project: ```bash cargo add cargo-packager-updater ``` Afterwards you need to generate a cryptographic key pair which will be used to verify the integrity of the update. New updates will be signed with the private key and the public key will be used to confirm the integrity of the update. ```bash cargo packager signer generate ``` Save the private key in a secure location as it will be used to sign the new release when you publish it. For the configuration of the updater code you will only need the public key. In your Rust project navigate to the specific file where you want to add the updater code and add the following imports: ```rust use cargo_packager_updater::{semver::Version, url::Url}; ``` Now add the following code: ```rust let config = cargo_packager_updater::Config { endpoints: vec![Url::parse("https://cdn.crabnebula.app/update/YOUR_ORG_SLUG/YOUR_APP_SLUG/{{target}}-{{arch}}/{{current_version}}").expect("Failed to parse URL")], // REPLACE: YOUR_ORG_SLUG and YOUR_APP_SLUG of the app in CN Cloud pubkey: String::from("YOUR_PUBLIC_KEY"), // REPLACE: YOUR_PUBLIC_KEY generated by the signer ..Default::default() }; let current_version = Version::parse(env!("CARGO_PKG_VERSION")).expect("Failed to parse version"); println!("Current version: {}", current_version); if let Some(update) = cargo_packager_updater::check_update(current_version.clone(), config) .expect("Failed to check for update") { update .download_and_install() .expect("Failed to download and install update"); println!("Update installed") } else { println!("No update available") } ``` Make sure to replace `YOUR_ORG_SLUG` and `YOUR_APP_SLUG` with the slug of your organization and app on Cloud. Also replace `YOUR_PUBLIC_KEY` with the public key generated by the signer. Now as soon as that code is run, the updater will check for updates and if a new update is available, it will be downloaded and installed automatically. # Tauri import { Tabs, TabItem } from "@astrojs/starlight/components"; On this page you will find an overview of how to configure Tauri (v1 and v2) auto-updater with **CrabNebula Cloud**. This will allow you to automatically update your application as soon as you publish a new release on Cloud without having to manually handle the update process. :::tip A more in depth explanation for Tauri v2 can be found in this [guide](/cloud/guides/auto-updates-tauri/). For more details on how to configure Tauri updater, please refer to the Tauri documentation for [Tauri v1](https://v1.tauri.app/v1/guides/distribution/updater/) and [Tauri v2](https://tauri.app/plugin/updater/) respectively. ::: Before you can adjust your `tauri.conf.json` file to configure the update endpoint, you need to generate a cryptographic key pair for your application which will be used to check if the update is valid or might have been tampered with. The public key will be used to verify the update (needs to be put in the `tauri.conf.json` file) and the private key (has to be kept secret!) will be used to sign the new release when you publish it. Run the following command to generate a key pair for your application: ```bash cargo tauri signer generate -w ~/.tauri/myapp.key ``` ```bash cargo tauri signer generate -w $HOME/.tauri/myapp.key ``` You should now see the two keyfiles `~/.tauri/myapp.key` and `~/.tauri/myapp.key.pub`. Now you need to add the following configuration to your `tauri.conf.json` file: ```json "tauri": { "updater": { "active": true, "endpoints": [ "https://cdn.crabnebula.app/update/ORG_NAME/APP_NAME/{{target}}-{{arch}}/{{current_version}}" ], "dialog": true, "pubkey": "PUBKEY" }, }, ``` Before you can configure the update endpoint, you need to install the `updater` plugin: ```bash cargo tauri add updater ``` Now you need to add the following configuration to your `tauri.conf.json` file: ```json "bundle": { "createUpdaterArtifacts": true }, "plugins": { "updater": { "endpoints": [ "https://cdn.crabnebula.app/update/ORG_NAME/APP_NAME/{{target}}-{{arch}}/{{current_version}}" ], "pubkey": "PUBKEY" } } ``` :::caution Note that the `createUpdaterArtifacts` value must be set to `true` for new applications, but set to `"v1Compatible"` when updating from a Tauri v1 application. ::: Make sure to replace `ORG_NAME` with your organizations name on Cloud, `APP_NAME` with the apps name on Cloud and `PUBKEY` with the public key from `~/.tauri/myapp.key.pub`. :::caution It is important to sign the app with the private key from `~/.tauri/myapp.key` before you publish a new release as otherwise the update will not be valid. ::: # Changelogs for Cloud import logs from '@components/Changelog.astro'; export const components = {blockquote: logs} > # Generic Assets import { Tabs, TabItem } from "@astrojs/starlight/components"; This workflow is not tailored to any specific framework or bundler. It's a generic workflow that can be used to release any type of asset, such as executables, installers, or app bundles. If your app is written with [Tauri v2](/cloud/ci/tauri-v2-workflow), [v1](/cloud/ci/tauri-v1-workflow), or [Packager](/cloud/ci/packager-workflow). ## Versioning Make sure to adjust the version number before reaching this workflow during your CI process. This step can read a `config.json` file and extract the version number from it. ```yaml - name: Get version from config.json id: get_version run: | VERSION=$(jq -r '.version' config.json) NOTES=$(jq -r '.notes' config.json) echo "NOTES=$NOTES" >> $GITHUB_ENV echo "VERSION=$VERSION" >> $GITHUB_ENV ``` ```json { "notes": "release notes", "version": "0.0.0" } ``` ## Workflow Triggers For testing and developing purposes it may be useful to set a `workflow_dispatch` trigger, so the workflow can be initiated from the GitHub UI. ```yaml run-name: triggered by ${{ github.actor }}. on: workflow_dispatch ``` Once testing is done, it's recommended to use Continuous Deployment. ```yaml on: push: branches: - main ``` ## Draft Release The release draft command will create a new entry in your CrabNebula project, but it won't upload any assets just yet. It uses the **crabnebula-dev/cloud-release** action, which requires [`CN_API_KEY`](/cloud/org-management/create-api-key) to be defined within your GitHub Action scope. ```yaml - name: draft release uses: crabnebula-dev/cloud-release@v0 id: draft with: command: release draft ${{ env.CN_APPLICATION }} ${{ env.VERSION }} --notes ${{ env.NOTES }} api-key: ${{ secrets.CN_API_KEY }} ``` ### Upload Assets to Cloud Once your app is built (you must write this step according yo your own framework and targets), we push all assets to the **Cloud** project. At this point, you will be able to see the binaries showing up in your dashboard. But the release is not published yet! ```yaml - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload --file ${{ env.CN_ASSET_PATH }} ${{ env.CN_APPLICATION }} ${{ env.VERSION }} api-key: ${{ secrets.CN_API_KEY }} ``` ## Publishing At this point, the heavy lifting has been done and it's time ot publish the release. If you don't want to autopublish, you can do it manually from the **Cloud** dashboard. ```yaml - name: publish release uses: crabnebula-dev/cloud-release@v0 with: command: release publish ${{ env.CN_APPLICATION }} ${{ env.VERSION }} api-key: ${{ secrets.CN_API_KEY }} ``` ## Full Workflow ```yaml name: Generic Workflow Release Process on: push: branches: - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: CN_APPLICATION: YOUR_ORG_NAME/YOUR_APP_NAME CN_ASSET_PATH: YOUR-ASSET-PATH jobs: release: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: draft release uses: crabnebula-dev/cloud-release@v0 id: draft with: command: release draft ${{ env.CN_APPLICATION }} ${{ env.VERSION }} --notes ${{ env.NOTES }} api-key: ${{ secrets.CN_API_KEY }} - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload --file ${{ env.CN_ASSET_PATH }} ${{ env.CN_APPLICATION }} ${{ env.VERSION }} api-key: ${{ secrets.CN_API_KEY }} - name: publish release uses: crabnebula-dev/cloud-release@v0 with: command: release publish ${{ env.CN_APPLICATION }} ${{ env.VERSION }} api-key: ${{ secrets.CN_API_KEY }} ``` # Overview Creating a draft, uploading assets, and publishing a release can all also be automated via [GitHub Actions](https://docs.github.com/en/actions). In order to improve developer experience we have a [cloud-release](https://github.com/crabnebula-dev/cloud-release) action which forms a wrapper around the [CrabNebula CLI](/cloud/cli/install). With its two required arguments, **cloud-release** will create a [draft release](/cloud/cli/create-draft) in your organization account, [upload all assets](/cloud/cli/upload-assets), and [publish](/cloud/cli/publish-release) when everything is done. Two optional arguments are also available. | key | description | required | | ------------------- | -------------------------------------------------------------------------------------------- | ------------------ | | `api-key` | The [CrabNebula Cloud API key](/cloud/org-management/create-api-key) to use. | Yes | | `command` | The [CrabNebula Cloud CLI](/cloud/cli/install) command to run. (without the `cn` namespace). | Yes | | `path` | Directory the CLI is downloaded into; must be a valid path (Unix syntax). | No (default: `.`) | | `working-directory` | Working directory to use when running the CLI. | No (default: `.`) | ## Workflows **CrabNebula Cloud** supports every existing framework through its 5 workflow types. Check the table below to find which one is best suited for your project. | Workflow Type | Description | | --------------------------------------------------- | ---------------------------------------------------------------------- | | [Tauri v1](/cloud/ci/tauri-v1-workflow) | [Tauri v1](https://tauri.app) applications. | | [Tauri v2](/cloud/ci/tauri-v2-workflow) | [Tauri v2](https://v2.tauri.app) applications. | | [Packager](/cloud/ci/packager-workflow) | Apps using [packager](/packager) to create their binaries. | | [Taurify](/cloud/ci/taurify-workflow) | [Taurify](/taurify) applications. | | [Generic Assets](/cloud/ci/generic-assets-workflow) | Build agnostic workflow that will handle release and upload of assets. | # Packager The following workflow is specifically tailored to [Packager](/packager) applications. ## Versionining The release version number can be defined in 3 different file names, the order of priority within which **Packager** checks them is as follows: 1. `Packager.toml`. 2. `packager.json`. 3. `Cargo.toml`. In order for any of these files to work, they must be at the root of your project. ## Workflow Triggers For testing and developing purposes it may be useful to set a `workflow_dispatch` trigger, so the workflow can be initiated from the GitHub UI. ```yaml run-name: triggered by ${{ github.actor }}. on: workflow_dispatch ``` Once testing is done, it's recommended to use Continuous Deployment. ```yaml on: push: branches: - main ``` ## Action Environment The runtime where **Packager** will run depends on the app or framework you want to target and the platform you want to build for. We recommend using `ubuntu-latest` whenever possible, but check the table below for specific use-cases: | Framework | Image | | --------- | -------------- | | Tauri v1 | 'ubuntu-20.04' | | Tauri v2 | 'ubuntu-22.04' | :::note[Windows and macOS] For Windows and macOS, you can always opt for "latest". ::: Once defined, we establish variables so the images can be used consistently across the entire workflow. Additionally we store our CrabNebula Cloud application name to be used in the CLI commands. ```yaml env: CN_APPLICATION: YOUR_ORG_NAME/YOUR_APP_NAME ``` :::tip[Your App Name] Remember to replace `YOUR_ORG_NAME/YOUR_APP_NAME` for your org and app's slugs. For example `crabnebula/devtools-desktop`. ::: Finally, when deploying to multiple platforms, it's useful to make builds concurrent. Also, cancelling ongoing processes when a new workflow starts. ```yaml concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true ``` ## Jobs The following section snippets must be added in the `jobs` map. ```yaml jobs: : ``` Note that the indentation is important. ### Draft Release The release draft command will create a new entry in your CrabNebula project, but it won't upload any assets just yet. It uses the **crabnebula-dev/cloud-release** action, which requires [`CN_API_KEY`](/cloud/org-management/create-api-key) to be defined within your GitHub Action scope. ```yaml draft: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: create draft release uses: crabnebula-dev/cloud-release@v0 with: command: release draft ${{ env.CN_APPLICATION }} --framework packager api-key: ${{ secrets.CN_API_KEY }} ``` ### Build Your App The build step is for setting up the container image in which our task will run for each platform, and finally run **Packager** to create your binaries. Establish the dependencies and the matrix of platforms we want to run concurrently. Add Rust toolchain and create a cache for it. ```yaml build: needs: draft strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true - name: install cargo packager run: | cargo install cargo-packager --locked - name: build packager app run: | cargo packager --release - name: Move assets to workdir run: | mv target/release/* . ``` #### Upload Assets to Cloud At the last step of our **build**, we push all assets to the **Cloud** project. At this point, you will be able to see the binaries showing up in your dashboard. But the release is not published yet! ```yaml - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework packager api-key: ${{ secrets.CN_API_KEY }} ``` ### Publishing At this point, the heavy lifting has been done and it's time ot publish the release. If you don't want to autopublish, you can do it manually from the **Cloud** dashboard. ```yaml publish: needs: build runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: publish release uses: crabnebula-dev/cloud-release@v0 with: command: release publish ${{ env.CN_APPLICATION }} --framework packager api-key: ${{ secrets.CN_API_KEY }} ``` ## Full Workflow ```yaml name: Packager Release Process on: push: branches: - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: CN_APPLICATION: YOUR_ORG_NAME/YOUR_APP_NAME jobs: draft: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: create draft release uses: crabnebula-dev/cloud-release@v0 with: command: release draft ${{ env.CN_APPLICATION }} --framework packager api-key: ${{ secrets.CN_API_KEY }} build: needs: draft strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true - name: install cargo packager run: | cargo install cargo-packager --locked - name: build packager app run: | cargo packager --release - name: Move assets to workdir run: | mv target/release/* . - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework packager api-key: ${{ secrets.CN_API_KEY }} publish: needs: build runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: publish release uses: crabnebula-dev/cloud-release@v0 with: command: release publish ${{ env.CN_APPLICATION }} --framework packager api-key: ${{ secrets.CN_API_KEY }} ``` # Tauri v1 import { Tabs, TabItem } from "@astrojs/starlight/components"; This workflow is specifically tailored to [Tauri v1](https://tauri.app) applications. It can be easily adapted to work with any Tauri app and only requires the your project's slug within your CrabNebula organization as an input. Instead of just uploading assets (like in the previous workflow), the `build` job builds the Tauri app automatically for Linux, MacOS, and Windows. and uploads the assets directly afterwards. :::tip[Tauri v2] If working in a greenfield project, we strongly recommend that you give [Tauri v2](https://tauri.app) priority. It has been released and comes with a lot of new awesome features. See [Tauri 2.0 Stable Release blog](https://tauri.app/blog/tauri-20/) ::: ## Versionining The release version number is automatically extracted from [Tauri configuration files (`tauri.conf.json`)](https://tauri.app/v1/references/configuration-files/). The version entries in `Cargo.toml` and `package.json` will be ignored for your project release in CrabNebula and thus can be removed/ommitted. ## Code Signing For security reasons, it's recommended to sign your code by generating a **private key** and a **private key password** for your app. Passing those keys via the environment variables (`TAURI_PRIVATE_KEY` and `TAURI_KEY_PASSWORD`) to your `tauri build` command will be enough. See the [Tauri Docs](https://v1.tauri.app/v1/guides/distribution/sign-linux/) for more details. ## Workflow Triggers For testing and developing purposes it may be useful to set a `workflow_dispatch` trigger, so the workflow can be initiated from the GitHub UI. ```yaml run-name: triggered by ${{ github.actor }}. on: workflow_dispatch ``` Once testing is done, it's recommended to use Continuous Deployment. ```yaml on: push: branches: - main ``` ## Deploy Platforms When deploying to multiple platforms, it's useful to make builds concurrent. Also, cancelling ongoing processes when a new workflow starts. ```yaml concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true ``` ## Jobs The following section snippets must be added in the `jobs` map. ```yaml jobs: : ``` Note that the indentation is important. ### Draft Release The release draft command will create a new entry in your CrabNebula project, but it won't upload any assets just yet. It uses the **crabnebula-dev/cloud-release** action, which requires [`CN_API_KEY`](/cloud/org-management/create-api-key) to be defined within your GitHub Action scope. Because we'll refer to this later on as well, we'll store our application name in `env` first. ```yaml env: # ... CN_APPLICATION: "YOUR_ORG_NAME/YOUR_APP_NAME" ``` :::tip[Your App Name] Remember to replace `YOUR_ORG_NAME/YOUR_APP_NAME` for your org and app's slugs. For example `crabnebula/devtools-desktop`. ::: And then call the release draft command. ```yaml draft: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: create draft release uses: crabnebula-dev/cloud-release@v0 with: command: release draft ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} ``` ### Build Your App The build step is for setting up the container image in which our task will run for each platform, and finally run your app's build to create the Tauri binaries. Establish the dependencies and the matrix of platforms we want to run concurrently. Add the common dependencies (Rust, and Node.js), create a cache for Rust. ```yaml build: needs: draft strategy: fail-fast: false matrix: os: - ubuntu-22.04 - macos-latest - windows-latest runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true ``` ```yaml build: needs: draft strategy: fail-fast: false matrix: os: - ubuntu-22.04 - macos-latest - windows-latest runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Install pnpm uses: pnpm/action-setup@v3 with: version: 9 - uses: actions/setup-node@v4 with: node-version: "20" - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true ``` ```yaml build_desktop: needs: draft strategy: fail-fast: false matrix: os: - ubuntu-22.04 - macos-latest - windows-latest runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Install bun uses: oven-sh/setup-bun@v2 - uses: actions/setup-node@v4 with: node-version: "20" - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true ``` #### Linux and Windows Linux distros require additional system dependencies. For Tauri v1 we need `webkit2gtk-4.0`, that's the WebView our frontend will be running in. ```yaml - name: install Linux dependencies if: matrix.os == 'ubuntu-22.04' run: | sudo apt-get update sudo apt-get install -y libwebkit2gtk-4.0-dev ``` With dependencies setup for Linux, it's time to build the Tauri app for Windows and Linux. ```yaml - name: build Tauri app for Windows, Linux if: matrix.os != 'macos-latest' run: | npm ci npm exec tauri build env: TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} ``` ```yaml - name: build Tauri app for Windows, Linux if: matrix.os != 'macos-latest' run: | pnpm install pnpm tauri build env: TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} ``` ```yaml - name: build Tauri app for Windows, Linux if: matrix.os != 'macos-latest' run: | yarn install --frozen-lockfile yarn tauri build env: TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} ``` ```yaml - name: build Tauri app for Windows, Linux if: matrix.os != 'macos-latest' run: | bun install bun run tauri build env: TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} ``` #### MacOS GitHub Actions run on Apple Silicon by default, so we must add Mac Intel support to our platform and establish the appropriate target to our Tauri CLI. ```yaml - name: Install x86_64-apple-darwin for mac and build Tauri binaries if: matrix.os == 'macos-latest' run: | rustup target add x86_64-apple-darwin npm ci npm exec tauri build -- --target x86_64-apple-darwin npm exec tauri build -- --target aarch64-apple-darwin env: TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} ``` ```yaml - name: Install x86_64-apple-darwin for mac and build Tauri binaries if: matrix.os == 'macos-latest' run: | rustup target add x86_64-apple-darwin pnpm install pnpm tauri build --target x86_64-apple-darwin pnpm tauri build --target aarch64-apple-darwin env: TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} ``` ```yaml - name: Install x86_64-apple-darwin for mac and build Tauri binaries if: matrix.os == 'macos-latest' run: | rustup target add x86_64-apple-darwin yarn install --frozen-lockfile yarn tauri build --target x86_64-apple-darwin yarn tauri build --target aarch64-apple-darwin env: TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} ``` ```yaml - name: Install x86_64-apple-darwin for mac and build Tauri binaries if: matrix.os == 'macos-latest' run: | rustup target add x86_64-apple-darwin bun install bun run tauri build --target x86_64-apple-darwin bun run tauri build --target aarch64-apple-darwin env: TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} ``` #### Upload Assets to Cloud At the last step of our **build**, we push all assets to the **Cloud** project. At this point, you will be able to see the binaries showing up in your dashboard. But the release is not published yet! ```yaml - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} path: ./src-tauri ``` ### Publishing At this point, the heavy lifting has been done and it's time ot publish the release. If you don't want to autopublish, you can do it manually from the **Cloud** dashboard. ```yaml publish: needs: build runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: publish release uses: crabnebula-dev/cloud-release@v0 with: command: release publish ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} ``` ## Full Workflow ```yaml name: Tauri v1 Release Process on: push: branches: - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: CN_APPLICATION: "YOUR_ORG_NAME/YOUR_APP_NAME" jobs: draft: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: create draft release uses: crabnebula-dev/cloud-release@v0 with: command: release draft ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} build: needs: draft strategy: fail-fast: false matrix: os: - ubuntu-22.04 - macos-latest - windows-latest runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: "20" - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true - name: install Linux dependencies if: matrix.os == 'ubuntu-22.04' run: | sudo apt-get update sudo apt-get install -y libwebkit2gtk-4.0-dev - name: build Tauri app for Windows, Linux if: matrix.os != 'macos-latest' run: | npm ci npm exec tauri build env: TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} - name: Install x86_64-apple-darwin for mac and build Tauri binaries if: matrix.os == 'macos-latest' run: | rustup target add x86_64-apple-darwin npm ci npm exec tauri build -- --target x86_64-apple-darwin npm exec tauri build -- --target aarch64-apple-darwin env: TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} path: ./src-tauri publish: needs: build runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: publish release uses: crabnebula-dev/cloud-release@v0 with: command: release publish ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} ``` ```yaml name: Tauri v1 Release Process on: push: branches: - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: CN_APPLICATION: "YOUR_ORG_NAME/YOUR_APP_NAME" jobs: draft: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: create draft release uses: crabnebula-dev/cloud-release@v0 with: command: release draft ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} build: needs: draft strategy: fail-fast: false matrix: os: - ubuntu-22.04 - macos-latest - windows-latest runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Install pnpm uses: pnpm/action-setup@v3 with: version: 9 - uses: actions/setup-node@v4 with: node-version: "20" - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true - name: install Linux dependencies if: matrix.os == 'ubuntu-22.04' run: | sudo apt-get update sudo apt-get install -y libwebkit2gtk-4.0-dev - name: build Tauri app for Windows, Linux if: matrix.os != 'macos-latest' run: | pnpm install pnpm tauri build env: TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} - name: Install x86_64-apple-darwin for mac and build Tauri binaries if: matrix.os == 'macos-latest' run: | rustup target add x86_64-apple-darwin pnpm install pnpm tauri build --target x86_64-apple-darwin pnpm tauri build --target aarch64-apple-darwin env: TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} path: ./src-tauri publish: needs: build runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: publish release uses: crabnebula-dev/cloud-release@v0 with: command: release publish ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} ``` ```yaml name: Tauri v1 Release Process on: push: branches: - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: CN_APPLICATION: "YOUR_ORG_NAME/YOUR_APP_NAME" jobs: draft: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: create draft release uses: crabnebula-dev/cloud-release@v0 with: command: release draft ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} build: needs: draft strategy: fail-fast: false matrix: os: - ubuntu-22.04 - macos-latest - windows-latest runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: "20" - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true - name: install Linux dependencies if: matrix.os == 'ubuntu-22.04' run: | sudo apt-get update sudo apt-get install -y libwebkit2gtk-4.0-dev - name: build Tauri app for Windows, Linux if: matrix.os != 'macos-latest' run: | yarn install --frozen-lockfile yarn tauri build env: TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} - name: Install x86_64-apple-darwin for mac and build Tauri binaries if: matrix.os == 'macos-latest' run: | rustup target add x86_64-apple-darwin yarn install --frozen-lockfile yarn tauri build --target x86_64-apple-darwin yarn tauri build --target aarch64-apple-darwin env: TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} path: ./src-tauri publish: needs: build runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: publish release uses: crabnebula-dev/cloud-release@v0 with: command: release publish ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} ``` ```yaml name: Tauri v1 Release Process on: push: branches: - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: CN_APPLICATION: "YOUR_ORG_NAME/YOUR_APP_NAME" jobs: draft: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: create draft release uses: crabnebula-dev/cloud-release@v0 with: command: release draft ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} build: needs: draft strategy: fail-fast: false matrix: os: - ubuntu-22.04 - macos-latest - windows-latest runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Install bun uses: oven-sh/setup-bun@v2 - uses: actions/setup-node@v4 with: node-version: "20" - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true - name: install Linux dependencies if: matrix.os == 'ubuntu-22.04' run: | sudo apt-get update sudo apt-get install -y libwebkit2gtk-4.0-dev - name: build Tauri app for Windows, Linux if: matrix.os != 'macos-latest' run: | bun install bun run tauri build env: TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} - name: Install x86_64-apple-darwin for mac and build Tauri binaries if: matrix.os == 'macos-latest' run: | rustup target add x86_64-apple-darwin bun install bun run tauri build --target x86_64-apple-darwin bun run tauri build --target aarch64-apple-darwin env: TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} path: ./src-tauri publish: needs: build runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: publish release uses: crabnebula-dev/cloud-release@v0 with: command: release publish ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} ``` # Tauri v2 import { Steps, Tabs, TabItem } from "@astrojs/starlight/components"; This workflow is specifically tailored to [Tauri v2](https://tauri.app) applications. It can be easily adapted to work with any Tauri app and only requires the your project's slug within your CrabNebula organization as an input. Instead of just uploading assets (like in the previous workflow), the `build` job builds the Tauri app automatically for Linux, MacOS, and Windows. and uploads the assets directly afterwards. :::caution[Coming from v1] If you are in the process of migrating a Tauri v1 project, make sure to run [`tauri migrate`](https://tauri.app/start/migrate/) in your codebase before proceeding with this workflow. ::: ## Versionining The release version number is automatically extracted from [Tauri configuration files (`tauri.conf.json`)](https://tauri.app/develop/configuration-files/). The version entries in `Cargo.toml` and `package.json` will be ignored for your project release in CrabNebula and thus can be removed/ommitted. ## Code Signing For security reasons, it's recommended to sign your code by generating a **private key** and a **private key password** for your app. Passing those keys via the environment variables (`TAURI_SIGNING_PRIVATE_KEY` and `TAURI_SIGNING_PRIVATE_KEY_PASSWORD`) to your `tauri build` command will be enough. See the [Tauri Docs](https://tauri.app/distribute/sign/linux/) for more details. ## Workflow Triggers For testing and developing purposes it may be useful to set a `workflow_dispatch` trigger, so the workflow can be initiated from the GitHub UI. ```yaml run-name: triggered by ${{ github.actor }}. on: workflow_dispatch ``` Once testing is done, it's recommended to use Continuous Deployment. ```yaml on: push: branches: - main ``` ## Deploy Platforms When deploying to multiple platforms, it's useful to make builds concurrent. Also, cancelling ongoing processes when a new workflow starts. ```yaml concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true ``` ## Jobs The following section snippets must be added in the `jobs` map. ```yaml jobs: : ``` Note that the indentation is important. ### Draft Release The release draft command will create a new entry in your CrabNebula project, but it won't upload any assets just yet. It uses the **crabnebula-dev/cloud-release** action, which requires [`CN_API_KEY`](/cloud/org-management/create-api-key) to be defined within your GitHub Action scope. Because we'll refer to this later on as well, we'll store our application name in `env` first. ```yaml env: # ... CN_APPLICATION: "YOUR_ORG_NAME/YOUR_APP_NAME" ``` :::tip[Your App Name] Remember to replace `YOUR_ORG_NAME/YOUR_APP_NAME` for your org and app's slugs. For example `crabnebula/devtools-desktop`. ::: And then call the release draft command. ```yaml draft: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: create draft release uses: crabnebula-dev/cloud-release@v0 with: command: release draft ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} ``` ### Build Your App The build step is for setting up the GitHub Action runner in which our task will run for each platform, and finally run your app's build to create the Tauri binaries. Establish the dependencies and the matrix of platforms we want to run concurrently. Add the common dependencies (Rust, and Node.js), create a cache for Rust, build the binaries and upload the artifacts. ```yaml build_desktop: needs: draft strategy: fail-fast: false matrix: os: - ubuntu-22.04 - macos-latest - windows-latest runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true ``` ```yaml build_desktop: needs: draft strategy: fail-fast: false matrix: os: - ubuntu-22.04 - macos-latest - windows-latest runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Install pnpm uses: pnpm/action-setup@v3 with: version: 9 - uses: actions/setup-node@v4 with: node-version: "lts/*" - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true ``` ```yaml build_desktop: needs: draft strategy: fail-fast: false matrix: os: - ubuntu-22.04 - macos-latest - windows-latest runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Install bun uses: oven-sh/setup-bun@v2 - uses: actions/setup-node@v4 with: node-version: "lts/*" - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true ``` #### Linux and Windows Linux distros require additional system dependencies. For Tauri v2 we need `webkit2gtk-4.1`, that's the WebView our frontend will be running in. ```yaml - name: install Linux dependencies if: matrix.os == 'ubuntu-22.04' run: | sudo apt-get update sudo apt-get install -y libwebkit2gtk-4.1-dev ``` With dependencies setup for Linux, it's time to build the Tauri app for Windows and Linux. ```yaml - name: build Tauri app for Windows, Linux if: matrix.os != 'macos-latest' run: | npm ci npm exec tauri build env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} ``` ```yaml - name: build Tauri app for Windows, Linux if: matrix.os != 'macos-latest' run: | pnpm install pnpm tauri build env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} ``` ```yaml - name: build Tauri app for Windows, Linux if: matrix.os != 'macos-latest' run: | yarn install --frozen-lockfile yarn tauri build env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} ``` ```yaml - name: build Tauri app for Windows, Linux if: matrix.os != 'macos-latest' run: | bun install bun run tauri build env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} ``` #### MacOS GitHub Actions run on Apple Silicon by default, so we must add Mac Intel support to our platform and establish the appropriate target to our Tauri CLI. ```yaml - name: Install x86_64-apple-darwin for mac and build Tauri binaries if: matrix.os == 'macos-latest' run: | rustup target add x86_64-apple-darwin npm ci npm exec tauri build -- --target x86_64-apple-darwin npm exec tauri build -- --target aarch64-apple-darwin env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} ``` ```yaml - name: Install x86_64-apple-darwin for mac and build Tauri binaries if: matrix.os == 'macos-latest' run: | rustup target add x86_64-apple-darwin pnpm install --frozen-lockfile pnpm tauri build --target x86_64-apple-darwin pnpm tauri build --target aarch64-apple-darwin env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} ``` ```yaml - name: Install x86_64-apple-darwin for mac and build Tauri binaries if: matrix.os == 'macos-latest' run: | rustup target add x86_64-apple-darwin yarn install --frozen-lockfile yarn tauri build --target x86_64-apple-darwin yarn tauri build --target aarch64-apple-darwin env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} ``` ```yaml - name: Install x86_64-apple-darwin for mac and build Tauri binaries if: matrix.os == 'macos-latest' run: | rustup target add x86_64-apple-darwin bun install bun run tauri build --target x86_64-apple-darwin bun run tauri build --target aarch64-apple-darwin env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} ``` #### Upload Assets to Cloud At the last step of our **build**, we push all assets to the **Cloud** project. At this point, you will be able to see the binaries showing up in your dashboard. But the release is not published yet! ```yaml - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} ``` #### Mobile If your application targets Android and iOS, we recommend defining separate jobs per platform so your workflow is easier to read. ##### Android 1. Create the job and install Rust and Node.js ```yml build_android: needs: draft runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: "lts/*" - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true ``` 2. Install Android dependencies ```yml - name: setup JDK 17 uses: actions/setup-java@v4 with: java-version: "17" distribution: "temurin" - name: setup Android SDK uses: android-actions/setup-android@v3 - name: setup Android NDK uses: nttld/setup-ndk@v1 id: setup-ndk with: ndk-version: r26d link-to-sdk: true - name: install Android targets run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android ``` 3. Setup Android signing See the [official documentation](https://v2.tauri.app/distribute/sign/android) for more information. ```yml - name: setup Android signing working-directory: src-tauri/gen/android run: | echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" > keystore.properties echo "password=${{ secrets.ANDROID_KEY_PASSWORD }}" >> keystore.properties base64 -d <<< "${{ secrets.ANDROID_KEY_BASE64 }}" > $RUNNER_TEMP/keystore.jks echo "storeFile=$RUNNER_TEMP/keystore.jks" >> keystore.properties ``` 4. Build the Android application ```yml - name: build Tauri app for Android env: NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} run: | npm ci npm run tauri android build ``` ```yml - name: Install pnpm uses: pnpm/action-setup@v3 with: version: 9 - name: build Tauri app for Android env: NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} run: | pnpm install pnpm tauri android build ``` ```yml - name: build Tauri app for Android env: NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} run: | yarn install yarn tauri android build ``` ```yml - name: build Tauri app for Android env: NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} run: | bun install bun run tauri android build ``` 5. Upload to CrabNebula Cloud ```yml - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} ``` ##### iOS 1. Create the job and install Rust and Node.js ```yml build_ios: needs: draft runs-on: macos-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: "lts/*" - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true - name: install iOS target run: rustup target add aarch64-apple-ios ``` 2. Install iOS dependencies ```yml - name: setup xcode uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: latest-stable ``` 3. Setup iOS signing See the [official documentation](https://v2.tauri.app/distribute/sign/ios/) for more information. ```yml - name: setup Apple API key run: | APPLE_API_KEY_PATH="$RUNNER_TEMP/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8" echo "${{ secrets.APPLE_API_KEY }}" > $APPLE_API_KEY_PATH echo "APPLE_API_KEY_PATH=$APPLE_API_KEY_PATH" >> $GITHUB_ENV echo "API_PRIVATE_KEYS_DIR=$RUNNER_TEMP" >> $GITHUB_ENV ``` 4. Build the iOS application ```yml - name: build Tauri app for iOS env: APPLE_API_KEY: ${{ secrets.APPLE_API_KEY_ID }} APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} APPLE_DEVELOPMENT_TEAM: run: | npm ci npm run tauri ios build --export-method app-store-connect ``` ```yml - name: Install pnpm uses: pnpm/action-setup@v3 with: version: 9 - name: build Tauri app for iOS env: APPLE_API_KEY: ${{ secrets.APPLE_API_KEY_ID }} APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} APPLE_DEVELOPMENT_TEAM: run: | pnpm install pnpm tauri ios build --export-method app-store-connect ``` ```yml - name: build Tauri app for iOS env: APPLE_API_KEY: ${{ secrets.APPLE_API_KEY_ID }} APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} APPLE_DEVELOPMENT_TEAM: run: | yarn install yarn tauri ios build --export-method app-store-connect ``` ```yml - name: build Tauri app for iOS env: APPLE_API_KEY: ${{ secrets.APPLE_API_KEY_ID }} APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} APPLE_DEVELOPMENT_TEAM: run: | bun install bun run tauri ios build --export-method app-store-connect ``` :::caution Note that you **must** set a value for the APPLE_DEVELOPMENT_TEAM environment variable. ::: 5. Upload to CrabNebula Cloud ```yml - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} ``` ### Publishing At this point, the heavy lifting has been done and it's time ot publish the release. If you don't want to autopublish, you can do it manually from the **Cloud** dashboard. ```yaml publish: needs: [build_desktop, build_android, build_ios] runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: publish release uses: crabnebula-dev/cloud-release@v0 with: command: release publish ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} ``` ## Full Workflow ```yaml name: Tauri v2 Release Process on: push: branches: - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: CN_APPLICATION: "YOUR_ORG_NAME/YOUR_APP_NAME" jobs: draft: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: create draft release uses: crabnebula-dev/cloud-release@v0 with: command: release draft ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} build_desktop: needs: draft strategy: fail-fast: false matrix: include: - os: ubuntu-22.04 - os: macos-latest - os: windows-latest runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: "lts/*" - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true - name: install Linux dependencies if: matrix.os == 'ubuntu-22.04' run: | sudo apt-get update sudo apt-get install -y libwebkit2gtk-4.1-dev - name: build Tauri app for Windows, Linux if: matrix.os != 'macos-latest' run: | npm ci npm exec tauri build env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} - name: Install x86_64-apple-darwin target for mac and build Tauri binaries if: matrix.os == 'macos-latest' run: | rustup target add x86_64-apple-darwin npm ci npm exec tauri build -- --target x86_64-apple-darwin npm exec tauri build -- --target aarch64-apple-darwin env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} build_android: needs: draft runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: "lts/*" - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true - name: setup JDK 17 uses: actions/setup-java@v4 with: java-version: "17" distribution: "temurin" - name: setup Android SDK uses: android-actions/setup-android@v3 - name: setup Android NDK uses: nttld/setup-ndk@v1 id: setup-ndk with: ndk-version: r26d link-to-sdk: true - name: install Android targets run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android - name: setup Android signing working-directory: src-tauri/gen/android run: | echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" > keystore.properties echo "password=${{ secrets.ANDROID_KEY_PASSWORD }}" >> keystore.properties base64 -d <<< "${{ secrets.ANDROID_KEY_BASE64 }}" > $RUNNER_TEMP/keystore.jks echo "storeFile=$RUNNER_TEMP/keystore.jks" >> keystore.properties - name: build Tauri app for Android env: NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} run: | npm ci npm run tauri android build - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} build_ios: needs: draft runs-on: macos-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: "lts/*" - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true - name: install iOS target run: rustup target add aarch64-apple-ios - name: setup xcode uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: latest-stable - name: setup Apple API key run: | APPLE_API_KEY_PATH="$RUNNER_TEMP/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8" echo "${{ secrets.APPLE_API_KEY }}" > $APPLE_API_KEY_PATH echo "APPLE_API_KEY_PATH=$APPLE_API_KEY_PATH" >> $GITHUB_ENV echo "API_PRIVATE_KEYS_DIR=$RUNNER_TEMP" >> $GITHUB_ENV - name: build Tauri app for iOS env: APPLE_API_KEY: ${{ secrets.APPLE_API_KEY_ID }} APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} APPLE_DEVELOPMENT_TEAM: run: | npm ci npm run tauri ios build --export-method app-store-connect - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} publish: needs: [build_desktop, build_android, build_ios] runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: publish release uses: crabnebula-dev/cloud-release@v0 with: command: release publish ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} ``` ```yaml name: Tauri v2 Release Process on: push: branches: - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: CN_APPLICATION: "YOUR_ORG_NAME/YOUR_APP_NAME" jobs: draft: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: create draft release uses: crabnebula-dev/cloud-release@v0 with: command: release draft ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} build_desktop: needs: draft strategy: fail-fast: false matrix: os: - ubuntu-22.04 - macos-latest - windows-latest runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Install pnpm uses: pnpm/action-setup@v3 with: version: 9 - uses: actions/setup-node@v4 with: node-version: "lts/*" - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true - name: install Linux dependencies if: matrix.os == 'ubuntu-22.04' run: | sudo apt-get update sudo apt-get install -y libwebkit2gtk-4.1-dev - name: build Tauri app for Windows, Linux if: matrix.os != 'macos-latest' run: | pnpm install pnpm tauri build env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} - name: Install x86_64-apple-darwin for mac and build Tauri binaries if: matrix.os == 'macos-latest' run: | rustup target add x86_64-apple-darwin pnpm install pnpm tauri build --target x86_64-apple-darwin pnpm tauri build --target aarch64-apple-darwin env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} build_android: needs: draft runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: "lts/*" - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true - name: setup JDK 17 uses: actions/setup-java@v4 with: java-version: "17" distribution: "temurin" - name: setup Android SDK uses: android-actions/setup-android@v3 - name: setup Android NDK uses: nttld/setup-ndk@v1 id: setup-ndk with: ndk-version: r26d link-to-sdk: true - name: install Android targets run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android - name: setup Android signing working-directory: src-tauri/gen/android run: | echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" > keystore.properties echo "password=${{ secrets.ANDROID_KEY_PASSWORD }}" >> keystore.properties base64 -d <<< "${{ secrets.ANDROID_KEY_BASE64 }}" > $RUNNER_TEMP/keystore.jks echo "storeFile=$RUNNER_TEMP/keystore.jks" >> keystore.properties - name: Install pnpm uses: pnpm/action-setup@v3 with: version: 9 - name: build Tauri app for Android env: NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} run: | pnpm install pnpm tauri android build - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} build_ios: needs: draft runs-on: macos-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: "lts/*" - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true - name: install iOS target run: rustup target add aarch64-apple-ios - name: setup xcode uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: latest-stable - name: setup Apple API key run: | APPLE_API_KEY_PATH="$RUNNER_TEMP/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8" echo "${{ secrets.APPLE_API_KEY }}" > $APPLE_API_KEY_PATH echo "APPLE_API_KEY_PATH=$APPLE_API_KEY_PATH" >> $GITHUB_ENV echo "API_PRIVATE_KEYS_DIR=$RUNNER_TEMP" >> $GITHUB_ENV - name: Install pnpm uses: pnpm/action-setup@v3 with: version: 9 - name: build Tauri app for iOS env: APPLE_API_KEY: ${{ secrets.APPLE_API_KEY_ID }} APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} APPLE_DEVELOPMENT_TEAM: run: | pnpm install pnpm tauri ios build --export-method app-store-connect - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} publish: needs: [build_desktop, build_android, build_ios] runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: publish release uses: crabnebula-dev/cloud-release@v0 with: command: release publish ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} ``` ```yaml name: Tauri v2 Release Process on: push: branches: - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: CN_APPLICATION: "YOUR_ORG_NAME/YOUR_APP_NAME" jobs: draft: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: create draft release uses: crabnebula-dev/cloud-release@v0 with: command: release draft ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} build_desktop: needs: draft strategy: fail-fast: false matrix: os: - ubuntu-22.04 - macos-latest - windows-latest runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: "lts/*" - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true - name: install Linux dependencies if: matrix.os == 'ubuntu-22.04' run: | sudo apt-get update sudo apt-get install -y libwebkit2gtk-4.1-dev - name: build Tauri app for Windows, Linux if: matrix.os != 'macos-latest' run: | yarn install --frozen-lockfile yarn tauri build env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} - name: Install x86_64-apple-darwin for mac and build Tauri binaries if: matrix.os == 'macos-latest' run: | rustup target add x86_64-apple-darwin yarn install --frozen-lockfile yarn tauri build --target x86_64-apple-darwin yarn tauri build --target aarch64-apple-darwin env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} build_android: needs: draft runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: "lts/*" - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true - name: setup JDK 17 uses: actions/setup-java@v4 with: java-version: "17" distribution: "temurin" - name: setup Android SDK uses: android-actions/setup-android@v3 - name: setup Android NDK uses: nttld/setup-ndk@v1 id: setup-ndk with: ndk-version: r26d link-to-sdk: true - name: install Android targets run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android - name: setup Android signing working-directory: src-tauri/gen/android run: | echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" > keystore.properties echo "password=${{ secrets.ANDROID_KEY_PASSWORD }}" >> keystore.properties base64 -d <<< "${{ secrets.ANDROID_KEY_BASE64 }}" > $RUNNER_TEMP/keystore.jks echo "storeFile=$RUNNER_TEMP/keystore.jks" >> keystore.properties - name: build Tauri app for Android env: NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} run: | yarn install yarn tauri android build - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} build_ios: needs: draft runs-on: macos-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: "lts/*" - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true - name: install iOS target run: rustup target add aarch64-apple-ios - name: setup xcode uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: latest-stable - name: setup Apple API key run: | APPLE_API_KEY_PATH="$RUNNER_TEMP/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8" echo "${{ secrets.APPLE_API_KEY }}" > $APPLE_API_KEY_PATH echo "APPLE_API_KEY_PATH=$APPLE_API_KEY_PATH" >> $GITHUB_ENV echo "API_PRIVATE_KEYS_DIR=$RUNNER_TEMP" >> $GITHUB_ENV - name: build Tauri app for iOS env: APPLE_API_KEY: ${{ secrets.APPLE_API_KEY_ID }} APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} APPLE_DEVELOPMENT_TEAM: run: | yarn install yarn tauri ios build --export-method app-store-connect - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} publish: needs: [build_desktop, build_android, build_ios] runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: publish release uses: crabnebula-dev/cloud-release@v0 with: command: release publish ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} ``` ```yaml name: Tauri v2 Release Process on: push: branches: - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: CN_APPLICATION: "YOUR_ORG_NAME/YOUR_APP_NAME" jobs: draft: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: create draft release uses: crabnebula-dev/cloud-release@v0 with: command: release draft ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} build_desktop: needs: draft strategy: fail-fast: false matrix: os: - ubuntu-22.04 - macos-latest - windows-latest runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Install bun uses: oven-sh/setup-bun@v2 - uses: actions/setup-node@v4 with: node-version: "lts/*" - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true - name: install Linux dependencies if: matrix.os == 'ubuntu-22.04' run: | sudo apt-get update sudo apt-get install -y libwebkit2gtk-4.1-dev - name: build Tauri app for Windows, Linux if: matrix.os != 'macos-latest' run: | bun install bun run tauri build env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} - name: Install x86_64-apple-darwin for mac and build Tauri binaries if: matrix.os == 'macos-latest' run: | rustup target add x86_64-apple-darwin bun install bun run tauri build --target x86_64-apple-darwin bun run tauri build --target aarch64-apple-darwin env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} build_android: needs: draft runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: "lts/*" - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true - name: setup JDK 17 uses: actions/setup-java@v4 with: java-version: "17" distribution: "temurin" - name: setup Android SDK uses: android-actions/setup-android@v3 - name: setup Android NDK uses: nttld/setup-ndk@v1 id: setup-ndk with: ndk-version: r26d link-to-sdk: true - name: install Android targets run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android - name: setup Android signing working-directory: src-tauri/gen/android run: | echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" > keystore.properties echo "password=${{ secrets.ANDROID_KEY_PASSWORD }}" >> keystore.properties base64 -d <<< "${{ secrets.ANDROID_KEY_BASE64 }}" > $RUNNER_TEMP/keystore.jks echo "storeFile=$RUNNER_TEMP/keystore.jks" >> keystore.properties - name: Install bun uses: oven-sh/setup-bun@v2 - name: build Tauri app for Android env: NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} run: | bun install bun run tauri android build - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} build_ios: needs: draft runs-on: macos-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: "lts/*" - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true - name: install iOS target run: rustup target add aarch64-apple-ios - name: setup xcode uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: latest-stable - name: setup Apple API key run: | APPLE_API_KEY_PATH="$RUNNER_TEMP/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8" echo "${{ secrets.APPLE_API_KEY }}" > $APPLE_API_KEY_PATH echo "APPLE_API_KEY_PATH=$APPLE_API_KEY_PATH" >> $GITHUB_ENV echo "API_PRIVATE_KEYS_DIR=$RUNNER_TEMP" >> $GITHUB_ENV - name: Install bun uses: oven-sh/setup-bun@v2 - name: build Tauri app for iOS env: APPLE_API_KEY: ${{ secrets.APPLE_API_KEY_ID }} APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} APPLE_DEVELOPMENT_TEAM: run: | bun install bun run tauri ios build --export-method app-store-connect - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} publish: needs: [build_desktop, build_android, build_ios] runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: publish release uses: crabnebula-dev/cloud-release@v0 with: command: release publish ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} ``` # Taurify import { Tabs, TabItem } from "@astrojs/starlight/components"; The following workflow is specifically tailored to [Taurify](/taurify) applications. ## Versionining The release version number is automatically extracted from [Taurify configuration file (`taurify.json`)](/taurify/configuration#version). ## Workflow Triggers For testing and developing purposes it may be useful to set a `workflow_dispatch` trigger, so the workflow can be initiated from the GitHub UI. ```yaml run-name: triggered by ${{ github.actor }}. on: workflow_dispatch ``` Once testing is done, it's recommended to use Continuous Deployment. ```yaml on: push: branches: - main ``` ## Action Environment The actual packaging of your application is done on the Taurify servers, so you can use the `ubuntu-latest` GitHub Actions runner. When deploying you might desire to cancel ongoing processes when a new workflow starts. ```yaml concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true ``` ## Jobs The following section snippets must be added in the `jobs` map. ```yaml jobs: : ``` Note that the indentation is important. ### Trigger Release To trigger a new release, you must set up the Taurify secrets and run [`taurify build`](/taurify/cli#build). Fore more information on how to set up secrets such as your Taurify signing keypair, CrabNebula Cloud API key and application signing keys, see the [Taurify distribution guide](/taurify/distribute/). ```yaml build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 - name: install dependencies run: npm install - name: trigger release env: CN_API_KEY: ${{ secrets.CN_API_KEY }} PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }} run: npm exec taurify build ``` ```yaml build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install pnpm uses: pnpm/action-setup@v3 with: version: 9 - uses: actions/setup-node@v4 - name: install dependencies run: pnpm install - name: trigger release env: CN_API_KEY: ${{ secrets.CN_API_KEY }} PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }} run: pnpm taurify build ``` ```yaml build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 - name: install dependencies run: yarn install - name: trigger release env: CN_API_KEY: ${{ secrets.CN_API_KEY }} PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }} run: yarn taurify build ``` ```yaml build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install bun uses: oven-sh/setup-bun@v2 - uses: actions/setup-node@v4 - name: install dependencies run: bun install - name: trigger release env: CN_API_KEY: ${{ secrets.CN_API_KEY }} PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }} run: bun run taurify build ``` When this job is completed, your Taurify release is available on the CrabNebula Cloud platform. ## Full Workflow ```yaml name: Taurify Release Process on: push: branches: - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 - name: install dependencies run: npm install - name: trigger release env: CN_API_KEY: ${{ secrets.CN_API_KEY }} PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }} run: npm exec taurify build ``` ```yaml name: Taurify Release Process on: push: branches: - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install pnpm uses: pnpm/action-setup@v3 with: version: 9 - uses: actions/setup-node@v4 - name: install dependencies run: pnpm install - name: trigger release env: CN_API_KEY: ${{ secrets.CN_API_KEY }} PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }} run: pnpm taurify build ``` ```yaml name: Taurify Release Process on: push: branches: - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 - name: install dependencies run: yarn install - name: trigger release env: CN_API_KEY: ${{ secrets.CN_API_KEY }} PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }} run: yarn taurify build ``` ```yaml name: Taurify Release Process on: push: branches: - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install bun uses: oven-sh/setup-bun@v2 - uses: actions/setup-node@v4 - name: install dependencies run: bun install - name: trigger release env: CN_API_KEY: ${{ secrets.CN_API_KEY }} PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }} run: bun run taurify build ``` # Bootstrap import { Steps } from "@astrojs/starlight/components"; The CrabNebula Cloud CLI offers a `bootstrap` command that helps you prepare your application to be distributed using Cloud. It performs the following tasks: - ensure your organization and application exists in the CrabNebula Cloud platform - set up your Tauri application with support to auto-updates via Cloud - create a CrabNebula Cloud API key - optionally set up a release GitHub Action workflow for [Tauri v1](/cloud/ci/tauri-v1-workflow) or [Tauri v2](/cloud/ci/tauri-v2-workflow). ## Usage After [installing the CLI](/cloud/cli/install), you can simply run the bootstrap command inside a Tauri app project: ```sh cd path/to/app cn bootstrap ``` The bootstrap CLI command must sign-in to CrabNebula Cloud to ensure your organization, application and API key are set up. When you execute `cn bootstrap`, it opens the browser to authenticate with `https://web.crabnebula.cloud`. After signing in, switch back to the terminal to complete the following bootstrap steps: 1. Choose a CrabNebula Cloud application to upload releases to by either: - Creating your first organization and application. - Selecting an existing organization and application. 2. (Optional) Create a new CrabNebula Cloud API key to upload releases unless you already have one set up. 3. If a Tauri project can be found in the current working directory, the CLI will set up the Tauri updater with CrabNebula Cloud support. - The `tauri.conf.json` file will be updated to include the required Tauri updater configuration - A new updater signing key is generated - For tauri v2 the updater plugin is added to the application 4. Additionally the bootstrap command generates a basic GitHub action release workflow that uploads assets to CrabNebula Cloud. # Create a Release Draft The first step in creating a new release for your app is to create a draft. You will need: - The Application's slug (example: `devtools-desktop`) - The Organization's slug (example: `crabnebula`) - The version number for this draft (example: `1.0.0`) When combined like `crabnebula/devtools-desktop` this is referred to as a "fully qualified" application slug. The slugs can be found on the Application's details page. :::tip Be sure to follow the [instructions to setup the CrabNebula Cloud CLI](/cloud/cli/install) before continuing. ::: Create a draft by running the following command: ```sh cn release draft {org-slug/app-slug} {version-number} ``` :::tip When using Tauri or cargo-packager, you can automatically draft a release with your app's version by running `cn release draft {org-slug/app-slug} --framework [tauri|packager]`. ::: Note that the version number can be any string that represents the version of the application so that any versioning scheme is supported. For example, if wanting to create the 1.0.0 release for an application with the fully qualified slug `crabnebula/devtools-desktop` you would run the following command: ```sh cn release draft crabnebula/devtools-desktop "1.0.0" ``` You will now see a new draft in the Cloud Platform for the specified application. Take note of the `id` value output from the `cn release draft` command as it will be needed when uploading assets in the next step. ## Release notes You can also add notes to a release by including the `--notes` flag when running `cn release draft`. Alternatively, a file containing the notes can be specified with the `--notes-file` argument. Release notes would typically become part of your CI workflow (like GitHub Actions) to obtain or generate release notes first. Then you can provide it as part of the `cn release draft` command. ```sh # Generating your release notes as release-notes.txt cn release draft crabnebula/devtools-desktop "1.0.0" \ --notes-file release-notes.txt ``` The same can be done when you're using the `--framework [tauri|packager]` argument. ```sh # Generating your release notes as release-notes.txt cn release draft crabnebula/devtools-desktop --framework tauri \ --notes-file release-notes.txt ``` ## Release Channels Release channels are a mechanism that allows you to deploy assets to different environments such as beta releases or QA builds. To draft a release on a specific channel, use the `--channel ` CLI argument. If no channel is set, it is assumed to be the default/production channel which does **NOT** have an actual name, so no value provided as channel name matches it. :::note The `--channel ` CLI argument must also be provided to the `release show`, `release purge`, `release upload` and `release publish` commands. ::: :::caution Release channels are NOT visible on your application's public page, but they are still publicly accessible. Consider the channels "public, but not advertised". ::: #### Release Creation Create a draft release on a specific channel (such as `beta`) by running the following command: ```sh cn release draft crabnebula/devtools-desktop "1.0.0" --channel beta ``` #### App Download To utilize this channel in download links such as in our Download Button Snippet generator, use the `channel` query parameter. For example, to download the latest release of an application under a specific channel, you would use the following URL format: `https://cdn.crabnebula.app/download///latest/?channel=` Where you must replace ``, ``, ``, and `` with your organization's slug, the application slug, the release asset file name, and the channel, respectively. #### (Tauri) App Updates To utilize this channel in the Tauri Updater links, the `channel` query parameter is also used. For example, the following URL format could be used in your `tauri.conf.json` file: ```json "endpoints": [ "https://cdn.crabnebula.app/update///{{target}}-{{arch}}/{{current_version}}?channel=" ], ``` Where you must replace each of the `<..>` pieces with with your data. Visit your application's 'Configure Tauri Updates' page to get the correct URL for your application, and just add the `channel` parameter. ##### Changing Release Channel at Runtime If you would like to offer app users the ability to switch between channels, you must clear the configured endpoints and check for updates on the Rust side. See [AppHandle::updater](https://docs.rs/tauri/latest/tauri/struct.AppHandle.html#method.updater) and [UpdateBuilder::endpoints](https://docs.rs/tauri/latest/tauri/updater/struct.UpdateBuilder.html#method.endpoints) for Tauri v1 and [UpdaterExt::updater_builder](https://docs.rs/tauri-plugin-updater/2/tauri_plugin_updater/trait.UpdaterExt.html#tymethod.updater_builder) and [UpdaterBuilder::endpoints](https://docs.rs/tauri-plugin-updater/2/tauri_plugin_updater/struct.UpdaterBuilder.html#method.endpoints) for Tauri v2. For a complete example application that manages release channels at runtime, see the [cloud-release-channels-demo repository](https://github.com/crabnebula-dev/cloud-release-channels-demo). ## Delete a Release Draft If you need to delete a release draft, you can do so from the Cloud Platform. Go to the applications page and find the unpublished draft. Click on the _"View"_ button on the right and then select _"Delete draft"_ from the Danger Zone. Note that this cannot be undone. Next, [upload assets for the release](/cloud/cli/upload-assets). # Fetch Latest Release The latest release assets are available via the Cloud's Content Delivery Network (CDN). Additionally you can display the metadata of any release from the [CLI](/cloud/cli/install). ## View release metadata from [CLI](/cloud/cli/install) You can view the metadata of any release by running: ```sh cn release show {org-slug/app-slug} {release-id or version} ``` :::note You have to specify the channel name as well using `--channel ` if using a release channel. For more information, see the [Release Draft](/cloud/cli/create-draft/#release-channels) page. ::: This will print the metadata of the release in JSON format. For example: ```json { "id": "01JSGWMMTRBTD4YSBEVE3W5B7V", "status": "Published", "appId": "01JDSTGXKDNHCQJV3MAM4R6RVT", "version": "0.1.0-quick.1", "notes": null, "createdAt": "2025-04-23T08:36:11.736Z", "pubDate": "2025-04-23T08:36:12.101Z", "purgedAt": null, "assets": [ { "id": "01JSGWMMZ7NE042DHJVAP520KN", "updatePlatform": null, "publicPlatform": null, "filename": "nova.webp", "signature": null, "size": "5060", "createdAt": "2025-04-23T08:36:11.956293524Z" } ], "channel": null } ``` ## Download Assets by File Name Each asset in the latest release can be downloaded with the following CDN URL: `https://cdn.crabnebula.app/download///latest/` Where you must replace ``, `` and `` with your organization's slug, the application slug and the release asset file name, respectively. This endpoint is useful when you want to allow your users to download your application's latest installer, for instance. :::tip To fetch the latest asset of a particular release channel you can append the `?channel=` query string to the URL. ::: ## Download Assets by Public Platform The CDN exposes an endpoint that can be used to fetch an asset in the latest release by its public platform instead of its filename: `https://cdn.crabnebula.app/download///latest/platform/` Where you must replace ``, `` and `` with your organization's slug, the application slug and the executable's public platform key, respectively. Public platform keys that are automatically set by the CLI when using the `--framework` option are: - Linux: - `deb-$arch` - `rpm-$arch` - `appimage-$arch` - `pacman-$arch` - `linux-$arch` (for custom formats e.g. plain executable) - macOS: - `dmg-$arch` - `macos-$arch` (for custom formats e.g. plain executable) - Windows: - `nsis-$arch` - `wix-$arch` - `windows-$arch` (for custom formats e.g. plain executable) :::tip To fetch the latest asset of a particular release channel you can append the `?channel=` query string to the URL. ::: ## Asset Metadata by Update Platform The CDN additionally exposes an endpoint that can be used by your application to check for updates by taking a version number and update platform and producing a JSON object containing the update data if the version does not match the latest. The update metadata can be fetched with the following CDN URL: `https://cdn.crabnebula.app/update////` Where you must replace ``, ``, `` and `` with your organization's slug, the application slug, the executable's update platform key and the current version, respectively. A list of update platform keys can be found on the [Upload Assets](/cloud/cli/upload-assets/#update-platform---update-platform) page. :::tip To fetch the latest asset of a particular release channel you can append the `?channel=` query string to the URL. ::: For instance when uploading the following `linux-x86_64` and `darwin-aarch64` assets: ```sh cn release draft "crabnebula/devtools-desktop" "0.2.0" cn release upload "crabnebula/devtools-desktop" "" \ --update-platform linux-x86_64 \ --file \ --signature cn release upload "crabnebula/devtools-desktop" "" \ --update-platform darwin-aarch64 \ --file \ --signature cn release publish "crabnebula/devtools-desktop" "" ``` For the `https://cdn.crabnebula.app/update/crabnebula/devtools-desktop/linux-x86_64/0.2.0` request, the current version matches latest so the response status code is 204. For the `https://cdn.crabnebula.app/update/crabnebula/devtools-desktop/linux-x86_64/0.1.0` request, the response status code is 200 with the following JSON body: ```json { "version": "0.2.0", "pub_date": "2024-03-19T02:35:10.440Z", "notes": "...", "url": "", "signature": "" } ``` For the `https://cdn.crabnebula.app/update/crabnebula/crabnebula-devtools/darwin-aarch64/1.0.0` request, the response status code is 200 with the following JSON body: ```json { "version": "0.2.0", "pub_date": "2024-03-19T02:35:10.440Z", "notes": "...", "url": "", "signature": "" } ``` :::note In this last example the latest release version (0.2.0) is lower than the current one (1.0.0) but the CDN still returns the update data, allowing downgrades. ::: # Install The CrabNebula Cloud CLI can be used to create a release draft, upload assets, and then publish a release. Creating a release involves the following steps: 1. [Create a new draft](/cloud/cli/create-draft) 2. [Upload assets to CrabNebula Cloud](/cloud/cli/upload-assets) 3. [Publish the release to users](/cloud/cli/publish-release) ## Prerequisites :::tip The [bootstrap](/cloud/cli/bootstrap) command ensures you have all prerequites to start distributing with CrabNebula Cloud. [Install the CLI](#install-the-cli) and see the [bootstrap](/cloud/cli/bootstrap) documentation for more information. ::: In order to begin using the CrabNebula Cloud CLI a few steps must first be completed: 1. Create an Application (learn how to in [Create an Application](/cloud#create-an-application)) 2. Create an API key (learn how to in [Create an API Key](/cloud/org-management/create-api-key)) 3. Export the API key to the environment - Linux and macOS: `export CN_API_KEY={api-key}` - Windows: `set CN_API_KEY={api-key}` - Note that this will only add the API key as an environment variable for the lifetime of the current shell session. You can also pass the API key with the `--api-key` flag when executing any command. ## Install the CLI You can download the CLI from [here](https://crabnebula.cloud/crabnebula/cn-cli/releases). It is a single binary that can be executed from anywhere on your system. In the context of this documentation we will assume that the binary is named `cn` (`cn.exe` on Windows). ### Quick Links :::tip The above download buttons were automatically generated by CrabNebula Cloud since the CLI is distributed over it as well. Head to the *Download Button* section on the Application details page to create your own download button (even supports automatic OS recognition). ::: ### Linux and macOS To verify that the CLI can execute as expected open a terminal and navigate to the folder with the downloaded binary. Assuming the binary is named `cn`, running `./cn whoami` will show you the identity linked to the API key. If you get a permission denied error, you may need to make the binary executable with `chmod +x cn`. If you want to install the CLI globally on your system, you can move the binary to a folder in your `PATH` (e.g.: `/usr/local/bin` on macOS and Linux). ### Windows To verify that the CLI can execute as expected open a command prompt and navigate to the folder with the downloaded binary. Assuming the binary is named `cn.exe`, running `.\cn.exe whoami` will show you the identity linked to the API key. If you want to install the CLI globally on your system, you can add the folder with the binary to your `PATH` environment variable. See [these steps from Microsoft](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/path) for instructions on how to do this. # Publish a Release The final step to getting an update to users is to publish the release. Be sure to first [create a draft](/cloud/cli/create-draft) then [upload assets](/cloud/cli/upload-assets) for a release before continuing. :::tip You can verify the release notes, version number, and assets in the "Releases" section for a given application. ::: There are two ways to publish a release: - [Publishing with the Cloud Platform](#publishing-with-the-cloud-platform) - [Publishing with the CLI](#publishing-with-the-cli) ### Publishing with the Cloud Platform After the assets have been uploaded, a release can be published by visiting the respective "Release" page on the CrabNebula Cloud platform. Clicking the "Publish draft" button in the upper-right corner will make the release available to users. ### Publishing with the CLI In order to publish a release with the CLI you will need: - Organization slug - Application slug - Release ID (output after creating a new draft with the CLI) - _Optional_: The release channel name :::tip Be sure to follow the [instructions to setup the CrabNebula Cloud CLI](/cloud/cli/install) before continuing. ::: To publish a release run the following command: ```sh cn release publish {org-slug/app-slug} {release-id} ``` :::tip When using Tauri or cargo-packager, you can automatically publish the release referencing your app's version by running `cn release publish {org-slug/app-slug} --framework [tauri|packager]`. ::: ### Release channel `--channel` If you specified the release channel while drafting the release, you must specify the same channel name again using `--channel ` argument to publish the release in the same channel. For more information, see the [Release Draft](/cloud/cli/create-draft/#release-channels) page. ### Example Usage To publish the example of `crabnebula/devtools-desktop` with release ID `01HKA6TGC281V51NGSRJNTJQAF` the following command would be used: ```sh cn release publish "crabnebula/devtools-desktop" "01HKA6TGC281V51NGSRJNTJQAF" ``` # Purge a Release When an older release is not needed anymore or your latest release has an issue and you want to roll back or stop its rollout, you can purge a release to delete all of its assets from the CrabNebula Cloud platform. :::caution Purging a release is an irreversible action that destroys all of its assets. ::: :::caution If the purged release is the latest release of a given channel the CDN updater automatically rolls back to the previous release (by publish date instead of semantic versioning). If that is not desired, you must publish a new release before purging the latest. ::: There are two ways to purge a release: - [Purging with the Cloud Platform](#purging-with-the-cloud-platform) - [Purging with the CLI](#purging-with-the-cli) ### Purging with the Cloud Platform A release can be purged by visiting the respective "Release" page on the CrabNebula Cloud platform. Clicking the "Purge release" button in the bottom-left corner will purge the release. This action can only be done by admins. ### Purging with the CLI In order to purge a release with the CLI you will need: - Organization slug - Application slug - Release ID or version :::tip Be sure to follow the [instructions to setup the CrabNebula Cloud CLI](/cloud/cli/install) before continuing. ::: To purge a release run the following command: ```sh cn release purge {org-slug/app-slug} {release-id or version} ``` :::note You have to specify the channel name as well using `--channel ` if using a release channel. For more information, see the [Release Draft](/cloud/cli/create-draft/#release-channels) page. ::: # Quality reports import { Tabs, TabItem } from "@astrojs/starlight/components"; We're constantly monitoring the Cloud Platform for [availability](https://cloud.crabnebula.online/) and possible issues. In order to help detect such issues the CrabNebula Cloud CLI may submit quality reports. ## Privacy Quality reports from the CLI are sent to CrabNebula Cloud at `api.crabnebula.app` and are not processed by any third parties. For more information, check our [general privacy policy](https://crabnebula.dev/privacy-policy/). ### Opting-Out While we make sure that these reports are minimal and don't contain sensitive information, you can opt-out from sending these reports by either: - Adding the `--no-quality-reports` command line option. - Setting the `CN_QUALITY_REPORTS=false` environment variable. For example: ```sh frame=none cn release upload --no-quality-reports ``` ```sh frame=none CN_QUALITY_REPORTS=false cn release upload ``` ## Example Reports Here are example of the quality reports currently being sent. Though the types of reports may change over time, for example if we become aware of new types of issues to be monitoring for. ### Asset Upload Because the `cn release upload` command may run into networking issues. | key | description | type | | ------------- | --------------------------------------------------- | -------- | | `asset_idx` | the index of the asset, if there are multiple | integer | | `asset_count` | the total number of assets uploaded in one CLI call | integer | | `asset_id` | the ID of the asset | string | | `asset_size` | the size of the asset in bytes | integer | | `auth` | whether authentication succeeded | Status | | `resolve` | whether the asset metadata could be resolved | Status | | `start` | whether the upload started | Status | | `parts` | whether all parts could be uploaded | Status | | `finish` | whether the upload finished | Status | | `part` | the status of each part | Status[] | | `part_count` | the total number of parts | integer | Where the `Status` type is `boolean | integer | null`. - `null` for when this step hasn't started yet. - `true` when the step succeeded. - `integer` when the step failed due to an HTTP error, the HTTP response code. - `false` when the step failed for any other reason. Here is an example report where the upload encountered a server error. ```json title="Example Quality Report" { "asset_idx": 0, "asset_count": 1, "asset_id": "01JC1BV1WJJMSPR267W13S9G85", "asset_size": 12320304, "auth": true, "resolve": true, "start": true, "parts": 500, "finish": null, "part": [500, null, null], "part_count": 3 } ``` Additionally some HTTP request headers collected from the report: ```text title="HTTP Response Headers" User-Agent: Cloud CLI/0.9.0 CF-IPCountry: NL ``` - `User-Agent`: The version of the CLI that submitted the report. - `CF-IPCountry`: The GeoIP country that the report was submitted from. # Upload Assets An asset is the compiled binary that will be distributed to users. Before uploading assets be sure to [create a draft release](/cloud/cli/create-draft). In order to upload an asset the following are needed: - The Application's slug (example: `devtools-desktop`) - The Organization's slug (example: `crabnebula`) - Release ID (printed to the console when creating a new draft or can be found on the Cloud Platform page for the specific release) - The application asset file - _Optional_: The signature file for the asset - _Optional_: The public platform name - _Optional_: The update platform name - _Optional_: The release channel name :::tip Be sure to follow the [instructions to setup the CrabNebula Cloud CLI](/cloud/cli/install) before continuing. ::: :::tip When using Tauri or cargo-packager, you can automatically upload all application bundles to Cloud by running `cn release upload {org-slug/app-slug} {release-id} --framework [tauri|packager]`. ::: To upload an asset run the following command: ```sh cn release upload {org-slug/app-slug} {release-id} \ --public-platform {public-platform-name} \ --update-platform {update-platform-name} \ --file {asset-file-path} \ --signature {signature-file-path} ``` ### Public Platform `--public-platform` The public platform is referenced in your application market page, download buttons and can be used to fetch the asset in the latest release via the CDN. For more information, see the [Fetch Latest Release](/cloud/cli/fetch-latest-release/#download-assets-by-public-platform) page. Common **public** platform names for Tauri and cargo-packager are listed below: | Bundle Format | Public platform names | | ------------- | ------------------------------------------------------------------------ | | Debian | `deb-x86_64`, `deb-aarch64`, `deb-i686`, `deb-armv7` | | RPM | `rpm-x86_64`, `rpm-aarch64`, `rpm-i686`, `rpm-armv7` | | AppImage | `appimage-x86_64`, `appimage-aarch64`, `appimage-i686`, `appimage-armv7` | | Pacman | `pacman-x86_64`, `pacman-aarch64`, `pacman-i686`, `pacman-armv7` | | DMG | `dmg-x86_64`, `dmg-aarch64` | | NSIS | `nsis-x86_64`, `nsis-aarch64`, `nsis-i686` | | WiX | `wix-x86_64`, `wix-aarch64`, `wix-i686` | ### Update Platform `--update-platform` The update platform is used to check for updates by taking a version number and update platform and producing a JSON object containing the update data which can be used by application updaters such as the [Tauri updater](https://tauri.app/plugin/updater/) and the [cargo packager auto updater](/packager/updater/). For more information, see the [Fetch Latest Release](/cloud/cli/fetch-latest-release/#asset-metadata-by-update-platform) page. The `--update-platform` flag is not needed if the asset is for example platform-independent (e.g.: a web app). If no platform is specified, the asset will be presented as a generic asset on the Cloud Platform. Common **update** platform names for Tauri and cargo-packager are listed below: | Operating System | Tauri | cargo-packager | | ---------------- | ----------------------------------------------------------- | ---------------------------------------------------------- | | Linux | `linux-x86_64`, `linux-aarch64`, `linux-i686`, `linux-armv7` | `linux-x86_64`, `linux-aarch64`, `linux-i686`, `linux-armv7` | | macOS | `darwin-x86_64`, `darwin-aarch64` | `macos-x86_64`, `macos-aarch64` | | Windows | `windows-x86_64`, `windows-aarch64`, `windows-i686` | `windows-x86_64`, `windows-aarch64`, `windows-i686` | Only the macOS prefix differs between the two tools: Tauri uses `darwin-`, while cargo-packager uses `macos-`. Linux and Windows names are identical for both. Tauri update assets may additionally include the bundle type as a suffix, for example `linux-aarch64-appimage`. The suffix corresponds to the [Tauri bundle type](https://v2.tauri.app/reference/config/#bundletype) (e.g. `appimage`, `deb`, `rpm`, `nsis`, `msi`), excluding `dmg`. The `--signature` flag is required if `--update-platform` is set. If a `.sig` file with the same name as the asset file exists, the CLI will use it by default. ### Release channel `--channel` If you specified the release channel while drafting the release, you must specify the same channel name again using `--channel ` argument to upload the assets to the same channel. For more information, see the [Release Draft](/cloud/cli/create-draft/#release-channels) page. ### Example Usage Here is an example of uploading a `linux-x86_64` binary for the `crabnebula/devtools-desktop` application with a release ID of `01HKA6TGC281V51NGSRJNTJQAF`: ```sh cn release upload "crabnebula/devtools-desktop" "01HKA6TGC281V51NGSRJNTJQAF" \ --update-platform linux-x86_64 \ --file path_to_binary \ --signature path_to_signature ``` After an asset is uploaded it will then show up on the Cloud Platform under the "Releases" section for an application. Repeat this command for each platform and its respective asset to be distributed. Next, [publish the release](/cloud/cli/publish-release). # Tauri v2 with Auto-Updater import { Tabs, TabItem } from "@astrojs/starlight/components"; import CommandTabs from "@components/CommandTabs.astro"; Let's setup auto-updates with Tauri v2. For this guide, you will need a working Tauri project (v2), in a GitHub repository and integrated with **CrabNebula Cloud**. If you haven't done that yet, the [Publish Tauri with GitHub Actions](/cloud/guides/publish-cloud-github) guide will help you. :::caution[Tauri v2 only] Though similar, APIs have changed between Tauri v1 and Tauri v2. This guide is for Tauri v2 only. ::: ## Required Dependencies | crate name | description | version | | ---------------------- | ----------------------------------------------------- | -------- | | `tauri-plugin-updater` | Tauri plugin for auto-updates | `^2.0.0` | | `tauri-plugin-dialog` | Tauri plugin for dialogs | `^2.0.0` | | `tauri-plugin-process` | Tauri plugin for handling processes like app relaunch | `^2.0.0` | To add them with `cargo` you can run: ```bash frame="none" cargo add tauri-plugin-updater tauri-plugin-dialog ``` ## Tauri Capabilities Before starting to implement auto-updates, some capabilities must be enabled in your app. Usually capabilities are under `/src-tauri/capabilities/main.json`, adjust accordingly if your setup diverged from the defaults. Finally, add the necessary permissions so they match the JSON below: ```json title="/src-tauri/capabilities/main.json" { "identifier": "main", "description": "permissions for desktop app", "local": true, "windows": ["main"], "permissions": [ "dialog:default", "updater:default", "process:default", "process:allow-restart" ] } ``` ## Secret and Public Keys To secure auto-updates, you need to generate a secret and public key pair. You can use the `tauri-plugin-updater` CLI to generate them: The above commands will generate a prompt to add a password to your key, make note of that for a while. :::note[Official Tauri Docs] To know more, [check the official Tauri documentation](https://tauri.app/plugin/updater/#signing-updates). ::: The stdout will yield back: ```text title="terminal" Please enter a password to protect the secret key. Password: Password (one more time): Deriving a key from the password in order to encrypt the secret key... done Your keypair was generated successfully Private: /path/.tauri/myapp.key (Keep it secret!) Public: /path/.tauri/myapp.key.pub --------------------------- Environment variables used to sign: `TAURI_SIGNING_PRIVATE_KEY` Path or String of your private key `TAURI_SIGNING_PRIVATE_KEY_PASSWORD` Your private key password (optional) ATTENTION: If you lose your private key OR password, you'll not be able to sign your update package and updates will not work. --------------------------- ``` In your CI integration, you must add 2 environment variable secrets: - `TAURI_SIGNING_PRIVATE_KEY` with the content of `myapp.key`. - `TAURI_SIGNING_PRIVATE_KEY_PASSWORD` with the password you set. And the contents of `myapp.key.pub` must be added to your `tauri.conf.json`: ```json title="/src-tauri/tauri.conf.json" "bundle": { "createUpdaterArtifacts": true }, "plugins": { "updater": { "active": true, "endpoints": [ "CrabNebula Cloud updater endpoint" ], "dialog": true, "pubkey": "contents of myapp.key.pub" } } ``` :::caution Note that the `createUpdaterArtifacts` value must be set to `true` for new applications, but set to `"v1Compatible"` when updating from a Tauri v1 application. ::: ## Get Updater Endpoint from CrabNebula Cloud Navigate to [CrabNebula Cloud](https://crabnebula.cloud) and login. At the **Get started** section you will find the **Configure Tauri Updates** card. Clicking on "Configure" will offer you a snippet with the endpoint. ![Get Started section on CrabNebula Cloud](../../../../assets/guides/auto-updater/cloud-get-started.png) The endpoint URL follows this template: ```text frame="none" https://cdn.crabnebula.app/update/your-org/your-app/{{target}}-{{arch}}/{{current_version}} ``` **Do not replace the curly brackets**, those are variables that will be used by Tauri itself when defining the right endpoint to hit. CrabNebula will take care of the rest. ## Add the Plugins to Your App Now it's time to wire things up and use it within your app. The infrastructure is in place, we need to connect to it and to provide a decent user experience. First, we will add the plugins to our Tauri app. ```rust title="/src-tauri/src/lib.rs" use tauri_plugin_dialog; pub fn run() { builder .plugin(tauri_plugin_updater::Builder::new().build()) .plugin(tauri_plugin_dialog::init()) .run(tauri::generate_context!()) .expect("error while running tauri application"); } ``` And now it's time to make use of that from the front-end side. We will create a method that will ping the endpoint for updates. If a new version is available it will download it and gracefully restart the app. ```ts title="/src/updater.ts" import { check } from "@tauri-apps/plugin-updater"; import { ask, message } from "@tauri-apps/plugin-dialog"; import { relaunch } from "@tauri-apps/plugin-process"; export async function checkForAppUpdates() { const update = await check(); if (update?.available) { const yes = await ask( ` Update to ${update.version} is available! Release notes: ${update.body} `, { title: "Update Now!", kind: "info", okLabel: "Update", cancelLabel: "Cancel", } ); if (yes) { await update.downloadAndInstall(); await relaunch(); } } } ``` Lastly, we let this run early and non-blocking. ```tsx frame="none" import { checkForAppUpdates } from "./updater"; function App() { onMount(async () => { await checkForAppUpdates(); }); return

Hello world

; } ```
```tsx frame="none" import { checkForAppUpdates } from "./updater"; function App() { useEffect(async () => { await checkForAppUpdates(); }, []); return

Hello world

; } ```
```vue ``` ```js import { Component, OnInit } from "@angular/core"; import { checkForAppUpdates } from "./updater"; @Component({ selector: "app-root", templateUrl: "./app.component.html", styleUrls: ["./app.component.css"], }) export class AppComponent implements OnInit { constructor() {} async ngOnInit() { await checkForAppUpdates(); } } ``` ```js import { component$, useMount$ } from "@builder.io/qwik"; import { checkForAppUpdates } from "./updater"; export const App = component$(() => { useMount$(async () => { await checkForAppUpdates(); }); return

Hello world

; }); ```
```svelte

Hello world

```
```js import { checkForAppUpdates } from "./updater"; document.addEventListener("DOMContentLoaded", async () => { await checkForAppUpdates(); }); ```
## Final Thoughts With this setup, you now have auto-updates and CI/CD in your app through [CrabNebula Cloud](https://crabnebula.dev/cloud). This is recommended to make sure your users always have the best and most secure experience. If you have any issues, feel free to reach out at the [CrabNebula Discord](https://discord.gg/W2MNdXVgjD) or the [Tauri Discord](https://discord.gg/tauri). # Packager with Auto-Updater In this guide we will cover setting up [Packager](/packager)'s auto-updater with CrabNebula Cloud. We will use a sample [Slint](https://slint.dev) app to demonstrate the process. However, the process is very similar for any other app built with Cargo. ## Prerequisites To get started, you will need the following: - [Rust](https://www.rust-lang.org/tools/install) installed on your machine - [CrabNebula Cloud](https://crabnebula.dev/cloud) account Additionally, you will need to install Cargo packager itself. You can do this by running the following command: ```sh frame="none" cargo install cargo-packager --locked ``` ## Download and Configure the Sample App The Slint sample app is provided within the [cargo packager repository](https://github.com/crabnebula-dev/cargo-packager/tree/main/examples/slint). All the necessary zipped files can be [downloaded](https://cdn.crabnebula.app/download/crabnebula/super-slint-app/latest/super-slint-app.zip). Should you want to use a different app, the guide is relatively easy to adapt. There are other sample apps for other GUI frameworks available in the repo as well. For Tauri apps, however, we feature a separate [guide](/cloud/guides/publish-cloud-github). :::tip All the code files which need to be adjusted in the course of this guide are available [for download](https://web.crabnebula.cloud/crabnebula/super-slint-app/releases) from CrabNebula Cloud. ::: ### Customize the Sample App Navigate into the just downloaded folder and open the `Cargo.toml` file. You will need to adjust the `name` to `super-slint-app` and the `version` to `2.0.0`. The `Cargo.toml` file should look like this: ```toml frame="none" [package] name = "super-slint-app" version = "2.0.0" edition = "2021" publish = false [dependencies] slint = "1.0" [build-dependencies] slint-build = "1.0" [package.metadata.packager] before-packaging-command = "cargo build --release" product-name = "Slint example" identifier = "com.slint.example" resources = ["Cargo.toml", "src", "32x32.png"] icons = ["32x32.png"] ``` The `before-packaging-command` key is set to `cargo build --release` to build the app before packaging it. If your app requires a different command to build, you can adjust it here. ### Add the Packager Auto Updater Now we need to add the packager auto updater as a dependency. Open a Terminal and navigate to the app's root folder. Run the following command to add the packager auto updater as a dependency: ```sh frame="none" cargo add cargo-packager-updater ``` :::note Make sure that your app folder is not part of a Cargo workspace as this might interfere with all `cargo` commands. If you e.g. have a `Cargo.toml` file in a parent folder, you should move the app folder to a different location. ::: ### Generate a Signing Key Pair In order to later ship updates, we need our application to be signed so that the auto updater can verify the integrity of the updates. Hence, we need to generate a signing key pair: ```sh frame="none" cargo packager signer generate ``` After setting a password, you will see two keys generated: a private key and a public key. The private key will be used to sign the updates, and the public key will be used to verify the updates. The private key should be kept secret and not shared with anyone. In order to sign the updates, we need to set the private key and its password as environment variables. Run the following commands to do so for the current terminal session: ```sh frame="none" export CARGO_PACKAGER_SIGN_PRIVATE_KEY=YOUR_PRIVATE_KEY ``` ```sh frame="none" export CARGO_PACKAGER_SIGN_PRIVATE_KEY_PASSWORD=YOUR_PASSWORD ``` You will need the public key later when setting up the auto updater in the app. ## Add the App to Your CrabNebula Cloud Organization Go to [crabnebula.cloud](https://crabnebula.cloud) and sign-in with your GitHub or GitLab account. You will be asked to [set up an organization](/cloud#set-up-an-organization) and to [create your app](/cloud#create-an-application). Call it **Super-Slint-App** and leave the generated slug as is. You will then need to select `packager` as application type. Make sure to note the organization slug and the app slug as you will need them later. Finally you'll have it as the image below. ![Create a new application on CrabNebula Cloud](../../../../assets/guides/packager-auto-updater/cn-cloud-new-app.png) After creating the app, you will be redirected to the app's [application overview page](/cloud/org-management/application-pages/#application-overview-page). Here you can adjust the app's metadata, such as the website, description, and repo link. For now we will focus on creating an initial release. Start by clicking on _Create release_ in the releases section which will show us some of the commands we need to run. Before we can execute the commands, we need to [download the Cloud CLI](https://web.crabnebula.cloud/crabnebula/cn-cli/releases). Make sure that the CLI is executable and available in your PATH. Additionally, the binary should be named `cn`. Should you need assistance with this, please refer to the [CLI installation guide](/cloud/cli/install/#install-the-cli). Confirm that the CLI is installed by checking the CLI version: ```sh frame="none" cn --version ``` :::note The minimum required version of the CLI is `0.6.0`. ::: ### Generate an API key Now we will need to generate an API key which has read and write access to the app and allows the CLI to be authenticated. To achieve this, the key will be set as an environment variable for the CLI to use. Generate the key by clicking _New_, set a name, expiry date and the necessary read/write scope and then copy the command which should include your key. Run the command in your terminal to set the key as an environment variable for the current terminal session: ```sh frame="none" export CN_API_KEY=YOUR_API_KEY ``` ![Create a new API key on CrabNebula Cloud](../../../../assets/guides/packager-auto-updater/cn-cloud-new-api-key.png) ### Draft a new release Make sure that your terminal context is in the app's root folder and draft a new release: ```sh frame="none" cn release draft YOUR_ORG_SLUG/YOUR_APP_SLUG --framework packager ``` Make sure to replace `YOUR_ORG_SLUG` with the organization's slug. While for `YOUR_APP_SLUG` be sure to use `super-slint-app` as that was the application slug created in a previous step. The relevant release info will be extracted from the app's `Cargo.toml` file automatically and you should see a JSON response with the release's ID and the line `"version": "2.0.0"`. ### Include Auto Updater and Version Open the `src/main.rs` file and add the following code to include the auto updater: Include the following imports at the top of the file: ```rust frame="none" use cargo_packager_updater::{semver::Version, url::Url}; ``` Add the following code at the beginning of the `main` function: ```rust frame="none" let config = cargo_packager_updater::Config { endpoints: vec![Url::parse("https://cdn.crabnebula.app/update/YOUR_ORG_SLUG/YOUR_APP_SLUG/{{target}}-{{arch}}/{{current_version}}").expect("Failed to parse URL")], // REPLACE: YOUR_ORG_SLUG and YOUR_APP_SLUG of the app in CN Cloud pubkey: String::from("YOUR_PUBLIC_KEY"), // REPLACE: YOUR_PUBLIC_KEY generated by the signer ..Default::default() }; let current_version = Version::parse(env!("CARGO_PKG_VERSION")).expect("Failed to parse version"); println!("Current version: {}", current_version); if let Some(update) = cargo_packager_updater::check_update(current_version.clone(), config) .expect("Failed to check for update") { update .download_and_install() .expect("Failed to download and install update"); println!("Update installed") } else { println!("No update available") } ``` Make sure to replace `YOUR_ORG_SLUG`, `YOUR_APP_SLUG` and `YOUR_PUBLIC_KEY` with the respective values. This tells the app to check for updates at the specified URL and to verify the updates with the public key. In order to later verify the version of the app we want to display it in the app window. Add the following line after the initialization of the `ui` object in the `main` function (after `let ui = AppWindow::new()?;`): ```rust frame="none" ui.set_app_version(current_version.to_string().into()); ``` Now open `ui/appwindow.slint` and add the following property at the top of the `AppWindow` component: ```txt in property app_version: "0.0.0"; ``` Then add the following code at the top of the `VerticalBox` to display the version in the window: ```txt Text { text: "App Version: \{root.app_version}"; } ``` ### Build and Upload Release Assets To build the release assets, execute packager: ```sh frame="none" cargo packager --release ``` Since we have set the `before-packaging-command` key in the `Cargo.toml` file to `cargo build --release`, the app will be built before packaging. The release assets will be generated in the `target/release` folder. Copy the Cargo.toml file temporarily to the `target/release` folder and navigate there: ```sh frame="none" cp Cargo.toml target/release && cd target/release ``` Now you can upload the release assets to the draft release: ```sh frame="none" cn release upload YOUR_ORG_SLUG/YOUR_APP_SLUG --framework packager ``` Afterwards you should see them appearing in the Assets section of the release page on CrabNebula Cloud. ### Publish Release Now you can go ahead and publish the release: ```sh frame="none" cn release publish YOUR_ORG_SLUG/YOUR_APP_SLUG --framework packager ``` In CN Cloud, if you go back to the app's [application overview page](/cloud/org-management/application-pages/#application-overview-page), you will see the published release. Make the app public by clicking on the _Make it public_ button in the Danger zone at the bottom of the page. Now users will be able to download the app from the app's public [market page](/cloud/org-management/application-pages/#application-market-page) (linked at the top of the overview page) on CrabNebula Cloud. ## Test the Auto Updater To test the auto updater, you can decrement the version in the `Cargo.toml` file to `1.0.0` to simulate an older version. Afterwards we need to clear the `target/release` folder and rerun the packager: ```sh frame="none" rm -rf target/release/* && cargo packager --release ``` Navigate to `target/release` and run the app. You should see the app window with the version `1.0.0` displayed. The app will check for updates and since an update is available (our initial `2.0.0` version), it will download and install it in the background. If you restart the app you should see the updated version `2.0.0` displayed in the app window. ![Slint Sample App](../../../../assets/guides/packager-auto-updater/slint-app.png) # Tauri with GitHub Actions import { Tabs, TabItem } from "@astrojs/starlight/components"; This guide will walk you through creating a [Tauri](https://tauri.app) app from scratch and setting up a release workflow that leverages CrabNebula Cloud from a GitHub Action. This enables you to automatically build and release your app to CrabNebula Cloud every time you push to `main` and to trigger it manually whenever convenient. Cloud is a great way to distribute your app to your users, providing: - Global asset distribution resulting in faster downloads. - [Automatic application updates](/cloud/guides/auto-updates-tauri): CrabNebula Cloud has **first-class integration** with the Tauri updater to ensure secure delivery of updates automatically to your users. - Nightly application builds/prerelease versions: with this GitHub action, you can ship different application versions to your users, including pre-release variants for staging/trial purposes. ## Requirements To follow this guide you will need: - Rust and Node.js **installed** on your machine - [CrabNebula Cloud](https://crabnebula.dev/cloud) account - [GitHub](https://github.com) account ## Create Your App and Upload to GitHub The first step is to have an app which can be as complex or simple as you wish. If you're not sure where/how to begin, [Tauri](https://tauri.app) is a great place to start. The [Tauri docs](https://tauri.app/start/prerequisites/) list multiple ways of getting started and preparing your app with your Web Framework of choice. Additionally, there are multiple community based templates which can be found in the [Awesome Tauri repository](https://github.com/tauri-apps/awesome-tauri) and at Tauri's Discord _#showcase_ channel. For this guide we will create a new Tauri app. Start from scratch by running the following command: ```sh frame="none" npm create tauri@latest ``` You will be taken through a series of questions to set up your app. If you are unsure about an option, stick to the default settings. In the context of this guide we will call our app `super-tauri-app`. When it comes to choosing a package manager, choose `npm` as it is the package manager we adapted the following GitHub Actions workflow for. Once the app is created, you will see a new directory with the app's name. Change into that directory and you wil find the typical folder structure of a Tauri app. Now we need to make some minor configuration changes to the app. Edit `src-tauri/tauri.conf.json` and change the `version` in the `package` section to `0.1.0`. Also, modify the `identifier` in the `bundle` section to match your app's name and organization. See the following configuration snippets for reference. ```json frame="none" "package": { "productName": "super-tauri-app", "version": "0.1.0" }, ``` ```json frame="none" "bundle": { "active": true, "targets": "all", "identifier": "demo.super-tauri-app", "icon": [ "icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png", "icons/icon.icns", "icons/icon.ico" ] } ``` :::tip Now you can directly test out your newly ceated app by running the following command: ```sh frame="none" npm install && npm exec tauri dev ``` You should see a window pop up with your app running. ::: Finally initialize a new Git repository which you will then have to push to GitHub. If you are not familiar with the process, check out the [GitHub docs](https://docs.github.com/en/migrations/importing-source-code/using-the-command-line-to-import-source-code/adding-locally-hosted-code-to-github#initializing-a-git-repository). ## Set up your app in CrabNebula Cloud After your app is uploaded to your GitHub repo, head over to [CrabNebula Cloud](https://crabnebula.cloud) and sign-in with your GitHub account. You will be asked to [set up an organization](/cloud#set-up-an-organization) and to [create your app](/cloud#create-an-application). ![Create a new application on CrabNebula Cloud](../../../../assets/guides/publish-cloud-github/crabnebula-cloud-new-app.webp) Now it's time to prepare an API key for your GitHub Action. In the organizaion navigation on the top right, click on the **API keys** tab and then on **New API key**. ![Generate API key](../../../../assets/guides/publish-cloud-github/crabnebula-cloud-generate-api-key.webp) Make sure that you enable Read/Write permissions for the API key. Also note that this key will only be shown once, so make sure to save it for the next step. :::tip Remember to fill in the application's description, website and repo on the [application overview page](/cloud/org-management/application-pages/#application-overview-page). This will be shown on the application's [public market page](/cloud/org-management/application-pages/#application-market-page) and will create a better experience for your users. ::: ## Add Cloud API Key to GitHub repo With the CrabNebula Cloud application set up, it's time to add the necessary secrets to your GitHub repository. In GitHub go to your repository settings, and click on the **Secrets and variables** tab in the sidebar and then choose the **Actions** tab right underneath. ![Add secrets to your repository](../../../../assets/guides/publish-cloud-github/github-settings-secret.png) :::danger Environment Secrets will show in your logs as plain text. Add your tokens as **repository secrets**. ::: Now add a secret called `CN_API_KEY` to the **Repository Secrets** and paste your previously generated CrabNebula Cloud API key. If you have any issues creating or updating the secrets, you can check out the [GitHub documentation](https://docs.github.com/en/actions/reference/encrypted-secrets). ### GitHub Action Setup :::tip For more information on how to set up your CI for Cloud with GitHub Actions and tailored workflows for other application types, check out our [CI section](/cloud/ci/overview). ::: Now we are ready to set up the GitHub Action that will build and release your app to CrabNebula Cloud. In your GitHub repository, create a new directory `.github/workflows` and add a new file called `release.yml`. Alternatively you can create a new workflow via the GitHub GUI. ```text .github/ └── workflows/ └── release.yml ``` The `release.yml` is where we are going to add our GitHub Action code. The first block will determine the name and triggers for this action. We want to release automatically everytime `main` is updated, but it's also possible to manually trigger the workflow and to define on-the-fly which app we are working with. The `env` block will set the app slug to the input value or the default value if not provided. Adjust your app slug accordingly. ```yaml title="release.yml" name: "Publish Release" on: push: branches: - main workflow_dispatch: inputs: application: description: "The fully qualified slug of your app on CrabNebula Cloud" required: true default: "my-org/super-tauri-app" env: CN_APPLICATION: ${{ github.event.inputs.application || 'my-org/super-tauri-app' }} ``` The `concurrency` block will prevent multiple releases from happening at the same time. ```yaml title="release.yml" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true ``` Time to define the actual build jobs. We will name them, give them write permissions, and establish a matrix of environments they will run on. The environments will determine which platforms our app will be built for, in this example we're selecting all desktop platforms supported by Tauri (MacOS, Linux, and Windows). First, we create a [release draft](/cloud/cli/create-draft/) job. Thanks to `crabnebula-dev/cloud-release` we just need to call the release command and pass the `api-key` secret we previously set. ```yaml title="release.yml" jobs: draft: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: create draft release uses: crabnebula-dev/cloud-release@v0 with: command: release draft ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} ``` With a draft done, the task can move on to actually build the app. Let's make sure the dependency is explicit in our workflow and establish the strategy and matrix for this pipeline. ```yaml title="release.yml" build: needs: draft strategy: fail-fast: false matrix: os: [ubuntu-22.04, macos-latest, windows-latest] runs-on: ${{ matrix.os }} ``` The above snippet ensures we're building respectively for Linux, MacOS, and Windows, but only after the **draft** job is concluded. The steps will be the same for all platforms and so we can define them only once: ```yaml title="release.yml" steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true - name: install Linux dependencies if: matrix.os == 'ubuntu-22.04' run: | sudo apt-get update sudo apt-get install -y webkit2gtk-4.1 - name: build tauri app run: | npm ci npm exec tauri build - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} path: ./src-tauri ``` With the builds successfully concluded and the [build assets uploaded to CrabNebula Cloud](/cloud/cli/upload-assets/), we can trigger the publishing workflow. This will run only in `ubuntu-latest` since we don't need the multi-system matrix for this task. And it will have only one step, calling the [`release publish`](/cloud/cli/publish-release/) command from the `crabnebula-dev/cloud-release` action. ```yaml title="release.yml" publish: needs: build runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: publish release uses: crabnebula-dev/cloud-release@v0 with: command: release publish ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} ``` With this, our code is ready to be deployed to [CrabNebula Cloud](https://crabnebula.dev/cloud). Merging to `main` will trigger the release and in a few minutes your app will have the correct binaries built and a public changelog including ready-to-share download links available. Check the complete code snippet for the GitHub Action workflow below: ```yaml title="release.yml" name: Publish Release on: push: branches: - main workflow_dispatch: inputs: application: description: "The fully qualified slug of your app on CrabNebula Cloud" required: true default: "my-org/super-tauri-app" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: CN_APPLICATION: ${{ github.event.inputs.application || 'my-org/super-tauri-app' }} jobs: draft: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: create draft release uses: crabnebula-dev/cloud-release@v0 with: command: release draft ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} build: needs: draft strategy: fail-fast: false matrix: os: [ubuntu-22.04, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true - name: install Linux dependencies if: matrix.os == 'ubuntu-22.04' run: | sudo apt-get update sudo apt-get install -y webkit2gtk-4.1 - name: build tauri app run: | npm ci npm exec tauri build - name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} path: ./src-tauri publish: needs: build runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: publish release uses: crabnebula-dev/cloud-release@v0 with: command: release publish ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }} ``` ## Testing the GitHub Action Just by committing and pushing to `main` you will trigger the GitHub Action. You can also manually trigger the workflow by going to the Actions tab in your repository and selecting the workflow you want to run. You will be prompted to enter the app slug, which you can leave unmodified if you want to use the default value. After you trigger the workflow, you can check the progress in the Actions tab on GitHub. If everything goes well, you will see a new release in your CrabNebula Cloud [Application Overview Page](/cloud/org-management/application-pages/#application-overview-page). You can check the release status and download the binaries from the [Releases](/cloud/org-management/application-pages/#releases) tab. Choose the right format for your platform, download the binary and run it. Now in order to test the automatic release process, make a change to your app, adjust the version number in `src-tauri/tauri.conf.json` and push the changes to `main`. After a few minutes, you will see a new release in CrabNebula Cloud. For example you could change the _Welcome to Tauri!_ heading in `index.html` and version number in `src-tauri/tauri.conf.json` to `0.1.1`. After pushing and letting the CI pipeline finish, redownload the app from CrabNebula Cloud and you should see the updated heading. ## Final Thoughts With this setup, you can now have your app automatically built and released to [CrabNebula Cloud](https://crabnebula.dev/cloud). This is a great way to keep your app up-to-date and easily shareable with your users. If you have any issues, feel free to reach out at the [CrabNebula Discord](https://discord.gg/W2MNdXVgjD) or the [Tauri Discord](https://discord.gg/tauri). # Application Pages This section provides an overview of the two application pages in CrabNebula Cloud: the private [application overview page](#application-overview-page) and the public [application market page](#application-market-page). ## Application Overview Page The overview page of an application allows you to manage the application and its releases. At the very top right you can catch a glimpse of the applications status which includes: - Asset count - Download count - Visibility: Either _public_ or _private_ If the application is public, a link to the market page is also provided just beneath the applications title. The application overview page is divided into the following sections: ### Get Started Depending on what kind of application type you configured when creating the application, you will see a different set of tiles at the top of the page. This section is meant to provide you with a quick overview of steps you can take to get the most out of CrabNebula Cloud. #### Releasing For example, depending on whether you want to create a release manually or automate the process, you can choose between the following options: - **Publish Manually**: If you want to create a release manually, you will be taken to a step by step guide with the commands outlined in the release process. For further in-depth explanations, you can follow the steps described in the Release Process starting with the [Create a Release](/cloud/cli/create-draft) page. - **Setup your CI/CD**: If you want to automate the release process, the tile will take you to the [Continuous Integration section](/cloud/ci/overview) of this documentation. #### Share your Application Once you [published a release](/cloud/cli/publish-release), you will be able to share your application with end users. CrabNebula Cloud allows you generate a download button which can be embedded into any website and detects the users OS to provide the correct download link for the respective asset. After clicking on the _Share your app_ tile, you are prompted to complete the applications metadata and description. Once you have done that, you will have to make the entire application public, so that it can be accessed by end users and a market page is created. Afterwards you just need to select the respective asset for each OS. :::note Your asset filename or public platform must be stable across releases! ::: CrabNebula Cloud will provide you with a code snippet that you can embed in your website to allow users to download your application directly from your website. We provide templates for Vanilla CSS and Tailwind CSS. #### Tauri Updater If you created a [Tauri app](https://tauri.app/), a tile which shows you how to configure Tauri updater is shown. You will need to generate signing keys first. CrabNebula Cloud provides you with a configuration snippet where you have to insert your public key. Include this snippet in your `src-tauri/tauri.conf.json` file. For more information on how to use the updater, see the [Tauri updater](https://tauri.app/plugin/updater/) docs. :::tip Should you be new to Tauri, get started right away by clicking on the _Bootstrap you application_ tile which shows you [how to build your first Tauri application](https://tauri.app/start/prerequisites/). ::: ### About This section includes the following information: - **Description**: Used on the Market page for public applications. Supports markdown styling which can be previewed from the Web UI. - **Website**: A link to the application's website. - **Repository**: A link to the application's repository. ### Releases The releases section consists of a list of drafts and published releases of the app. For starting of with a new release click the button at the top right of the page. Clicking on an existing release will take you to the an overview page where you can manage the release, download the release assets and delete the release if it has not been published yet. ### Danger Zone Here you are able to delete the application or change its visibility. :::note Changes to the visibility of an application will affect the visibility of the market page. If an application is made private after being public, the market page will no longer display the applications metadata. However, the market page will still provide download options for users who have the direct asset links or CDN URLs. ::: :::danger Deletions are permanent and cannot be reversed. Deleting an application will also delete all of its releases and assets. ::: ## Application Market Page When an application is set to public, the market page for end users is created. It provides users with information about the application and gives them the ability to download the application. ### Downloads In the left sidebar users see a downloads section which matches the OS bundle types with the current user's operating system: - **Linux users** see a button for `deb`, `rpm`, `appimage` or `pacman` bundles. - **macOS users** have a button for `.dmg` files. - **Windows users** see `nsis` or `wix` installers. :::note The format for _Tauri_ and _cargo-packager_ applications is `$bundle-$arch` where `$bundle` is one of `deb`, `rpm`, `appimage`, `pacman`, `dmg`, `nsis` and `wix` and `$arch` is either `x86_64` or `aarch64`. ::: :::tip For applications with custom public platform formats, we also display a dedicated download button if the public_platform starts with `linux`, `darwin`, `macos`, or `windows`. ::: Below the download section users see information about the latest release of the app including the version number and release date. ### Description On the right side of the page, users can see the applications description in rendered Markdown styling and the applications metadata. This includes the applications website and repository. # Billing & Usage On this page you can find information on managing your CrabNebula Cloud usage, fair-use policies, and invoices. Since June 19th, CrabNebula Cloud is free for everyone, with advanced features unlocked at no cost. :::tip[Welcome to Free] CrabNebula Cloud is now free for everyone. There are no monthly fees, no subscription tiers, and no credit card required to start using the platform. ::: We removed the paywall so you can focus on building. For details on how this works and the limits that keep the system fast for everyone, read on. ## How It Works Now Unlike before, there are no subscription plans to select. Every account automatically receives our top-tier features—including advanced insights and full [DevTools](/cloud/org-management/invite-member/#devtools-access) access—starting immediately. You only need to worry about billing if: 1. You are a large-scale user whose traffic significantly exceeds standard patterns. 2. You specifically request a custom enterprise arrangement. If neither of these applies to you, you can skip straight to the **Usage** section below. ## Usage Guidelines To ensure the platform remains fast and reliable for the entire Tauri community, we apply two simple fair-use rules. These are designed to prevent abuse, not to limit normal development work. :::note[Storage Cleanup] **Inactive releases are cleaned up.** A release that sees no downloads for 90 days will be removed to save space. However, your *latest* release on every channel is always protected. This rule starts counting on **July 1st**, meaning no deletions will occur before the end of September. ::: :::caution[Traffic Limits] **High-traffic patterns are monitored.** We don't set a fixed number for downloads, but we watch for traffic that is well outside ordinary usage (e.g., sudden, massive spikes). If your account crosses into this zone, we will contact you first to discuss what we're seeing before taking any action like throttling. ::: If your project is growing and you anticipate pushing past these standard limits, please [contact us](https://crabnebula.dev/contact/) so we can work out a custom arrangement that fits your scale. ### What Happens If You Hit Limits? In the rare event that you exceed fair use, we won't cut you off without warning. Our process is: 1. **Notification:** We contact you to explain the traffic or storage anomaly. 2. **Discussion:** We talk through your usage patterns. 3. **Resolution:** We either adjust your specific case or move you to a tailored enterprise plan. For 99% of users, these limits will never be an issue. ## Billing Details Since the service is free, most users will never see a billing page. However, if you have an existing paid account transitioning to the new model, or if you require a custom plan, here is how billing works. ### No Credit Card Required You do **not** need to enter payment details to create an account, upload releases, or use DevTools. The barrier to entry has been removed. ### Invoices Even though the service is free, you may still need invoices for internal accounting records or for custom enterprise arrangements. - If you have a custom plan, all invoices will appear at the bottom of your dashboard. - You can download them as PDF by clicking the button next to each entry. :::note[Legacy Accounts] If you were previously on a paid plan, your subscription has been converted to the free tier automatically. You will receive a confirmation email regarding your billing changes, but no further action is required on your part. ::: ## Frequently Asked Questions ### Do I need to cancel my old subscription? No. On **June 19th**, all accounts were automatically upgraded to the free tier. Your existing subscription was cancelled on our end, and you will no longer be charged. Check your email for a final billing notification confirming this change. ### Is the "Open Source Plan" still available? Yes, but in a different way. Previously, open-source projects could apply for special discounts. Now, *everyone* gets those benefits for free. You don't need to apply; the plan is active by default. ### What if I'm a huge company with millions of downloads? We love seeing Tauri scale! If your usage is far beyond typical developer needs (think millions of updates per day), please reach out via our [contact form](https://crabnebula.dev/contact/). We'd love to build a partnership that supports your specific infrastructure needs. ### Can I still get support? Absolutely. Whether you are a solo developer or a large team, our support channels remain open. If you encounter issues with your builds or the platform, just let us know. # Create API Key An API key is used to authenticate to the Cloud Platform when using the [CLI](/cloud/cli/install). To create an API key: 1. Open "Settings" in the Cloud Platform. 2. Select "New API key". 3. Give the key a name, an expiration, and select the scope. A "Read, write" scope is required for creating drafts, uploading assets, and publishing releases from the CrabNebula Cloud CLI. # Member Management Organizations allow you to collaborate with others on your applications. In order to achieve this you can invite anyone to become a member of your organization via email. There are two types of roles with different permissions: - **Member** - Ability to edit applications (includes deleting them and changing their visibility) - Ability to create new applications within the organization - **Admin** - Includes all of the permissions of a _member_ - Ability to modify the organization's members, settings, and billing After you [created an organization](/cloud/#set-up-an-organization), go to the _Members_ section in the _Organization_ menu. You will see all the current members including their roles as well as the pending member invitations below. Click the _Invite new member_ button at the top right and enter the email address and choose the role of the person you want to invite. After confirming, the user will receive an email with a link to accept the invitation. :::note Invitations are valid for 7 days and can be revoked during that time from the _Pending Invitations_ section. Should you need to resend the invitation email, you can do so from here as well. ::: If the user does not have a CrabNebula Cloud account yet, they will be prompted to sign up with GitHub before accepting the invitation. ## Modifying Members If you are an admin of the organization, you can modify its members. This includes changing their role and removing them from the organization. To achieve this, go to the _Members_ section in the _Organization_ menu. At the top you will see a list of all the current members followed by pending member invitations. Here you can change the role of a member or remove them from the organization at any time. ### DevTools Access DevTools Premium is an enhanced version of [DevTools](https://crabnebula.dev/devtools/). Every member of your organization can be granted access to DevTools Premium individually, at no cost — it is included for everyone on CrabNebula Cloud. Below the members list there is a _DevTools Seats_ section where you can find the list of members that has a DevTools seat assigned. In the _Search Members without seats_ input you can select the members to grant access to DevTools Premium. After assigning the seat, members will be able to sign in to DevTools Premium with their CrabNebula Cloud account. # Architecture At the time of writing, we currently do not offer a publicly available architecture diagram. While we work to develop one that is accessible without requiring significant investment from the team as things evolve, we've chosen to highlight some of the key systems involved. import { Image } from "astro:assets"; ## Cloud Providers Cloud providers underpin most software as a service offerings today. When developing the cloud, we chose to leverage Amazon Web Services (AWS) as our control plane and Cloudflare as our edge (or data) plane. import aws from "@assets/cloud/architecture/aws.svg"; import cloudflare from "@assets/cloud/architecture/cloudflare.svg";
Amazon Web Services Cloudflare
## Notable Open-Source Projects Like most companies out there, much of our operations stack is composed of open source tooling. This includes everything from our certificate management system, to our network mesh, and metrics store. import kubernetes from "@assets/cloud/architecture/kubernetes.svg"; import certManager from "@assets/cloud/architecture/cert-manager.svg"; import linkerd from "@assets/cloud/architecture/linkerd.svg"; import ory from "@assets/cloud/architecture/ory.png"; import loki from "@assets/cloud/architecture/loki.svg"; import grafana from "@assets/cloud/architecture/grafana.svg"; import grafanaTempo from "@assets/cloud/architecture/grafana-tempo.svg"; import prometheus from "@assets/cloud/architecture/prometheus.svg"; import traefik from "@assets/cloud/architecture/traefik.svg";
Kubernetes cert-manager Linkerd Ory Loki Grafana Tempo Prometheus Traefik
## Languages Finally, the services that we write and deploy are written using one of two languages. Rust is used to write and deploy several of our backend services including our authentication and billing systems. NodeJS is used for our web and any Cloudflare Worker processes. Some of our Cloudflare Workers may eventually be written in Rust as that integration becomes more supported. import rust from "@assets/cloud/architecture/rust.png"; import nodeJs from "@assets/cloud/architecture/nodejs.svg";
Rust NodeJS
# Third-Party Libraries Most software today leverages open source software to some extent. In the table found below, you will find the various third-party software libraries that were used to help develop our private platform. This table also includes which version of the software was used, as well as the license associated with that piece of software. This table is periodically generated using the SBOM export from GitHub's Dependency Graph (found under insights). The downloaded JSON file is then passed through `spdx-fmt` to render the table. ### GitHub Actions | Library | Version | License | | ------------------------------------------------ | ------------------------------------------ | ------- | | `actions:1password/install-cli-action` | `143a85f84a90555d121cde2ff5872e393a47ab9f` | `` | | `actions:1password/load-secrets-action` | `1.*.*` | `` | | `actions:AnimMouse/setup-rclone` | `1a535c480a89e3990d2a0015ea21f6fa3eb1fdc4` | `` | | `actions:Swatinem/rust-cache` | `2.*.*` | `` | | `actions:actions-rust-lang/setup-rust-toolchain` | `1.*.*` | `` | | `actions:actions/cache` | `4.*.*` | `` | | `actions:actions/cache` | `3.*.*` | `` | | `actions:actions/checkout` | `4.*.*` | `` | | `actions:actions/checkout` | `3.*.*` | `` | | `actions:actions/download-artifact` | `4.*.*` | `` | | `actions:actions/github-script` | `7.*.*` | `` | | `actions:actions/setup-node` | `3.*.*` | `` | | `actions:actions/setup-node` | `4.*.*` | `` | | `actions:actions/upload-artifact` | `4.*.*` | `` | | `actions:amannn/action-semantic-pull-request` | `5.*.*` | `` | | `actions:ataylorme/eslint-annotate-action` | `3.*.*` | `` | | `actions:aws-actions/amazon-ecr-login` | `1.*.*` | `` | | `actions:aws-actions/configure-aws-credentials` | `2.*.*` | `` | | `actions:cloudflare/wrangler-action` | `3.*.*` | `` | | `actions:crabnebula-dev/codesign-action` | `main` | `` | | `actions:docker/build-push-action` | `4.*.*` | `` | | `actions:docker/metadata-action` | `4.*.*` | `` | | `actions:docker/setup-buildx-action` | `2.*.*` | `` | | `actions:dorny/paths-filter` | `3.*.*` | `` | | `actions:hoverkraft-tech/compose-action` | `2.0.1` | `` | | `actions:mamezou-tech/setup-helmfile` | `03233e1cd9b19b2ba320e431f7bcc0618db4248d` | `` | | `actions:mshick/add-pr-comment` | `2.*.*` | `` | | `actions:pascalgn/automerge-action` | `0.16.3` | `` | | `actions:peter-evans/create-pull-request` | `c5a7806660adbe173f04e3e038b0ccdcd758773c` | `` | | `actions:pnpm/action-setup` | `4.*.*` | `` | | `actions:rustsec/audit-check` | `2.0.0` | `` | ### JavaScript | Library | Version | License | | ------------------------------------- | ---------------- | -------------- | | `npm:@chargebee/chargebee-js-types` | `^ 1.0.1` | `` | | `npm:@cloudflare/vitest-pool-workers` | `0.4.26` | `MIT` | | `npm:@cloudflare/workers-types` | `^ 4.20231121.0` | `` | | `npm:@fabien0102/tailwind-aria` | `^ 1.0.0` | `` | | `npm:@felte/common` | `^ 1.1.8` | `` | | `npm:@felte/reporter-tippy` | `^ 1.1.9` | `` | | `npm:@felte/solid` | `^ 1.2.13` | `` | | `npm:@kobalte/core` | `^ 0.13.3` | `` | | `npm:@kobalte/tailwindcss` | `^ 0.9.0` | `` | | `npm:@microlabs/otel-cf-workers` | `1.0.0-rc.45` | `BSD-3-Clause` | | `npm:@opentelemetry/api` | `1.9.0` | `Apache-2.0` | | `npm:@ory/keto-namespace-types` | `0.11.1-alpha.0` | `` | | `npm:@rspc/client` | `0.2.4` | `MIT` | | `npm:@rspc/solid-query` | `^ 0.2.4` | `` | | `npm:@serenity-js/assertions` | `^ 3.25.1` | `` | | `npm:@serenity-js/console-reporter` | `^ 3.25.1` | `` | | `npm:@serenity-js/core` | `^ 3.25.1` | `` | | `npm:@serenity-js/mocha` | `^ 3.25.1` | `` | | `npm:@serenity-js/rest` | `^ 3.25.1` | `` | | `npm:@serenity-js/serenity-bdd` | `^ 3.25.1` | `` | | `npm:@serenity-js/web` | `^ 3.25.1` | `` | | `npm:@serenity-js/webdriverio` | `^ 3.25.1` | `` | | `npm:@solid-primitives/script-loader` | `^ 2.2.0` | `` | | `npm:@solid-primitives/storage` | `^ 2.1.4` | `` | | `npm:@solidjs/router` | `^ 0.14.1` | `` | | `npm:@solidjs/testing-library` | `^ 0.8.8` | `` | | `npm:@tanstack/solid-query` | `^ 5.51.2` | `` | | `npm:@tanstack/solid-query-devtools` | `^ 5.51.2` | `` | | `npm:@tanstack/solid-table` | `^ 8.19.3` | `` | | `npm:@testing-library/jest-dom` | `^ 6.4.6` | `` | | `npm:@types/hast` | `^ 3.0.4` | `` | | `npm:@types/jest` | `^ 29.5.11` | `` | | `npm:@types/jquery` | `^ 3.5.30` | `` | | `npm:@types/js-cookie` | `^ 3.0.6` | `` | | `npm:@types/mocha` | `^ 10.0.7` | `` | | `npm:@types/node` | `^ 20.14.10` | `` | | `npm:@vitest/runner` | `~> 1.5.0` | `` | | `npm:@vitest/snapshot` | `~> 1.5.0` | `` | | `npm:@wdio/cli` | `^ 8.39.1` | `` | | `npm:@wdio/dot-reporter` | `^ 8.39.0` | `` | | `npm:@wdio/globals` | `^ 8.39.1` | `` | | `npm:@wdio/local-runner` | `^ 8.39.1` | `` | | `npm:@wdio/spec-reporter` | `^ 8.39.0` | `` | | `npm:@wdio/types` | `^ 8.39.0` | `` | | `npm:autoprefixer` | `^ 10.4.19` | `` | | `npm:case` | `^ 1.6.3` | `` | | `npm:chromedriver` | `^ 123.0.4` | `` | | `npm:clsx` | `^ 2.1.1` | `` | | `npm:commander` | `^ 11.1.0` | `` | | `npm:eslint` | `^ 8.57.0` | `` | | `npm:eslint-plugin-solid` | `^ 0.14.1` | `` | | `npm:eslint-plugin-tailwindcss` | `^ 3.17.4` | `` | | `npm:glob` | `^ 10.3.10` | `` | | `npm:hono` | `^ 4.5.0` | `` | | `npm:jest` | `^ 29.7.0` | `` | | `npm:jose` | `^ 4.15.5` | `` | | `npm:jsdom` | `^ 22.1.0` | `` | | `npm:mocha` | `^ 10.6.0` | `` | | `npm:node-fetch` | `^ 3.3.2` | `` | | `npm:npm-failsafe` | `^ 1.2.1` | `` | | `npm:npm-run-all2` | `^ 5.0.0` | `` | | `npm:postcss` | `^ 8.4.39` | `` | | `npm:randomstring` | `^ 1.3.0` | `` | | `npm:rehype-raw` | `^ 6.1.1` | `` | | `npm:rehype-sanitize` | `^ 6.0.0` | `` | | `npm:remark-gfm` | `3.0.1` | `MIT` | | `npm:rimraf` | `^ 5.0.9` | `` | | `npm:shiki` | `^ 1.10.3` | `` | | `npm:solid-confetti-explosion` | `^ 1.1.8` | `` | | `npm:solid-js` | `^ 1.8.18` | `` | | `npm:solid-markdown` | `^ 2.0.13` | `` | | `npm:tailwind-scrollbar` | `^ 3.1.0` | `` | | `npm:tailwindcss` | `^ 3.4.4` | `` | | `npm:tippy.js` | `^ 6.3.7` | `` | | `npm:ts-jest` | `^ 29.1.1` | `` | | `npm:ts-morph` | `^ 20.0.0` | `` | | `npm:ts-node` | `^ 10.9.2` | `` | | `npm:ts-pattern` | `^ 5.2.0` | `` | | `npm:typescript` | `^ 5.3.3` | `` | | `npm:ulidx` | `^ 2.2.1` | `` | | `npm:vite` | `^ 5.4.7` | `` | | `npm:vite-plugin-solid` | `^ 2.10.2` | `` | | `npm:vitest` | `^ 1.6.0` | `` | | `npm:vitest` | `1.5.3` | `MIT` | | `npm:vitest-github-actions-reporter` | `^ 0.11.1` | `` | | `npm:wrangler` | `^ 3.32.0` | `` | | `npm:zod` | `^ 3.22.4` | `` | ### Rust | Library | Version | License | | ------------------------------------------------ | ------------------------------- | ------------------------------------------------------- | | `rust:Inflector` | `0.11.4` | `BSD-2-Clause` | | `rust:addr2line` | `0.22.0` | `Apache-2.0 OR MIT` | | `rust:adler` | `1.0.2` | `0BSD AND Apache-2.0 AND MIT` | | `rust:ahash` | `0.8.11` | `MIT OR Apache-2.0` | | `rust:aho-corasick` | `1.1.3` | `Unlicense OR MIT` | | `rust:allocator-api2` | `0.2.18` | `MIT OR Apache-2.0` | | `rust:android-tzdata` | `0.1.1` | `MIT OR Apache-2.0` | | `rust:android_system_properties` | `0.1.5` | `MIT OR Apache-2.0` | | `rust:anstream` | `0.6.14` | `MIT OR Apache-2.0` | | `rust:anstyle` | `1.0.7` | `MIT OR Apache-2.0` | | `rust:anstyle-parse` | `0.2.4` | `MIT OR Apache-2.0` | | `rust:anstyle-query` | `1.1.0` | `MIT OR Apache-2.0` | | `rust:anstyle-wincon` | `3.0.3` | `MIT OR Apache-2.0` | | `rust:anyhow` | `1.0.86` | `MIT OR Apache-2.0` | | `rust:arrayref` | `0.3.7` | `BSD-2-Clause` | | `rust:arrayvec` | `0.7.4` | `MIT OR Apache-2.0` | | `rust:assert-json-diff` | `2.0.2` | `MIT` | | `rust:async-channel` | `1.9.0` | `Apache-2.0 OR MIT` | | `rust:async-once-cell` | `0.5.3` | `MIT OR Apache-2.0` | | `rust:async-stream` | `0.3.5` | `MIT` | | `rust:async-stream-impl` | `0.3.5` | `MIT` | | `rust:async-trait` | `0.1.80` | `MIT OR Apache-2.0` | | `rust:atomic` | `0.6.0` | `Apache-2.0 OR MIT` | | `rust:atomic-waker` | `1.1.2` | `Apache-2.0 OR MIT` | | `rust:autocfg` | `1.3.0` | `Apache-2.0 OR MIT` | | `rust:axum` | `0.6.20` | `MIT` | | `rust:axum` | `0.7.5` | `MIT` | | `rust:axum-core` | `0.3.4` | `MIT` | | `rust:axum-core` | `0.4.3` | `MIT` | | `rust:axum-extra` | `>= 0.9.3,< 0.10.0` | `` | | `rust:axum-extra` | `0.9.3` | `MIT` | | `rust:axum-tracing-opentelemetry` | `0.18.1` | `CC0-1.0` | | `rust:backtrace` | `0.3.73` | `MIT OR Apache-2.0` | | `rust:base16ct` | `0.2.0` | `Apache-2.0 OR MIT` | | `rust:base64` | `0.22.1` | `MIT OR Apache-2.0` | | `rust:base64` | `0.13.1` | `MIT OR Apache-2.0` | | `rust:base64` | `0.21.7` | `MIT OR Apache-2.0` | | `rust:base64ct` | `1.6.0` | `Apache-2.0 OR MIT` | | `rust:bitflags` | `1.3.2` | `MIT OR Apache-2.0` | | `rust:bitflags` | `2.5.0` | `MIT OR Apache-2.0` | | `rust:bitvec` | `1.0.1` | `MIT` | | `rust:blake3` | `>= 1.4.1,< 2.0.0` | `` | | `rust:blake3` | `1.5.1` | `CC0-1.0 OR Apache-2.0` | | `rust:block-buffer` | `0.10.4` | `MIT OR Apache-2.0` | | `rust:bson` | `2.11.0` | `MIT` | | `rust:bumpalo` | `3.16.0` | `MIT OR Apache-2.0` | | `rust:bytecount` | `0.6.8` | `Apache-2.0 OR MIT` | | `rust:bytemuck` | `1.16.0` | `Zlib OR (Apache-2.0 OR MIT)` | | `rust:byteorder` | `1.5.0` | `Unlicense OR MIT` | | `rust:bytes` | `1.7.1` | `MIT` | | `rust:bytes` | `>= 1.7.0,< 2.0.0` | `` | | `rust:cc` | `1.0.99` | `MIT OR Apache-2.0` | | `rust:cfg-if` | `1.0.0` | `Apache-2.0 OR MIT` | | `rust:chrono` | `>= 0.4.0,< 0.5.0` | `` | | `rust:chrono` | `0.4.38` | `MIT OR Apache-2.0` | | `rust:chumsky` | `0.9.3` | `MIT` | | `rust:clap` | `4.5.7` | `MIT OR Apache-2.0` | | `rust:clap_builder` | `4.5.7` | `MIT OR Apache-2.0` | | `rust:clap_derive` | `4.5.5` | `MIT OR Apache-2.0` | | `rust:clap_lex` | `0.7.1` | `MIT OR Apache-2.0` | | `rust:colorchoice` | `1.0.1` | `MIT OR Apache-2.0` | | `rust:concurrent-queue` | `2.5.0` | `Apache-2.0 OR MIT` | | `rust:const-oid` | `0.9.6` | `Apache-2.0 OR MIT` | | `rust:constant_time_eq` | `0.3.0` | `CC0-1.0 OR (MIT-0 OR Apache-2.0)` | | `rust:convert_case` | `0.4.0` | `MIT` | | `rust:cookie` | `0.18.1` | `MIT OR Apache-2.0` | | `rust:core-foundation` | `0.9.4` | `MIT OR Apache-2.0` | | `rust:core-foundation-sys` | `0.8.6` | `MIT OR Apache-2.0` | | `rust:cpufeatures` | `0.2.12` | `MIT OR Apache-2.0` | | `rust:crossbeam-channel` | `0.5.13` | `MIT OR Apache-2.0` | | `rust:crossbeam-utils` | `0.8.20` | `MIT OR Apache-2.0` | | `rust:crossterm` | `0.25.0` | `MIT` | | `rust:crossterm_winapi` | `0.9.1` | `MIT` | | `rust:crypto-bigint` | `0.5.5` | `Apache-2.0 OR MIT` | | `rust:crypto-common` | `0.1.6` | `MIT OR Apache-2.0` | | `rust:curve25519-dalek` | `4.1.3` | `BSD-3-Clause` | | `rust:curve25519-dalek-derive` | `0.1.1` | `MIT OR Apache-2.0` | | `rust:darling` | `0.20.9` | `MIT` | | `rust:darling` | `0.13.4` | `MIT` | | `rust:darling_core` | `0.20.9` | `MIT` | | `rust:darling_core` | `0.13.4` | `MIT` | | `rust:darling_macro` | `0.20.9` | `MIT` | | `rust:darling_macro` | `0.13.4` | `MIT` | | `rust:dashmap` | `5.5.3` | `MIT` | | `rust:data-encoding` | `2.6.0` | `MIT` | | `rust:deadpool` | `0.9.5` | `MIT OR Apache-2.0` | | `rust:deadpool-runtime` | `0.1.4` | `MIT OR Apache-2.0` | | `rust:der` | `0.7.9` | `Apache-2.0 OR MIT` | | `rust:deranged` | `0.3.11` | `MIT OR Apache-2.0` | | `rust:derivative` | `2.2.0` | `Apache-2.0 AND MIT` | | `rust:derive_more` | `0.99.17` | `MIT` | | `rust:digest` | `0.10.7` | `MIT OR Apache-2.0` | | `rust:dirs` | `>= 5.0.1,< 6.0.0` | `` | | `rust:dirs` | `5.0.1` | `MIT OR Apache-2.0` | | `rust:dirs-sys` | `0.4.1` | `MIT OR Apache-2.0` | | `rust:displaydoc` | `0.2.4` | `MIT OR Apache-2.0` | | `rust:document-features` | `0.2.8` | `MIT OR Apache-2.0` | | `rust:dyn-clone` | `1.0.17` | `MIT OR Apache-2.0` | | `rust:ecdsa` | `0.16.9` | `Apache-2.0 OR MIT` | | `rust:ed25519` | `2.2.3` | `Apache-2.0 OR MIT` | | `rust:ed25519-dalek` | `2.1.1` | `BSD-3-Clause` | | `rust:either` | `1.12.0` | `MIT OR Apache-2.0` | | `rust:elliptic-curve` | `0.13.8` | `Apache-2.0 OR MIT` | | `rust:email-encoding` | `0.3.0` | `MIT OR Apache-2.0` | | `rust:email_address` | `0.2.4` | `MIT` | | `rust:encoding_rs` | `0.8.34` | `(Apache-2.0 OR MIT) AND BSD-3-Clause` | | `rust:enum-as-inner` | `0.4.0` | `MIT OR Apache-2.0` | | `rust:equivalent` | `1.0.1` | `Apache-2.0 OR MIT` | | `rust:errno` | `0.3.9` | `MIT OR Apache-2.0` | | `rust:event-listener` | `2.5.3` | `Apache-2.0 OR MIT` | | `rust:fastrand` | `2.1.0` | `Apache-2.0 OR MIT` | | `rust:fastrand` | `1.9.0` | `Apache-2.0 OR MIT` | | `rust:ff` | `0.13.0` | `MIT OR Apache-2.0` | | `rust:fiat-crypto` | `0.2.9` | `MIT OR Apache-2.0 OR BSD-1-Clause` | | `rust:figment` | `0.10.19` | `MIT OR Apache-2.0` | | `rust:fnv` | `1.0.7` | `Apache-2.0 AND MIT` | | `rust:foreign-types` | `0.3.2` | `MIT OR Apache-2.0` | | `rust:foreign-types-shared` | `0.1.1` | `MIT OR Apache-2.0` | | `rust:form_urlencoded` | `1.2.1` | `MIT OR Apache-2.0` | | `rust:funty` | `2.0.0` | `MIT` | | `rust:futures` | `0.3.30` | `MIT OR Apache-2.0` | | `rust:futures-channel` | `0.3.30` | `MIT OR Apache-2.0` | | `rust:futures-core` | `0.3.30` | `MIT OR Apache-2.0` | | `rust:futures-executor` | `0.3.30` | `MIT OR Apache-2.0` | | `rust:futures-io` | `0.3.30` | `MIT OR Apache-2.0` | | `rust:futures-lite` | `1.13.0` | `Apache-2.0 OR MIT` | | `rust:futures-macro` | `0.3.30` | `MIT OR Apache-2.0` | | `rust:futures-sink` | `0.3.30` | `MIT OR Apache-2.0` | | `rust:futures-task` | `0.3.30` | `MIT OR Apache-2.0` | | `rust:futures-timer` | `3.0.3` | `MIT OR Apache-2.0` | | `rust:futures-util` | `0.3.30` | `MIT OR Apache-2.0` | | `rust:futures-util` | `>= 0.3.30,< 0.4.0` | `` | | `rust:generic-array` | `0.14.7` | `MIT` | | `rust:getrandom` | `0.2.15` | `MIT OR Apache-2.0` | | `rust:getrandom` | `0.1.16` | `MIT OR Apache-2.0` | | `rust:gimli` | `0.29.0` | `MIT OR Apache-2.0` | | `rust:glob` | `>= 0.3.0,< 0.4.0` | `` | | `rust:glob` | `0.3.1` | `MIT OR Apache-2.0` | | `rust:group` | `0.13.0` | `MIT OR Apache-2.0` | | `rust:h2` | `0.3.26` | `MIT` | | `rust:h2` | `0.4.5` | `MIT` | | `rust:hashbrown` | `0.14.5` | `MIT OR Apache-2.0` | | `rust:hashbrown` | `0.12.3` | `MIT OR Apache-2.0` | | `rust:heck` | `0.4.1` | `MIT OR Apache-2.0` | | `rust:heck` | `0.5.0` | `MIT OR Apache-2.0` | | `rust:hermit-abi` | `0.3.9` | `MIT OR Apache-2.0` | | `rust:hex` | `0.4.3` | `MIT OR Apache-2.0` | | `rust:hex` | `>= 0.4.0,< 0.5.0` | `` | | `rust:hex-literal` | `>= 0.4.1,< 0.5.0` | `` | | `rust:hex-literal` | `0.4.1` | `MIT OR Apache-2.0` | | `rust:hkdf` | `0.12.4` | `MIT OR Apache-2.0` | | `rust:hmac` | `0.12.1` | `MIT OR Apache-2.0` | | `rust:hostname` | `0.4.0` | `MIT` | | `rust:hostname` | `0.3.1` | `MIT` | | `rust:http` | `1.1.0` | `MIT OR Apache-2.0` | | `rust:http` | `0.2.12` | `MIT OR Apache-2.0` | | `rust:http-body` | `1.0.0` | `MIT` | | `rust:http-body` | `0.4.6` | `MIT` | | `rust:http-body-util` | `0.1.2` | `MIT` | | `rust:http-serde` | `2.1.1` | `Apache-2.0 OR MIT` | | `rust:http-serde` | `>= 2.1.0,< 3.0.0` | `` | | `rust:http-types` | `2.12.0` | `MIT OR Apache-2.0` | | `rust:httparse` | `1.9.3` | `MIT OR Apache-2.0` | | `rust:httpdate` | `1.0.3` | `MIT OR Apache-2.0` | | `rust:humantime` | `2.1.0` | `Apache-2.0 OR (Apache-2.0 AND MIT)` | | `rust:hyper` | `1.3.1` | `MIT` | | `rust:hyper` | `0.14.29` | `MIT` | | `rust:hyper-rustls` | `0.24.2` | `Apache-2.0 OR (ISC OR MIT)` | | `rust:hyper-rustls` | `0.26.0` | `Apache-2.0 OR (ISC OR MIT)` | | `rust:hyper-timeout` | `0.4.1` | `Apache-2.0 OR MIT` | | `rust:hyper-tls` | `0.6.0` | `MIT OR Apache-2.0` | | `rust:hyper-tls` | `0.5.0` | `MIT OR Apache-2.0` | | `rust:hyper-util` | `0.1.5` | `MIT` | | `rust:iana-time-zone` | `0.1.60` | `MIT OR Apache-2.0` | | `rust:iana-time-zone-haiku` | `0.1.2` | `MIT OR Apache-2.0` | | `rust:icu_collections` | `1.5.0` | `Unicode-3.0` | | `rust:icu_locid` | `1.5.0` | `Unicode-3.0` | | `rust:icu_locid_transform` | `1.5.0` | `Unicode-3.0` | | `rust:icu_locid_transform_data` | `1.5.0` | `` | | `rust:icu_normalizer` | `1.5.0` | `` | | `rust:icu_normalizer_data` | `1.5.0` | `` | | `rust:icu_properties` | `1.5.0` | `` | | `rust:icu_properties_data` | `1.5.0` | `Unicode-3.0` | | `rust:icu_provider` | `1.5.0` | `Unicode-3.0` | | `rust:icu_provider_macros` | `1.5.0` | `Unicode-3.0` | | `rust:ident_case` | `1.0.1` | `MIT OR Apache-2.0` | | `rust:idna` | `0.5.0` | `MIT OR Apache-2.0` | | `rust:idna` | `1.0.0` | `MIT OR Apache-2.0` | | `rust:idna` | `0.4.0` | `MIT OR Apache-2.0` | | `rust:idna` | `0.2.3` | `MIT OR Apache-2.0` | | `rust:indexmap` | `1.9.3` | `Apache-2.0 OR MIT` | | `rust:indexmap` | `2.2.6` | `Apache-2.0 OR MIT` | | `rust:indoc` | `1.0.9` | `MIT OR Apache-2.0` | | `rust:infer` | `0.2.3` | `MIT` | | `rust:inlinable_string` | `0.1.15` | `Apache-2.0 OR MIT` | | `rust:inquire` | `0.6.2` | `MIT` | | `rust:inquire` | `>= 0.6.0,< 0.7.0` | `` | | `rust:instant` | `0.1.13` | `BSD-3-Clause` | | `rust:ipconfig` | `0.3.2` | `MIT OR Apache-2.0` | | `rust:ipnet` | `2.9.0` | `MIT OR Apache-2.0` | | `rust:is_terminal_polyfill` | `1.70.0` | `MIT OR Apache-2.0` | | `rust:itertools` | `0.10.5` | `MIT OR Apache-2.0` | | `rust:itertools` | `0.12.1` | `MIT OR Apache-2.0` | | `rust:itoa` | `1.0.11` | `MIT OR Apache-2.0` | | `rust:js-sys` | `0.3.69` | `MIT OR Apache-2.0` | | `rust:json-patch` | `1.4.0` | `MIT OR Apache-2.0` | | `rust:json-patch` | `>= 1.2.0,< 2.0.0` | `` | | `rust:jsonwebtoken` | `8.3.0` | `MIT` | | `rust:lazy_static` | `1.4.0` | `Apache-2.0 AND MIT` | | `rust:lettre` | `0.11.7` | `MIT` | | `rust:lettre` | `>= 0.11.0,< 0.12.0` | `` | | `rust:libc` | `0.2.155` | `MIT OR Apache-2.0` | | `rust:libm` | `0.2.8` | `MIT OR Apache-2.0` | | `rust:libredox` | `0.1.3` | `MIT` | | `rust:linked-hash-map` | `0.5.6` | `MIT OR Apache-2.0` | | `rust:linux-raw-sys` | `0.4.14` | `Apache-2.0 WITH LLVM-exception OR (Apache-2.0 OR MIT)` | | `rust:litemap` | `0.7.3` | `` | | `rust:litrs` | `0.4.1` | `` | | `rust:lock_api` | `0.4.12` | `MIT OR Apache-2.0` | | `rust:log` | `0.4.21` | `MIT OR Apache-2.0` | | `rust:lru-cache` | `0.1.2` | `MIT OR Apache-2.0` | | `rust:match_cfg` | `0.1.0` | `MIT OR Apache-2.0` | | `rust:matchers` | `0.1.0` | `MIT` | | `rust:matches` | `0.1.10` | `MIT` | | `rust:matchit` | `0.7.3` | `MIT AND BSD-3-Clause` | | `rust:md-5` | `0.10.6` | `MIT OR Apache-2.0` | | `rust:md-5` | `>= 0.10.0,< 0.11.0` | `` | | `rust:md5` | `>= 0.5.0,< 0.6.0` | `` | | `rust:md5` | `0.5.0` | `Apache-2.0 OR MIT` | | `rust:memchr` | `2.7.2` | `Unlicense OR MIT` | | `rust:mime` | `0.3.17` | `MIT OR Apache-2.0` | | `rust:mime_guess` | `2.0.4` | `MIT` | | `rust:minimal-lexical` | `0.2.1` | `MIT OR Apache-2.0` | | `rust:miniz_oxide` | `0.7.3` | `MIT OR (Zlib OR Apache-2.0)` | | `rust:mio` | `0.8.11` | `MIT` | | `rust:mongodb` | `2.8.2` | `Apache-2.0` | | `rust:native-tls` | `0.2.12` | `MIT OR Apache-2.0` | | `rust:newline-converter` | `0.2.2` | `MIT` | | `rust:nom` | `7.1.3` | `MIT` | | `rust:nu-ansi-term` | `0.46.0` | `MIT` | | `rust:num-bigint` | `0.4.5` | `MIT OR Apache-2.0` | | `rust:num-bigint-dig` | `0.8.4` | `MIT OR Apache-2.0` | | `rust:num-conv` | `0.1.0` | `MIT OR Apache-2.0` | | `rust:num-integer` | `0.1.46` | `MIT OR Apache-2.0` | | `rust:num-iter` | `0.1.45` | `MIT OR Apache-2.0` | | `rust:num-traits` | `0.2.19` | `MIT OR Apache-2.0` | | `rust:num_cpus` | `1.16.0` | `MIT OR Apache-2.0` | | `rust:oauth2` | `4.4.2` | `MIT OR Apache-2.0` | | `rust:object` | `0.36.0` | `Apache-2.0 OR MIT` | | `rust:once_cell` | `1.19.0` | `MIT OR Apache-2.0` | | `rust:openidconnect` | `>= 3.5.0,< 4.0.0` | `` | | `rust:openidconnect` | `3.5.0` | `MIT` | | `rust:openssl` | `0.10.66` | `Apache-2.0` | | `rust:openssl-macros` | `0.1.1` | `MIT OR Apache-2.0` | | `rust:openssl-probe` | `0.1.5` | `MIT OR Apache-2.0` | | `rust:openssl-sys` | `0.9.103` | `MIT` | | `rust:opentelemetry` | `0.22.0` | `Apache-2.0` | | `rust:opentelemetry` | `>= 0.22.0,< 0.23.0` | `` | | `rust:opentelemetry-jaeger-propagator` | `0.1.0` | `Apache-2.0` | | `rust:opentelemetry-otlp` | `0.15.0` | `Apache-2.0` | | `rust:opentelemetry-prometheus` | `0.15.0` | `Apache-2.0` | | `rust:opentelemetry-proto` | `0.5.0` | `Apache-2.0` | | `rust:opentelemetry-semantic-conventions` | `0.14.0` | `Apache-2.0` | | `rust:opentelemetry_sdk` | `0.22.1` | `Apache-2.0` | | `rust:option-ext` | `0.2.0` | `MPL-2.0` | | `rust:ordered-float` | `2.10.1` | `MIT` | | `rust:ordered-float` | `4.2.0` | `MIT` | | `rust:ory-hydra-client` | `2.2.0` | `Apache-2.0` | | `rust:overload` | `0.1.1` | `MIT` | | `rust:p256` | `0.13.2` | `Apache-2.0 OR MIT` | | `rust:p384` | `0.13.0` | `Apache-2.0 OR MIT` | | `rust:papergrid` | `0.10.0` | `MIT` | | `rust:parking` | `2.2.0` | `Apache-2.0 OR MIT` | | `rust:parking_lot` | `0.11.2` | `Apache-2.0 OR MIT` | | `rust:parking_lot` | `0.12.3` | `MIT OR Apache-2.0` | | `rust:parking_lot_core` | `0.8.6` | `Apache-2.0 OR MIT` | | `rust:parking_lot_core` | `0.9.10` | `MIT OR Apache-2.0` | | `rust:paste` | `1.0.15` | `MIT OR Apache-2.0` | | `rust:pbkdf2` | `0.11.0` | `MIT OR Apache-2.0` | | `rust:pear` | `0.2.9` | `MIT OR Apache-2.0` | | `rust:pear_codegen` | `0.2.9` | `MIT OR Apache-2.0` | | `rust:pem` | `1.1.1` | `MIT` | | `rust:pem-rfc7468` | `0.7.0` | `Apache-2.0 OR MIT` | | `rust:percent-encoding` | `2.3.1` | `MIT OR Apache-2.0` | | `rust:pin-project` | `1.1.5` | `Apache-2.0 OR MIT` | | `rust:pin-project-internal` | `1.1.5` | `Apache-2.0 OR MIT` | | `rust:pin-project-lite` | `0.2.14` | `Apache-2.0 OR MIT` | | `rust:pin-utils` | `0.1.0` | `MIT OR Apache-2.0` | | `rust:pkcs1` | `0.7.5` | `Apache-2.0 OR MIT` | | `rust:pkcs8` | `0.10.2` | `Apache-2.0 OR MIT` | | `rust:pkg-config` | `0.3.30` | `MIT OR Apache-2.0` | | `rust:powerfmt` | `0.2.0` | `MIT OR Apache-2.0` | | `rust:ppv-lite86` | `0.2.17` | `MIT OR Apache-2.0` | | `rust:primeorder` | `0.13.6` | `Apache-2.0 OR MIT` | | `rust:proc-macro-error` | `1.0.4` | `MIT OR Apache-2.0` | | `rust:proc-macro-error-attr` | `1.0.4` | `Apache-2.0 AND MIT` | | `rust:proc-macro2` | `1.0.85` | `MIT OR Apache-2.0` | | `rust:proc-macro2` | `>= 1.0.0,< 2.0.0` | `` | | `rust:proc-macro2-diagnostics` | `0.10.1` | `MIT OR Apache-2.0` | | `rust:prometheus` | `0.13.4` | `Apache-2.0` | | `rust:prost` | `0.12.6` | `Apache-2.0` | | `rust:prost-derive` | `0.12.6` | `Apache-2.0` | | `rust:protobuf` | `2.28.0` | `MIT` | | `rust:psm` | `0.1.21` | `MIT OR Apache-2.0` | | `rust:quick-error` | `1.2.3` | `MIT OR Apache-2.0` | | `rust:quote` | `1.0.36` | `MIT OR Apache-2.0` | | `rust:quote` | `>= 1.0.0,< 2.0.0` | `` | | `rust:quoted_printable` | `0.5.0` | `0BSD` | | `rust:radium` | `0.7.0` | `MIT` | | `rust:rand` | `0.8.5` | `MIT OR Apache-2.0` | | `rust:rand` | `0.7.3` | `MIT OR Apache-2.0` | | `rust:rand` | `>= 0.8.0,< 0.9.0` | `` | | `rust:rand_chacha` | `0.2.2` | `MIT OR Apache-2.0` | | `rust:rand_chacha` | `0.3.1` | `MIT OR Apache-2.0` | | `rust:rand_core` | `0.6.4` | `MIT OR Apache-2.0` | | `rust:rand_core` | `0.5.1` | `MIT OR Apache-2.0` | | `rust:rand_hc` | `0.2.0` | `MIT OR Apache-2.0` | | `rust:redox_syscall` | `0.5.1` | `MIT` | | `rust:redox_syscall` | `0.2.16` | `MIT` | | `rust:redox_users` | `0.4.5` | `MIT` | | `rust:regex` | `>= 1.10.2,< 2.0.0` | `` | | `rust:regex` | `1.10.5` | `MIT OR Apache-2.0` | | `rust:regex-automata` | `0.1.10` | `MIT OR (MIT AND Unlicense)` | | `rust:regex-automata` | `0.4.7` | `MIT OR Apache-2.0` | | `rust:regex-syntax` | `0.8.4` | `MIT OR Apache-2.0` | | `rust:regex-syntax` | `0.6.29` | `MIT OR Apache-2.0` | | `rust:reqwest` | `>= 0.12.3,< 0.13.0` | `` | | `rust:reqwest` | `0.12.4` | `MIT OR Apache-2.0` | | `rust:reqwest` | `0.11.27` | `MIT OR Apache-2.0` | | `rust:reqwest-middleware` | `>= 0.3.0,< 0.4.0` | `` | | `rust:reqwest-middleware` | `0.3.3` | `MIT OR Apache-2.0` | | `rust:reqwest-retry` | `>= 0.6.0,< 0.7.0` | `` | | `rust:reqwest-retry` | `0.6.1` | `MIT OR Apache-2.0` | | `rust:resolv-conf` | `0.7.0` | `MIT OR Apache-2.0` | | `rust:retain_mut` | `0.1.9` | `MIT` | | `rust:retry-policies` | `0.4.0` | `MIT OR Apache-2.0` | | `rust:rfc6979` | `0.4.0` | `Apache-2.0 OR MIT` | | `rust:ring` | `0.17.8` | `` | | `rust:ring` | `0.16.20` | `ISC` | | `rust:rsa` | `0.9.6` | `MIT OR Apache-2.0` | | `rust:rspc` | `0.2.0` | `MIT` | | `rust:rspc-axum` | `0.1.1` | `MIT` | | `rust:rustc-demangle` | `0.1.24` | `MIT OR Apache-2.0` | | `rust:rustc_version` | `0.2.3` | `MIT OR Apache-2.0` | | `rust:rustc_version` | `0.4.0` | `MIT OR Apache-2.0` | | `rust:rustc_version_runtime` | `0.2.1` | `MIT` | | `rust:rustix` | `0.38.34` | `Apache-2.0 WITH LLVM-exception OR (Apache-2.0 OR MIT)` | | `rust:rustls` | `0.21.12` | `Apache-2.0 OR (ISC OR MIT)` | | `rust:rustls` | `0.22.4` | `Apache-2.0 OR (ISC OR MIT)` | | `rust:rustls-native-certs` | `0.7.0` | `Apache-2.0 OR (ISC OR MIT)` | | `rust:rustls-native-certs` | `0.6.3` | `Apache-2.0 OR (ISC OR MIT)` | | `rust:rustls-pemfile` | `2.1.2` | `Apache-2.0 OR (ISC OR MIT)` | | `rust:rustls-pemfile` | `1.0.4` | `Apache-2.0 OR (ISC OR MIT)` | | `rust:rustls-pki-types` | `1.7.0` | `MIT OR Apache-2.0` | | `rust:rustls-webpki` | `0.102.4` | `ISC` | | `rust:rustls-webpki` | `0.101.7` | `ISC` | | `rust:rustversion` | `1.0.17` | `MIT OR Apache-2.0` | | `rust:ryu` | `1.0.18` | `Apache-2.0 OR BSL-1.0` | | `rust:scc` | `2.1.1` | `Apache-2.0` | | `rust:schannel` | `0.1.23` | `MIT` | | `rust:scopeguard` | `1.2.0` | `MIT OR Apache-2.0` | | `rust:sct` | `0.7.1` | `Apache-2.0 OR (ISC OR MIT)` | | `rust:sdd` | `0.2.0` | `Apache-2.0` | | `rust:sec1` | `0.7.3` | `Apache-2.0 OR MIT` | | `rust:security-framework` | `2.11.0` | `MIT OR Apache-2.0` | | `rust:security-framework-sys` | `2.11.0` | `MIT OR Apache-2.0` | | `rust:semver` | `0.9.0` | `MIT OR Apache-2.0` | | `rust:semver` | `1.0.23` | `MIT OR Apache-2.0` | | `rust:semver` | `>= 1.0.0,< 2.0.0` | `` | | `rust:semver-parser` | `0.7.0` | `MIT OR Apache-2.0` | | `rust:serde` | `1.0.203` | `MIT OR Apache-2.0` | | `rust:serde` | `>= 1.0.0,< 2.0.0` | `` | | `rust:serde-value` | `0.7.0` | `MIT` | | `rust:serde_bytes` | `0.11.14` | `MIT OR Apache-2.0` | | `rust:serde_derive` | `1.0.203` | `MIT OR Apache-2.0` | | `rust:serde_json` | `>= 1.0.0,< 2.0.0` | `` | | `rust:serde_json` | `1.0.117` | `MIT OR Apache-2.0` | | `rust:serde_path_to_error` | `0.1.16` | `MIT OR Apache-2.0` | | `rust:serde_plain` | `1.0.2` | `MIT OR Apache-2.0` | | `rust:serde_qs` | `0.8.5` | `MIT OR Apache-2.0` | | `rust:serde_qs` | `0.12.0` | `MIT OR Apache-2.0` | | `rust:serde_spanned` | `0.6.6` | `MIT OR Apache-2.0` | | `rust:serde_urlencoded` | `0.7.1` | `MIT OR Apache-2.0` | | `rust:serde_with` | `3.8.1` | `MIT OR Apache-2.0` | | `rust:serde_with` | `>= 3.8.0,< 4.0.0` | `` | | `rust:serde_with` | `1.14.0` | `MIT OR Apache-2.0` | | `rust:serde_with_macros` | `1.5.2` | `MIT OR Apache-2.0` | | `rust:serde_with_macros` | `3.8.1` | `MIT OR Apache-2.0` | | `rust:serde_yaml` | `0.9.34+deprecated` | `MIT OR Apache-2.0` | | `rust:serde_yaml` | `>= 0.9.27,< 0.10.0` | `` | | `rust:serial_test` | `>= 3.0.0,< 4.0.0` | `` | | `rust:serial_test` | `2.0.0` | `MIT` | | `rust:serial_test` | `3.1.1` | `MIT` | | `rust:serial_test_derive` | `2.0.0` | `MIT` | | `rust:serial_test_derive` | `3.1.1` | `MIT` | | `rust:sha-1` | `0.10.1` | `MIT OR Apache-2.0` | | `rust:sha2` | `>= 0.10.7,< 0.11.0` | `` | | `rust:sha2` | `0.10.8` | `MIT OR Apache-2.0` | | `rust:sharded-slab` | `0.1.7` | `MIT` | | `rust:signal-hook` | `0.3.17` | `Apache-2.0 OR MIT` | | `rust:signal-hook-mio` | `0.2.3` | `Apache-2.0 OR MIT` | | `rust:signal-hook-registry` | `1.4.2` | `Apache-2.0 OR MIT` | | `rust:signature` | `2.2.0` | `Apache-2.0 OR MIT` | | `rust:simple_asn1` | `0.6.2` | `ISC` | | `rust:slab` | `0.4.9` | `MIT` | | `rust:slugify` | `>= 0.1.0,< 0.2.0` | `` | | `rust:slugify` | `0.1.0` | `MIT` | | `rust:smallvec` | `1.13.2` | `MIT OR Apache-2.0` | | `rust:socket2` | `0.4.10` | `MIT OR Apache-2.0` | | `rust:socket2` | `0.5.7` | `MIT OR Apache-2.0` | | `rust:specta` | `1.0.5` | `MIT` | | `rust:specta-macros` | `1.0.5` | `MIT` | | `rust:spin` | `0.5.2` | `MIT` | | `rust:spin` | `0.9.8` | `MIT` | | `rust:spki` | `0.7.3` | `Apache-2.0 OR MIT` | | `rust:stable_deref_trait` | `1.2.0` | `MIT OR Apache-2.0` | | `rust:stacker` | `0.1.15` | `MIT OR Apache-2.0` | | `rust:stringprep` | `0.1.5` | `MIT OR Apache-2.0` | | `rust:strsim` | `0.11.1` | `MIT` | | `rust:strsim` | `0.10.0` | `MIT` | | `rust:strum` | `0.26.2` | `MIT` | | `rust:strum_macros` | `0.26.4` | `MIT` | | `rust:subtle` | `2.5.0` | `BSD-3-Clause` | | `rust:syn` | `>= 2.0.0,< 3.0.0` | `` | | `rust:syn` | `1.0.109` | `MIT OR Apache-2.0` | | `rust:syn` | `2.0.66` | `MIT OR Apache-2.0` | | `rust:sync_wrapper` | `0.1.2` | `Apache-2.0` | | `rust:sync_wrapper` | `1.0.1` | `Apache-2.0` | | `rust:synstructure` | `0.13.1` | `MIT` | | `rust:system-configuration` | `0.5.1` | `MIT OR Apache-2.0` | | `rust:system-configuration-sys` | `0.5.0` | `MIT OR Apache-2.0` | | `rust:tabled` | `0.14.0` | `MIT` | | `rust:tabled` | `>= 0.14.0,< 0.15.0` | `` | | `rust:tabled_derive` | `0.6.0` | `MIT` | | `rust:take_mut` | `0.2.2` | `MIT` | | `rust:tap` | `1.0.1` | `MIT` | | `rust:tempfile` | `3.10.1` | `MIT OR Apache-2.0` | | `rust:termcolor` | `1.4.1` | `Unlicense OR MIT` | | `rust:thiserror` | `1.0.61` | `MIT OR Apache-2.0` | | `rust:thiserror` | `>= 1.0.0,< 2.0.0` | `` | | `rust:thiserror-impl` | `1.0.61` | `MIT OR Apache-2.0` | | `rust:thread_local` | `1.1.8` | `MIT OR Apache-2.0` | | `rust:time` | `0.3.36` | `MIT OR Apache-2.0` | | `rust:time-core` | `0.1.2` | `MIT OR Apache-2.0` | | `rust:time-humanize` | `0.1.3` | `MIT` | | `rust:time-humanize` | `>= 0.1.0,< 0.2.0` | `` | | `rust:time-macros` | `0.2.18` | `MIT OR Apache-2.0` | | `rust:tinystr` | `0.7.6` | `` | | `rust:tinyvec` | `1.6.0` | `Zlib OR (Apache-2.0 OR MIT)` | | `rust:tinyvec_macros` | `0.1.1` | `MIT OR (Apache-2.0 OR Zlib)` | | `rust:tokio` | `1.38.0` | `MIT` | | `rust:tokio-io-timeout` | `1.2.0` | `MIT OR Apache-2.0` | | `rust:tokio-macros` | `2.3.0` | `MIT` | | `rust:tokio-native-tls` | `0.3.1` | `MIT` | | `rust:tokio-rustls` | `0.24.1` | `MIT OR Apache-2.0` | | `rust:tokio-rustls` | `0.25.0` | `MIT OR Apache-2.0` | | `rust:tokio-stream` | `0.1.15` | `MIT` | | `rust:tokio-util` | `>= 0.7.8,< 0.8.0` | `` | | `rust:tokio-util` | `0.7.11` | `MIT` | | `rust:toml` | `>= 0.8.0,< 0.9.0` | `` | | `rust:toml` | `0.7.8` | `MIT OR Apache-2.0` | | `rust:toml` | `0.8.14` | `MIT OR Apache-2.0` | | `rust:toml_datetime` | `0.6.6` | `MIT OR Apache-2.0` | | `rust:toml_edit` | `0.19.15` | `MIT OR Apache-2.0` | | `rust:toml_edit` | `0.22.14` | `MIT OR Apache-2.0` | | `rust:tonic` | `0.11.0` | `MIT` | | `rust:tower` | `0.4.13` | `MIT` | | `rust:tower` | `>= 0.4.13,< 0.5.0` | `` | | `rust:tower-http` | `0.5.2` | `MIT` | | `rust:tower-layer` | `0.3.2` | `MIT` | | `rust:tower-service` | `0.3.2` | `MIT` | | `rust:tower-service` | `>= 0.3.2,< 0.4.0` | `` | | `rust:tracing` | `0.1.40` | `MIT` | | `rust:tracing` | `>= 0.1.0,< 0.2.0` | `` | | `rust:tracing-attributes` | `0.1.27` | `MIT` | | `rust:tracing-core` | `0.1.32` | `MIT` | | `rust:tracing-log` | `0.2.0` | `MIT` | | `rust:tracing-opentelemetry` | `0.23.0` | `MIT` | | `rust:tracing-opentelemetry` | `>= 0.23.0,< 0.24.0` | `` | | `rust:tracing-opentelemetry-instrumentation-sdk` | `0.18.1` | `CC0-1.0` | | `rust:tracing-serde` | `0.1.3` | `MIT` | | `rust:tracing-subscriber` | `0.3.18` | `MIT` | | `rust:trust-dns-proto` | `0.21.2` | `MIT OR Apache-2.0` | | `rust:trust-dns-resolver` | `0.21.2` | `MIT OR Apache-2.0` | | `rust:try-lock` | `0.2.5` | `MIT` | | `rust:trybuild` | `>= 1.0.0,< 2.0.0` | `` | | `rust:trybuild` | `1.0.96` | `MIT OR Apache-2.0` | | `rust:typed-builder` | `0.10.0` | `MIT OR Apache-2.0` | | `rust:typenum` | `1.17.0` | `MIT OR Apache-2.0` | | `rust:ulid` | `1.1.2` | `MIT` | | `rust:uncased` | `0.9.10` | `MIT OR Apache-2.0` | | `rust:unicase` | `2.7.0` | `MIT OR Apache-2.0` | | `rust:unicode-bidi` | `0.3.15` | `MIT OR Apache-2.0` | | `rust:unicode-ident` | `1.0.12` | `(MIT OR Apache-2.0) AND Unicode-DFS-2016` | | `rust:unicode-normalization` | `0.1.23` | `MIT OR Apache-2.0` | | `rust:unicode-properties` | `0.1.1` | `MIT OR Apache-2.0` | | `rust:unicode-segmentation` | `1.11.0` | `MIT OR Apache-2.0` | | `rust:unicode-width` | `0.1.13` | `MIT OR Apache-2.0` | | `rust:unidecode` | `0.3.0` | `BSD-3-Clause` | | `rust:unsafe-libyaml` | `0.2.11` | `MIT` | | `rust:untrusted` | `0.9.0` | `ISC` | | `rust:untrusted` | `0.7.1` | `ISC` | | `rust:url` | `>= 2.5.0,< 3.0.0` | `` | | `rust:url` | `2.5.1` | `MIT OR Apache-2.0` | | `rust:urlencoding` | `2.1.3` | `MIT` | | `rust:utf16_iter` | `1.0.5` | `Apache-2.0 OR MIT` | | `rust:utf8_iter` | `1.0.4` | `Apache-2.0 OR MIT` | | `rust:utf8parse` | `0.2.2` | `Apache-2.0 OR MIT` | | `rust:uuid` | `>= 1.8.0,< 2.0.0` | `` | | `rust:uuid` | `1.8.0` | `Apache-2.0 OR MIT` | | `rust:validator` | `0.16.1` | `MIT` | | `rust:validator` | `>= 0.16.0,< 0.17.0` | `` | | `rust:valuable` | `0.1.0` | `MIT` | | `rust:vcpkg` | `0.2.15` | `MIT OR Apache-2.0` | | `rust:version_check` | `0.9.4` | `MIT OR Apache-2.0` | | `rust:waker-fn` | `1.2.0` | `Apache-2.0 OR MIT` | | `rust:want` | `0.3.1` | `MIT` | | `rust:wasi` | `0.11.0+wasi-snapshot-preview1` | `Apache-2.0 WITH LLVM-exception OR (Apache-2.0 OR MIT)` | | `rust:wasi` | `0.9.0+wasi-snapshot-preview1` | `Apache-2.0 WITH LLVM-exception OR (Apache-2.0 OR MIT)` | | `rust:wasm-bindgen` | `0.2.92` | `MIT OR Apache-2.0` | | `rust:wasm-bindgen-backend` | `0.2.92` | `MIT OR Apache-2.0` | | `rust:wasm-bindgen-futures` | `0.4.42` | `MIT OR Apache-2.0` | | `rust:wasm-bindgen-macro` | `0.2.92` | `MIT OR Apache-2.0` | | `rust:wasm-bindgen-macro-support` | `0.2.92` | `MIT OR Apache-2.0` | | `rust:wasm-bindgen-shared` | `0.2.92` | `MIT OR Apache-2.0` | | `rust:wasm-streams` | `0.4.0` | `MIT OR Apache-2.0` | | `rust:wasm-timer` | `0.2.5` | `MIT` | | `rust:web-sys` | `0.3.69` | `MIT OR Apache-2.0` | | `rust:web-time` | `1.1.0` | `MIT OR Apache-2.0` | | `rust:webpki-roots` | `0.25.4` | `MPL-2.0` | | `rust:widestring` | `1.1.0` | `MIT OR Apache-2.0` | | `rust:winapi` | `0.3.9` | `MIT OR Apache-2.0` | | `rust:winapi-i686-pc-windows-gnu` | `0.4.0` | `MIT OR Apache-2.0` | | `rust:winapi-util` | `0.1.8` | `Unlicense OR MIT` | | `rust:winapi-x86_64-pc-windows-gnu` | `0.4.0` | `MIT OR Apache-2.0` | | `rust:windows` | `0.52.0` | `MIT OR Apache-2.0` | | `rust:windows-core` | `0.52.0` | `MIT OR Apache-2.0` | | `rust:windows-sys` | `0.52.0` | `MIT OR Apache-2.0` | | `rust:windows-sys` | `0.48.0` | `MIT OR Apache-2.0` | | `rust:windows-targets` | `0.48.5` | `MIT OR Apache-2.0` | | `rust:windows-targets` | `0.52.5` | `MIT OR Apache-2.0` | | `rust:windows_aarch64_gnullvm` | `0.48.5` | `MIT OR Apache-2.0` | | `rust:windows_aarch64_gnullvm` | `0.52.5` | `MIT OR Apache-2.0` | | `rust:windows_aarch64_msvc` | `0.48.5` | `MIT OR Apache-2.0` | | `rust:windows_aarch64_msvc` | `0.52.5` | `MIT OR Apache-2.0` | | `rust:windows_i686_gnu` | `0.48.5` | `MIT OR Apache-2.0` | | `rust:windows_i686_gnu` | `0.52.5` | `MIT OR Apache-2.0` | | `rust:windows_i686_gnullvm` | `0.52.5` | `MIT OR Apache-2.0` | | `rust:windows_i686_msvc` | `0.52.5` | `MIT OR Apache-2.0` | | `rust:windows_i686_msvc` | `0.48.5` | `MIT OR Apache-2.0` | | `rust:windows_x86_64_gnu` | `0.48.5` | `MIT OR Apache-2.0` | | `rust:windows_x86_64_gnu` | `0.52.5` | `MIT OR Apache-2.0` | | `rust:windows_x86_64_gnullvm` | `0.52.5` | `MIT OR Apache-2.0` | | `rust:windows_x86_64_gnullvm` | `0.48.5` | `MIT OR Apache-2.0` | | `rust:windows_x86_64_msvc` | `0.48.5` | `MIT OR Apache-2.0` | | `rust:windows_x86_64_msvc` | `0.52.5` | `MIT OR Apache-2.0` | | `rust:winnow` | `0.5.40` | `MIT` | | `rust:winnow` | `0.6.13` | `MIT` | | `rust:winreg` | `0.50.0` | `MIT` | | `rust:winreg` | `0.52.0` | `MIT` | | `rust:wiremock` | `>= 0.5.19,< 0.6.0` | `` | | `rust:wiremock` | `0.5.22` | `MIT OR Apache-2.0` | | `rust:write16` | `1.0.0` | `Apache-2.0 OR MIT` | | `rust:writeable` | `0.5.5` | `Unicode-3.0` | | `rust:wyz` | `0.5.1` | `MIT` | | `rust:yansi` | `1.0.1` | `MIT OR Apache-2.0` | | `rust:yoke` | `0.7.4` | `Unicode-3.0` | | `rust:yoke-derive` | `0.7.4` | `` | | `rust:zerocopy` | `0.7.34` | `BSD-2-Clause OR (Apache-2.0 OR MIT)` | | `rust:zerocopy-derive` | `0.7.34` | `BSD-2-Clause OR (Apache-2.0 OR MIT)` | | `rust:zerofrom` | `0.1.4` | `Unicode-3.0` | | `rust:zerofrom-derive` | `0.1.4` | `Unicode-3.0` | | `rust:zeroize` | `1.8.1` | `Apache-2.0 OR MIT` | | `rust:zerovec` | `0.10.4` | `Unicode-3.0` | | `rust:zerovec-derive` | `0.10.3` | `Unicode-3.0` | # Security At CrabNebula we take security topics into account when designing a product and during it's whole lifecycle. We have internal manual and automated security testing in place but, as it is impossible to discover all bugs in a code base, we encourage reporting security relevant bugs in a coordinated way. :::tip If you're reporting vulnerabilities related to code in a GitHub repo then please use the respective disclosure in that repo. [Learn more about GitHub Coordinated Disclosures](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/about-coordinated-disclosure-of-security-vulnerabilities). ::: ## Vulnerability Disclosure **Do not report security vulnerabilities through public channels.** Please contact us via email at [security@crabnebula.dev](mailto:security@crabnebula.dev). You can encrypt your mail using GnuPG if you want. See the [security.txt](https://crabnebula.dev/.well-known/security.txt) at crabnebula.dev: ``` Contact: mailto:security@crabnebula.dev Expires: 2025-01-30T06:30:00.000Z Encryption: https://crabnebula.dev/.well-known/pgp.txt Preferred-Languages: en,de,fr Canonical: https://crabnebula.dev/.well-known/security.txt ``` Include as much of the following information as possible in the security report: - Type of issue (e.g. code execution, privilege escalation, information leak etc.) - The location of the affected feature (URL/Code) - Any special configuration required to reproduce the issue - The distribution affected or used for reproduction. - Step-by-step instructions to reproduce the issue, ideally a reproduction repository - Impact of the issue, including how an attacker might exploit the issue We prefer to receive reports in English. If necessary, we also understand French and German. We currently have no paid bug bounty system in place but consider rewards on an individual basis. # Updater Configuration import { Tabs, TabItem } from "@astrojs/starlight/components"; On this page you will find an overview of how to configure supported updater services and frameworks to work with CrabNebula Cloud. This will allow you to automatically update your application as soon as you publish a new release on Cloud without having to manually handle the update process. Right now we support the following options: - [Tauri v1](https://v1.tauri.app) - [Tauri v2](https://tauri.app) - [Cargo Packager](https://github.com/crabnebula-dev/cargo-packager) ## Tauri :::tip A more in depth explanation for Tauri v2 can be found in this [guide](/cloud/guides/auto-updates-tauri/). For more details on how to configure Tauri updater, please refer to the Tauri documentation for [Tauri v1](https://v1.tauri.app/v1/guides/distribution/updater/) and [Tauri v2](https://tauri.app/plugin/updater/) respectively. ::: Before you can adjust your `tauri.conf.json` file to configure the update endpoint, you need to generate a cryptographic key pair for your application which will be used to check if the update is valid or might have been tampered with. The public key will be used to verify the update (needs to be put in the `tauri.conf.json` file) and the private key (has to be kept secret!) will be used to sign the new release when you publish it. Run the following command to generate a key pair for your application: ```bash cargo tauri signer generate -w ~/.tauri/myapp.key ``` ```bash cargo tauri signer generate -w $HOME/.tauri/myapp.key ``` You should now see the two keyfiles `~/.tauri/myapp.key` and `~/.tauri/myapp.key.pub`. Now you need to add the following configuration to your `tauri.conf.json` file: ```json "tauri": { "updater": { "active": true, "endpoints": [ "https://cdn.crabnebula.app/update/ORG_NAME/APP_NAME/{{target}}-{{arch}}/{{current_version}}" ], "dialog": true, "pubkey": "PUBKEY" }, }, ``` Before you can configure the update endpoint, you need to install the `updater` plugin: ```bash cargo tauri add updater ``` Now you need to add the following configuration to your `tauri.conf.json` file: ```json "bundle": { "createUpdaterArtifacts": true }, "plugins": { "updater": { "endpoints": [ "https://cdn.crabnebula.app/update/ORG_NAME/APP_NAME/{{target}}-{{arch}}/{{current_version}}" ], "pubkey": "PUBKEY" } } ``` :::caution Note that the `createUpdaterArtifacts` value must be set to `true` for new applications, but set to `"v1Compatible"` when updating from a Tauri v1 application. ::: Make sure to replace `ORG_NAME` with your organizations name on Cloud, `APP_NAME` with the apps name on Cloud and `PUBKEY` with the public key from `~/.tauri/myapp.key.pub`. :::caution It is important to sign the app with the private key from `~/.tauri/myapp.key` before you publish a new release as otherwise the update will not be valid. ::: ## Cargo Packager :::tip A more in depth explanation for Cargo Packager can be found in this [guide](/cloud/guides/packager-auto-updater/). Detailed documentation for the updater can be found in the [docs](/packager/updater/) and the [GitHub repository](https://github.com/crabnebula-dev/cargo-packager/tree/main/crates/updater). ::: Packager includes a built-in updater which can be configured to automatically update your application as soon as you publish a new release on Cloud. Start off by adding the `cargo-packager-updater` dependency to your project: ```bash cargo add cargo-packager-updater ``` Afterwards you need to generate a cryptographic key pair which will be used to verify the integrity of the update. New updates will be signed with the private key and the public key will be used to confirm the integrity of the update. ```bash cargo packager signer generate ``` Save the private key in a secure location as it will be used to sign the new release when you publish it. For the configuration of the updater code you will only need the public key. In your Rust project navigate to the specific file where you want to add the updater code and add the following imports: ```rust use cargo_packager_updater::{semver::Version, url::Url}; ``` Now add the following code: ```rust let config = cargo_packager_updater::Config { endpoints: vec![Url::parse("https://cdn.crabnebula.app/update/YOUR_ORG_SLUG/YOUR_APP_SLUG/{{target}}-{{arch}}/{{current_version}}").expect("Failed to parse URL")], // REPLACE: YOUR_ORG_SLUG and YOUR_APP_SLUG of the app in CN Cloud pubkey: String::from("YOUR_PUBLIC_KEY"), // REPLACE: YOUR_PUBLIC_KEY generated by the signer ..Default::default() }; let current_version = Version::parse(env!("CARGO_PKG_VERSION")).expect("Failed to parse version"); println!("Current version: {}", current_version); if let Some(update) = cargo_packager_updater::check_update(current_version.clone(), config) .expect("Failed to check for update") { update .download_and_install() .expect("Failed to download and install update"); println!("Update installed") } else { println!("No update available") } ``` Make sure to replace `YOUR_ORG_SLUG` and `YOUR_APP_SLUG` with the slug of your organization and app on Cloud. Also replace `YOUR_PUBLIC_KEY` with the public key generated by the signer. Now as soon as that code is run, the updater will check for updates and if a new update is available, it will be downloaded and installed automatically. # Prevent Vendor Lock-In :::tip[What is lock-in?] Vendor lock-in occurs when individuals are unable to switch away from a specific product or service, regardless of its quality, due to the impracticality of transitioning away from it. ::: At CrabNebula, we prioritize addressing this concern and remain transparent with our customers about off-boarding strategies. We recommend considering these strategies as they may provide valuable options, regardless of your Cloud usage. This is not an exhaustive list, but rather some suggestions to help you find the best solution: - (Full control with minimal effort) Set up a redirect from your own domain to the [public updater JSON served by Cloud](/cloud/cli/fetch-latest-release). Ensure that your updater system follows redirects (the Tauri and Packager updater system follows HTTP redirects (`301` response status code). - (Some control with minimal effort) Each release dictates the source of the next update, allowing you to put out a new version pointing to the new update location. - (A backup strategy with considerable effort) Build a notification system in-app. This system can publish announcements to your users, providing a link to re-download the new app version. While less about vendor lock-in, it serves as a backup plan for any significant issues! # Taurify # Get Started import CommandTabs from "@components/CommandTabs.astro"; Taurify is a system that simplifies the process of Web-based desktop and mobile application development and distribution. ## Installation The Taurify CLI is all you need to turn your web application into a desktop and mobile app. The CLI is distributed on [NPM](https://npm.io/package/taurify), you can install it with your preferred package manager: ## Initializing To start developing your application, you must initialize the Taurify configuration. Run `taurify init` and the CLI will guide you through the options that you must configure. ## Developing The `taurify dev` command starts your application in development mode. See the [developing guide](/taurify/developing) for more information on how to develop your application for desktop and mobile. ## Distributing The `taurify build` command triggers a new release of your application. Our servers take care of the distribution for all platforms, but you must prepare your application and configure the distribution first. See the [distribution documentation](/taurify/distribute). To handle auto-updates you must configure your application to check and install them. See the [updater guide](/taurify/updater) for more information. # @crabnebula/taurify-api The Taurify API allows you to interface with the backend layer. This module exposes all other modules as an object where the key is the module name, and the value is the module exports. ## Example ```typescript import { event, window, path } from '@crabnebula/taurify-api' ``` ## Functions ### isDev() ```ts function isDev(): Promise ``` #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> ## Namespaces - [app](/taurify/api/namespaceapp/) - [barcodeScanner](/taurify/api/namespacebarcodescanner/) - [biometric](/taurify/api/namespacebiometric/) - [cli](/taurify/api/namespacecli/) - [clipboardManager](/taurify/api/namespaceclipboardmanager/) - [core](/taurify/api/namespacecore/) - [deepLink](/taurify/api/namespacedeeplink/) - [dialog](/taurify/api/namespacedialog/) - [dpi](/taurify/api/namespacedpi/) - [event](/taurify/api/namespaceevent/) - [fs](/taurify/api/namespacefs/) - [geolocation](/taurify/api/namespacegeolocation/) - [globalShortcut](/taurify/api/namespaceglobalshortcut/) - [haptics](/taurify/api/namespacehaptics/) - [http](/taurify/api/namespacehttp/) - [image](/taurify/api/namespaceimage/) - [log](/taurify/api/namespacelog/) - [menu](/taurify/api/namespacemenu/) - [nfc](/taurify/api/namespacenfc/) - [notification](/taurify/api/namespacenotification/) - [opener](/taurify/api/namespaceopener/) - [os](/taurify/api/namespaceos/) - [path](/taurify/api/namespacepath/) - [process](/taurify/api/namespaceprocess/) - [shell](/taurify/api/namespaceshell/) - [store](/taurify/api/namespacestore/) - [tray](/taurify/api/namespacetray/) - [updater](/taurify/api/namespaceupdater/) - [webview](/taurify/api/namespacewebview/) - [webviewWindow](/taurify/api/namespacewebviewwindow/) - [window](/taurify/api/namespacewindow/) # app ## Type Aliases ### DataStoreIdentifier ```ts type DataStoreIdentifier: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]; ``` *** ### NewInstance ```ts type NewInstance: object; ``` #### Type declaration | Name | Type | Defined in | | ------ | ------ | ------ | | `args` | `string`[] | | | `cwd` | `string` | | ## Functions ### defaultWindowIcon() ```ts function defaultWindowIcon(): Promise ``` Get the default window icon. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Image`](/taurify/api/namespaceimage/#image) \| `null`\> #### Example ```typescript import { defaultWindowIcon } from '@crabnebula/taurify-api/app'; await defaultWindowIcon(); ``` *** ### fetchDataStoreIdentifiers() ```ts function fetchDataStoreIdentifiers(): Promise ``` Fetches the data store identifiers on macOS and iOS. See https://developer.apple.com/documentation/webkit/wkwebsitedatastore for more information. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`DataStoreIdentifier`](/taurify/api/namespaceapp/#datastoreidentifier)[]\> #### Example ```typescript import { fetchDataStoreIdentifiers } from '@crabnebula/taurify-api/app'; const ids = await fetchDataStoreIdentifiers(); ``` *** ### getIdentifier() ```ts function getIdentifier(): Promise ``` Gets the application identifier. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> The application identifier as configured in `tauri.conf.json`. #### Example ```typescript import { getIdentifier } from '@crabnebula/taurify-api/app'; const identifier = await getIdentifier(); ``` *** ### getName() ```ts function getName(): Promise ``` Gets the application name. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { getName } from '@crabnebula/taurify-api/app'; const appName = await getName(); ``` *** ### getTauriVersion() ```ts function getTauriVersion(): Promise ``` Gets the Tauri version. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { getTauriVersion } from '@crabnebula/taurify-api/app'; const tauriVersion = await getTauriVersion(); ``` *** ### getVersion() ```ts function getVersion(): Promise ``` Gets the application version. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { getVersion } from '@crabnebula/taurify-api/app'; const appVersion = await getVersion(); ``` *** ### hide() ```ts function hide(): Promise ``` Hides the application on macOS. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> #### Example ```typescript import { hide } from '@crabnebula/taurify-api/app'; await hide(); ``` *** ### onNewInstance() ```ts function onNewInstance(cb): Promise ``` #### Parameters | Parameter | Type | | ------ | ------ | | `cb` | (`instance`) => `void` | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> *** ### removeDataStore() ```ts function removeDataStore(uuid): Promise ``` Removes the data store with the given identifier. Note that any webview using this data store should be closed before running this API. See https://developer.apple.com/documentation/webkit/wkwebsitedatastore for more information. #### Parameters | Parameter | Type | | ------ | ------ | | `uuid` | [`DataStoreIdentifier`](/taurify/api/namespaceapp/#datastoreidentifier) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`DataStoreIdentifier`](/taurify/api/namespaceapp/#datastoreidentifier)[]\> #### Example ```typescript import { fetchDataStoreIdentifiers, removeDataStore } from '@crabnebula/taurify-api/app'; for (const id of (await fetchDataStoreIdentifiers())) { await removeDataStore(id); } ``` *** ### setDockVisibility() ```ts function setDockVisibility(visible): Promise ``` Sets the dock visibility for the application on macOS. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `visible` | `boolean` | whether the dock should be visible or not | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> *** ### setTheme() ```ts function setTheme(theme?): Promise ``` Set app's theme, pass in `null` or `undefined` to follow system theme #### Parameters | Parameter | Type | | ------ | ------ | | `theme`? | `null` \| [`Theme`](/taurify/api/namespacewindow/#theme-2) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> #### Example ```typescript import { setTheme } from '@crabnebula/taurify-api/app'; await setTheme('dark'); ``` #### Platform-specific - **iOS / Android:** Unsupported. *** ### show() ```ts function show(): Promise ``` Shows the application on macOS. This function does not automatically focus any specific app window. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> #### Example ```typescript import { show } from '@crabnebula/taurify-api/app'; await show(); ``` # barcodeScanner ## References ### PermissionState Re-exports [PermissionState](/taurify/api/namespacecore/#permissionstate) ## Enumerations ### Format #### Enumeration Members ##### Aztec ```ts Aztec: "AZTEC"; ``` ##### Codabar ```ts Codabar: "CODABAR"; ``` ##### Code128 ```ts Code128: "CODE_128"; ``` ##### Code39 ```ts Code39: "CODE_39"; ``` ##### Code93 ```ts Code93: "CODE_93"; ``` ##### DataMatrix ```ts DataMatrix: "DATA_MATRIX"; ``` ##### EAN13 ```ts EAN13: "EAN_13"; ``` ##### EAN8 ```ts EAN8: "EAN_8"; ``` ##### ITF ```ts ITF: "ITF"; ``` ##### PDF417 ```ts PDF417: "PDF_417"; ``` ##### QRCode ```ts QRCode: "QR_CODE"; ``` ##### UPC\_A ```ts UPC_A: "UPC_A"; ``` ##### UPC\_E ```ts UPC_E: "UPC_E"; ``` ## Interfaces ### Scanned #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `bounds` | `unknown` | | | `content` | `string` | | | `format` | [`Format`](/taurify/api/namespacebarcodescanner/#format) | | *** ### ScanOptions #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `cameraDirection?` | `"back"` \| `"front"` | | | `formats?` | [`Format`](/taurify/api/namespacebarcodescanner/#format)[] | | | `windowed?` | `boolean` | | ## Functions ### cancel() ```ts function cancel(): Promise ``` Cancel the current scan process. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> *** ### checkPermissions() ```ts function checkPermissions(): Promise ``` Get permission state. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`PermissionState`\> *** ### openAppSettings() ```ts function openAppSettings(): Promise ``` Open application settings. Useful if permission was denied and the user must manually enable it. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> *** ### requestPermissions() ```ts function requestPermissions(): Promise ``` Request permissions to use the camera. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`PermissionState`\> *** ### scan() ```ts function scan(options?): Promise ``` Start scanning. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options`? | [`ScanOptions`](/taurify/api/namespacebarcodescanner/#scanoptions) | | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Scanned`](/taurify/api/namespacebarcodescanner/#scanned)\> # biometric ## Enumerations ### BiometryType #### Enumeration Members ##### FaceID ```ts FaceID: 2; ``` ##### Iris ```ts Iris: 3; ``` ##### None ```ts None: 0; ``` ##### TouchID ```ts TouchID: 1; ``` ## Interfaces ### AuthOptions #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `allowDeviceCredential?` | `boolean` | | | `cancelTitle?` | `string` | | | `confirmationRequired?` | `boolean` | | | `fallbackTitle?` | `string` | | | `maxAttemps?` | `number` | | | `subtitle?` | `string` | | | `title?` | `string` | | *** ### Status #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `biometryType` | [`BiometryType`](/taurify/api/namespacebiometric/#biometrytype) | | | `error?` | `string` | | | `errorCode?` | \| `"appCancel"` \| `"authenticationFailed"` \| `"invalidContext"` \| `"notInteractive"` \| `"passcodeNotSet"` \| `"systemCancel"` \| `"userCancel"` \| `"userFallback"` \| `"biometryLockout"` \| `"biometryNotAvailable"` \| `"biometryNotEnrolled"` | | | `isAvailable` | `boolean` | | ## Functions ### authenticate() ```ts function authenticate(reason, options?): Promise ``` Prompts the user for authentication using the system interface (touchID, faceID or Android Iris). Rejects if the authentication fails. ```javascript import { authenticate } from "@crabnebula/taurify-api/biometric"; await authenticate('Open your wallet'); ``` #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `reason` | `string` | | | `options`? | [`AuthOptions`](/taurify/api/namespacebiometric/#authoptions) | | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> *** ### checkStatus() ```ts function checkStatus(): Promise ``` Checks if the biometric authentication is available. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Status`](/taurify/api/namespacebiometric/#status)\> a promise resolving to an object containing all the information about the status of the biometry. # cli Parse arguments from your Command Line Interface. ## Interfaces ### ArgMatch #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `occurrences` | `number` | Number of occurrences | | | `value` | `null` \| `string` \| `boolean` \| `string`[] | string if takes value boolean if flag string[] or null if takes multiple values | | *** ### CliMatches #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `args` | [`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)\<`string`, [`ArgMatch`](/taurify/api/namespacecli/#argmatch)\> | | | `subcommand` | `null` \| [`SubcommandMatch`](/taurify/api/namespacecli/#subcommandmatch) | | *** ### SubcommandMatch #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `matches` | [`CliMatches`](/taurify/api/namespacecli/#climatches) | | | `name` | `string` | | ## Functions ### getMatches() ```ts function getMatches(): Promise ``` 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` #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`CliMatches`](/taurify/api/namespacecli/#climatches)\> #### Example ```typescript import { getMatches } from '@crabnebula/taurify-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 } ``` # clipboardManager Read and write to the system clipboard. ## Functions ### clear() ```ts function clear(): Promise ``` Clears the clipboard. #### Platform-specific - **Android:** Only supported on SDK 28+. For older releases we write an empty string to the clipboard instead. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> #### Example ```typescript import { clear } from '@crabnebula/taurify-api/clipboard-manager'; await clear(); ``` *** ### readImage() ```ts function readImage(): Promise ``` Gets the clipboard content as Uint8Array image. #### Platform-specific - **Android / iOS:** Not supported. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Image`](/taurify/api/namespaceimage/#image)\> #### Example ```typescript import { readImage } from '@crabnebula/taurify-api/clipboard-manager'; const clipboardImage = await readImage(); const blob = new Blob([await clipboardImage.rgba()], { type: 'image' }) const url = URL.createObjectURL(blob) ``` *** ### readText() ```ts function readText(): Promise ``` Gets the clipboard content as plain text. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { readText } from '@crabnebula/taurify-api/clipboard-manager'; const clipboardText = await readText(); ``` *** ### writeHtml() ```ts function writeHtml(html, altText?): Promise ``` * Writes HTML or fallbacks to write provided plain text to the clipboard. #### Platform-specific - **Android / iOS:** Not supported. #### Parameters | Parameter | Type | | ---------- | -------- | | `html` | `string` | | `altText`? | `string` | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. #### Example ```typescript import { writeHtml } from '@crabnebula/taurify-api/clipboard-manager'; await writeHtml('

Tauri is awesome!

', 'plaintext'); // The following will write "

Tauri is awesome

" as plain text await writeHtml('

Tauri is awesome!

', '

Tauri is awesome

'); // we can read html data only as a string so there's just readText(), no readHtml() assert(await readText(), '

Tauri is awesome!

'); ``` *** ### writeImage() ```ts function writeImage(image): Promise ``` Writes image buffer to the clipboard. #### Platform-specific - **Android / iOS:** Not supported. #### Parameters | Parameter | Type | | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `image` | \| `string` \| `number`[] \| [`ArrayBuffer`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) \| [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\> \| [`Image`](/taurify/api/namespaceimage/#image) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. #### Example ```typescript import { writeImage } from '@crabnebula/taurify-api/clipboard-manager'; const buffer = [ // A red pixel 255, 0, 0, 255, // A green pixel 0, 255, 0, 255, ]; await writeImage(buffer); ``` *** ### writeText() ```ts function writeText(text, opts?): Promise ``` Writes plain text to the clipboard. #### Parameters | Parameter | Type | | ------------- | -------- | | `text` | `string` | | `opts`? | `object` | | `opts.label`? | `string` | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. #### Example ```typescript import { writeText, readText } from '@crabnebula/taurify-api/clipboard-manager'; await writeText('Tauri is awesome!'); assert(await readText(), 'Tauri is awesome!'); ``` # core Invoke your custom commands. This package is also accessible with `window.__TAURIFY__.core`. ## Classes ### Channel\ #### Type Parameters | Type Parameter | Default type | | ------ | ------ | | `T` | `unknown` | #### Constructors ##### new Channel() ```ts new Channel(onmessage?): Channel ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `onmessage`? | (`response`) => `void` | ###### Returns [`Channel`](/taurify/api/namespacecore/#channelt)\<`T`\> #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `id` | `number` | The callback id returned from [`transformCallback`](/taurify/api/namespacecore/#transformcallback) | | #### Accessors ##### onmessage ###### Get Signature ```ts get onmessage(): (response) => void ``` ###### Returns `Function` ###### Parameters | Parameter | Type | | ------ | ------ | | `response` | `T` | ###### Returns `void` ###### Set Signature ```ts set onmessage(handler): void ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | (`response`) => `void` | ###### Returns `void` #### Methods ##### \_\_TAURI\_TO\_IPC\_KEY\_\_() ```ts __TAURI_TO_IPC_KEY__(): string ``` ###### Returns `string` ##### toJSON() ```ts toJSON(): string ``` ###### Returns `string` *** ### PluginListener #### Constructors ##### new PluginListener() ```ts new PluginListener( plugin, event, channelId): PluginListener ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `plugin` | `string` | | `event` | `string` | | `channelId` | `number` | ###### Returns [`PluginListener`](/taurify/api/namespacecore/#pluginlistener) #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `channelId` | `number` | | | `event` | `string` | | | `plugin` | `string` | | #### Methods ##### unregister() ```ts unregister(): Promise ``` ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> *** ### Resource A rust-backed resource. The resource lives in the main process and does not exist in the Javascript world, and thus will not be cleaned up automatiacally except on application exit. If you want to clean it up early, call [`Resource.close`](/taurify/api/namespacecore/#close) #### Example ```typescript import { Resource, invoke } from '@crabnebula/taurify-api/core'; export class DatabaseHandle extends Resource { static async open(path: string): Promise { const rid: number = await invoke('open_db', { path }); return new DatabaseHandle(rid); } async execute(sql: string): Promise { await invoke('execute_sql', { rid: this.rid, sql }); } } ``` #### Extended by - [`TrayIcon`](/taurify/api/namespacetray/#trayicon) - [`Image`](/taurify/api/namespaceimage/#image) - [`FileHandle`](/taurify/api/namespacefs/#filehandle) - [`Store`](/taurify/api/namespacestore/#store) - [`Update`](/taurify/api/namespaceupdater/#update) #### Constructors ##### new Resource() ```ts new Resource(rid): Resource ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `rid` | `number` | ###### Returns [`Resource`](/taurify/api/namespacecore/#resource) #### Accessors ##### rid ###### Get Signature ```ts get rid(): number ``` ###### Returns `number` #### Methods ##### close() ```ts close(): Promise ``` Destroys and cleans up this resource from memory. **You should not call any method on this object anymore and should drop any reference to it.** ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ## Interfaces ### InvokeOptions #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `headers` | `HeadersInit` | | ## Type Aliases ### InvokeArgs ```ts type InvokeArgs: Record | number[] | ArrayBuffer | Uint8Array; ``` Command arguments. *** ### PermissionState ```ts type PermissionState: "granted" | "denied" | "prompt" | "prompt-with-rationale"; ``` ## Variables ### SERIALIZE\_TO\_IPC\_FN ```ts const SERIALIZE_TO_IPC_FN: "__TAURI_TO_IPC_KEY__" = '__TAURI_TO_IPC_KEY__'; ``` A key to be used to implement a special function on your types that define how your type should be serialized when passing across the IPC. #### Example Given a type in Rust that looks like this ```rs #[derive(serde::Serialize, serde::Deserialize) enum UserId { String(String), Number(u32), } ``` `UserId::String("id")` would be serialized into `{ String: "id" }` and so we need to pass the same structure back to Rust ```ts import { SERIALIZE_TO_IPC_FN } from "@crabnebula/taurify-api/core" class UserIdString { id constructor(id) { this.id = id } [SERIALIZE_TO_IPC_FN]() { return { String: this.id } } } class UserIdNumber { id constructor(id) { this.id = id } [SERIALIZE_TO_IPC_FN]() { return { Number: this.id } } } type UserId = UserIdString | UserIdNumber ``` ## Functions ### addPluginListener() ```ts function addPluginListener( plugin, event, cb): Promise ``` Adds a listener to a plugin event. #### Type Parameters | Type Parameter | | ------ | | `T` | #### Parameters | Parameter | Type | | ------ | ------ | | `plugin` | `string` | | `event` | `string` | | `cb` | (`payload`) => `void` | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`PluginListener`](/taurify/api/namespacecore/#pluginlistener)\> The listener object to stop listening to the events. *** ### checkPermissions() ```ts function checkPermissions(plugin): Promise ``` Get permission state for a plugin. This should be used by plugin authors to wrap their actual implementation. #### Type Parameters | Type Parameter | | ------ | | `T` | #### Parameters | Parameter | Type | | ------ | ------ | | `plugin` | `string` | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`T`\> *** ### convertFileSrc() ```ts function convertFileSrc(filePath, protocol): string ``` Convert a device file path to an URL that can be loaded by the webview. Note that `asset:` and `http://asset.localhost` must be added to [`app.security.csp`](https://v2.tauri.app/reference/config/#csp-1) in `tauri.conf.json`. Example CSP value: `"csp": "default-src 'self' ipc: http://ipc.localhost; img-src 'self' asset: http://asset.localhost"` to use the asset protocol on image sources. Additionally, `"enable" : "true"` must be added to [`app.security.assetProtocol`](https://v2.tauri.app/reference/config/#assetprotocolconfig) in `tauri.conf.json` and its access scope must be defined on the `scope` array on the same `assetProtocol` object. #### Parameters | Parameter | 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. #### Example ```typescript import { appDataDir, join } from '@crabnebula/taurify-api/path'; import { convertFileSrc } from '@crabnebula/taurify-api/core'; 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(); ``` *** ### invoke() ```ts function invoke( cmd, args, options?): Promise ``` Sends a message to the backend. #### Type Parameters | Type Parameter | | ------ | | `T` | #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `cmd` | `string` | The command name. | | `args` | [`InvokeArgs`](/taurify/api/namespacecore/#invokeargs) | The optional arguments to pass to the command. | | `options`? | [`InvokeOptions`](/taurify/api/namespacecore/#invokeoptions) | The request options. | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`T`\> A promise resolving or rejecting to the backend response. #### Example ```typescript import { invoke } from '@crabnebula/taurify-api/core'; await invoke('login', { user: 'tauri', password: 'poiwe3h4r5ip3yrhtew9ty' }); ``` *** ### isTauri() ```ts function isTauri(): boolean ``` #### Returns `boolean` *** ### requestPermissions() ```ts function requestPermissions(plugin): Promise ``` Request permissions. This should be used by plugin authors to wrap their actual implementation. #### Type Parameters | Type Parameter | | ------ | | `T` | #### Parameters | Parameter | Type | | ------ | ------ | | `plugin` | `string` | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`T`\> *** ### transformCallback() ```ts function transformCallback(callback?, once?): number ``` Stores the callback in a known location, and returns an identifier that can be passed to the backend. The backend uses the identifier to `eval()` the callback. #### Type Parameters | Type Parameter | Default type | | ------ | ------ | | `T` | `unknown` | #### Parameters | Parameter | Type | Default value | | ------ | ------ | ------ | | `callback`? | (`response`) => `void` | `undefined` | | `once`? | `boolean` | `false` | #### Returns `number` An unique identifier associated with the callback function. # deepLink ## Functions ### getCurrent() ```ts function getCurrent(): Promise ``` Get the current URLs that triggered the deep link. Use this on app load to check whether your app was started via a deep link. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`[] \| `null`\> #### Example ```typescript import { getCurrent } from '@crabnebula/taurify-api/deep-link'; const urls = await getCurrent(); ``` #### - **Windows / Linux**: This function reads the command line arguments and checks if there's only one value, which must be an URL with scheme matching one of the configured values. Note that you must manually check the arguments when registering deep link schemes dynamically with [`Self::register`]. Additionally, the deep link might have been provided as a CLI argument so you should check if its format matches what you expect.. *** ### isRegistered() ```ts function isRegistered(protocol): Promise ``` Check whether the app is the default handler for the specified protocol. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `protocol` | `string` | The name of the protocol without `://`. | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> #### Example ```typescript import { isRegistered } from '@crabnebula/taurify-api/deep-link'; await isRegistered("my-scheme"); ``` #### - **macOS / Android / iOS**: Unsupported. *** ### onOpenUrl() ```ts function onOpenUrl(handler): Promise ``` Helper function for the `deep-link://new-url` event to run a function each time the protocol is triggered while the app is running. Use `getCurrent` on app load to check whether your app was started via a deep link. #### Parameters | Parameter | Type | | ------ | ------ | | `handler` | (`urls`) => `void` | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#unlistenfn)\> #### Example ```typescript import { onOpenUrl } from '@crabnebula/taurify-api/deep-link'; await onOpenUrl((urls) => { console.log(urls) }); ``` #### - **Windows / Linux**: Unsupported without the single-instance plugin. The OS will spawn a new app instance passing the URL as a CLI argument. *** ### register() ```ts function register(protocol): Promise ``` Register the app as the default handler for the specified protocol. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `protocol` | `string` | The name of the protocol without `://`. For example, if you want your app to handle `tauri://` links, call this method with `tauri` as the protocol. | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`null`\> #### Example ```typescript import { register } from '@crabnebula/taurify-api/deep-link'; await register("my-scheme"); ``` #### - **macOS / Android / iOS**: Unsupported. *** ### unregister() ```ts function unregister(protocol): Promise ``` Unregister the app as the default handler for the specified protocol. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `protocol` | `string` | The name of the protocol without `://`. | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`null`\> #### Example ```typescript import { unregister } from '@crabnebula/taurify-api/deep-link'; await unregister("my-scheme"); ``` #### - **macOS / Linux / Android / iOS**: Unsupported. # dialog ## Interfaces ### ConfirmDialogOptions #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `cancelLabel?` | `string` | The label of the cancel button. | | | `kind?` | `"error"` \| `"info"` \| `"warning"` | The kind of the dialog. Defaults to `info`. | | | `okLabel?` | `string` | The label of the confirm button. | | | `title?` | `string` | The title of the dialog. Defaults to the app name. | | *** ### DialogFilter Extension filters for the file dialog. #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `extensions` | `string`[] | Extensions to filter, without a `.` prefix. **Example** `extensions: ['svg', 'png']` | | | `name` | `string` | Filter name. | | *** ### MessageDialogOptions #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `kind?` | `"error"` \| `"info"` \| `"warning"` | The kind of the dialog. Defaults to `info`. | | | `okLabel?` | `string` | The label of the confirm button. | | | `title?` | `string` | The title of the dialog. Defaults to the app name. | | *** ### OpenDialogOptions Options for the open dialog. #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `canCreateDirectories?` | `boolean` | Whether to allow creating directories in the dialog. Enabled by default. **macOS Only** | | | `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. On mobile the file name is always used on the dialog's file name input. If not provided, Android uses `(invalid).txt` as default file name. | | | `directory?` | `boolean` | Whether the dialog is a directory selection or not. | | | `filters?` | [`DialogFilter`](/taurify/api/namespacedialog/#dialogfilter)[] | The filters of the dialog. | | | `multiple?` | `boolean` | Whether the dialog allows multiple selection or not. | | | `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. | | | `title?` | `string` | The title of the dialog window (desktop only). | | *** ### SaveDialogOptions Options for the save dialog. #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `canCreateDirectories?` | `boolean` | Whether to allow creating directories in the dialog. Enabled by default. **macOS Only** | | | `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. On mobile the file name is always used on the dialog's file name input. If not provided, Android uses `(invalid).txt` as default file name. | | | `filters?` | [`DialogFilter`](/taurify/api/namespacedialog/#dialogfilter)[] | The filters of the dialog. | | | `title?` | `string` | The title of the dialog window (desktop only). | | ## Type Aliases ### OpenDialogReturn\ ```ts type OpenDialogReturn: T["directory"] extends true ? T["multiple"] extends true ? string[] | null : string | null : T["multiple"] extends true ? string[] | null : string | null; ``` #### Type Parameters | Type Parameter | | ------ | | `T` *extends* [`OpenDialogOptions`](/taurify/api/namespacedialog/#opendialogoptions) | ## Functions ### ask() ```ts function ask(message, options?): Promise ``` Shows a question dialog with `Yes` and `No` buttons. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `message` | `string` | The message to show. | | `options`? | `string` \| [`ConfirmDialogOptions`](/taurify/api/namespacedialog/#confirmdialogoptions) | The dialog's options. If a string, it represents the dialog title. | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> A promise resolving to a boolean indicating whether `Yes` was clicked or not. #### Example ```typescript import { ask } from '@crabnebula/taurify-api/dialog'; const yes = await ask('Are you sure?', 'Tauri'); const yes2 = await ask('This action cannot be reverted. Are you sure?', { title: 'Tauri', kind: 'warning' }); ``` *** ### confirm() ```ts function confirm(message, options?): Promise ``` Shows a question dialog with `Ok` and `Cancel` buttons. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `message` | `string` | The message to show. | | `options`? | `string` \| [`ConfirmDialogOptions`](/taurify/api/namespacedialog/#confirmdialogoptions) | The dialog's options. If a string, it represents the dialog title. | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> A promise resolving to a boolean indicating whether `Ok` was clicked or not. #### Example ```typescript import { confirm } from '@crabnebula/taurify-api/dialog'; const confirmed = await confirm('Are you sure?', 'Tauri'); const confirmed2 = await confirm('This action cannot be reverted. Are you sure?', { title: 'Tauri', kind: 'warning' }); ``` *** ### message() ```ts function message(message, options?): Promise ``` Shows a message dialog with an `Ok` button. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `message` | `string` | The message to show. | | `options`? | `string` \| [`MessageDialogOptions`](/taurify/api/namespacedialog/#messagedialogoptions) | The dialog's options. If a string, it represents the dialog title. | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. #### Example ```typescript import { message } from '@crabnebula/taurify-api/dialog'; await message('Tauri is awesome', 'Tauri'); await message('File not found', { title: 'Tauri', kind: 'error' }); ``` *** ### open() ```ts function open(options): Promise> ``` Open a file/directory selection dialog. The selected paths are added to the filesystem and asset protocol scopes. When security is more important than the easy of use of this API, prefer writing a dedicated command instead. Note that the 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). #### Type Parameters | Type Parameter | | ------ | | `T` *extends* [`OpenDialogOptions`](/taurify/api/namespacedialog/#opendialogoptions) | #### Parameters | Parameter | Type | | ------ | ------ | | `options` | `T` | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`OpenDialogReturn`](/taurify/api/namespacedialog/#opendialogreturnt)\<`T`\>\> A promise resolving to the selected path(s) #### Examples ```typescript import { open } from '@crabnebula/taurify-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 } ``` ```typescript import { open } from '@crabnebula/taurify-api/dialog'; import { appDir } from '../../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 } ``` *** ### save() ```ts function save(options): Promise ``` Open a file/directory save dialog. The selected path is added to the filesystem and asset protocol scopes. When security is more important than the easy of use of this API, prefer writing a dedicated command instead. Note that the 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). #### Parameters | Parameter | Type | | ------ | ------ | | `options` | [`SaveDialogOptions`](/taurify/api/namespacedialog/#savedialogoptions) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string` \| `null`\> A promise resolving to the selected path. #### Example ```typescript import { save } from '@crabnebula/taurify-api/dialog'; const filePath = await save({ filters: [{ name: 'Image', extensions: ['png', 'jpeg'] }] }); ``` # dpi ## Classes ### LogicalPosition A position represented in logical pixels. For an explanation of what logical pixels are, see description of [`LogicalSize`](/taurify/api/namespacedpi/#logicalsize). #### Constructors ##### new LogicalPosition() ```ts new LogicalPosition(x, y): LogicalPosition ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `x` | `number` | | `y` | `number` | ###### Returns [`LogicalPosition`](/taurify/api/namespacedpi/#logicalposition) ##### new LogicalPosition() ```ts new LogicalPosition(object): LogicalPosition ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `object` | `object` | | `object.Logical` | `object` | | `object.Logical.x` | `number` | | `object.Logical.y` | `number` | ###### Returns [`LogicalPosition`](/taurify/api/namespacedpi/#logicalposition) ##### new LogicalPosition() ```ts new LogicalPosition(object): LogicalPosition ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `object` | `object` | | `object.x` | `number` | | `object.y` | `number` | ###### Returns [`LogicalPosition`](/taurify/api/namespacedpi/#logicalposition) #### Properties | Property | Modifier | Type | Default value | Defined in | | ------ | ------ | ------ | ------ | ------ | | `type` | `readonly` | `"Logical"` | `'Logical'` | | | `x` | `public` | `number` | `undefined` | | | `y` | `public` | `number` | `undefined` | | #### Methods ##### \_\_TAURI\_TO\_IPC\_KEY\_\_() ```ts __TAURI_TO_IPC_KEY__(): object ``` ###### Returns `object` | Name | Type | Defined in | | ------ | ------ | ------ | | `x` | `number` | | | `y` | `number` | | ##### toJSON() ```ts toJSON(): object ``` ###### Returns `object` | Name | Type | Defined in | | ------ | ------ | ------ | | `x` | `number` | | | `y` | `number` | | ##### toPhysical() ```ts toPhysical(scaleFactor): PhysicalPosition ``` Converts the logical position to a physical one. ###### Parameters | Parameter | Type | | ------ | ------ | | `scaleFactor` | `number` | ###### Returns [`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition) ###### Example ```typescript import { LogicalPosition } from '@crabnebula/taurify-api/dpi'; import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const appWindow = getCurrentWindow(); const factor = await appWindow.scaleFactor(); const position = new LogicalPosition(400, 500); const physical = position.toPhysical(factor); ``` *** ### LogicalSize A size represented in logical pixels. Logical pixels are scaled according to the window's DPI scale. Most browser APIs (i.e. `MouseEvent`'s `clientX`) will return logical pixels. For logical-pixel-based position, see [`LogicalPosition`](/taurify/api/namespacedpi/#logicalposition). #### Constructors ##### new LogicalSize() ```ts new LogicalSize(width, height): LogicalSize ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `width` | `number` | | `height` | `number` | ###### Returns [`LogicalSize`](/taurify/api/namespacedpi/#logicalsize) ##### new LogicalSize() ```ts new LogicalSize(object): LogicalSize ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `object` | `object` | | `object.Logical` | `object` | | `object.Logical.height` | `number` | | `object.Logical.width` | `number` | ###### Returns [`LogicalSize`](/taurify/api/namespacedpi/#logicalsize) ##### new LogicalSize() ```ts new LogicalSize(object): LogicalSize ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `object` | `object` | | `object.height` | `number` | | `object.width` | `number` | ###### Returns [`LogicalSize`](/taurify/api/namespacedpi/#logicalsize) #### Properties | Property | Modifier | Type | Default value | Defined in | | ------ | ------ | ------ | ------ | ------ | | `height` | `public` | `number` | `undefined` | | | `type` | `readonly` | `"Logical"` | `'Logical'` | | | `width` | `public` | `number` | `undefined` | | #### Methods ##### \_\_TAURI\_TO\_IPC\_KEY\_\_() ```ts __TAURI_TO_IPC_KEY__(): object ``` ###### Returns `object` | Name | Type | Defined in | | ------ | ------ | ------ | | `height` | `number` | | | `width` | `number` | | ##### toJSON() ```ts toJSON(): object ``` ###### Returns `object` | Name | Type | Defined in | | ------ | ------ | ------ | | `height` | `number` | | | `width` | `number` | | ##### toPhysical() ```ts toPhysical(scaleFactor): PhysicalSize ``` Converts the logical size to a physical one. ###### Parameters | Parameter | Type | | ------ | ------ | | `scaleFactor` | `number` | ###### Returns [`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize) ###### Example ```typescript import { LogicalSize } from '@crabnebula/taurify-api/dpi'; import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const appWindow = getCurrentWindow(); const factor = await appWindow.scaleFactor(); const size = new LogicalSize(400, 500); const physical = size.toPhysical(factor); ``` *** ### PhysicalPosition A position represented in physical pixels. For an explanation of what physical pixels are, see description of [`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize). #### Constructors ##### new PhysicalPosition() ```ts new PhysicalPosition(x, y): PhysicalPosition ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `x` | `number` | | `y` | `number` | ###### Returns [`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition) ##### new PhysicalPosition() ```ts new PhysicalPosition(object): PhysicalPosition ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `object` | `object` | | `object.Physical` | `object` | | `object.Physical.x` | `number` | | `object.Physical.y` | `number` | ###### Returns [`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition) ##### new PhysicalPosition() ```ts new PhysicalPosition(object): PhysicalPosition ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `object` | `object` | | `object.x` | `number` | | `object.y` | `number` | ###### Returns [`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition) #### Properties | Property | Modifier | Type | Default value | Defined in | | ------ | ------ | ------ | ------ | ------ | | `type` | `readonly` | `"Physical"` | `'Physical'` | | | `x` | `public` | `number` | `undefined` | | | `y` | `public` | `number` | `undefined` | | #### Methods ##### \_\_TAURI\_TO\_IPC\_KEY\_\_() ```ts __TAURI_TO_IPC_KEY__(): object ``` ###### Returns `object` | Name | Type | Defined in | | ------ | ------ | ------ | | `x` | `number` | | | `y` | `number` | | ##### toJSON() ```ts toJSON(): object ``` ###### Returns `object` | Name | Type | Defined in | | ------ | ------ | ------ | | `x` | `number` | | | `y` | `number` | | ##### toLogical() ```ts toLogical(scaleFactor): LogicalPosition ``` Converts the physical position to a logical one. ###### Parameters | Parameter | Type | | ------ | ------ | | `scaleFactor` | `number` | ###### Returns [`LogicalPosition`](/taurify/api/namespacedpi/#logicalposition) ###### Example ```typescript import { PhysicalPosition } from '@crabnebula/taurify-api/dpi'; import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const appWindow = getCurrentWindow(); const factor = await appWindow.scaleFactor(); const position = new PhysicalPosition(400, 500); const physical = position.toLogical(factor); ``` *** ### PhysicalSize A size represented in physical pixels. Physical pixels represent actual screen pixels, and are DPI-independent. For high-DPI windows, this means that any point in the window on the screen will have a different position in logical pixels (@linkcode LogicalSize). For physical-pixel-based position, see [`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition). #### Constructors ##### new PhysicalSize() ```ts new PhysicalSize(width, height): PhysicalSize ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `width` | `number` | | `height` | `number` | ###### Returns [`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize) ##### new PhysicalSize() ```ts new PhysicalSize(object): PhysicalSize ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `object` | `object` | | `object.Physical` | `object` | | `object.Physical.height` | `number` | | `object.Physical.width` | `number` | ###### Returns [`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize) ##### new PhysicalSize() ```ts new PhysicalSize(object): PhysicalSize ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `object` | `object` | | `object.height` | `number` | | `object.width` | `number` | ###### Returns [`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize) #### Properties | Property | Modifier | Type | Default value | Defined in | | ------ | ------ | ------ | ------ | ------ | | `height` | `public` | `number` | `undefined` | | | `type` | `readonly` | `"Physical"` | `'Physical'` | | | `width` | `public` | `number` | `undefined` | | #### Methods ##### \_\_TAURI\_TO\_IPC\_KEY\_\_() ```ts __TAURI_TO_IPC_KEY__(): object ``` ###### Returns `object` | Name | Type | Defined in | | ------ | ------ | ------ | | `height` | `number` | | | `width` | `number` | | ##### toJSON() ```ts toJSON(): object ``` ###### Returns `object` | Name | Type | Defined in | | ------ | ------ | ------ | | `height` | `number` | | | `width` | `number` | | ##### toLogical() ```ts toLogical(scaleFactor): LogicalSize ``` Converts the physical size to a logical one. ###### Parameters | Parameter | Type | | ------ | ------ | | `scaleFactor` | `number` | ###### Returns [`LogicalSize`](/taurify/api/namespacedpi/#logicalsize) ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const appWindow = getCurrentWindow(); const factor = await appWindow.scaleFactor(); const size = await appWindow.innerSize(); // PhysicalSize const logical = size.toLogical(factor); ``` *** ### Position A position represented either in physical or in logical pixels. This type is basically a union type of [`LogicalSize`](/taurify/api/namespacedpi/#logicalsize) and [`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize) but comes in handy when using `tauri::Position` in Rust as an argument to a command, as this class automatically serializes into a valid format so it can be deserialized correctly into `tauri::Position` So instead of ```typescript import { invoke } from '@crabnebula/taurify-api/core'; import { LogicalPosition, PhysicalPosition } from '@crabnebula/taurify-api/dpi'; const position: LogicalPosition | PhysicalPosition = someFunction(); // where someFunction returns either LogicalPosition or PhysicalPosition const validPosition = position instanceof LogicalPosition ? { Logical: { x: position.x, y: position.y } } : { Physical: { x: position.x, y: position.y } } await invoke("do_something_with_position", { position: validPosition }); ``` You can just use [`Position`](/taurify/api/namespacedpi/#position) ```typescript import { invoke } from '@crabnebula/taurify-api/core'; import { LogicalPosition, PhysicalPosition, Position } from '@crabnebula/taurify-api/dpi'; const position: LogicalPosition | PhysicalPosition = someFunction(); // where someFunction returns either LogicalPosition or PhysicalPosition const validPosition = new Position(position); await invoke("do_something_with_position", { position: validPosition }); ``` #### Constructors ##### new Position() ```ts new Position(position): Position ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `position` | [`LogicalPosition`](/taurify/api/namespacedpi/#logicalposition) \| [`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition) | ###### Returns [`Position`](/taurify/api/namespacedpi/#position) #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `position` | [`LogicalPosition`](/taurify/api/namespacedpi/#logicalposition) \| [`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition) | | #### Methods ##### \_\_TAURI\_TO\_IPC\_KEY\_\_() ```ts __TAURI_TO_IPC_KEY__(): object ``` ###### Returns `object` ##### toJSON() ```ts toJSON(): object ``` ###### Returns `object` ##### toLogical() ```ts toLogical(scaleFactor): LogicalPosition ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `scaleFactor` | `number` | ###### Returns [`LogicalPosition`](/taurify/api/namespacedpi/#logicalposition) ##### toPhysical() ```ts toPhysical(scaleFactor): PhysicalPosition ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `scaleFactor` | `number` | ###### Returns [`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition) *** ### Size A size represented either in physical or in logical pixels. This type is basically a union type of [`LogicalSize`](/taurify/api/namespacedpi/#logicalsize) and [`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize) but comes in handy when using `tauri::Size` in Rust as an argument to a command, as this class automatically serializes into a valid format so it can be deserialized correctly into `tauri::Size` So instead of ```typescript import { invoke } from '@crabnebula/taurify-api/core'; import { LogicalSize, PhysicalSize } from '@crabnebula/taurify-api/dpi'; const size: LogicalSize | PhysicalSize = someFunction(); // where someFunction returns either LogicalSize or PhysicalSize const validSize = size instanceof LogicalSize ? { Logical: { width: size.width, height: size.height } } : { Physical: { width: size.width, height: size.height } } await invoke("do_something_with_size", { size: validSize }); ``` You can just use [`Size`](/taurify/api/namespacedpi/#size) ```typescript import { invoke } from '@crabnebula/taurify-api/core'; import { LogicalSize, PhysicalSize, Size } from '@crabnebula/taurify-api/dpi'; const size: LogicalSize | PhysicalSize = someFunction(); // where someFunction returns either LogicalSize or PhysicalSize const validSize = new Size(size); await invoke("do_something_with_size", { size: validSize }); ``` #### Constructors ##### new Size() ```ts new Size(size): Size ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `size` | [`LogicalSize`](/taurify/api/namespacedpi/#logicalsize) \| [`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize) | ###### Returns [`Size`](/taurify/api/namespacedpi/#size) #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `size` | [`LogicalSize`](/taurify/api/namespacedpi/#logicalsize) \| [`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize) | | #### Methods ##### \_\_TAURI\_TO\_IPC\_KEY\_\_() ```ts __TAURI_TO_IPC_KEY__(): object ``` ###### Returns `object` ##### toJSON() ```ts toJSON(): object ``` ###### Returns `object` ##### toLogical() ```ts toLogical(scaleFactor): LogicalSize ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `scaleFactor` | `number` | ###### Returns [`LogicalSize`](/taurify/api/namespacedpi/#logicalsize) ##### toPhysical() ```ts toPhysical(scaleFactor): PhysicalSize ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `scaleFactor` | `number` | ###### Returns [`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize) # event The event system allows you to emit events to the backend and listen to events from it. ## Enumerations ### TauriEvent #### Enumeration Members ##### DRAG\_DROP ```ts DRAG_DROP: "tauri://drag-drop"; ``` ##### DRAG\_ENTER ```ts DRAG_ENTER: "tauri://drag-enter"; ``` ##### DRAG\_LEAVE ```ts DRAG_LEAVE: "tauri://drag-leave"; ``` ##### DRAG\_OVER ```ts DRAG_OVER: "tauri://drag-over"; ``` ##### WEBVIEW\_CREATED ```ts WEBVIEW_CREATED: "tauri://webview-created"; ``` ##### WINDOW\_BLUR ```ts WINDOW_BLUR: "tauri://blur"; ``` ##### WINDOW\_CLOSE\_REQUESTED ```ts WINDOW_CLOSE_REQUESTED: "tauri://close-requested"; ``` ##### WINDOW\_CREATED ```ts WINDOW_CREATED: "tauri://window-created"; ``` ##### WINDOW\_DESTROYED ```ts WINDOW_DESTROYED: "tauri://destroyed"; ``` ##### WINDOW\_FOCUS ```ts WINDOW_FOCUS: "tauri://focus"; ``` ##### WINDOW\_MOVED ```ts WINDOW_MOVED: "tauri://move"; ``` ##### WINDOW\_RESIZED ```ts WINDOW_RESIZED: "tauri://resize"; ``` ##### WINDOW\_SCALE\_FACTOR\_CHANGED ```ts WINDOW_SCALE_FACTOR_CHANGED: "tauri://scale-change"; ``` ##### WINDOW\_THEME\_CHANGED ```ts WINDOW_THEME_CHANGED: "tauri://theme-changed"; ``` ## Interfaces ### Event\ #### Type Parameters | Type Parameter | | ------ | | `T` | #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `event` | [`EventName`](/taurify/api/namespaceevent/#eventname) | Event name | | | `id` | `number` | Event identifier used to unlisten | | | `payload` | `T` | Event payload | | *** ### Options #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `target?` | `string` \| [`EventTarget`](/taurify/api/namespaceevent/#eventtarget) | The event target to listen to, defaults to `{ kind: 'Any' }`, see [EventTarget](/taurify/api/namespaceevent/#eventtarget). If a string is provided, EventTarget.AnyLabel is used. | | ## Type Aliases ### EventCallback()\ ```ts type EventCallback: (event) => void; ``` #### Type Parameters | Type Parameter | | ------ | | `T` | #### Parameters | Parameter | Type | | ------ | ------ | | `event` | [`Event`](/taurify/api/namespaceevent/#eventt)\<`T`\> | #### Returns `void` *** ### EventName ```ts type EventName: `${TauriEvent}` | string & Record; ``` *** ### EventTarget ```ts type EventTarget: | object | object | object | object | object | object; ``` *** ### UnlistenFn() ```ts type UnlistenFn: () => void; ``` #### Returns `void` ## Functions ### emit() ```ts function emit(event, payload?): Promise ``` Emits an event to all [targets](/taurify/api/namespaceevent/#eventtarget). #### Type Parameters | Type Parameter | | ------ | | `T` | #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `event` | `string` | Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. | | `payload`? | `T` | Event payload. | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> #### Example ```typescript import { emit } from '@crabnebula/taurify-api/event'; await emit('frontend-loaded', { loggedIn: true, token: 'authToken' }); ``` *** ### emitTo() ```ts function emitTo( target, event, payload?): Promise ``` Emits an event to all [targets](/taurify/api/namespaceevent/#eventtarget) matching the given target. #### Type Parameters | Type Parameter | | ------ | | `T` | #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `target` | `string` \| [`EventTarget`](/taurify/api/namespaceevent/#eventtarget) | Label of the target Window/Webview/WebviewWindow or raw [EventTarget](/taurify/api/namespaceevent/#eventtarget) object. | | `event` | `string` | Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. | | `payload`? | `T` | Event payload. | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> #### Example ```typescript import { emitTo } from '@crabnebula/taurify-api/event'; await emitTo('main', 'frontend-loaded', { loggedIn: true, token: 'authToken' }); ``` *** ### listen() ```ts function listen( event, handler, options?): Promise ``` Listen to an emitted event to any [target](/taurify/api/namespaceevent/#eventtarget). #### Type Parameters | Type Parameter | | ------ | | `T` | #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `event` | [`EventName`](/taurify/api/namespaceevent/#eventname) | Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. | | `handler` | [`EventCallback`](/taurify/api/namespaceevent/#eventcallbackt)\<`T`\> | Event handler callback. | | `options`? | [`Options`](/taurify/api/namespaceevent/#options) | Event listening options. | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#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. #### Example ```typescript import { listen } from '@crabnebula/taurify-api/event'; const unlisten = await listen('error', (event) => { console.log(`Got error, payload: ${event.payload}`); }); // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted unlisten(); ``` *** ### once() ```ts function once( event, handler, options?): Promise ``` Listens once to an emitted event to any [target](/taurify/api/namespaceevent/#eventtarget). #### Type Parameters | Type Parameter | | ------ | | `T` | #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `event` | [`EventName`](/taurify/api/namespaceevent/#eventname) | Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. | | `handler` | [`EventCallback`](/taurify/api/namespaceevent/#eventcallbackt)\<`T`\> | Event handler callback. | | `options`? | [`Options`](/taurify/api/namespaceevent/#options) | Event listening options. | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#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. #### Example ```typescript import { once } from '@crabnebula/taurify-api/event'; interface LoadedPayload { loggedIn: boolean, token: string } const unlisten = await once('loaded', (event) => { console.log(`App is loaded, loggedIn: ${event.payload.loggedIn}, token: ${event.payload.token}`); }); // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted unlisten(); ``` # fs Access the file system. ## Security This module prevents path traversal, not allowing parent directory accessors to be used (i.e. "/usr/path/to/../file" or "../path/to/file" paths are not allowed). Paths accessed with this API must be either relative to one of the [base directories](/taurify/api/namespacepath/#basedirectory) or created with the [path API](https://v2.tauri.app/taurify/api/namespacepath/). 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 file/directory paths that are allowed. For instance, this scope configuration allows **all** enabled `fs` APIs to (only) access files in the *databases* directory of the [`$APPDATA` directory](https://v2.tauri.app/taurify/api/namespacepath/#appdatadir): ```json { "permissions": [ { "identifier": "fs:scope", "allow": [{ "path": "$APPDATA/databases/*" }] } ] } ``` Scopes can also be applied to specific `fs` APIs by using the API's identifier instead of `fs:scope`: ```json { "permissions": [ { "identifier": "fs:allow-exists", "allow": [{ "path": "$APPDATA/databases/*" }] } ] } ``` Notice the use of the `$APPDATA` variable. The value is injected at runtime, resolving to the [app data directory](https://v2.tauri.app/taurify/api/namespacepath/#appdatadir). The available variables are: [`$APPCONFIG`](https://v2.tauri.app/taurify/api/namespacepath/#appconfigdir), [`$APPDATA`](https://v2.tauri.app/taurify/api/namespacepath/#appdatadir), [`$APPLOCALDATA`](https://v2.tauri.app/taurify/api/namespacepath/#applocaldatadir), [`$APPCACHE`](https://v2.tauri.app/taurify/api/namespacepath/#appcachedir), [`$APPLOG`](https://v2.tauri.app/taurify/api/namespacepath/#applogdir), [`$AUDIO`](https://v2.tauri.app/taurify/api/namespacepath/#audiodir), [`$CACHE`](https://v2.tauri.app/taurify/api/namespacepath/#cachedir), [`$CONFIG`](https://v2.tauri.app/taurify/api/namespacepath/#configdir), [`$DATA`](https://v2.tauri.app/taurify/api/namespacepath/#datadir), [`$LOCALDATA`](https://v2.tauri.app/taurify/api/namespacepath/#localdatadir), [`$DESKTOP`](https://v2.tauri.app/taurify/api/namespacepath/#desktopdir), [`$DOCUMENT`](https://v2.tauri.app/taurify/api/namespacepath/#documentdir), [`$DOWNLOAD`](https://v2.tauri.app/taurify/api/namespacepath/#downloaddir), [`$EXE`](https://v2.tauri.app/taurify/api/namespacepath/#executabledir), [`$FONT`](https://v2.tauri.app/taurify/api/namespacepath/#fontdir), [`$HOME`](https://v2.tauri.app/taurify/api/namespacepath/#homedir), [`$PICTURE`](https://v2.tauri.app/taurify/api/namespacepath/#picturedir), [`$PUBLIC`](https://v2.tauri.app/taurify/api/namespacepath/#publicdir), [`$RUNTIME`](https://v2.tauri.app/taurify/api/namespacepath/#runtimedir), [`$TEMPLATE`](https://v2.tauri.app/taurify/api/namespacepath/#templatedir), [`$VIDEO`](https://v2.tauri.app/taurify/api/namespacepath/#videodir), [`$RESOURCE`](https://v2.tauri.app/taurify/api/namespacepath/#resourcedir), [`$TEMP`](https://v2.tauri.app/taurify/api/namespacepath/#tempdir). Trying to execute any API with a URL not configured on the scope results in a promise rejection due to denied access. ## References ### BaseDirectory Re-exports [BaseDirectory](/taurify/api/namespacepath/#basedirectory) ## Enumerations ### SeekMode #### Enumeration Members ##### Current ```ts Current: 1; ``` ##### End ```ts End: 2; ``` ##### Start ```ts Start: 0; ``` ## Classes ### FileHandle The Tauri abstraction for reading and writing files. #### Extends - [`Resource`](/taurify/api/namespacecore/#resource) #### Constructors ##### new FileHandle() ```ts new FileHandle(rid): FileHandle ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `rid` | `number` | ###### Returns [`FileHandle`](/taurify/api/namespacefs/#filehandle) ###### Inherited from [`Resource`](/taurify/api/namespacecore/#resource).[`constructor`](/taurify/api/namespacecore/#constructors-2) #### Accessors ##### rid ###### Get Signature ```ts get rid(): number ``` ###### Returns `number` ###### Inherited from [`Resource`](/taurify/api/namespacecore/#resource).[`rid`](/taurify/api/namespacecore/#rid) #### Methods ##### close() ```ts close(): Promise ``` Destroys and cleans up this resource from memory. **You should not call any method on this object anymore and should drop any reference to it.** ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Inherited from [`Resource`](/taurify/api/namespacecore/#resource).[`close`](/taurify/api/namespacecore/#close) ##### read() ```ts read(buffer): Promise ``` Reads up to `p.byteLength` bytes into `p`. It resolves to the number of bytes read (`0` < `n` <= `p.byteLength`) and rejects if any error encountered. Even if `read()` resolves to `n` < `p.byteLength`, it may use all of `p` as scratch space during the call. If some data is available but not `p.byteLength` bytes, `read()` conventionally resolves to what is available instead of waiting for more. When `read()` encounters end-of-file condition, it resolves to EOF (`null`). When `read()` encounters an error, it rejects with an error. Callers should always process the `n` > `0` bytes returned before considering the EOF (`null`). Doing so correctly handles I/O errors that happen after reading some bytes and also both of the allowed EOF behaviors. ###### Parameters | Parameter | Type | | ------ | ------ | | `buffer` | [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\> | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`null` \| `number`\> ###### Example ```typescript import { open, BaseDirectory } from "@crabnebula/taurify-api/fs" // if "$APPCONFIG/foo/bar.txt" contains the text "hello world": const file = await open("foo/bar.txt", { baseDir: BaseDirectory.AppConfig }); const buf = new Uint8Array(100); const numberOfBytesRead = await file.read(buf); // 11 bytes const text = new TextDecoder().decode(buf); // "hello world" await file.close(); ``` ##### seek() ```ts seek(offset, whence): Promise ``` Seek sets the offset for the next `read()` or `write()` to offset, interpreted according to `whence`: `Start` means relative to the start of the file, `Current` means relative to the current offset, and `End` means relative to the end. Seek resolves to the new offset relative to the start of the file. Seeking to an offset before the start of the file is an error. Seeking to any positive offset is legal, but the behavior of subsequent I/O operations on the underlying object is implementation-dependent. It returns the number of cursor position. ###### Parameters | Parameter | Type | | ------ | ------ | | `offset` | `number` | | `whence` | [`SeekMode`](/taurify/api/namespacefs/#seekmode) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`number`\> ###### Example ```typescript import { open, SeekMode, BaseDirectory } from '@crabnebula/taurify-api/fs'; // Given hello.txt pointing to file with "Hello world", which is 11 bytes long: const file = await open('hello.txt', { read: true, write: true, truncate: true, create: true, baseDir: BaseDirectory.AppLocalData }); await file.write(new TextEncoder().encode("Hello world")); // Seek 6 bytes from the start of the file console.log(await file.seek(6, SeekMode.Start)); // "6" // Seek 2 more bytes from the current position console.log(await file.seek(2, SeekMode.Current)); // "8" // Seek backwards 2 bytes from the end of the file console.log(await file.seek(-2, SeekMode.End)); // "9" (e.g. 11-2) await file.close(); ``` ##### stat() ```ts stat(): Promise ``` Returns a [`FileInfo`](/taurify/api/namespacefs/#fileinfo) for this file. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`FileInfo`](/taurify/api/namespacefs/#fileinfo)\> ###### Example ```typescript import { open, BaseDirectory } from '@crabnebula/taurify-api/fs'; const file = await open("file.txt", { read: true, baseDir: BaseDirectory.AppLocalData }); const fileInfo = await file.stat(); console.log(fileInfo.isFile); // true await file.close(); ``` ##### truncate() ```ts truncate(len?): Promise ``` Truncates or extends this file, to reach the specified `len`. If `len` is not specified then the entire file contents are truncated. ###### Parameters | Parameter | Type | | ------ | ------ | | `len`? | `number` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Example ```typescript import { open, BaseDirectory } from '@crabnebula/taurify-api/fs'; // truncate the entire file const file = await open("my_file.txt", { read: true, write: true, create: true, baseDir: BaseDirectory.AppLocalData }); await file.truncate(); // truncate part of the file const file = await open("my_file.txt", { read: true, write: true, create: true, baseDir: BaseDirectory.AppLocalData }); await file.write(new TextEncoder().encode("Hello World")); await file.truncate(7); const data = new Uint8Array(32); await file.read(data); console.log(new TextDecoder().decode(data)); // Hello W await file.close(); ``` ##### write() ```ts write(data): Promise ``` Writes `data.byteLength` bytes from `data` to the underlying data stream. It resolves to the number of bytes written from `data` (`0` <= `n` <= `data.byteLength`) or reject with the error encountered that caused the write to stop early. `write()` must reject with a non-null error if would resolve to `n` < `data.byteLength`. `write()` must not modify the slice data, even temporarily. ###### Parameters | Parameter | Type | | ------ | ------ | | `data` | [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\> | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`number`\> ###### Example ```typescript import { open, write, BaseDirectory } from '@crabnebula/taurify-api/fs'; const encoder = new TextEncoder(); const data = encoder.encode("Hello world"); const file = await open("bar.txt", { write: true, baseDir: BaseDirectory.AppLocalData }); const bytesWritten = await file.write(data); // 11 await file.close(); ``` ## Interfaces ### CopyFileOptions #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `fromPathBaseDir?` | [`BaseDirectory`](/taurify/api/namespacepath/#basedirectory) | Base directory for `fromPath`. | | | `toPathBaseDir?` | [`BaseDirectory`](/taurify/api/namespacepath/#basedirectory) | Base directory for `toPath`. | | *** ### CreateOptions #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `baseDir?` | [`BaseDirectory`](/taurify/api/namespacepath/#basedirectory) | Base directory for `path` | | *** ### DebouncedWatchOptions #### Extends - [`WatchOptions`](/taurify/api/namespacefs/#watchoptions) #### Properties | Property | Type | Description | Inherited from | Defined in | | ------ | ------ | ------ | ------ | ------ | | `baseDir?` | [`BaseDirectory`](/taurify/api/namespacepath/#basedirectory) | Base directory for `path` | [`WatchOptions`](/taurify/api/namespacefs/#watchoptions).[`baseDir`](/taurify/api/namespacefs/#basedir-10) | | | `delayMs?` | `number` | Debounce delay | - | | | `recursive?` | `boolean` | Watch a directory recursively | [`WatchOptions`](/taurify/api/namespacefs/#watchoptions).[`recursive`](/taurify/api/namespacefs/#recursive-3) | | *** ### DirEntry A disk entry which is either a file, a directory or a symlink. This is the result of the [`readDir`](/taurify/api/namespacefs/#readdir). #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `isDirectory` | `boolean` | Specifies whether this entry is a directory or not. | | | `isFile` | `boolean` | Specifies whether this entry is a file or not. | | | `isSymlink` | `boolean` | Specifies whether this entry is a symlink or not. | | | `name` | `string` | The name of the entry (file name with extension or directory name). | | *** ### ExistsOptions #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `baseDir?` | [`BaseDirectory`](/taurify/api/namespacepath/#basedirectory) | Base directory for `path`. | | *** ### FileInfo A FileInfo describes a file and is returned by `stat`, `lstat` or `fstat`. #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `atime` | `null` \| [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) | The last access time of the file. This corresponds to the `atime` field from `stat` on Unix and `ftLastAccessTime` on Windows. This may not be available on all platforms. | | | `birthtime` | `null` \| [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) | The creation time of the file. This corresponds to the `birthtime` field from `stat` on Mac/BSD and `ftCreationTime` on Windows. This may not be available on all platforms. | | | `blksize` | `null` \| `number` | Blocksize for filesystem I/O. #### Platform-specific - **Windows:** Unsupported. | | | `blocks` | `null` \| `number` | Number of blocks allocated to the file, in 512-byte units. #### Platform-specific - **Windows:** Unsupported. | | | `dev` | `null` \| `number` | ID of the device containing the file. #### Platform-specific - **Windows:** Unsupported. | | | `fileAttributes` | `null` \| `number` | This field contains the file system attribute information for a file or directory. For possible values and their descriptions, see [File Attribute Constants](https://docs.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants) in the Windows Dev Center #### Platform-specific - **macOS / Linux / Android / iOS:** Unsupported. | | | `gid` | `null` \| `number` | Group ID of the owner of this file. #### Platform-specific - **Windows:** Unsupported. | | | `ino` | `null` \| `number` | Inode number. #### Platform-specific - **Windows:** Unsupported. | | | `isDirectory` | `boolean` | True if this is info for a regular directory. Mutually exclusive to `FileInfo.isFile` and `FileInfo.isSymlink`. | | | `isFile` | `boolean` | True if this is info for a regular file. Mutually exclusive to `FileInfo.isDirectory` and `FileInfo.isSymlink`. | | | `isSymlink` | `boolean` | True if this is info for a symlink. Mutually exclusive to `FileInfo.isFile` and `FileInfo.isDirectory`. | | | `mode` | `null` \| `number` | The underlying raw `st_mode` bits that contain the standard Unix permissions for this file/directory. #### Platform-specific - **Windows:** Unsupported. | | | `mtime` | `null` \| [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) | The last modification time of the file. This corresponds to the `mtime` field from `stat` on Linux/Mac OS and `ftLastWriteTime` on Windows. This may not be available on all platforms. | | | `nlink` | `null` \| `number` | Number of hard links pointing to this file. #### Platform-specific - **Windows:** Unsupported. | | | `rdev` | `null` \| `number` | Device ID of this file. #### Platform-specific - **Windows:** Unsupported. | | | `readonly` | `boolean` | Whether this is a readonly (unwritable) file. | | | `size` | `number` | The size of the file, in bytes. | | | `uid` | `null` \| `number` | User ID of the owner of this file. #### Platform-specific - **Windows:** Unsupported. | | *** ### MkdirOptions #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `baseDir?` | [`BaseDirectory`](/taurify/api/namespacepath/#basedirectory) | Base directory for `path` | | | `mode?` | `number` | Permissions to use when creating the directory (defaults to `0o777`, before the process's umask). Ignored on Windows. | | | `recursive?` | `boolean` | Defaults to `false`. If set to `true`, means that any intermediate directories will also be created (as with the shell command `mkdir -p`). | | *** ### OpenOptions #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `append?` | `boolean` | Sets the option for the append mode. This option, when `true`, means that writes will append to a file instead of overwriting previous contents. Note that setting `{ write: true, append: true }` has the same effect as setting only `{ append: true }`. | | | `baseDir?` | [`BaseDirectory`](/taurify/api/namespacepath/#basedirectory) | Base directory for `path` | | | `create?` | `boolean` | Sets the option to allow creating a new file, if one doesn't already exist at the specified path. Requires write or append access to be used. | | | `createNew?` | `boolean` | Defaults to `false`. If set to `true`, no file, directory, or symlink is allowed to exist at the target location. Requires write or append access to be used. When createNew is set to `true`, create and truncate are ignored. | | | `mode?` | `number` | Permissions to use if creating the file (defaults to `0o666`, before the process's umask). Ignored on Windows. | | | `read?` | `boolean` | Sets the option for read access. This option, when `true`, means that the file should be read-able if opened. | | | `truncate?` | `boolean` | Sets the option for truncating a previous file. If a file is successfully opened with this option set it will truncate the file to `0` size if it already exists. The file must be opened with write access for truncate to work. | | | `write?` | `boolean` | Sets the option for write access. This option, when `true`, means that the file should be write-able if opened. If the file already exists, any write calls on it will overwrite its contents, by default without truncating it. | | *** ### ReadDirOptions #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `baseDir?` | [`BaseDirectory`](/taurify/api/namespacepath/#basedirectory) | Base directory for `path` | | *** ### ReadFileOptions #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `baseDir?` | [`BaseDirectory`](/taurify/api/namespacepath/#basedirectory) | Base directory for `path` | | *** ### RemoveOptions #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `baseDir?` | [`BaseDirectory`](/taurify/api/namespacepath/#basedirectory) | Base directory for `path` | | | `recursive?` | `boolean` | Defaults to `false`. If set to `true`, path will be removed even if it's a non-empty directory. | | *** ### RenameOptions #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `newPathBaseDir?` | [`BaseDirectory`](/taurify/api/namespacepath/#basedirectory) | Base directory for `newPath`. | | | `oldPathBaseDir?` | [`BaseDirectory`](/taurify/api/namespacepath/#basedirectory) | Base directory for `oldPath`. | | *** ### StatOptions #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `baseDir?` | [`BaseDirectory`](/taurify/api/namespacepath/#basedirectory) | Base directory for `path`. | | *** ### TruncateOptions #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `baseDir?` | [`BaseDirectory`](/taurify/api/namespacepath/#basedirectory) | Base directory for `path`. | | *** ### WatchEvent #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `attrs` | `unknown` | | | `paths` | `string`[] | | | `type` | [`WatchEventKind`](/taurify/api/namespacefs/#watcheventkind) | | *** ### WatchOptions #### Extended by - [`DebouncedWatchOptions`](/taurify/api/namespacefs/#debouncedwatchoptions) #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `baseDir?` | [`BaseDirectory`](/taurify/api/namespacepath/#basedirectory) | Base directory for `path` | | | `recursive?` | `boolean` | Watch a directory recursively | | *** ### WriteFileOptions #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `append?` | `boolean` | Defaults to `false`. If set to `true`, will append to a file instead of overwriting previous contents. | | | `baseDir?` | [`BaseDirectory`](/taurify/api/namespacepath/#basedirectory) | Base directory for `path` | | | `create?` | `boolean` | Sets the option to allow creating a new file, if one doesn't already exist at the specified path (defaults to `true`). | | | `createNew?` | `boolean` | Sets the option to create a new file, failing if it already exists. | | | `mode?` | `number` | File permissions. Ignored on Windows. | | ## Type Aliases ### UnwatchFn() ```ts type UnwatchFn: () => void; ``` #### Returns `void` *** ### WatchEventKind ```ts type WatchEventKind: | "any" | object | object | object | object | "other"; ``` *** ### WatchEventKindAccess ```ts type WatchEventKindAccess: object | object | object | object; ``` *** ### WatchEventKindCreate ```ts type WatchEventKindCreate: object | object | object | object; ``` *** ### WatchEventKindModify ```ts type WatchEventKindModify: | object | object | object | object | object; ``` *** ### WatchEventKindRemove ```ts type WatchEventKindRemove: object | object | object | object; ``` ## Functions ### copyFile() ```ts function copyFile( fromPath, toPath, options?): Promise ``` Copies the contents and permissions of one file to another specified path, by default creating a new file if needed, else overwriting. #### Parameters | Parameter | Type | | ------ | ------ | | `fromPath` | `string` \| [`URL`](https://developer.mozilla.org/docs/Web/API/URL) | | `toPath` | `string` \| [`URL`](https://developer.mozilla.org/docs/Web/API/URL) | | `options`? | [`CopyFileOptions`](/taurify/api/namespacefs/#copyfileoptions) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> #### Example ```typescript import { copyFile, BaseDirectory } from '@crabnebula/taurify-api/fs'; await copyFile('app.conf', 'app.conf.bk', { fromPathBaseDir: BaseDirectory.AppConfig, toPathBaseDir: BaseDirectory.AppConfig }); ``` *** ### create() ```ts function create(path, options?): Promise ``` Creates a file if none exists or truncates an existing file and resolves to an instance of [`FileHandle`](/taurify/api/namespacefs/#filehandle). #### Parameters | Parameter | Type | | ------ | ------ | | `path` | `string` \| [`URL`](https://developer.mozilla.org/docs/Web/API/URL) | | `options`? | [`CreateOptions`](/taurify/api/namespacefs/#createoptions) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`FileHandle`](/taurify/api/namespacefs/#filehandle)\> #### Example ```typescript import { create, BaseDirectory } from "@crabnebula/taurify-api/fs" const file = await create("foo/bar.txt", { baseDir: BaseDirectory.AppConfig }); await file.write(new TextEncoder().encode("Hello world")); await file.close(); ``` *** ### exists() ```ts function exists(path, options?): Promise ``` Check if a path exists. #### Parameters | Parameter | Type | | ------ | ------ | | `path` | `string` \| [`URL`](https://developer.mozilla.org/docs/Web/API/URL) | | `options`? | [`ExistsOptions`](/taurify/api/namespacefs/#existsoptions) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> #### Example ```typescript import { exists, BaseDirectory } from '@crabnebula/taurify-api/fs'; // Check if the `$APPDATA/avatar.png` file exists await exists('avatar.png', { baseDir: BaseDirectory.AppData }); ``` *** ### lstat() ```ts function lstat(path, options?): Promise ``` Resolves to a [`FileInfo`](/taurify/api/namespacefs/#fileinfo) for the specified `path`. If `path` is a symlink, information for the symlink will be returned instead of what it points to. #### Parameters | Parameter | Type | | ------ | ------ | | `path` | `string` \| [`URL`](https://developer.mozilla.org/docs/Web/API/URL) | | `options`? | [`StatOptions`](/taurify/api/namespacefs/#statoptions) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`FileInfo`](/taurify/api/namespacefs/#fileinfo)\> #### Example ```typescript import { lstat, BaseDirectory } from '@crabnebula/taurify-api/fs'; const fileInfo = await lstat("hello.txt", { baseDir: BaseDirectory.AppLocalData }); console.log(fileInfo.isFile); // true ``` *** ### mkdir() ```ts function mkdir(path, options?): Promise ``` Creates a new directory with the specified path. #### Parameters | Parameter | Type | | ------ | ------ | | `path` | `string` \| [`URL`](https://developer.mozilla.org/docs/Web/API/URL) | | `options`? | [`MkdirOptions`](/taurify/api/namespacefs/#mkdiroptions) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> #### Example ```typescript import { mkdir, BaseDirectory } from '@crabnebula/taurify-api/fs'; await mkdir('users', { baseDir: BaseDirectory.AppLocalData }); ``` *** ### open() ```ts function open(path, options?): Promise ``` Open a file and resolve to an instance of [`FileHandle`](/taurify/api/namespacefs/#filehandle). The file does not need to previously exist if using the `create` or `createNew` open options. It is the callers responsibility to close the file when finished with it. #### Parameters | Parameter | Type | | ------ | ------ | | `path` | `string` \| [`URL`](https://developer.mozilla.org/docs/Web/API/URL) | | `options`? | [`OpenOptions`](/taurify/api/namespacefs/#openoptions) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`FileHandle`](/taurify/api/namespacefs/#filehandle)\> #### Example ```typescript import { open, BaseDirectory } from "@crabnebula/taurify-api/fs" const file = await open("foo/bar.txt", { read: true, write: true, baseDir: BaseDirectory.AppLocalData }); // Do work with file await file.close(); ``` *** ### readDir() ```ts function readDir(path, options?): Promise ``` Reads the directory given by path and returns an array of `DirEntry`. #### Parameters | Parameter | Type | | ------ | ------ | | `path` | `string` \| [`URL`](https://developer.mozilla.org/docs/Web/API/URL) | | `options`? | [`ReadDirOptions`](/taurify/api/namespacefs/#readdiroptions) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`DirEntry`](/taurify/api/namespacefs/#direntry)[]\> #### Example ```typescript import { readDir, BaseDirectory } from '@crabnebula/taurify-api/fs'; import { join } from '../../path'; const dir = "users" const entries = await readDir('users', { baseDir: BaseDirectory.AppLocalData }); processEntriesRecursively(dir, entries); async function processEntriesRecursively(parent, entries) { for (const entry of entries) { console.log(`Entry: ${entry.name}`); if (entry.isDirectory) { const dir = await join(parent, entry.name); processEntriesRecursively(dir, await readDir(dir, { baseDir: BaseDirectory.AppLocalData })) } } } ``` *** ### readFile() ```ts function readFile(path, options?): Promise ``` Reads and resolves to the entire contents of a file as an array of bytes. TextDecoder can be used to transform the bytes to string if required. #### Parameters | Parameter | Type | | ------ | ------ | | `path` | `string` \| [`URL`](https://developer.mozilla.org/docs/Web/API/URL) | | `options`? | [`ReadFileOptions`](/taurify/api/namespacefs/#readfileoptions) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\> #### Example ```typescript import { readFile, BaseDirectory } from '@crabnebula/taurify-api/fs'; const contents = await readFile('avatar.png', { baseDir: BaseDirectory.Resource }); ``` *** ### readTextFile() ```ts function readTextFile(path, options?): Promise ``` Reads and returns the entire contents of a file as UTF-8 string. #### Parameters | Parameter | Type | | ------ | ------ | | `path` | `string` \| [`URL`](https://developer.mozilla.org/docs/Web/API/URL) | | `options`? | [`ReadFileOptions`](/taurify/api/namespacefs/#readfileoptions) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { readTextFile, BaseDirectory } from '@crabnebula/taurify-api/fs'; const contents = await readTextFile('app.conf', { baseDir: BaseDirectory.AppConfig }); ``` *** ### readTextFileLines() ```ts function readTextFileLines(path, options?): Promise> ``` Returns an async AsyncIterableIterator over the lines of a file as UTF-8 string. #### Parameters | Parameter | Type | | ------ | ------ | | `path` | `string` \| [`URL`](https://developer.mozilla.org/docs/Web/API/URL) | | `options`? | [`ReadFileOptions`](/taurify/api/namespacefs/#readfileoptions) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`AsyncIterableIterator`\<`string`\>\> #### Example ```typescript import { readTextFileLines, BaseDirectory } from '@crabnebula/taurify-api/fs'; const lines = await readTextFileLines('app.conf', { baseDir: BaseDirectory.AppConfig }); for await (const line of lines) { console.log(line); } ``` You could also call AsyncIterableIterator.next to advance the iterator so you can lazily read the next line whenever you want. *** ### remove() ```ts function remove(path, options?): Promise ``` Removes the named file or directory. If the directory is not empty and the `recursive` option isn't set to true, the promise will be rejected. #### Parameters | Parameter | Type | | ------ | ------ | | `path` | `string` \| [`URL`](https://developer.mozilla.org/docs/Web/API/URL) | | `options`? | [`RemoveOptions`](/taurify/api/namespacefs/#removeoptions) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> #### Example ```typescript import { remove, BaseDirectory } from '@crabnebula/taurify-api/fs'; await remove('users/file.txt', { baseDir: BaseDirectory.AppLocalData }); await remove('users', { baseDir: BaseDirectory.AppLocalData }); ``` *** ### rename() ```ts function rename( oldPath, newPath, options?): Promise ``` Renames (moves) oldpath to newpath. Paths may be files or directories. If newpath already exists and is not a directory, rename() replaces it. OS-specific restrictions may apply when oldpath and newpath are in different directories. On Unix, this operation does not follow symlinks at either path. #### Parameters | Parameter | Type | | ------ | ------ | | `oldPath` | `string` \| [`URL`](https://developer.mozilla.org/docs/Web/API/URL) | | `newPath` | `string` \| [`URL`](https://developer.mozilla.org/docs/Web/API/URL) | | `options`? | [`RenameOptions`](/taurify/api/namespacefs/#renameoptions) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> #### Example ```typescript import { rename, BaseDirectory } from '@crabnebula/taurify-api/fs'; await rename('avatar.png', 'deleted.png', { oldPathBaseDir: BaseDirectory.App, newPathBaseDir: BaseDirectory.AppLocalData }); ``` *** ### size() ```ts function size(path): Promise ``` Get the size of a file or directory. For files, the `stat` functions can be used as well. If `path` is a directory, this function will recursively iterate over every file and every directory inside of `path` and therefore will be very time consuming if used on larger directories. #### Parameters | Parameter | Type | | ------ | ------ | | `path` | `string` \| [`URL`](https://developer.mozilla.org/docs/Web/API/URL) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`number`\> #### Example ```typescript import { size, BaseDirectory } from '@crabnebula/taurify-api/fs'; // Get the size of the `$APPDATA/tauri` directory. const dirSize = await size('tauri', { baseDir: BaseDirectory.AppData }); console.log(dirSize); // 1024 ``` *** ### stat() ```ts function stat(path, options?): Promise ``` Resolves to a [`FileInfo`](/taurify/api/namespacefs/#fileinfo) for the specified `path`. Will always follow symlinks but will reject if the symlink points to a path outside of the scope. #### Parameters | Parameter | Type | | ------ | ------ | | `path` | `string` \| [`URL`](https://developer.mozilla.org/docs/Web/API/URL) | | `options`? | [`StatOptions`](/taurify/api/namespacefs/#statoptions) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`FileInfo`](/taurify/api/namespacefs/#fileinfo)\> #### Example ```typescript import { stat, BaseDirectory } from '@crabnebula/taurify-api/fs'; const fileInfo = await stat("hello.txt", { baseDir: BaseDirectory.AppLocalData }); console.log(fileInfo.isFile); // true ``` *** ### truncate() ```ts function truncate( path, len?, options?): Promise ``` Truncates or extends the specified file, to reach the specified `len`. If `len` is `0` or not specified, then the entire file contents are truncated. #### Parameters | Parameter | Type | | ------ | ------ | | `path` | `string` \| [`URL`](https://developer.mozilla.org/docs/Web/API/URL) | | `len`? | `number` | | `options`? | [`TruncateOptions`](/taurify/api/namespacefs/#truncateoptions) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> #### Example ```typescript import { truncate, readTextFile, writeTextFile, BaseDirectory } from '@crabnebula/taurify-api/fs'; // truncate the entire file await truncate("my_file.txt", 0, { baseDir: BaseDirectory.AppLocalData }); // truncate part of the file const filePath = "file.txt"; await writeTextFile(filePath, "Hello World", { baseDir: BaseDirectory.AppLocalData }); await truncate(filePath, 7, { baseDir: BaseDirectory.AppLocalData }); const data = await readTextFile(filePath, { baseDir: BaseDirectory.AppLocalData }); console.log(data); // "Hello W" ``` *** ### watch() ```ts function watch( paths, cb, options?): Promise ``` #### Parameters | Parameter | Type | | ------ | ------ | | `paths` | `string` \| [`URL`](https://developer.mozilla.org/docs/Web/API/URL) \| `string`[] \| [`URL`](https://developer.mozilla.org/docs/Web/API/URL)[] | | `cb` | (`event`) => `void` | | `options`? | [`DebouncedWatchOptions`](/taurify/api/namespacefs/#debouncedwatchoptions) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnwatchFn`](/taurify/api/namespacefs/#unwatchfn)\> *** ### watchImmediate() ```ts function watchImmediate( paths, cb, options?): Promise ``` #### Parameters | Parameter | Type | | ------ | ------ | | `paths` | `string` \| [`URL`](https://developer.mozilla.org/docs/Web/API/URL) \| `string`[] \| [`URL`](https://developer.mozilla.org/docs/Web/API/URL)[] | | `cb` | (`event`) => `void` | | `options`? | [`WatchOptions`](/taurify/api/namespacefs/#watchoptions) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnwatchFn`](/taurify/api/namespacefs/#unwatchfn)\> *** ### writeFile() ```ts function writeFile( path, data, options?): Promise ``` Write `data` to the given `path`, by default creating a new file if needed, else overwriting. #### Parameters | Parameter | Type | | ------ | ------ | | `path` | `string` \| [`URL`](https://developer.mozilla.org/docs/Web/API/URL) | | `data` | [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\> \| [`ReadableStream`](https://developer.mozilla.org/docs/Web/API/ReadableStream)\<[`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\>\> | | `options`? | [`WriteFileOptions`](/taurify/api/namespacefs/#writefileoptions) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> #### Example ```typescript import { writeFile, BaseDirectory } from '@crabnebula/taurify-api/fs'; let encoder = new TextEncoder(); let data = encoder.encode("Hello World"); await writeFile('file.txt', data, { baseDir: BaseDirectory.AppLocalData }); ``` *** ### writeTextFile() ```ts function writeTextFile( path, data, options?): Promise ``` Writes UTF-8 string `data` to the given `path`, by default creating a new file if needed, else overwriting. #### Parameters | Parameter | Type | | ------ | ------ | | `path` | `string` \| [`URL`](https://developer.mozilla.org/docs/Web/API/URL) | | `data` | `string` | | `options`? | [`WriteFileOptions`](/taurify/api/namespacefs/#writefileoptions) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> #### Example ```typescript import { writeTextFile, BaseDirectory } from '@crabnebula/taurify-api/fs'; await writeTextFile('file.txt', "Hello world", { baseDir: BaseDirectory.AppLocalData }); ``` # geolocation ## Type Aliases ### Coordinates ```ts type Coordinates: object; ``` #### Type declaration | Name | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `accuracy` | `number` | Accuracy level of the latitude and longitude coordinates in meters. | | | `altitude` | `number` \| `null` | The altitude the user is at, if available. | | | `altitudeAccuracy` | `number` \| `null` | Accuracy level of the altitude coordinate in meters, if available. Available on all iOS versions and on Android 8 and above. | | | `heading` | `number` \| `null` | The heading the user is facing, if available. | | | `latitude` | `number` | Latitude in decimal degrees. | | | `longitude` | `number` | Longitude in decimal degrees. | | | `speed` | `number` \| `null` | - | | *** ### PermissionStatus ```ts type PermissionStatus: object; ``` #### Type declaration | Name | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `coarseLocation` | [`PermissionState`](/taurify/api/namespacecore/#permissionstate) | Permissions state for the coarseLoaction alias. On Android it requests/checks ACCESS_COARSE_LOCATION. On Android 12+, users can choose between Approximate location (ACCESS_COARSE_LOCATION) and Precise location (ACCESS_FINE_LOCATION). On iOS it will have the same value as the `location` alias. | | | `location` | [`PermissionState`](/taurify/api/namespacecore/#permissionstate) | Permission state for the location alias. On Android it requests/checks both ACCESS_COARSE_LOCATION and ACCESS_FINE_LOCATION permissions. On iOS it requests/checks location permissions. | | *** ### PermissionType ```ts type PermissionType: "location" | "coarseLocation"; ``` *** ### Position ```ts type Position: object; ``` #### Type declaration | Name | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `coords` | [`Coordinates`](/taurify/api/namespacegeolocation/#coordinates) | The GPD coordinates along with the accuracy of the data. | | | `timestamp` | `number` | Creation time for these coordinates. | | *** ### PositionOptions ```ts type PositionOptions: object; ``` #### Type declaration | Name | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `enableHighAccuracy` | `boolean` | High accuracy mode (such as GPS, if available) Will be ignored on Android 12+ if users didn't grant the ACCESS_FINE_LOCATION permission (`coarseLocation` permission). | | | `maximumAge` | `number` | The maximum age in milliseconds of a possible cached position that is acceptable to return. Default: 0 Ignored on iOS | | | `timeout` | `number` | The maximum wait time in milliseconds for location updates. On Android the timeout gets ignored for getCurrentPosition. Ignored on iOS | | ## Functions ### checkPermissions() ```ts function checkPermissions(): Promise ``` #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`PermissionStatus`](/taurify/api/namespacegeolocation/#permissionstatus)\> *** ### clearWatch() ```ts function clearWatch(channelId): Promise ``` #### Parameters | Parameter | Type | | ------ | ------ | | `channelId` | `number` | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> *** ### getCurrentPosition() ```ts function getCurrentPosition(options?): Promise ``` #### Parameters | Parameter | Type | | ------ | ------ | | `options`? | [`PositionOptions`](/taurify/api/namespacegeolocation/#positionoptions) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Position`](/taurify/api/namespacegeolocation/#position)\> *** ### requestPermissions() ```ts function requestPermissions(permissions): Promise ``` #### Parameters | Parameter | Type | | ------ | ------ | | `permissions` | `null` \| [`PermissionType`](/taurify/api/namespacegeolocation/#permissiontype)[] | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`PermissionStatus`](/taurify/api/namespacegeolocation/#permissionstatus)\> *** ### watchPosition() ```ts function watchPosition(options, cb): Promise ``` #### Parameters | Parameter | Type | | ------ | ------ | | `options` | [`PositionOptions`](/taurify/api/namespacegeolocation/#positionoptions) | | `cb` | (`location`, `error`?) => `void` | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`number`\> # globalShortcut Register global shortcuts. ## Interfaces ### ShortcutEvent #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `id` | `number` | | | `shortcut` | `string` | | | `state` | `"Released"` \| `"Pressed"` | | ## Type Aliases ### ShortcutHandler() ```ts type ShortcutHandler: (event) => void; ``` #### Parameters | Parameter | Type | | ------ | ------ | | `event` | [`ShortcutEvent`](/taurify/api/namespaceglobalshortcut/#shortcutevent) | #### Returns `void` ## Functions ### isRegistered() ```ts function isRegistered(shortcut): Promise ``` Determines whether the given shortcut is registered by this application or not. If the shortcut is registered by another application, it will still return `false`. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `shortcut` | `string` | shortcut definition, modifiers and key separated by "+" e.g. CmdOrControl+Q | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> #### Example ```typescript import { isRegistered } from '@crabnebula/taurify-api/global-shortcut'; const isRegistered = await isRegistered('CommandOrControl+P'); ``` *** ### register() ```ts function register(shortcuts, handler): Promise ``` Register a global shortcut or a list of shortcuts. The handler is called when any of the registered shortcuts are pressed by the user. If the shortcut is already taken by another application, the handler will not be triggered. Make sure the shortcut is as unique as possible while still taking user experience into consideration. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `shortcuts` | `string` \| `string`[] | - | | `handler` | [`ShortcutHandler`](/taurify/api/namespaceglobalshortcut/#shortcuthandler) | Shortcut handler callback - takes the triggered shortcut as argument | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> #### Example ```typescript import { register } from '@crabnebula/taurify-api/global-shortcut'; // register a single hotkey await register('CommandOrControl+Shift+C', (event) => { if (event.state === "Pressed") { console.log('Shortcut triggered'); } }); // or register multiple hotkeys at once await register(['CommandOrControl+Shift+C', 'Alt+A'], (event) => { console.log(`Shortcut ${event.shortcut} triggered`); }); ``` *** ### unregister() ```ts function unregister(shortcuts): Promise ``` Unregister a global shortcut or a list of shortcuts. #### Parameters | Parameter | Type | | ------ | ------ | | `shortcuts` | `string` \| `string`[] | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> #### Example ```typescript import { unregister } from '@crabnebula/taurify-api/global-shortcut'; // unregister a single hotkey await unregister('CmdOrControl+Space'); // or unregister multiple hotkeys at the same time await unregister(['CmdOrControl+Space', 'Alt+A']); ``` *** ### unregisterAll() ```ts function unregisterAll(): Promise ``` Unregister all global shortcuts. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> #### Example ```typescript import { unregisterAll } from '@crabnebula/taurify-api/global-shortcut'; await unregisterAll(); ``` # haptics ## Type Aliases ### ImpactFeedbackStyle ```ts type ImpactFeedbackStyle: | "light" | "medium" | "heavy" | "soft" | "rigid"; ``` *** ### NotificationFeedbackType ```ts type NotificationFeedbackType: "success" | "warning" | "error"; ``` ## Functions ### impactFeedback() ```ts function impactFeedback(style): Promise> ``` #### Parameters | Parameter | Type | | ------ | ------ | | `style` | [`ImpactFeedbackStyle`](/taurify/api/namespacehaptics/#impactfeedbackstyle) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`Result`\<`null`, `never`\>\> *** ### notificationFeedback() ```ts function notificationFeedback(type): Promise> ``` #### Parameters | Parameter | Type | | ------ | ------ | | `type` | [`NotificationFeedbackType`](/taurify/api/namespacehaptics/#notificationfeedbacktype) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`Result`\<`null`, `never`\>\> *** ### selectionFeedback() ```ts function selectionFeedback(): Promise> ``` #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`Result`\<`null`, `never`\>\> *** ### vibrate() ```ts function vibrate(duration): Promise> ``` #### Parameters | Parameter | Type | | ------ | ------ | | `duration` | `number` | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`Result`\<`null`, `never`\>\> # http Make HTTP requests with the Rust backend. ## Security This API has a scope configuration that forces you to restrict the URLs that can be accessed using glob patterns. For instance, this scope configuration only allows making HTTP requests to all subdomains for `tauri.app` except for `https://private.tauri.app`: ```json { "permissions": [ { "identifier": "http:default", "allow": [{ "url": "https://*.tauri.app" }], "deny": [{ "url": "https://private.tauri.app" }] } ] } ``` Trying to execute any API with a URL not configured on the scope results in a promise rejection due to denied access. ## Interfaces ### ClientOptions Options to configure the Rust client used to make fetch requests #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `connectTimeout?` | `number` | Timeout in milliseconds | | | `danger?` | [`DangerousSettings`](/taurify/api/namespacehttp/#dangeroussettings) | Configuration for dangerous settings on the client such as disabling SSL verification. | | | `maxRedirections?` | `number` | Defines the maximum number of redirects the client should follow. If set to 0, no redirects will be followed. | | | `proxy?` | [`Proxy`](/taurify/api/namespacehttp/#proxy-1) | Configuration of a proxy that a Client should pass requests to. | | *** ### DangerousSettings Configuration for dangerous settings on the client such as disabling SSL verification. #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `acceptInvalidCerts?` | `boolean` | Disables SSL verification. | | | `acceptInvalidHostnames?` | `boolean` | Disables hostname verification. | | *** ### Proxy Configuration of a proxy that a Client should pass requests to. #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `all?` | `string` \| [`ProxyConfig`](/taurify/api/namespacehttp/#proxyconfig) | Proxy all traffic to the passed URL. | | | `http?` | `string` \| [`ProxyConfig`](/taurify/api/namespacehttp/#proxyconfig) | Proxy all HTTP traffic to the passed URL. | | | `https?` | `string` \| [`ProxyConfig`](/taurify/api/namespacehttp/#proxyconfig) | Proxy all HTTPS traffic to the passed URL. | | *** ### ProxyConfig #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `basicAuth?` | `object` | Set the `Proxy-Authorization` header using Basic auth. | | | `basicAuth.password` | `string` | - | | | `basicAuth.username` | `string` | - | | | `noProxy?` | `string` | A configuration for filtering out requests that shouldn't be proxied. Entries are expected to be comma-separated (whitespace between entries is ignored) | | | `url` | `string` | The URL of the proxy server. | | ## Functions ### fetch() ```ts function fetch(input, init?): Promise ``` Fetch a resource from the network. It returns a `Promise` that resolves to the `Response` to that `Request`, whether it is successful or not. #### Parameters | Parameter | Type | | ------ | ------ | | `input` | `string` \| [`URL`](https://developer.mozilla.org/docs/Web/API/URL) \| [`Request`](https://developer.mozilla.org/docs/Web/API/Request) | | `init`? | `RequestInit` & [`ClientOptions`](/taurify/api/namespacehttp/#clientoptions) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Response`](https://developer.mozilla.org/docs/Web/API/Response)\> #### Example ```typescript const response = await fetch("http://my.json.host/data.json"); console.log(response.status); // e.g. 200 console.log(response.statusText); // e.g. "OK" const jsonData = await response.json(); ``` # image ## Classes ### Image An RGBA Image in row-major order from top to bottom. #### Extends - [`Resource`](/taurify/api/namespacecore/#resource) #### Accessors ##### rid ###### Get Signature ```ts get rid(): number ``` ###### Returns `number` ###### Inherited from [`Resource`](/taurify/api/namespacecore/#resource).[`rid`](/taurify/api/namespacecore/#rid) #### Methods ##### close() ```ts close(): Promise ``` Destroys and cleans up this resource from memory. **You should not call any method on this object anymore and should drop any reference to it.** ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Inherited from [`Resource`](/taurify/api/namespacecore/#resource).[`close`](/taurify/api/namespacecore/#close) ##### rgba() ```ts rgba(): Promise> ``` Returns the RGBA data for this image, in row-major order from top to bottom. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\>\> ##### size() ```ts size(): Promise ``` Returns the size of this image. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`ImageSize`](/taurify/api/namespaceimage/#imagesize)\> ##### fromBytes() ```ts static fromBytes(bytes): Promise ``` Creates a new image using the provided bytes by inferring the file format. If the format is known, prefer [@link Image.fromPngBytes] or [@link Image.fromIcoBytes]. Only `ico` and `png` are supported. ###### Parameters | Parameter | Type | | ------ | ------ | | `bytes` | `number`[] \| [`ArrayBuffer`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) \| [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\> | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Image`](/taurify/api/namespaceimage/#image)\> ##### fromPath() ```ts static fromPath(path): Promise ``` Creates a new image using the provided path. Only `ico` and `png` are supported. ###### Parameters | Parameter | Type | | ------ | ------ | | `path` | `string` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Image`](/taurify/api/namespaceimage/#image)\> ##### new() ```ts static new( rgba, width, height): Promise ``` Creates a new Image using RGBA data, in row-major order from top to bottom, and with specified width and height. ###### Parameters | Parameter | Type | | ------ | ------ | | `rgba` | `number`[] \| [`ArrayBuffer`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) \| [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\> | | `width` | `number` | | `height` | `number` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Image`](/taurify/api/namespaceimage/#image)\> ## Interfaces ### ImageSize #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `height` | `number` | | | `width` | `number` | | ## Functions ### transformImage() ```ts function transformImage(image): T ``` Transforms image from various types into a type acceptable by Rust. See [tauri::image::JsImage](https://docs.rs/tauri/2/tauri/image/enum.JsImage.html) for more information. Note the API signature is not stable and might change. #### Type Parameters | Type Parameter | | ------ | | `T` | #### Parameters | Parameter | Type | | ------ | ------ | | `image` | \| `null` \| `string` \| `number`[] \| [`ArrayBuffer`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) \| [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\> \| [`Image`](/taurify/api/namespaceimage/#image) | #### Returns `T` # log ## Enumerations ### LogLevel #### Enumeration Members ##### Debug ```ts Debug: 2; ``` The "debug" level. Designates lower priority information. ##### Error ```ts Error: 5; ``` The "error" level. Designates very serious errors. ##### Info ```ts Info: 3; ``` The "info" level. Designates useful information. ##### Trace ```ts Trace: 1; ``` The "trace" level. Designates very low priority, often extremely verbose, information. ##### Warn ```ts Warn: 4; ``` The "warn" level. Designates hazardous situations. ## Interfaces ### LogOptions #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `file?` | `string` | | | `keyValues?` | [`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)\<`string`, `undefined` \| `string`\> | | | `line?` | `number` | | ## Functions ### attachConsole() ```ts function attachConsole(): Promise ``` Attaches a listener that writes log entries to the console as they come in. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#unlistenfn)\> a function to cancel the listener. *** ### attachLogger() ```ts function attachLogger(fn): Promise ``` Attaches a listener for the log, and calls the passed function for each log entry. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `fn` | `LoggerFn` | | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#unlistenfn)\> a function to cancel the listener. *** ### debug() ```ts function debug(message, options?): Promise ``` Logs a message at the debug level. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `message` | `string` | # Examples `import { debug } from '@crabnebula/taurify-api/log'; const pos = { x: 3.234, y: -1.223 }; debug(`New position: x: {pos.x}, y: {pos.y}`);` | | `options`? | [`LogOptions`](/taurify/api/namespacelog/#logoptions) | - | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> *** ### error() ```ts function error(message, options?): Promise ``` Logs a message at the error level. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `message` | `string` | # Examples `import { error } from '@crabnebula/taurify-api/log'; const err_info = "No connection"; const port = 22; error(`Error: ${err_info} on port ${port}`);` | | `options`? | [`LogOptions`](/taurify/api/namespacelog/#logoptions) | - | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> *** ### info() ```ts function info(message, options?): Promise ``` Logs a message at the info level. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `message` | `string` | # Examples `import { info } from '@crabnebula/taurify-api/log'; const conn_info = { port: 40, speed: 3.20 }; info(`Connected to port {conn_info.port} at {conn_info.speed} Mb/s`);` | | `options`? | [`LogOptions`](/taurify/api/namespacelog/#logoptions) | - | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> *** ### trace() ```ts function trace(message, options?): Promise ``` Logs a message at the trace level. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `message` | `string` | # Examples `import { trace } from '@crabnebula/taurify-api/log'; let pos = { x: 3.234, y: -1.223 }; trace(`Position is: x: {pos.x}, y: {pos.y}`);` | | `options`? | [`LogOptions`](/taurify/api/namespacelog/#logoptions) | - | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> *** ### warn() ```ts function warn(message, options?): Promise ``` Logs a message at the warn level. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `message` | `string` | # Examples `import { warn } from '@crabnebula/taurify-api/log'; const warn_description = "Invalid Input"; warn(`Warning! {warn_description}!`);` | | `options`? | [`LogOptions`](/taurify/api/namespacelog/#logoptions) | - | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> # menu ## Enumerations ### NativeIcon A native Icon to be used for the menu item #### Platform-specific: - **Windows / Linux**: Unsupported. #### Enumeration Members ##### Add ```ts Add: "Add"; ``` An add item template image. ##### Advanced ```ts Advanced: "Advanced"; ``` Advanced preferences toolbar icon for the preferences window. ##### Bluetooth ```ts Bluetooth: "Bluetooth"; ``` A Bluetooth template image. ##### Bookmarks ```ts Bookmarks: "Bookmarks"; ``` Bookmarks image suitable for a template. ##### Caution ```ts Caution: "Caution"; ``` A caution image. ##### ColorPanel ```ts ColorPanel: "ColorPanel"; ``` A color panel toolbar icon. ##### ColumnView ```ts ColumnView: "ColumnView"; ``` A column view mode template image. ##### Computer ```ts Computer: "Computer"; ``` A computer icon. ##### EnterFullScreen ```ts EnterFullScreen: "EnterFullScreen"; ``` An enter full-screen mode template image. ##### Everyone ```ts Everyone: "Everyone"; ``` Permissions for all users. ##### ExitFullScreen ```ts ExitFullScreen: "ExitFullScreen"; ``` An exit full-screen mode template image. ##### FlowView ```ts FlowView: "FlowView"; ``` A cover flow view mode template image. ##### Folder ```ts Folder: "Folder"; ``` A folder image. ##### FolderBurnable ```ts FolderBurnable: "FolderBurnable"; ``` A burnable folder icon. ##### FolderSmart ```ts FolderSmart: "FolderSmart"; ``` A smart folder icon. ##### FollowLinkFreestanding ```ts FollowLinkFreestanding: "FollowLinkFreestanding"; ``` A link template image. ##### FontPanel ```ts FontPanel: "FontPanel"; ``` A font panel toolbar icon. ##### GoLeft ```ts GoLeft: "GoLeft"; ``` A `go back` template image. ##### GoRight ```ts GoRight: "GoRight"; ``` A `go forward` template image. ##### Home ```ts Home: "Home"; ``` Home image suitable for a template. ##### IChatTheater ```ts IChatTheater: "IChatTheater"; ``` An iChat Theater template image. ##### IconView ```ts IconView: "IconView"; ``` An icon view mode template image. ##### Info ```ts Info: "Info"; ``` An information toolbar icon. ##### InvalidDataFreestanding ```ts InvalidDataFreestanding: "InvalidDataFreestanding"; ``` A template image used to denote invalid data. ##### LeftFacingTriangle ```ts LeftFacingTriangle: "LeftFacingTriangle"; ``` A generic left-facing triangle template image. ##### ListView ```ts ListView: "ListView"; ``` A list view mode template image. ##### LockLocked ```ts LockLocked: "LockLocked"; ``` A locked padlock template image. ##### LockUnlocked ```ts LockUnlocked: "LockUnlocked"; ``` An unlocked padlock template image. ##### MenuMixedState ```ts MenuMixedState: "MenuMixedState"; ``` A horizontal dash, for use in menus. ##### MenuOnState ```ts MenuOnState: "MenuOnState"; ``` A check mark template image, for use in menus. ##### MobileMe ```ts MobileMe: "MobileMe"; ``` A MobileMe icon. ##### MultipleDocuments ```ts MultipleDocuments: "MultipleDocuments"; ``` A drag image for multiple items. ##### Network ```ts Network: "Network"; ``` A network icon. ##### Path ```ts Path: "Path"; ``` A path button template image. ##### PreferencesGeneral ```ts PreferencesGeneral: "PreferencesGeneral"; ``` General preferences toolbar icon for the preferences window. ##### QuickLook ```ts QuickLook: "QuickLook"; ``` A Quick Look template image. ##### Refresh ```ts Refresh: "Refresh"; ``` A refresh template image. ##### RefreshFreestanding ```ts RefreshFreestanding: "RefreshFreestanding"; ``` A refresh template image. ##### Remove ```ts Remove: "Remove"; ``` A remove item template image. ##### RevealFreestanding ```ts RevealFreestanding: "RevealFreestanding"; ``` A reveal contents template image. ##### RightFacingTriangle ```ts RightFacingTriangle: "RightFacingTriangle"; ``` A generic right-facing triangle template image. ##### Share ```ts Share: "Share"; ``` A share view template image. ##### Slideshow ```ts Slideshow: "Slideshow"; ``` A slideshow template image. ##### SmartBadge ```ts SmartBadge: "SmartBadge"; ``` A badge for a `smart` item. ##### StatusAvailable ```ts StatusAvailable: "StatusAvailable"; ``` Small green indicator, similar to iChat's available image. ##### StatusNone ```ts StatusNone: "StatusNone"; ``` Small clear indicator. ##### StatusPartiallyAvailable ```ts StatusPartiallyAvailable: "StatusPartiallyAvailable"; ``` Small yellow indicator, similar to iChat's idle image. ##### StatusUnavailable ```ts StatusUnavailable: "StatusUnavailable"; ``` Small red indicator, similar to iChat's unavailable image. ##### StopProgress ```ts StopProgress: "StopProgress"; ``` A stop progress button template image. ##### StopProgressFreestanding ```ts StopProgressFreestanding: "StopProgressFreestanding"; ``` A stop progress template image. ##### TrashEmpty ```ts TrashEmpty: "TrashEmpty"; ``` An image of the empty trash can. ##### TrashFull ```ts TrashFull: "TrashFull"; ``` An image of the full trash can. ##### User ```ts User: "User"; ``` Permissions for a single user. ##### UserAccounts ```ts UserAccounts: "UserAccounts"; ``` User account toolbar icon for the preferences window. ##### UserGroup ```ts UserGroup: "UserGroup"; ``` Permissions for a group of users. ##### UserGuest ```ts UserGuest: "UserGuest"; ``` Permissions for guests. ## Classes ### CheckMenuItem A check menu item inside a [`Menu`](/taurify/api/namespacemenu/#menu) or [`Submenu`](/taurify/api/namespacemenu/#submenu) and usually contains a text and a check mark or a similar toggle that corresponds to a checked and unchecked states. #### Extends - `MenuItemBase` #### Accessors ##### id ###### Get Signature ```ts get id(): string ``` The id of this item. ###### Returns `string` ###### Inherited from `MenuItemBase.id` ##### rid ###### Get Signature ```ts get rid(): number ``` ###### Returns `number` ###### Inherited from `MenuItemBase.rid` #### Methods ##### close() ```ts close(): Promise ``` Destroys and cleans up this resource from memory. **You should not call any method on this object anymore and should drop any reference to it.** ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Inherited from `MenuItemBase.close` ##### isChecked() ```ts isChecked(): Promise ``` Returns whether this check menu item is checked or not. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> ##### isEnabled() ```ts isEnabled(): Promise ``` Returns whether this check menu item is enabled or not. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> ##### setAccelerator() ```ts setAccelerator(accelerator): Promise ``` Sets the accelerator for this check menu item. ###### Parameters | Parameter | Type | | ------ | ------ | | `accelerator` | `null` \| `string` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### setChecked() ```ts setChecked(checked): Promise ``` Sets whether this check menu item is checked or not. ###### Parameters | Parameter | Type | | ------ | ------ | | `checked` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### setEnabled() ```ts setEnabled(enabled): Promise ``` Sets whether this check menu item is enabled or not. ###### Parameters | Parameter | Type | | ------ | ------ | | `enabled` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### setText() ```ts setText(text): Promise ``` Sets the text for this check menu item. ###### Parameters | Parameter | Type | | ------ | ------ | | `text` | `string` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### text() ```ts text(): Promise ``` Returns the text of this check menu item. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> ##### new() ```ts static new(opts): Promise ``` Create a new check menu item. ###### Parameters | Parameter | Type | | ------ | ------ | | `opts` | [`CheckMenuItemOptions`](/taurify/api/namespacemenu/#checkmenuitemoptions) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`CheckMenuItem`](/taurify/api/namespacemenu/#checkmenuitem)\> *** ### IconMenuItem An icon menu item inside a [`Menu`](/taurify/api/namespacemenu/#menu) or [`Submenu`](/taurify/api/namespacemenu/#submenu) and usually contains an icon and a text. #### Extends - `MenuItemBase` #### Accessors ##### id ###### Get Signature ```ts get id(): string ``` The id of this item. ###### Returns `string` ###### Inherited from `MenuItemBase.id` ##### rid ###### Get Signature ```ts get rid(): number ``` ###### Returns `number` ###### Inherited from `MenuItemBase.rid` #### Methods ##### close() ```ts close(): Promise ``` Destroys and cleans up this resource from memory. **You should not call any method on this object anymore and should drop any reference to it.** ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Inherited from `MenuItemBase.close` ##### isEnabled() ```ts isEnabled(): Promise ``` Returns whether this icon menu item is enabled or not. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> ##### setAccelerator() ```ts setAccelerator(accelerator): Promise ``` Sets the accelerator for this icon menu item. ###### Parameters | Parameter | Type | | ------ | ------ | | `accelerator` | `null` \| `string` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### setEnabled() ```ts setEnabled(enabled): Promise ``` Sets whether this icon menu item is enabled or not. ###### Parameters | Parameter | Type | | ------ | ------ | | `enabled` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### setIcon() ```ts setIcon(icon): Promise ``` Sets an icon for this icon menu item ###### Parameters | Parameter | Type | | ------ | ------ | | `icon` | \| `null` \| `string` \| `number`[] \| [`ArrayBuffer`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) \| [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\> \| [`Image`](/taurify/api/namespaceimage/#image) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### setText() ```ts setText(text): Promise ``` Sets the text for this icon menu item. ###### Parameters | Parameter | Type | | ------ | ------ | | `text` | `string` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### text() ```ts text(): Promise ``` Returns the text of this icon menu item. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> ##### new() ```ts static new(opts): Promise ``` Create a new icon menu item. ###### Parameters | Parameter | Type | | ------ | ------ | | `opts` | [`IconMenuItemOptions`](/taurify/api/namespacemenu/#iconmenuitemoptions) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`IconMenuItem`](/taurify/api/namespacemenu/#iconmenuitem)\> *** ### Menu A type that is either a menu bar on the window on Windows and Linux or as a global menu in the menubar on macOS. #### Platform-specific: - **macOS**: if using [`Menu`](/taurify/api/namespacemenu/#menu) for the global menubar, it can only contain [`Submenu`](/taurify/api/namespacemenu/#submenu)s. #### Extends - `MenuItemBase` #### Accessors ##### id ###### Get Signature ```ts get id(): string ``` The id of this item. ###### Returns `string` ###### Inherited from `MenuItemBase.id` ##### rid ###### Get Signature ```ts get rid(): number ``` ###### Returns `number` ###### Inherited from `MenuItemBase.rid` #### Methods ##### append() ```ts append(items): Promise ``` Add a menu item to the end of this menu. #### Platform-specific: - **macOS:** Only [`Submenu`](/taurify/api/namespacemenu/#submenu)s can be added to a [`Menu`](/taurify/api/namespacemenu/#menu). ###### Type Parameters | Type Parameter | | ------ | | `T` *extends* \| [`CheckMenuItemOptions`](/taurify/api/namespacemenu/#checkmenuitemoptions) \| [`MenuItemOptions`](/taurify/api/namespacemenu/#menuitemoptions) \| [`CheckMenuItem`](/taurify/api/namespacemenu/#checkmenuitem) \| [`SubmenuOptions`](/taurify/api/namespacemenu/#submenuoptions) \| [`PredefinedMenuItemOptions`](/taurify/api/namespacemenu/#predefinedmenuitemoptions) \| [`IconMenuItemOptions`](/taurify/api/namespacemenu/#iconmenuitemoptions) \| [`IconMenuItem`](/taurify/api/namespacemenu/#iconmenuitem) \| [`PredefinedMenuItem`](/taurify/api/namespacemenu/#predefinedmenuitem) \| [`Submenu`](/taurify/api/namespacemenu/#submenu) \| [`MenuItem`](/taurify/api/namespacemenu/#menuitem) | ###### Parameters | Parameter | Type | | ------ | ------ | | `items` | `T` \| `T`[] | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### close() ```ts close(): Promise ``` Destroys and cleans up this resource from memory. **You should not call any method on this object anymore and should drop any reference to it.** ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Inherited from `MenuItemBase.close` ##### get() ```ts get(id): Promise< | null | CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem> ``` Retrieves the menu item matching the given identifier. ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\< \| `null` \| [`CheckMenuItem`](/taurify/api/namespacemenu/#checkmenuitem) \| [`IconMenuItem`](/taurify/api/namespacemenu/#iconmenuitem) \| [`PredefinedMenuItem`](/taurify/api/namespacemenu/#predefinedmenuitem) \| [`Submenu`](/taurify/api/namespacemenu/#submenu) \| [`MenuItem`](/taurify/api/namespacemenu/#menuitem)\> ##### insert() ```ts insert(items, position): Promise ``` Add a menu item to the specified position in this menu. #### Platform-specific: - **macOS:** Only [`Submenu`](/taurify/api/namespacemenu/#submenu)s can be added to a [`Menu`](/taurify/api/namespacemenu/#menu). ###### Type Parameters | Type Parameter | | ------ | | `T` *extends* \| [`CheckMenuItemOptions`](/taurify/api/namespacemenu/#checkmenuitemoptions) \| [`MenuItemOptions`](/taurify/api/namespacemenu/#menuitemoptions) \| [`CheckMenuItem`](/taurify/api/namespacemenu/#checkmenuitem) \| [`SubmenuOptions`](/taurify/api/namespacemenu/#submenuoptions) \| [`PredefinedMenuItemOptions`](/taurify/api/namespacemenu/#predefinedmenuitemoptions) \| [`IconMenuItemOptions`](/taurify/api/namespacemenu/#iconmenuitemoptions) \| [`IconMenuItem`](/taurify/api/namespacemenu/#iconmenuitem) \| [`PredefinedMenuItem`](/taurify/api/namespacemenu/#predefinedmenuitem) \| [`Submenu`](/taurify/api/namespacemenu/#submenu) \| [`MenuItem`](/taurify/api/namespacemenu/#menuitem) | ###### Parameters | Parameter | Type | | ------ | ------ | | `items` | `T` \| `T`[] | | `position` | `number` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### items() ```ts items(): Promise<( | CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem)[]> ``` Returns a list of menu items that has been added to this menu. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<( \| [`CheckMenuItem`](/taurify/api/namespacemenu/#checkmenuitem) \| [`IconMenuItem`](/taurify/api/namespacemenu/#iconmenuitem) \| [`PredefinedMenuItem`](/taurify/api/namespacemenu/#predefinedmenuitem) \| [`Submenu`](/taurify/api/namespacemenu/#submenu) \| [`MenuItem`](/taurify/api/namespacemenu/#menuitem))[]\> ##### popup() ```ts popup(at?, window?): Promise ``` Popup this menu as a context menu on the specified window. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `at`? | [`LogicalPosition`](/taurify/api/namespacedpi/#logicalposition) \| [`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition) \| [`Position`](/taurify/api/namespacedpi/#position) | If a position is provided, it is relative to the window's top-left corner. If there isn't one provided, the menu will pop up at the current location of the mouse. | | `window`? | [`Window`](/taurify/api/namespacewindow/#window) | - | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### prepend() ```ts prepend(items): Promise ``` Add a menu item to the beginning of this menu. #### Platform-specific: - **macOS:** Only [`Submenu`](/taurify/api/namespacemenu/#submenu)s can be added to a [`Menu`](/taurify/api/namespacemenu/#menu). ###### Type Parameters | Type Parameter | | ------ | | `T` *extends* \| [`CheckMenuItemOptions`](/taurify/api/namespacemenu/#checkmenuitemoptions) \| [`MenuItemOptions`](/taurify/api/namespacemenu/#menuitemoptions) \| [`CheckMenuItem`](/taurify/api/namespacemenu/#checkmenuitem) \| [`SubmenuOptions`](/taurify/api/namespacemenu/#submenuoptions) \| [`PredefinedMenuItemOptions`](/taurify/api/namespacemenu/#predefinedmenuitemoptions) \| [`IconMenuItemOptions`](/taurify/api/namespacemenu/#iconmenuitemoptions) \| [`IconMenuItem`](/taurify/api/namespacemenu/#iconmenuitem) \| [`PredefinedMenuItem`](/taurify/api/namespacemenu/#predefinedmenuitem) \| [`Submenu`](/taurify/api/namespacemenu/#submenu) \| [`MenuItem`](/taurify/api/namespacemenu/#menuitem) | ###### Parameters | Parameter | Type | | ------ | ------ | | `items` | `T` \| `T`[] | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### remove() ```ts remove(item): Promise ``` Remove a menu item from this menu. ###### Parameters | Parameter | Type | | ------ | ------ | | `item` | \| [`CheckMenuItem`](/taurify/api/namespacemenu/#checkmenuitem) \| [`IconMenuItem`](/taurify/api/namespacemenu/#iconmenuitem) \| [`PredefinedMenuItem`](/taurify/api/namespacemenu/#predefinedmenuitem) \| [`Submenu`](/taurify/api/namespacemenu/#submenu) \| [`MenuItem`](/taurify/api/namespacemenu/#menuitem) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### removeAt() ```ts removeAt(position): Promise< | null | CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem> ``` Remove a menu item from this menu at the specified position. ###### Parameters | Parameter | Type | | ------ | ------ | | `position` | `number` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\< \| `null` \| [`CheckMenuItem`](/taurify/api/namespacemenu/#checkmenuitem) \| [`IconMenuItem`](/taurify/api/namespacemenu/#iconmenuitem) \| [`PredefinedMenuItem`](/taurify/api/namespacemenu/#predefinedmenuitem) \| [`Submenu`](/taurify/api/namespacemenu/#submenu) \| [`MenuItem`](/taurify/api/namespacemenu/#menuitem)\> ##### setAsAppMenu() ```ts setAsAppMenu(): Promise ``` Sets the app-wide menu and returns the previous one. If a window was not created with an explicit menu or had one set explicitly, this menu will be assigned to it. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`null` \| [`Menu`](/taurify/api/namespacemenu/#menu)\> ##### setAsWindowMenu() ```ts setAsWindowMenu(window?): Promise ``` Sets the window menu and returns the previous one. #### Platform-specific: - **macOS:** Unsupported. The menu on macOS is app-wide and not specific to one window, if you need to set it, use [`Menu.setAsAppMenu`](/taurify/api/namespacemenu/#setasappmenu) instead. ###### Parameters | Parameter | Type | | ------ | ------ | | `window`? | [`Window`](/taurify/api/namespacewindow/#window) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`null` \| [`Menu`](/taurify/api/namespacemenu/#menu)\> ##### default() ```ts static default(): Promise ``` Create a default menu. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Menu`](/taurify/api/namespacemenu/#menu)\> ##### new() ```ts static new(opts?): Promise ``` Create a new menu. ###### Parameters | Parameter | Type | | ------ | ------ | | `opts`? | [`MenuOptions`](/taurify/api/namespacemenu/#menuoptions) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Menu`](/taurify/api/namespacemenu/#menu)\> *** ### MenuItem A menu item inside a [`Menu`](/taurify/api/namespacemenu/#menu) or [`Submenu`](/taurify/api/namespacemenu/#submenu) and contains only text. #### Extends - `MenuItemBase` #### Accessors ##### id ###### Get Signature ```ts get id(): string ``` The id of this item. ###### Returns `string` ###### Inherited from `MenuItemBase.id` ##### rid ###### Get Signature ```ts get rid(): number ``` ###### Returns `number` ###### Inherited from `MenuItemBase.rid` #### Methods ##### close() ```ts close(): Promise ``` Destroys and cleans up this resource from memory. **You should not call any method on this object anymore and should drop any reference to it.** ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Inherited from `MenuItemBase.close` ##### isEnabled() ```ts isEnabled(): Promise ``` Returns whether this menu item is enabled or not. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> ##### setAccelerator() ```ts setAccelerator(accelerator): Promise ``` Sets the accelerator for this menu item. ###### Parameters | Parameter | Type | | ------ | ------ | | `accelerator` | `null` \| `string` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### setEnabled() ```ts setEnabled(enabled): Promise ``` Sets whether this menu item is enabled or not. ###### Parameters | Parameter | Type | | ------ | ------ | | `enabled` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### setText() ```ts setText(text): Promise ``` Sets the text for this menu item. ###### Parameters | Parameter | Type | | ------ | ------ | | `text` | `string` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### text() ```ts text(): Promise ``` Returns the text of this menu item. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> ##### new() ```ts static new(opts): Promise ``` Create a new menu item. ###### Parameters | Parameter | Type | | ------ | ------ | | `opts` | [`MenuItemOptions`](/taurify/api/namespacemenu/#menuitemoptions) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`MenuItem`](/taurify/api/namespacemenu/#menuitem)\> *** ### PredefinedMenuItem A predefined (native) menu item which has a predefined behavior by the OS or by tauri. #### Extends - `MenuItemBase` #### Accessors ##### id ###### Get Signature ```ts get id(): string ``` The id of this item. ###### Returns `string` ###### Inherited from `MenuItemBase.id` ##### rid ###### Get Signature ```ts get rid(): number ``` ###### Returns `number` ###### Inherited from `MenuItemBase.rid` #### Methods ##### close() ```ts close(): Promise ``` Destroys and cleans up this resource from memory. **You should not call any method on this object anymore and should drop any reference to it.** ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Inherited from `MenuItemBase.close` ##### setText() ```ts setText(text): Promise ``` Sets the text for this predefined menu item. ###### Parameters | Parameter | Type | | ------ | ------ | | `text` | `string` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### text() ```ts text(): Promise ``` Returns the text of this predefined menu item. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> ##### new() ```ts static new(opts?): Promise ``` Create a new predefined menu item. ###### Parameters | Parameter | Type | | ------ | ------ | | `opts`? | [`PredefinedMenuItemOptions`](/taurify/api/namespacemenu/#predefinedmenuitemoptions) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`PredefinedMenuItem`](/taurify/api/namespacemenu/#predefinedmenuitem)\> *** ### Submenu A type that is a submenu inside a [`Menu`](/taurify/api/namespacemenu/#menu) or [`Submenu`](/taurify/api/namespacemenu/#submenu). #### Extends - `MenuItemBase` #### Accessors ##### id ###### Get Signature ```ts get id(): string ``` The id of this item. ###### Returns `string` ###### Inherited from `MenuItemBase.id` ##### rid ###### Get Signature ```ts get rid(): number ``` ###### Returns `number` ###### Inherited from `MenuItemBase.rid` #### Methods ##### append() ```ts append(items): Promise ``` Add a menu item to the end of this submenu. #### Platform-specific: - **macOS:** Only [`Submenu`](/taurify/api/namespacemenu/#submenu)s can be added to a [`Menu`](/taurify/api/namespacemenu/#menu). ###### Type Parameters | Type Parameter | | ------ | | `T` *extends* \| [`CheckMenuItemOptions`](/taurify/api/namespacemenu/#checkmenuitemoptions) \| [`MenuItemOptions`](/taurify/api/namespacemenu/#menuitemoptions) \| [`CheckMenuItem`](/taurify/api/namespacemenu/#checkmenuitem) \| [`SubmenuOptions`](/taurify/api/namespacemenu/#submenuoptions) \| [`PredefinedMenuItemOptions`](/taurify/api/namespacemenu/#predefinedmenuitemoptions) \| [`IconMenuItemOptions`](/taurify/api/namespacemenu/#iconmenuitemoptions) \| [`IconMenuItem`](/taurify/api/namespacemenu/#iconmenuitem) \| [`PredefinedMenuItem`](/taurify/api/namespacemenu/#predefinedmenuitem) \| [`Submenu`](/taurify/api/namespacemenu/#submenu) \| [`MenuItem`](/taurify/api/namespacemenu/#menuitem) | ###### Parameters | Parameter | Type | | ------ | ------ | | `items` | `T` \| `T`[] | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### close() ```ts close(): Promise ``` Destroys and cleans up this resource from memory. **You should not call any method on this object anymore and should drop any reference to it.** ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Inherited from `MenuItemBase.close` ##### get() ```ts get(id): Promise< | null | CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem> ``` Retrieves the menu item matching the given identifier. ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\< \| `null` \| [`CheckMenuItem`](/taurify/api/namespacemenu/#checkmenuitem) \| [`IconMenuItem`](/taurify/api/namespacemenu/#iconmenuitem) \| [`PredefinedMenuItem`](/taurify/api/namespacemenu/#predefinedmenuitem) \| [`Submenu`](/taurify/api/namespacemenu/#submenu) \| [`MenuItem`](/taurify/api/namespacemenu/#menuitem)\> ##### insert() ```ts insert(items, position): Promise ``` Add a menu item to the specified position in this submenu. #### Platform-specific: - **macOS:** Only [`Submenu`](/taurify/api/namespacemenu/#submenu)s can be added to a [`Menu`](/taurify/api/namespacemenu/#menu). ###### Type Parameters | Type Parameter | | ------ | | `T` *extends* \| [`CheckMenuItemOptions`](/taurify/api/namespacemenu/#checkmenuitemoptions) \| [`MenuItemOptions`](/taurify/api/namespacemenu/#menuitemoptions) \| [`CheckMenuItem`](/taurify/api/namespacemenu/#checkmenuitem) \| [`SubmenuOptions`](/taurify/api/namespacemenu/#submenuoptions) \| [`PredefinedMenuItemOptions`](/taurify/api/namespacemenu/#predefinedmenuitemoptions) \| [`IconMenuItemOptions`](/taurify/api/namespacemenu/#iconmenuitemoptions) \| [`IconMenuItem`](/taurify/api/namespacemenu/#iconmenuitem) \| [`PredefinedMenuItem`](/taurify/api/namespacemenu/#predefinedmenuitem) \| [`Submenu`](/taurify/api/namespacemenu/#submenu) \| [`MenuItem`](/taurify/api/namespacemenu/#menuitem) | ###### Parameters | Parameter | Type | | ------ | ------ | | `items` | `T` \| `T`[] | | `position` | `number` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### isEnabled() ```ts isEnabled(): Promise ``` Returns whether this submenu is enabled or not. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> ##### items() ```ts items(): Promise<( | CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem)[]> ``` Returns a list of menu items that has been added to this submenu. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<( \| [`CheckMenuItem`](/taurify/api/namespacemenu/#checkmenuitem) \| [`IconMenuItem`](/taurify/api/namespacemenu/#iconmenuitem) \| [`PredefinedMenuItem`](/taurify/api/namespacemenu/#predefinedmenuitem) \| [`Submenu`](/taurify/api/namespacemenu/#submenu) \| [`MenuItem`](/taurify/api/namespacemenu/#menuitem))[]\> ##### popup() ```ts popup(at?, window?): Promise ``` Popup this submenu as a context menu on the specified window. If the position, is provided, it is relative to the window's top-left corner. ###### Parameters | Parameter | Type | | ------ | ------ | | `at`? | [`LogicalPosition`](/taurify/api/namespacedpi/#logicalposition) \| [`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition) | | `window`? | [`Window`](/taurify/api/namespacewindow/#window) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### prepend() ```ts prepend(items): Promise ``` Add a menu item to the beginning of this submenu. #### Platform-specific: - **macOS:** Only [`Submenu`](/taurify/api/namespacemenu/#submenu)s can be added to a [`Menu`](/taurify/api/namespacemenu/#menu). ###### Type Parameters | Type Parameter | | ------ | | `T` *extends* \| [`CheckMenuItemOptions`](/taurify/api/namespacemenu/#checkmenuitemoptions) \| [`MenuItemOptions`](/taurify/api/namespacemenu/#menuitemoptions) \| [`CheckMenuItem`](/taurify/api/namespacemenu/#checkmenuitem) \| [`SubmenuOptions`](/taurify/api/namespacemenu/#submenuoptions) \| [`PredefinedMenuItemOptions`](/taurify/api/namespacemenu/#predefinedmenuitemoptions) \| [`IconMenuItemOptions`](/taurify/api/namespacemenu/#iconmenuitemoptions) \| [`IconMenuItem`](/taurify/api/namespacemenu/#iconmenuitem) \| [`PredefinedMenuItem`](/taurify/api/namespacemenu/#predefinedmenuitem) \| [`Submenu`](/taurify/api/namespacemenu/#submenu) \| [`MenuItem`](/taurify/api/namespacemenu/#menuitem) | ###### Parameters | Parameter | Type | | ------ | ------ | | `items` | `T` \| `T`[] | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### remove() ```ts remove(item): Promise ``` Remove a menu item from this submenu. ###### Parameters | Parameter | Type | | ------ | ------ | | `item` | \| [`CheckMenuItem`](/taurify/api/namespacemenu/#checkmenuitem) \| [`IconMenuItem`](/taurify/api/namespacemenu/#iconmenuitem) \| [`PredefinedMenuItem`](/taurify/api/namespacemenu/#predefinedmenuitem) \| [`Submenu`](/taurify/api/namespacemenu/#submenu) \| [`MenuItem`](/taurify/api/namespacemenu/#menuitem) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### removeAt() ```ts removeAt(position): Promise< | null | CheckMenuItem | IconMenuItem | PredefinedMenuItem | Submenu | MenuItem> ``` Remove a menu item from this submenu at the specified position. ###### Parameters | Parameter | Type | | ------ | ------ | | `position` | `number` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\< \| `null` \| [`CheckMenuItem`](/taurify/api/namespacemenu/#checkmenuitem) \| [`IconMenuItem`](/taurify/api/namespacemenu/#iconmenuitem) \| [`PredefinedMenuItem`](/taurify/api/namespacemenu/#predefinedmenuitem) \| [`Submenu`](/taurify/api/namespacemenu/#submenu) \| [`MenuItem`](/taurify/api/namespacemenu/#menuitem)\> ##### setAsHelpMenuForNSApp() ```ts setAsHelpMenuForNSApp(): Promise ``` Set this submenu as the Help menu for the application on macOS. This will cause macOS to automatically add a search box to the menu. If no menu is set as the Help menu, macOS will automatically use any menu which has a title matching the localized word "Help". #### Platform-specific: - **Windows / Linux**: Unsupported. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### setAsWindowsMenuForNSApp() ```ts setAsWindowsMenuForNSApp(): Promise ``` Set this submenu as the Window menu for the application on macOS. This will cause macOS to automatically add window-switching items and certain other items to the menu. #### Platform-specific: - **Windows / Linux**: Unsupported. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### setEnabled() ```ts setEnabled(enabled): Promise ``` Sets whether this submenu is enabled or not. ###### Parameters | Parameter | Type | | ------ | ------ | | `enabled` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### setText() ```ts setText(text): Promise ``` Sets the text for this submenu. ###### Parameters | Parameter | Type | | ------ | ------ | | `text` | `string` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### text() ```ts text(): Promise ``` Returns the text of this submenu. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> ##### new() ```ts static new(opts): Promise ``` Create a new submenu. ###### Parameters | Parameter | Type | | ------ | ------ | | `opts` | [`SubmenuOptions`](/taurify/api/namespacemenu/#submenuoptions) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Submenu`](/taurify/api/namespacemenu/#submenu)\> ## Interfaces ### AboutMetadata A metadata for the about predefined menu item. #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `authors?` | `string`[] | The authors of the application. #### Platform-specific - **macOS:** Unsupported. | | | `comments?` | `string` | Application comments. #### Platform-specific - **macOS:** Unsupported. | | | `copyright?` | `string` | The copyright of the application. | | | `credits?` | `string` | The credits. #### Platform-specific - **Windows / Linux:** Unsupported. | | | `icon?` | \| `string` \| `number`[] \| [`ArrayBuffer`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) \| [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\> \| [`Image`](/taurify/api/namespaceimage/#image) | The application icon. #### Platform-specific - **Windows:** Unsupported. | | | `license?` | `string` | The license of the application. #### Platform-specific - **macOS:** Unsupported. | | | `name?` | `string` | Sets the application name. | | | `shortVersion?` | `string` | The short version, e.g. "1.0". #### Platform-specific - **Windows / Linux:** Appended to the end of `version` in parentheses. | | | `version?` | `string` | The application version. | | | `website?` | `string` | The application website. #### Platform-specific - **macOS:** Unsupported. | | | `websiteLabel?` | `string` | The website label. #### Platform-specific - **macOS:** Unsupported. | | *** ### CheckMenuItemOptions Options for creating a new check menu item. #### Extends - [`MenuItemOptions`](/taurify/api/namespacemenu/#menuitemoptions) #### Properties | Property | Type | Description | Inherited from | Defined in | | ------ | ------ | ------ | ------ | ------ | | `accelerator?` | `string` | Specify an accelerator for the new menu item. | [`MenuItemOptions`](/taurify/api/namespacemenu/#menuitemoptions).[`accelerator`](/taurify/api/namespacemenu/#accelerator-2) | | | `action?` | (`id`: `string`) => `void` | Specify a handler to be called when this menu item is activated. | [`MenuItemOptions`](/taurify/api/namespacemenu/#menuitemoptions).[`action`](/taurify/api/namespacemenu/#action-2) | | | `checked?` | `boolean` | Whether the new check menu item is enabled or not. | - | | | `enabled?` | `boolean` | Whether the new menu item is enabled or not. | [`MenuItemOptions`](/taurify/api/namespacemenu/#menuitemoptions).[`enabled`](/taurify/api/namespacemenu/#enabled-2) | | | `id?` | `string` | Specify an id to use for the new menu item. | [`MenuItemOptions`](/taurify/api/namespacemenu/#menuitemoptions).[`id`](/taurify/api/namespacemenu/#id-8) | | | `text` | `string` | The text of the new menu item. | [`MenuItemOptions`](/taurify/api/namespacemenu/#menuitemoptions).[`text`](/taurify/api/namespacemenu/#text-7) | | *** ### IconMenuItemOptions Options for creating a new icon menu item. #### Extends - [`MenuItemOptions`](/taurify/api/namespacemenu/#menuitemoptions) #### Properties | Property | Type | Description | Inherited from | Defined in | | ------ | ------ | ------ | ------ | ------ | | `accelerator?` | `string` | Specify an accelerator for the new menu item. | [`MenuItemOptions`](/taurify/api/namespacemenu/#menuitemoptions).[`accelerator`](/taurify/api/namespacemenu/#accelerator-2) | | | `action?` | (`id`: `string`) => `void` | Specify a handler to be called when this menu item is activated. | [`MenuItemOptions`](/taurify/api/namespacemenu/#menuitemoptions).[`action`](/taurify/api/namespacemenu/#action-2) | | | `enabled?` | `boolean` | Whether the new menu item is enabled or not. | [`MenuItemOptions`](/taurify/api/namespacemenu/#menuitemoptions).[`enabled`](/taurify/api/namespacemenu/#enabled-2) | | | `icon?` | \| `string` \| `number`[] \| [`ArrayBuffer`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) \| [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\> \| [`Image`](/taurify/api/namespaceimage/#image) | Icon to be used for the new icon menu item. | - | | | `id?` | `string` | Specify an id to use for the new menu item. | [`MenuItemOptions`](/taurify/api/namespacemenu/#menuitemoptions).[`id`](/taurify/api/namespacemenu/#id-8) | | | `text` | `string` | The text of the new menu item. | [`MenuItemOptions`](/taurify/api/namespacemenu/#menuitemoptions).[`text`](/taurify/api/namespacemenu/#text-7) | | *** ### MenuItemOptions Options for creating a new menu item. #### Extended by - [`CheckMenuItemOptions`](/taurify/api/namespacemenu/#checkmenuitemoptions) - [`IconMenuItemOptions`](/taurify/api/namespacemenu/#iconmenuitemoptions) #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `accelerator?` | `string` | Specify an accelerator for the new menu item. | | | `action?` | (`id`: `string`) => `void` | Specify a handler to be called when this menu item is activated. | | | `enabled?` | `boolean` | Whether the new menu item is enabled or not. | | | `id?` | `string` | Specify an id to use for the new menu item. | | | `text` | `string` | The text of the new menu item. | | *** ### MenuOptions Options for creating a new menu. #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `id?` | `string` | Specify an id to use for the new menu. | | | `items?` | ( \| [`CheckMenuItemOptions`](/taurify/api/namespacemenu/#checkmenuitemoptions) \| [`MenuItemOptions`](/taurify/api/namespacemenu/#menuitemoptions) \| [`CheckMenuItem`](/taurify/api/namespacemenu/#checkmenuitem) \| [`SubmenuOptions`](/taurify/api/namespacemenu/#submenuoptions) \| [`PredefinedMenuItemOptions`](/taurify/api/namespacemenu/#predefinedmenuitemoptions) \| [`IconMenuItemOptions`](/taurify/api/namespacemenu/#iconmenuitemoptions) \| [`IconMenuItem`](/taurify/api/namespacemenu/#iconmenuitem) \| [`PredefinedMenuItem`](/taurify/api/namespacemenu/#predefinedmenuitem) \| [`Submenu`](/taurify/api/namespacemenu/#submenu) \| [`MenuItem`](/taurify/api/namespacemenu/#menuitem))[] | List of items to add to the new menu. | | *** ### PredefinedMenuItemOptions Options for creating a new predefined menu item. #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `item` | \| `object` \| `"Separator"` \| `"Copy"` \| `"Cut"` \| `"Paste"` \| `"SelectAll"` \| `"Undo"` \| `"Redo"` \| `"Minimize"` \| `"Maximize"` \| `"Fullscreen"` \| `"Hide"` \| `"HideOthers"` \| `"ShowAll"` \| `"CloseWindow"` \| `"Quit"` \| `"Services"` | The predefined item type | | | `text?` | `string` | The text of the new predefined menu item. | | ## Type Aliases ### SubmenuOptions ```ts type SubmenuOptions: Omit & MenuOptions; ``` # nfc ## Enumerations ### NFCTypeNameFormat #### Enumeration Members ##### AbsoluteURI ```ts AbsoluteURI: 3; ``` ##### Empty ```ts Empty: 0; ``` ##### Media ```ts Media: 2; ``` ##### NfcExternal ```ts NfcExternal: 4; ``` ##### NfcWellKnown ```ts NfcWellKnown: 1; ``` ##### Unchanged ```ts Unchanged: 6; ``` ##### Unknown ```ts Unknown: 5; ``` *** ### TechKind #### Enumeration Members ##### IsoDep ```ts IsoDep: 0; ``` ##### MifareClassic ```ts MifareClassic: 1; ``` ##### MifareUltralight ```ts MifareUltralight: 2; ``` ##### Ndef ```ts Ndef: 3; ``` ##### NdefFormatable ```ts NdefFormatable: 4; ``` ##### NfcA ```ts NfcA: 5; ``` ##### NfcB ```ts NfcB: 6; ``` ##### NfcBarcode ```ts NfcBarcode: 7; ``` ##### NfcF ```ts NfcF: 8; ``` ##### NfcV ```ts NfcV: 9; ``` ## Interfaces ### NFCRecord #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `format` | [`NFCTypeNameFormat`](/taurify/api/namespacenfc/#nfctypenameformat) | | | `id` | `number`[] | | | `kind` | `number`[] | | | `payload` | `number`[] | | *** ### ScanOptions #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `keepSessionAlive?` | `boolean` | - | | | `message?` | `string` | Message displayed in the UI. iOS only. | | | `successMessage?` | `string` | Message displayed in the UI when the message has been read. iOS only. | | *** ### Tag #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `id` | `number`[] | | | `kind` | `string`[] | | | `records` | [`TagRecord`](/taurify/api/namespacenfc/#tagrecord)[] | | *** ### TagRecord #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `id` | `number`[] | | | `kind` | `number`[] | | | `payload` | `number`[] | | | `tnf` | [`NFCTypeNameFormat`](/taurify/api/namespacenfc/#nfctypenameformat) | | *** ### UriFilter #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `host?` | `string` | | | `pathPrefix?` | `string` | | | `scheme?` | `string` | | *** ### WriteOptions #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `kind?` | [`ScanKind`](/taurify/api/namespacenfc/#scankind) | - | | | `message?` | `string` | Message displayed in the UI when reading the tag. iOS only. | | | `successfulReadMessage?` | `string` | Message displayed in the UI when the tag has been read. iOS only. | | | `successMessage?` | `string` | Message displayed in the UI when the message has been written. iOS only. | | ## Type Aliases ### ScanKind ```ts type ScanKind: object | object; ``` ## Variables ### RTD\_TEXT ```ts const RTD_TEXT: number[]; ``` *** ### RTD\_URI ```ts const RTD_URI: number[]; ``` ## Functions ### isAvailable() ```ts function isAvailable(): Promise ``` #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> *** ### record() ```ts function record( format, kind, id, payload): NFCRecord ``` #### Parameters | Parameter | Type | | ------ | ------ | | `format` | [`NFCTypeNameFormat`](/taurify/api/namespacenfc/#nfctypenameformat) | | `kind` | `string` \| `number`[] | | `id` | `string` \| `number`[] | | `payload` | `string` \| `number`[] | #### Returns [`NFCRecord`](/taurify/api/namespacenfc/#nfcrecord) *** ### scan() ```ts function scan(kind, options?): Promise ``` Scans an NFC tag. ```javascript import { scan } from "@crabnebula/taurify-api/nfc"; await scan({ type: "tag" }); ``` See for more information. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `kind` | [`ScanKind`](/taurify/api/namespacenfc/#scankind) | | | `options`? | [`ScanOptions`](/taurify/api/namespacenfc/#scanoptions) | | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Tag`](/taurify/api/namespacenfc/#tag)\> *** ### textRecord() ```ts function textRecord( text, id?, language?): NFCRecord ``` #### Parameters | Parameter | Type | Default value | | ------ | ------ | ------ | | `text` | `string` | `undefined` | | `id`? | `string` \| `number`[] | `undefined` | | `language`? | `string` | `'en'` | #### Returns [`NFCRecord`](/taurify/api/namespacenfc/#nfcrecord) *** ### uriRecord() ```ts function uriRecord(uri, id?): NFCRecord ``` #### Parameters | Parameter | Type | | ------ | ------ | | `uri` | `string` | | `id`? | `string` \| `number`[] | #### Returns [`NFCRecord`](/taurify/api/namespacenfc/#nfcrecord) *** ### write() ```ts function write(records, options?): Promise ``` Write to an NFC tag. ```javascript import { uriRecord, write } from "@crabnebula/taurify-api/nfc"; await write([uriRecord("https://tauri.app")], { kind: { type: "ndef" } }); ``` If you did not previously call [scan](/taurify/api/namespacenfc/#scan) with [ScanOptions.keepSessionAlive](/taurify/api/namespacenfc/#keepsessionalive) set to true, it will first scan the tag then write to it. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `records` | [`NFCRecord`](/taurify/api/namespacenfc/#nfcrecord)[] | | | `options`? | [`WriteOptions`](/taurify/api/namespacenfc/#writeoptions) | | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> # notification Send toast notifications (brief auto-expiring OS window element) to your user. Can also be used with the Notification Web API. ## References ### PermissionState Re-exports [PermissionState](/taurify/api/namespacecore/#permissionstate) ## Enumerations ### Importance #### Enumeration Members ##### Default ```ts Default: 3; ``` ##### High ```ts High: 4; ``` ##### Low ```ts Low: 2; ``` ##### Min ```ts Min: 1; ``` ##### None ```ts None: 0; ``` *** ### ScheduleEvery #### Enumeration Members ##### Day ```ts Day: "day"; ``` ##### Hour ```ts Hour: "hour"; ``` ##### Minute ```ts Minute: "minute"; ``` ##### Month ```ts Month: "month"; ``` ##### Second ```ts Second: "second"; ``` Not supported on iOS. ##### TwoWeeks ```ts TwoWeeks: "twoWeeks"; ``` ##### Week ```ts Week: "week"; ``` ##### Year ```ts Year: "year"; ``` *** ### Visibility #### Enumeration Members ##### Private ```ts Private: 0; ``` ##### Public ```ts Public: 1; ``` ##### Secret ```ts Secret: -1; ``` ## Classes ### Schedule #### Constructors ##### new Schedule() ```ts new Schedule(): Schedule ``` ###### Returns [`Schedule`](/taurify/api/namespacenotification/#schedule) #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `at` | `undefined` \| `object` | | | `every` | `undefined` \| `object` | | | `interval` | `undefined` \| `object` | | #### Methods ##### at() ```ts static at( date, repeating, allowWhileIdle): Schedule ``` ###### Parameters | Parameter | Type | Default value | | ------ | ------ | ------ | | `date` | [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) | `undefined` | | `repeating` | `boolean` | `false` | | `allowWhileIdle` | `boolean` | `false` | ###### Returns [`Schedule`](/taurify/api/namespacenotification/#schedule) ##### every() ```ts static every( kind, count, allowWhileIdle): Schedule ``` ###### Parameters | Parameter | Type | Default value | | ------ | ------ | ------ | | `kind` | [`ScheduleEvery`](/taurify/api/namespacenotification/#scheduleevery) | `undefined` | | `count` | `number` | `undefined` | | `allowWhileIdle` | `boolean` | `false` | ###### Returns [`Schedule`](/taurify/api/namespacenotification/#schedule) ##### interval() ```ts static interval(interval, allowWhileIdle): Schedule ``` ###### Parameters | Parameter | Type | Default value | | ------ | ------ | ------ | | `interval` | [`ScheduleInterval`](/taurify/api/namespacenotification/#scheduleinterval) | `undefined` | | `allowWhileIdle` | `boolean` | `false` | ###### Returns [`Schedule`](/taurify/api/namespacenotification/#schedule) ## Interfaces ### Action #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `destructive?` | `boolean` | | | `foreground?` | `boolean` | | | `id` | `string` | | | `input?` | `boolean` | | | `inputButtonTitle?` | `string` | | | `inputPlaceholder?` | `string` | | | `requiresAuthentication?` | `boolean` | | | `title` | `string` | | *** ### ActionType #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `actions` | [`Action`](/taurify/api/namespacenotification/#action)[] | The list of associated actions | | | `allowInCarPlay?` | `boolean` | - | | | `customDismissAction?` | `boolean` | - | | | `hiddenPreviewsBodyPlaceholder?` | `string` | - | | | `hiddenPreviewsShowSubtitle?` | `boolean` | - | | | `hiddenPreviewsShowTitle?` | `boolean` | - | | | `id` | `string` | The identifier of this action type | | *** ### ActiveNotification #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `actionTypeId?` | `string` | | | `attachments` | [`Attachment`](/taurify/api/namespacenotification/#attachment)[] | | | `body?` | `string` | | | `data` | [`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)\<`string`, `string`\> | | | `extra` | [`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)\<`string`, `unknown`\> | | | `group?` | `string` | | | `groupSummary` | `boolean` | | | `id` | `number` | | | `schedule?` | [`Schedule`](/taurify/api/namespacenotification/#schedule) | | | `sound?` | `string` | | | `tag?` | `string` | | | `title?` | `string` | | *** ### Attachment Attachment of a notification. #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `id` | `string` | Attachment identifier. | | | `url` | `string` | Attachment URL. Accepts the `asset` and `file` protocols. | | *** ### Channel #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `description?` | `string` | | | `id` | `string` | | | `importance?` | [`Importance`](/taurify/api/namespacenotification/#importance) | | | `lightColor?` | `string` | | | `lights?` | `boolean` | | | `name` | `string` | | | `sound?` | `string` | | | `vibration?` | `boolean` | | | `visibility?` | [`Visibility`](/taurify/api/namespacenotification/#visibility) | | *** ### Options Options to send a notification. #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `actionTypeId?` | `string` | Defines an action type for this notification. | | | `attachments?` | [`Attachment`](/taurify/api/namespacenotification/#attachment)[] | Notification attachments. | | | `autoCancel?` | `boolean` | Automatically cancel the notification when the user clicks on it. | | | `body?` | `string` | Optional notification body. | | | `channelId?` | `string` | Identifier of the [Channel](/taurify/api/namespacenotification/#channel) that deliveres this notification. If the channel does not exist, the notification won't fire. Make sure the channel exists with listChannels and [createChannel](/taurify/api/namespacenotification/#createchannel). | | | `extra?` | [`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)\<`string`, `unknown`\> | Extra payload to store in the notification. | | | `group?` | `string` | Identifier used to group multiple notifications. https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent/1649872-threadidentifier | | | `groupSummary?` | `boolean` | Instructs the system that this notification is the summary of a group on Android. | | | `icon?` | `string` | Notification icon. On Android the icon must be placed in the app's `res/drawable` folder. | | | `iconColor?` | `string` | Icon color on Android. | | | `id?` | `number` | The notification identifier to reference this object later. Must be a 32-bit integer. | | | `inboxLines?` | `string`[] | List of lines to add to the notification. Changes the notification style to inbox. Cannot be used with `largeBody`. Only supports up to 5 lines. | | | `largeBody?` | `string` | Multiline text. Changes the notification style to big text. Cannot be used with `inboxLines`. | | | `largeIcon?` | `string` | Notification large icon (Android). The icon must be placed in the app's `res/drawable` folder. | | | `number?` | `number` | Sets the number of items this notification represents on Android. | | | `ongoing?` | `boolean` | If true, the notification cannot be dismissed by the user on Android. An application service must manage the dismissal of the notification. It is typically used to indicate a background task that is pending (e.g. a file download) or the user is engaged with (e.g. playing music). | | | `schedule?` | [`Schedule`](/taurify/api/namespacenotification/#schedule) | Schedule this notification to fire on a later time or a fixed interval. | | | `silent?` | `boolean` | Changes the notification presentation to be silent on iOS (no badge, no sound, not listed). | | | `sound?` | `string` | The sound resource name. Only available on mobile. | | | `summary?` | `string` | Detail text for the notification with `largeBody`, `inboxLines` or `groupSummary`. | | | `title` | `string` | Notification title. | | | `visibility?` | [`Visibility`](/taurify/api/namespacenotification/#visibility) | Notification visibility. | | *** ### PendingNotification #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `body?` | `string` | | | `id` | `number` | | | `schedule` | [`Schedule`](/taurify/api/namespacenotification/#schedule) | | | `title?` | `string` | | *** ### ScheduleInterval #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `day?` | `number` | - | | | `hour?` | `number` | - | | | `minute?` | `number` | - | | | `month?` | `number` | - | | | `second?` | `number` | - | | | `weekday?` | `number` | 1 - Sunday 2 - Monday 3 - Tuesday 4 - Wednesday 5 - Thursday 6 - Friday 7 - Saturday | | | `year?` | `number` | - | | ## Functions ### active() ```ts function active(): Promise ``` Retrieves the list of active notifications. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`ActiveNotification`](/taurify/api/namespacenotification/#activenotification)[]\> A promise resolving to the list of active notifications. #### Example ```typescript import { active } from '@crabnebula/taurify-api/notification'; const activeNotifications = await active(); ``` *** ### cancel() ```ts function cancel(notifications): Promise ``` Cancels the pending notifications with the given list of identifiers. #### Parameters | Parameter | Type | | ------ | ------ | | `notifications` | `number`[] | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. #### Example ```typescript import { cancel } from '@crabnebula/taurify-api/notification'; await cancel([-34234, 23432, 4311]); ``` *** ### cancelAll() ```ts function cancelAll(): Promise ``` Cancels all pending notifications. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. #### Example ```typescript import { cancelAll } from '@crabnebula/taurify-api/notification'; await cancelAll(); ``` *** ### channels() ```ts function channels(): Promise ``` Retrieves the list of notification channels. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Channel`](/taurify/api/namespacenotification/#channel)[]\> A promise resolving to the list of notification channels. #### Example ```typescript import { channels } from '@crabnebula/taurify-api/notification'; const notificationChannels = await channels(); ``` *** ### createChannel() ```ts function createChannel(channel): Promise ``` Creates a notification channel. #### Parameters | Parameter | Type | | ------ | ------ | | `channel` | [`Channel`](/taurify/api/namespacenotification/#channel) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. #### Example ```typescript import { createChannel, Importance, Visibility } from '@crabnebula/taurify-api/notification'; await createChannel({ id: 'new-messages', name: 'New Messages', lights: true, vibration: true, importance: Importance.Default, visibility: Visibility.Private }); ``` *** ### isPermissionGranted() ```ts function isPermissionGranted(): Promise ``` Checks if the permission to send notifications is granted. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> #### Example ```typescript import { isPermissionGranted } from '@crabnebula/taurify-api/notification'; const permissionGranted = await isPermissionGranted(); ``` *** ### onAction() ```ts function onAction(cb): Promise ``` #### Parameters | Parameter | Type | | ------ | ------ | | `cb` | (`notification`) => `void` | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`PluginListener`](/taurify/api/namespacecore/#pluginlistener)\> *** ### onNotificationReceived() ```ts function onNotificationReceived(cb): Promise ``` #### Parameters | Parameter | Type | | ------ | ------ | | `cb` | (`notification`) => `void` | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`PluginListener`](/taurify/api/namespacecore/#pluginlistener)\> *** ### pending() ```ts function pending(): Promise ``` Retrieves the list of pending notifications. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`PendingNotification`](/taurify/api/namespacenotification/#pendingnotification)[]\> A promise resolving to the list of pending notifications. #### Example ```typescript import { pending } from '@crabnebula/taurify-api/notification'; const pendingNotifications = await pending(); ``` *** ### registerActionTypes() ```ts function registerActionTypes(types): Promise ``` Register actions that are performed when the user clicks on the notification. #### Parameters | Parameter | Type | | ------ | ------ | | `types` | [`ActionType`](/taurify/api/namespacenotification/#actiontype)[] | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. #### Example ```typescript import { registerActionTypes } from '@crabnebula/taurify-api/notification'; await registerActionTypes([{ id: 'tauri', actions: [{ id: 'my-action', title: 'Settings' }] }]) ``` *** ### removeActive() ```ts function removeActive(notifications): Promise ``` Removes the active notifications with the given list of identifiers. #### Parameters | Parameter | Type | | ------ | ------ | | `notifications` | `object`[] | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. #### Example ```typescript import { cancel } from '@crabnebula/taurify-api/notification'; await cancel([-34234, 23432, 4311]) ``` *** ### removeAllActive() ```ts function removeAllActive(): Promise ``` Removes all active notifications. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. #### Example ```typescript import { removeAllActive } from '@crabnebula/taurify-api/notification'; await removeAllActive() ``` *** ### removeChannel() ```ts function removeChannel(id): Promise ``` Removes the channel with the given identifier. #### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. #### Example ```typescript import { removeChannel } from '@crabnebula/taurify-api/notification'; await removeChannel(); ``` *** ### requestPermission() ```ts function requestPermission(): Promise ``` Requests the permission to send notifications. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`NotificationPermission`\> A promise resolving to whether the user granted the permission or not. #### Example ```typescript import { isPermissionGranted, requestPermission } from '@crabnebula/taurify-api/notification'; let permissionGranted = await isPermissionGranted(); if (!permissionGranted) { const permission = await requestPermission(); permissionGranted = permission === 'granted'; } ``` *** ### sendNotification() ```ts function sendNotification(options): void ``` Sends a notification to the user. #### Parameters | Parameter | Type | | ------ | ------ | | `options` | `string` \| [`Options`](/taurify/api/namespacenotification/#options) | #### Returns `void` #### Example ```typescript import { isPermissionGranted, requestPermission, sendNotification } from '@crabnebula/taurify-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!' }); } ``` # opener Open files and URLs using their default application. ## Security This API has a scope configuration that forces you to restrict the files and urls to be opened. ### Restricting access to the open | `open` API On the configuration object, `open: true` means that the 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/`. ## Functions ### openPath() ```ts function openPath(path, openWith?): Promise ``` Opens a path with the system's default app, or the one specified with openWith. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `path` | `string` | The path to open. | | `openWith`? | `string` | The app to open the path with. If not specified, defaults to the system default application for the specified path type. | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> #### Example ```typescript import { openPath } from '@crabnebula/taurify-api/opener'; // opens a file using the default program: await openPath('/path/to/file'); // opens a file using `vlc` command on Windows. await openPath('C:/path/to/file', 'vlc'); ``` *** ### openUrl() ```ts function openUrl(url, openWith?): Promise ``` Opens a url with the system's default app, or the one specified with openWith. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `url` | `string` \| [`URL`](https://developer.mozilla.org/docs/Web/API/URL) | The URL to open. | | `openWith`? | `string` | The app to open the URL with. If not specified, defaults to the system default application for the specified url type. On mobile, `openWith` can be provided as `inAppBrowser` to open the URL in an in-app browser. Otherwise, it will open the URL in the system default browser. | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> #### Example ```typescript import { openUrl } from '@crabnebula/taurify-api/opener'; // opens the given URL on the default browser: await openUrl('https://github.com/tauri-apps/tauri'); // opens the given URL using `firefox`: await openUrl('https://github.com/tauri-apps/tauri', 'firefox'); ``` *** ### revealItemInDir() ```ts function revealItemInDir(path): Promise ``` Reveal a path with the system's default explorer. #### Platform-specific: - **Android / iOS:** Unsupported. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `path` | `string` | The path to reveal. | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`unknown`\> #### Example ```typescript import { revealItemInDir } from '@crabnebula/taurify-api/opener'; await revealItemInDir('/path/to/file'); ``` # os Provides operating system-related utility methods and properties. ## Type Aliases ### Arch ```ts type Arch: | "x86" | "x86_64" | "arm" | "aarch64" | "mips" | "mips64" | "powerpc" | "powerpc64" | "riscv64" | "s390x" | "sparc64"; ``` *** ### Family ```ts type Family: "unix" | "windows"; ``` *** ### OsType ```ts type OsType: | "linux" | "windows" | "macos" | "ios" | "android"; ``` *** ### Platform ```ts type Platform: | "linux" | "macos" | "ios" | "freebsd" | "dragonfly" | "netbsd" | "openbsd" | "solaris" | "android" | "windows"; ``` ## Functions ### arch() ```ts function arch(): Arch ``` Returns the current operating system architecture. Possible values are `'x86'`, `'x86_64'`, `'arm'`, `'aarch64'`, `'mips'`, `'mips64'`, `'powerpc'`, `'powerpc64'`, `'riscv64'`, `'s390x'`, `'sparc64'`. #### Returns [`Arch`](/taurify/api/namespaceos/#arch) #### Example ```typescript import { arch } from '@crabnebula/taurify-api/os'; const archName = arch(); ``` *** ### eol() ```ts function eol(): string ``` Returns the operating system-specific end-of-line marker. - `\n` on POSIX - `\r\n` on Windows #### Returns `string` *** ### exeExtension() ```ts function exeExtension(): string ``` Returns the file extension, if any, used for executable binaries on this platform. Possible values are `'exe'` and `''` (empty string). #### Returns `string` #### Example ```typescript import { exeExtension } from '@crabnebula/taurify-api/os'; const exeExt = exeExtension(); ``` *** ### family() ```ts function family(): Family ``` Returns the current operating system family. Possible values are `'unix'`, `'windows'`. #### Returns [`Family`](/taurify/api/namespaceos/#family) #### Example ```typescript import { family } from '@crabnebula/taurify-api/os'; const family = family(); ``` *** ### hostname() ```ts function hostname(): Promise ``` Returns the host name of the operating system. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string` \| `null`\> #### Example ```typescript import { hostname } from '@crabnebula/taurify-api/os'; const hostname = await hostname(); ``` *** ### locale() ```ts function locale(): Promise ``` Returns a String with a `BCP-47` language tag inside. If the locale couldn’t be obtained, `null` is returned instead. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string` \| `null`\> #### Example ```typescript import { locale } from '@crabnebula/taurify-api/os'; const locale = await locale(); if (locale) { // use the locale string here } ``` *** ### platform() ```ts function platform(): Platform ``` Returns a string describing the specific operating system in use. The value is set at compile time. Possible values are `'linux'`, `'macos'`, `'ios'`, `'freebsd'`, `'dragonfly'`, `'netbsd'`, `'openbsd'`, `'solaris'`, `'android'`, `'windows'` #### Returns [`Platform`](/taurify/api/namespaceos/#platform) #### Example ```typescript import { platform } from '@crabnebula/taurify-api/os'; const platformName = platform(); ``` *** ### type() ```ts function type(): OsType ``` Returns the current operating system type. Returns `'linux'` on Linux, `'macos'` on macOS, `'windows'` on Windows, `'ios'` on iOS and `'android'` on Android. #### Returns [`OsType`](/taurify/api/namespaceos/#ostype) #### Example ```typescript import { type } from '@crabnebula/taurify-api/os'; const osType = type(); ``` *** ### version() ```ts function version(): string ``` Returns the current operating system version. #### Returns `string` #### Example ```typescript import { version } from '@crabnebula/taurify-api/os'; const osVersion = version(); ``` # path The path module provides utilities for working with file and directory paths. It is recommended to allowlist only the APIs you use for optimal bundle size and security. ## Enumerations ### BaseDirectory #### Enumeration Members ##### AppCache ```ts AppCache: 16; ``` ###### See [appCacheDir](/taurify/api/namespacepath/#appcachedir) for more information. ##### AppConfig ```ts AppConfig: 13; ``` ###### See [appConfigDir](/taurify/api/namespacepath/#appconfigdir) for more information. ##### AppData ```ts AppData: 14; ``` ###### See [appDataDir](/taurify/api/namespacepath/#appdatadir) for more information. ##### AppLocalData ```ts AppLocalData: 15; ``` ###### See [appLocalDataDir](/taurify/api/namespacepath/#applocaldatadir) for more information. ##### AppLog ```ts AppLog: 17; ``` ###### See [appLogDir](/taurify/api/namespacepath/#applogdir) for more information. ##### Audio ```ts Audio: 1; ``` ###### See [audioDir](/taurify/api/namespacepath/#audiodir) for more information. ##### Cache ```ts Cache: 2; ``` ###### See [cacheDir](/taurify/api/namespacepath/#cachedir) for more information. ##### Config ```ts Config: 3; ``` ###### See [configDir](/taurify/api/namespacepath/#configdir) for more information. ##### Data ```ts Data: 4; ``` ###### See [dataDir](/taurify/api/namespacepath/#datadir) for more information. ##### Desktop ```ts Desktop: 18; ``` ###### See [desktopDir](/taurify/api/namespacepath/#desktopdir) for more information. ##### Document ```ts Document: 6; ``` ###### See [documentDir](/taurify/api/namespacepath/#documentdir) for more information. ##### Download ```ts Download: 7; ``` ###### See [downloadDir](/taurify/api/namespacepath/#downloaddir) for more information. ##### Executable ```ts Executable: 19; ``` ###### See [executableDir](/taurify/api/namespacepath/#executabledir) for more information. ##### Font ```ts Font: 20; ``` ###### See [fontDir](/taurify/api/namespacepath/#fontdir) for more information. ##### Home ```ts Home: 21; ``` ###### See [homeDir](/taurify/api/namespacepath/#homedir) for more information. ##### LocalData ```ts LocalData: 5; ``` ###### See [localDataDir](/taurify/api/namespacepath/#localdatadir) for more information. ##### Picture ```ts Picture: 8; ``` ###### See [pictureDir](/taurify/api/namespacepath/#picturedir) for more information. ##### Public ```ts Public: 9; ``` ###### See [publicDir](/taurify/api/namespacepath/#publicdir) for more information. ##### Resource ```ts Resource: 11; ``` ###### See [resourceDir](/taurify/api/namespacepath/#resourcedir) for more information. ##### Runtime ```ts Runtime: 22; ``` ###### See [runtimeDir](/taurify/api/namespacepath/#runtimedir) for more information. ##### Temp ```ts Temp: 12; ``` ###### See [tempDir](/taurify/api/namespacepath/#tempdir) for more information. ##### Template ```ts Template: 23; ``` ###### See [templateDir](/taurify/api/namespacepath/#templatedir) for more information. ##### Video ```ts Video: 10; ``` ###### See [videoDir](/taurify/api/namespacepath/#videodir) for more information. ## Functions ### appCacheDir() ```ts function appCacheDir(): Promise ``` Returns the path to the suggested directory for your app's cache files. Resolves to `${cacheDir}/${bundleIdentifier}`, where `bundleIdentifier` is the [`identifier`](https://v2.tauri.app/reference/config/#identifier) value configured in `tauri.conf.json`. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { appCacheDir } from '@crabnebula/taurify-api/path'; const appCacheDirPath = await appCacheDir(); ``` *** ### appConfigDir() ```ts function appConfigDir(): Promise ``` Returns the path to the suggested directory for your app's config files. Resolves to `${configDir}/${bundleIdentifier}`, where `bundleIdentifier` is the [`identifier`](https://v2.tauri.app/reference/config/#identifier) value configured in `tauri.conf.json`. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { appConfigDir } from '@crabnebula/taurify-api/path'; const appConfigDirPath = await appConfigDir(); ``` *** ### appDataDir() ```ts function appDataDir(): Promise ``` Returns the path to the suggested directory for your app's data files. Resolves to `${dataDir}/${bundleIdentifier}`, where `bundleIdentifier` is the [`identifier`](https://v2.tauri.app/reference/config/#identifier) value configured in `tauri.conf.json`. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { appDataDir } from '@crabnebula/taurify-api/path'; const appDataDirPath = await appDataDir(); ``` *** ### appLocalDataDir() ```ts function appLocalDataDir(): Promise ``` Returns the path to the suggested directory for your app's local data files. Resolves to `${localDataDir}/${bundleIdentifier}`, where `bundleIdentifier` is the [`identifier`](https://v2.tauri.app/reference/config/#identifier) value configured in `tauri.conf.json`. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { appLocalDataDir } from '@crabnebula/taurify-api/path'; const appLocalDataDirPath = await appLocalDataDir(); ``` *** ### appLogDir() ```ts function appLogDir(): Promise ``` Returns the path to the suggested directory for your app's log files. #### Platform-specific - **Linux:** Resolves to `${configDir}/${bundleIdentifier}/logs`. - **macOS:** Resolves to `${homeDir}/Library/Logs/{bundleIdentifier}` - **Windows:** Resolves to `${configDir}/${bundleIdentifier}/logs`. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { appLogDir } from '@crabnebula/taurify-api/path'; const appLogDirPath = await appLogDir(); ``` *** ### audioDir() ```ts function audioDir(): Promise ``` Returns the path to the user's audio directory. #### Platform-specific - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_MUSIC_DIR`. - **macOS:** Resolves to `$HOME/Music`. - **Windows:** Resolves to `{FOLDERID_Music}`. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { audioDir } from '@crabnebula/taurify-api/path'; const audioDirPath = await audioDir(); ``` *** ### basename() ```ts function basename(path, ext?): Promise ``` Returns the last portion of a `path`. Trailing directory separators are ignored. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `path` | `string` | - | | `ext`? | `string` | An optional file extension to be removed from the returned path. | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { basename } from '@crabnebula/taurify-api/path'; const base = await basename('path/to/app.conf'); assert(base === 'app.conf'); ``` *** ### cacheDir() ```ts function cacheDir(): Promise ``` Returns the path to the user's cache directory. #### Platform-specific - **Linux:** Resolves to `$XDG_CACHE_HOME` or `$HOME/.cache`. - **macOS:** Resolves to `$HOME/Library/Caches`. - **Windows:** Resolves to `{FOLDERID_LocalAppData}`. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { cacheDir } from '@crabnebula/taurify-api/path'; const cacheDirPath = await cacheDir(); ``` *** ### configDir() ```ts function configDir(): Promise ``` Returns the path to the user's config directory. #### Platform-specific - **Linux:** Resolves to `$XDG_CONFIG_HOME` or `$HOME/.config`. - **macOS:** Resolves to `$HOME/Library/Application Support`. - **Windows:** Resolves to `{FOLDERID_RoamingAppData}`. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { configDir } from '@crabnebula/taurify-api/path'; const configDirPath = await configDir(); ``` *** ### dataDir() ```ts function dataDir(): Promise ``` Returns the path to the user's data directory. #### Platform-specific - **Linux:** Resolves to `$XDG_DATA_HOME` or `$HOME/.local/share`. - **macOS:** Resolves to `$HOME/Library/Application Support`. - **Windows:** Resolves to `{FOLDERID_RoamingAppData}`. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { dataDir } from '@crabnebula/taurify-api/path'; const dataDirPath = await dataDir(); ``` *** ### delimiter() ```ts function delimiter(): string ``` Returns the platform-specific path segment delimiter: - `;` on Windows - `:` on POSIX #### Returns `string` *** ### desktopDir() ```ts function desktopDir(): Promise ``` Returns the path to the user's desktop directory. #### Platform-specific - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_DESKTOP_DIR`. - **macOS:** Resolves to `$HOME/Desktop`. - **Windows:** Resolves to `{FOLDERID_Desktop}`. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { desktopDir } from '@crabnebula/taurify-api/path'; const desktopPath = await desktopDir(); ``` *** ### dirname() ```ts function dirname(path): Promise ``` Returns the parent directory of a given `path`. Trailing directory separators are ignored. #### Parameters | Parameter | Type | | ------ | ------ | | `path` | `string` | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { dirname } from '@crabnebula/taurify-api/path'; const dir = await dirname('/path/to/somedir/'); assert(dir === '/path/to'); ``` *** ### documentDir() ```ts function documentDir(): Promise ``` Returns the path to the user's document directory. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { documentDir } from '@crabnebula/taurify-api/path'; const documentDirPath = await documentDir(); ``` #### Platform-specific - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_DOCUMENTS_DIR`. - **macOS:** Resolves to `$HOME/Documents`. - **Windows:** Resolves to `{FOLDERID_Documents}`. *** ### downloadDir() ```ts function downloadDir(): Promise ``` Returns the path to the user's download directory. #### Platform-specific - **Linux**: Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_DOWNLOAD_DIR`. - **macOS**: Resolves to `$HOME/Downloads`. - **Windows**: Resolves to `{FOLDERID_Downloads}`. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { downloadDir } from '@crabnebula/taurify-api/path'; const downloadDirPath = await downloadDir(); ``` *** ### executableDir() ```ts function executableDir(): Promise ``` Returns the path to the user's executable directory. #### Platform-specific - **Linux:** Resolves to `$XDG_BIN_HOME/../bin` or `$XDG_DATA_HOME/../bin` or `$HOME/.local/bin`. - **macOS:** Not supported. - **Windows:** Not supported. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { executableDir } from '@crabnebula/taurify-api/path'; const executableDirPath = await executableDir(); ``` *** ### extname() ```ts function extname(path): Promise ``` Returns the extension of the `path`. #### Parameters | Parameter | Type | | ------ | ------ | | `path` | `string` | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { extname } from '@crabnebula/taurify-api/path'; const ext = await extname('/path/to/file.html'); assert(ext === 'html'); ``` *** ### fontDir() ```ts function fontDir(): Promise ``` Returns the path to the user's font directory. #### Platform-specific - **Linux:** Resolves to `$XDG_DATA_HOME/fonts` or `$HOME/.local/share/fonts`. - **macOS:** Resolves to `$HOME/Library/Fonts`. - **Windows:** Not supported. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { fontDir } from '@crabnebula/taurify-api/path'; const fontDirPath = await fontDir(); ``` *** ### homeDir() ```ts function homeDir(): Promise ``` Returns the path to the user's home directory. #### Platform-specific - **Linux:** Resolves to `$HOME`. - **macOS:** Resolves to `$HOME`. - **Windows:** Resolves to `{FOLDERID_Profile}`. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { homeDir } from '@crabnebula/taurify-api/path'; const homeDirPath = await homeDir(); ``` *** ### isAbsolute() ```ts function isAbsolute(path): Promise ``` Returns whether the path is absolute or not. #### Parameters | Parameter | Type | | ------ | ------ | | `path` | `string` | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> #### Example ```typescript import { isAbsolute } from '@crabnebula/taurify-api/path'; assert(await isAbsolute('/home/tauri')); ``` *** ### join() ```ts function join(...paths): Promise ``` Joins all given `path` segments together using the platform-specific separator as a delimiter, then normalizes the resulting path. #### Parameters | Parameter | Type | | ------ | ------ | | ...`paths` | `string`[] | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { join, appDataDir } from '@crabnebula/taurify-api/path'; const appDataDirPath = await appDataDir(); const path = await join(appDataDirPath, 'users', 'tauri', 'avatar.png'); ``` *** ### localDataDir() ```ts function localDataDir(): Promise ``` Returns the path to the user's local data directory. #### Platform-specific - **Linux:** Resolves to `$XDG_DATA_HOME` or `$HOME/.local/share`. - **macOS:** Resolves to `$HOME/Library/Application Support`. - **Windows:** Resolves to `{FOLDERID_LocalAppData}`. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { localDataDir } from '@crabnebula/taurify-api/path'; const localDataDirPath = await localDataDir(); ``` *** ### normalize() ```ts function normalize(path): Promise ``` Normalizes the given `path`, resolving `'..'` and `'.'` segments and resolve symbolic links. #### Parameters | Parameter | Type | | ------ | ------ | | `path` | `string` | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { normalize, appDataDir } from '@crabnebula/taurify-api/path'; const appDataDirPath = await appDataDir(); const path = await normalize(`${appDataDirPath}/../users/tauri/avatar.png`); ``` *** ### pictureDir() ```ts function pictureDir(): Promise ``` Returns the path to the user's picture directory. #### Platform-specific - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_PICTURES_DIR`. - **macOS:** Resolves to `$HOME/Pictures`. - **Windows:** Resolves to `{FOLDERID_Pictures}`. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { pictureDir } from '@crabnebula/taurify-api/path'; const pictureDirPath = await pictureDir(); ``` *** ### publicDir() ```ts function publicDir(): Promise ``` Returns the path to the user's public directory. #### Platform-specific - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_PUBLICSHARE_DIR`. - **macOS:** Resolves to `$HOME/Public`. - **Windows:** Resolves to `{FOLDERID_Public}`. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { publicDir } from '@crabnebula/taurify-api/path'; const publicDirPath = await publicDir(); ``` *** ### resolve() ```ts function resolve(...paths): Promise ``` Resolves a sequence of `paths` or `path` segments into an absolute path. #### Parameters | Parameter | Type | | ------ | ------ | | ...`paths` | `string`[] | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { resolve, appDataDir } from '@crabnebula/taurify-api/path'; const appDataDirPath = await appDataDir(); const path = await resolve(appDataDirPath, '..', 'users', 'tauri', 'avatar.png'); ``` *** ### resolveResource() ```ts function resolveResource(resourcePath): Promise ``` Resolve the path to a resource file. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `resourcePath` | `string` | The path to the resource. Must follow the same syntax as defined in `tauri.conf.json > bundle > resources`, i.e. keeping subfolders and parent dir components (`../`). | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> The full path to the resource. #### Example ```typescript import { resolveResource } from '@crabnebula/taurify-api/path'; const resourcePath = await resolveResource('script.sh'); ``` *** ### resourceDir() ```ts function resourceDir(): Promise ``` Returns the path to the application's resource directory. To resolve a resource path, see [`resolveResource`](/taurify/api/namespacepath/#resolveresource). ## Platform-specific Although we provide the exact path where this function resolves to, this is not a contract and things might change in the future - **Windows:** Resolves to the directory that contains the main executable. - **Linux:** When running in an AppImage, the `APPDIR` variable will be set to the mounted location of the app, and the resource dir will be `${APPDIR}/usr/lib/${exe_name}`. If not running in an AppImage, the path is `/usr/lib/${exe_name}`. When running the app from `src-tauri/target/(debug|release)/`, the path is `${exe_dir}/../lib/${exe_name}`. - **macOS:** Resolves to `${exe_dir}/../Resources` (inside .app). - **iOS:** Resolves to `${exe_dir}/assets`. - **Android:** Currently the resources are stored in the APK as assets so it's not a normal file system path, we return a special URI prefix `asset://localhost/` here that can be used with the [file system plugin](https://tauri.app/plugin/file-system/), #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { resourceDir } from '@crabnebula/taurify-api/path'; const resourceDirPath = await resourceDir(); ``` *** ### runtimeDir() ```ts function runtimeDir(): Promise ``` Returns the path to the user's runtime directory. #### Platform-specific - **Linux:** Resolves to `$XDG_RUNTIME_DIR`. - **macOS:** Not supported. - **Windows:** Not supported. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { runtimeDir } from '@crabnebula/taurify-api/path'; const runtimeDirPath = await runtimeDir(); ``` *** ### sep() ```ts function sep(): string ``` Returns the platform-specific path segment separator: - `\` on Windows - `/` on POSIX #### Returns `string` *** ### tempDir() ```ts function tempDir(): Promise ``` Returns a temporary directory. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { tempDir } from '@crabnebula/taurify-api/path'; const temp = await tempDir(); ``` *** ### templateDir() ```ts function templateDir(): Promise ``` Returns the path to the user's template directory. #### Platform-specific - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_TEMPLATES_DIR`. - **macOS:** Not supported. - **Windows:** Resolves to `{FOLDERID_Templates}`. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { templateDir } from '@crabnebula/taurify-api/path'; const templateDirPath = await templateDir(); ``` *** ### videoDir() ```ts function videoDir(): Promise ``` Returns the path to the user's video directory. #### Platform-specific - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_VIDEOS_DIR`. - **macOS:** Resolves to `$HOME/Movies`. - **Windows:** Resolves to `{FOLDERID_Videos}`. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> #### Example ```typescript import { videoDir } from '@crabnebula/taurify-api/path'; const videoDirPath = await videoDir(); ``` # process Perform operations on the current process. ## Functions ### exit() ```ts function exit(code): Promise ``` Exits immediately with the given `exitCode`. #### Parameters | Parameter | Type | Default value | Description | | ------ | ------ | ------ | ------ | | `code` | `number` | `0` | The exit code to use. | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. #### Example ```typescript import { exit } from '@crabnebula/taurify-api/process'; await exit(1); ``` *** ### relaunch() ```ts function relaunch(): Promise ``` Exits the current instance of the app then relaunches it. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. #### Example ```typescript import { relaunch } from '@crabnebula/taurify-api/process'; await relaunch(); ``` # shell Access the system shell. Allows you to spawn child processes and manage files and URLs using their default application. ## 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`](/taurify/api/namespaceshell/#open) API On the configuration object, `open: true` means that the [open](/taurify/api/namespaceshell/#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`](/taurify/api/namespaceshell/#commando) APIs The plugin permissions 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.create function](/taurify/api/namespaceshell/#create). If it's a sidecar, this must be the value defined on `tauri.conf.json > 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"` Capability: ```json { "permissions": [ { "identifier": "shell:allow-execute", "allow": [ { "name": "run-git-commit", "cmd": "git", "args": ["commit", "-m", { "validator": "\\S+" }] } ] } ] } ``` Usage: ```typescript import { Command } from '@crabnebula/taurify-api/shell' Command.create('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 #### Constructors ##### new Child() ```ts new Child(pid): Child ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `pid` | `number` | ###### Returns [`Child`](/taurify/api/namespaceshell/#child) #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `pid` | `number` | The child process `pid`. | | #### Methods ##### kill() ```ts kill(): Promise ``` Kills the child process. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ##### write() ```ts write(data): Promise ``` Writes `data` to the `stdin`. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `data` | `number`[] \| [`IOPayload`](/taurify/api/namespaceshell/#iopayload) | The message to write, either a string or a byte array. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { Command } from '@crabnebula/taurify-api/shell'; const command = Command.create('node'); const child = await command.spawn(); await child.write('message'); await child.write([0, 1, 2, 3, 4, 5]); ``` *** ### Command\ The entry point for spawning child processes. It emits the `close` and `error` events. #### Example ```typescript import { Command } from '@crabnebula/taurify-api/shell'; const command = Command.create('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); ``` #### Extends - [`EventEmitter`](/taurify/api/namespaceshell/#eventemittere)\<[`CommandEvents`](/taurify/api/namespaceshell/#commandevents)\> #### Type Parameters | Type Parameter | | ------ | | `O` *extends* [`IOPayload`](/taurify/api/namespaceshell/#iopayload) | #### Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `stderr` | `readonly` | [`EventEmitter`](/taurify/api/namespaceshell/#eventemittere)\<[`OutputEvents`](/taurify/api/namespaceshell/#outputeventso)\<`O`\>\> | Event emitter for the `stderr`. Emits the `data` event. | | | `stdout` | `readonly` | [`EventEmitter`](/taurify/api/namespaceshell/#eventemittere)\<[`OutputEvents`](/taurify/api/namespaceshell/#outputeventso)\<`O`\>\> | Event emitter for the `stdout`. Emits the `data` event. | | #### Methods ##### addListener() ```ts addListener(eventName, listener): this ``` Alias for `emitter.on(eventName, listener)`. ###### Type Parameters | Type Parameter | | ------ | | `N` *extends* keyof [`CommandEvents`](/taurify/api/namespaceshell/#commandevents) | ###### Parameters | Parameter | Type | | ------ | ------ | | `eventName` | `N` | | `listener` | (`arg`) => `void` | ###### Returns `this` ###### Inherited from [`EventEmitter`](/taurify/api/namespaceshell/#eventemittere).[`addListener`](/taurify/api/namespaceshell/#addlistener-1) ##### execute() ```ts execute(): Promise> ``` Executes the command as a child process, waiting for it to finish and collecting all of its output. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`ChildProcess`](/taurify/api/namespaceshell/#childprocesso)\<`O`\>\> A promise resolving to the child process output. ###### Example ```typescript import { Command } from '@crabnebula/taurify-api/shell'; const output = await Command.create('echo', 'message').execute(); assert(output.code === 0); assert(output.signal === null); assert(output.stdout === 'message'); assert(output.stderr === ''); ``` ##### listenerCount() ```ts listenerCount(eventName): number ``` Returns the number of listeners listening to the event named `eventName`. ###### Type Parameters | Type Parameter | | ------ | | `N` *extends* keyof [`CommandEvents`](/taurify/api/namespaceshell/#commandevents) | ###### Parameters | Parameter | Type | | ------ | ------ | | `eventName` | `N` | ###### Returns `number` ###### Inherited from [`EventEmitter`](/taurify/api/namespaceshell/#eventemittere).[`listenerCount`](/taurify/api/namespaceshell/#listenercount-1) ##### off() ```ts off(eventName, listener): this ``` 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. ###### Type Parameters | Type Parameter | | ------ | | `N` *extends* keyof [`CommandEvents`](/taurify/api/namespaceshell/#commandevents) | ###### Parameters | Parameter | Type | | ------ | ------ | | `eventName` | `N` | | `listener` | (`arg`) => `void` | ###### Returns `this` ###### Inherited from [`EventEmitter`](/taurify/api/namespaceshell/#eventemittere).[`off`](/taurify/api/namespaceshell/#off-1) ##### on() ```ts on(eventName, listener): this ``` 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. ###### Type Parameters | Type Parameter | | ------ | | `N` *extends* keyof [`CommandEvents`](/taurify/api/namespaceshell/#commandevents) | ###### Parameters | Parameter | Type | | ------ | ------ | | `eventName` | `N` | | `listener` | (`arg`) => `void` | ###### Returns `this` ###### Inherited from [`EventEmitter`](/taurify/api/namespaceshell/#eventemittere).[`on`](/taurify/api/namespaceshell/#on-1) ##### once() ```ts once(eventName, listener): this ``` 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. ###### Type Parameters | Type Parameter | | ------ | | `N` *extends* keyof [`CommandEvents`](/taurify/api/namespaceshell/#commandevents) | ###### Parameters | Parameter | Type | | ------ | ------ | | `eventName` | `N` | | `listener` | (`arg`) => `void` | ###### Returns `this` ###### Inherited from [`EventEmitter`](/taurify/api/namespaceshell/#eventemittere).[`once`](/taurify/api/namespaceshell/#once-1) ##### prependListener() ```ts prependListener(eventName, listener): this ``` 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. ###### Type Parameters | Type Parameter | | ------ | | `N` *extends* keyof [`CommandEvents`](/taurify/api/namespaceshell/#commandevents) | ###### Parameters | Parameter | Type | | ------ | ------ | | `eventName` | `N` | | `listener` | (`arg`) => `void` | ###### Returns `this` ###### Inherited from [`EventEmitter`](/taurify/api/namespaceshell/#eventemittere).[`prependListener`](/taurify/api/namespaceshell/#prependlistener-1) ##### prependOnceListener() ```ts prependOnceListener(eventName, listener): this ``` 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. ###### Type Parameters | Type Parameter | | ------ | | `N` *extends* keyof [`CommandEvents`](/taurify/api/namespaceshell/#commandevents) | ###### Parameters | Parameter | Type | | ------ | ------ | | `eventName` | `N` | | `listener` | (`arg`) => `void` | ###### Returns `this` ###### Inherited from [`EventEmitter`](/taurify/api/namespaceshell/#eventemittere).[`prependOnceListener`](/taurify/api/namespaceshell/#prependoncelistener-1) ##### removeAllListeners() ```ts removeAllListeners(event?): this ``` Removes all listeners, or those of the specified eventName. Returns a reference to the `EventEmitter`, so that calls can be chained. ###### Type Parameters | Type Parameter | | ------ | | `N` *extends* keyof [`CommandEvents`](/taurify/api/namespaceshell/#commandevents) | ###### Parameters | Parameter | Type | | ------ | ------ | | `event`? | `N` | ###### Returns `this` ###### Inherited from [`EventEmitter`](/taurify/api/namespaceshell/#eventemittere).[`removeAllListeners`](/taurify/api/namespaceshell/#removealllisteners-1) ##### removeListener() ```ts removeListener(eventName, listener): this ``` Alias for `emitter.off(eventName, listener)`. ###### Type Parameters | Type Parameter | | ------ | | `N` *extends* keyof [`CommandEvents`](/taurify/api/namespaceshell/#commandevents) | ###### Parameters | Parameter | Type | | ------ | ------ | | `eventName` | `N` | | `listener` | (`arg`) => `void` | ###### Returns `this` ###### Inherited from [`EventEmitter`](/taurify/api/namespaceshell/#eventemittere).[`removeListener`](/taurify/api/namespaceshell/#removelistener-1) ##### spawn() ```ts spawn(): Promise ``` Executes the command as a child process, returning a handle to it. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Child`](/taurify/api/namespaceshell/#child)\> A promise resolving to the child process handle. ##### create() Creates a command to execute the given program. ###### Example ```typescript import { Command } from '@crabnebula/taurify-api/shell'; const command = Command.create('my-app', ['run', 'tauri']); const output = await command.execute(); ``` ###### Param The program to execute. It must be configured on `tauri.conf.json > plugins > shell > scope`. ###### create(program, args) ```ts static create(program, args?): Command ``` Creates a command to execute the given program. ###### Parameters | Parameter | Type | | ------ | ------ | | `program` | `string` | | `args`? | `string` \| `string`[] | ###### Returns [`Command`](/taurify/api/namespaceshell/#commando)\<`string`\> ###### Example ```typescript import { Command } from '@crabnebula/taurify-api/shell'; const command = Command.create('my-app', ['run', 'tauri']); const output = await command.execute(); ``` ###### Param The program to execute. It must be configured on `tauri.conf.json > plugins > shell > scope`. ###### create(program, args, options) ```ts static create( program, args?, options?): Command> ``` Creates a command to execute the given program. ###### Parameters | Parameter | Type | | ------ | ------ | | `program` | `string` | | `args`? | `string` \| `string`[] | | `options`? | [`SpawnOptions`](/taurify/api/namespaceshell/#spawnoptions) & `object` | ###### Returns [`Command`](/taurify/api/namespaceshell/#commando)\<[`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\>\> ###### Example ```typescript import { Command } from '@crabnebula/taurify-api/shell'; const command = Command.create('my-app', ['run', 'tauri']); const output = await command.execute(); ``` ###### Param The program to execute. It must be configured on `tauri.conf.json > plugins > shell > scope`. ###### create(program, args, options) ```ts static create( program, args?, options?): Command ``` Creates a command to execute the given program. ###### Parameters | Parameter | Type | | ------ | ------ | | `program` | `string` | | `args`? | `string` \| `string`[] | | `options`? | [`SpawnOptions`](/taurify/api/namespaceshell/#spawnoptions) | ###### Returns [`Command`](/taurify/api/namespaceshell/#commando)\<`string`\> ###### Example ```typescript import { Command } from '@crabnebula/taurify-api/shell'; const command = Command.create('my-app', ['run', 'tauri']); const output = await command.execute(); ``` ###### Param The program to execute. It must be configured on `tauri.conf.json > plugins > shell > scope`. ##### sidecar() Creates a command to execute the given sidecar program. ###### Example ```typescript import { Command } from '@crabnebula/taurify-api/shell'; const command = Command.sidecar('my-sidecar'); const output = await command.execute(); ``` ###### Param The program to execute. It must be configured on `tauri.conf.json > plugins > shell > scope`. ###### sidecar(program, args) ```ts static sidecar(program, args?): Command ``` Creates a command to execute the given sidecar program. ###### Parameters | Parameter | Type | | ------ | ------ | | `program` | `string` | | `args`? | `string` \| `string`[] | ###### Returns [`Command`](/taurify/api/namespaceshell/#commando)\<`string`\> ###### Example ```typescript import { Command } from '@crabnebula/taurify-api/shell'; const command = Command.sidecar('my-sidecar'); const output = await command.execute(); ``` ###### Param The program to execute. It must be configured on `tauri.conf.json > plugins > shell > scope`. ###### sidecar(program, args, options) ```ts static sidecar( program, args?, options?): Command> ``` Creates a command to execute the given sidecar program. ###### Parameters | Parameter | Type | | ------ | ------ | | `program` | `string` | | `args`? | `string` \| `string`[] | | `options`? | [`SpawnOptions`](/taurify/api/namespaceshell/#spawnoptions) & `object` | ###### Returns [`Command`](/taurify/api/namespaceshell/#commando)\<[`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\>\> ###### Example ```typescript import { Command } from '@crabnebula/taurify-api/shell'; const command = Command.sidecar('my-sidecar'); const output = await command.execute(); ``` ###### Param The program to execute. It must be configured on `tauri.conf.json > plugins > shell > scope`. ###### sidecar(program, args, options) ```ts static sidecar( program, args?, options?): Command ``` Creates a command to execute the given sidecar program. ###### Parameters | Parameter | Type | | ------ | ------ | | `program` | `string` | | `args`? | `string` \| `string`[] | | `options`? | [`SpawnOptions`](/taurify/api/namespaceshell/#spawnoptions) | ###### Returns [`Command`](/taurify/api/namespaceshell/#commando)\<`string`\> ###### Example ```typescript import { Command } from '@crabnebula/taurify-api/shell'; const command = Command.sidecar('my-sidecar'); const output = await command.execute(); ``` ###### Param The program to execute. It must be configured on `tauri.conf.json > plugins > shell > scope`. *** ### EventEmitter\ #### Extended by - [`Command`](/taurify/api/namespaceshell/#commando) #### Type Parameters | Type Parameter | | ------ | | `E` *extends* [`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)\<`string`, `any`\> | #### Constructors ##### new EventEmitter() ```ts new EventEmitter(): EventEmitter ``` ###### Returns [`EventEmitter`](/taurify/api/namespaceshell/#eventemittere)\<`E`\> #### Methods ##### addListener() ```ts addListener(eventName, listener): this ``` Alias for `emitter.on(eventName, listener)`. ###### Type Parameters | Type Parameter | | ------ | | `N` *extends* `string` \| `number` \| `symbol` | ###### Parameters | Parameter | Type | | ------ | ------ | | `eventName` | `N` | | `listener` | (`arg`) => `void` | ###### Returns `this` ##### listenerCount() ```ts listenerCount(eventName): number ``` Returns the number of listeners listening to the event named `eventName`. ###### Type Parameters | Type Parameter | | ------ | | `N` *extends* `string` \| `number` \| `symbol` | ###### Parameters | Parameter | Type | | ------ | ------ | | `eventName` | `N` | ###### Returns `number` ##### off() ```ts off(eventName, listener): this ``` 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. ###### Type Parameters | Type Parameter | | ------ | | `N` *extends* `string` \| `number` \| `symbol` | ###### Parameters | Parameter | Type | | ------ | ------ | | `eventName` | `N` | | `listener` | (`arg`) => `void` | ###### Returns `this` ##### on() ```ts on(eventName, listener): this ``` 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. ###### Type Parameters | Type Parameter | | ------ | | `N` *extends* `string` \| `number` \| `symbol` | ###### Parameters | Parameter | Type | | ------ | ------ | | `eventName` | `N` | | `listener` | (`arg`) => `void` | ###### Returns `this` ##### once() ```ts once(eventName, listener): this ``` 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. ###### Type Parameters | Type Parameter | | ------ | | `N` *extends* `string` \| `number` \| `symbol` | ###### Parameters | Parameter | Type | | ------ | ------ | | `eventName` | `N` | | `listener` | (`arg`) => `void` | ###### Returns `this` ##### prependListener() ```ts prependListener(eventName, listener): this ``` 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. ###### Type Parameters | Type Parameter | | ------ | | `N` *extends* `string` \| `number` \| `symbol` | ###### Parameters | Parameter | Type | | ------ | ------ | | `eventName` | `N` | | `listener` | (`arg`) => `void` | ###### Returns `this` ##### prependOnceListener() ```ts prependOnceListener(eventName, listener): this ``` 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. ###### Type Parameters | Type Parameter | | ------ | | `N` *extends* `string` \| `number` \| `symbol` | ###### Parameters | Parameter | Type | | ------ | ------ | | `eventName` | `N` | | `listener` | (`arg`) => `void` | ###### Returns `this` ##### removeAllListeners() ```ts removeAllListeners(event?): this ``` Removes all listeners, or those of the specified eventName. Returns a reference to the `EventEmitter`, so that calls can be chained. ###### Type Parameters | Type Parameter | | ------ | | `N` *extends* `string` \| `number` \| `symbol` | ###### Parameters | Parameter | Type | | ------ | ------ | | `event`? | `N` | ###### Returns `this` ##### removeListener() ```ts removeListener(eventName, listener): this ``` Alias for `emitter.off(eventName, listener)`. ###### Type Parameters | Type Parameter | | ------ | | `N` *extends* `string` \| `number` \| `symbol` | ###### Parameters | Parameter | Type | | ------ | ------ | | `eventName` | `N` | | `listener` | (`arg`) => `void` | ###### Returns `this` ## Interfaces ### ChildProcess\ #### Type Parameters | Type Parameter | | ------ | | `O` *extends* [`IOPayload`](/taurify/api/namespaceshell/#iopayload) | #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `code` | `null` \| `number` | Exit code of the process. `null` if the process was terminated by a signal on Unix. | | | `signal` | `null` \| `number` | If the process was terminated by a signal, represents that signal. | | | `stderr` | `O` | The data that the process wrote to `stderr`. | | | `stdout` | `O` | The data that the process wrote to `stdout`. | | *** ### CommandEvents #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `close` | [`TerminatedPayload`](/taurify/api/namespaceshell/#terminatedpayload) | | | `error` | `string` | | *** ### OutputEvents\ #### Type Parameters | Type Parameter | | ------ | | `O` *extends* [`IOPayload`](/taurify/api/namespaceshell/#iopayload) | #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `data` | `O` | | *** ### SpawnOptions #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `cwd?` | `string` | Current working directory. | | | `encoding?` | `string` | Character encoding for stdout/stderr | | | `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. | | *** ### TerminatedPayload Payload for the `Terminated` command event. #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `code` | `null` \| `number` | Exit code of the process. `null` if the process was terminated by a signal on Unix. | | | `signal` | `null` \| `number` | If the process was terminated by a signal, represents that signal. | | ## Type Aliases ### IOPayload ```ts type IOPayload: string | Uint8Array; ``` Event payload type ## Functions ### open() ```ts function open(path, openWith?): Promise ``` 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`. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `path` | `string` | The path or URL to open. This value is matched against the string regex defined on `tauri.conf.json > plugins > 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/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> #### Example ```typescript import { open } from '@crabnebula/taurify-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'); ``` # store ## Classes ### LazyStore A lazy loaded key-value store persisted by the backend layer. #### Implements - `IStore` #### Constructors ##### new LazyStore() ```ts new LazyStore(path, options?): LazyStore ``` Note that the options are not applied if someone else already created the store ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `path` | `string` | Path to save the store in `app_data_dir` | | `options`? | [`StoreOptions`](/taurify/api/namespacestore/#storeoptions) | Store configuration options | ###### Returns [`LazyStore`](/taurify/api/namespacestore/#lazystore) #### Methods ##### clear() ```ts clear(): Promise ``` Clears the store, removing all key-value pairs. Note: To clear the storage and reset it to its `default` value, use [`reset`](/taurify/api/namespacestore/#reset) instead. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Implementation of `IStore.clear` ##### close() ```ts close(): Promise ``` Close the store and cleans up this resource from memory. **You should not call any method on this object anymore and should drop any reference to it.** ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Implementation of `IStore.close` ##### delete() ```ts delete(key): Promise ``` Removes a key-value pair from the store. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `key` | `string` | | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> ###### Implementation of `IStore.delete` ##### entries() ```ts entries(): Promise<[string, T][]> ``` Returns a list of all entries in the store. ###### Type Parameters | Type Parameter | | ------ | | `T` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`string`, `T`][]\> ###### Implementation of `IStore.entries` ##### get() ```ts get(key): Promise ``` Returns the value for the given `key` or `undefined` if the key does not exist. ###### Type Parameters | Type Parameter | | ------ | | `T` | ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `key` | `string` | | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`undefined` \| `T`\> ###### Implementation of `IStore.get` ##### has() ```ts has(key): Promise ``` Returns `true` if the given `key` exists in the store. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `key` | `string` | | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> ###### Implementation of `IStore.has` ##### init() ```ts init(): Promise ``` Init/load the store if it's not loaded already ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### keys() ```ts keys(): Promise ``` Returns a list of all keys in the store. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`[]\> ###### Implementation of `IStore.keys` ##### length() ```ts length(): Promise ``` Returns the number of key-value pairs in the store. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`number`\> ###### Implementation of `IStore.length` ##### onChange() ```ts onChange(cb): Promise ``` Listen to changes on the store. ###### Type Parameters | Type Parameter | | ------ | | `T` | ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `cb` | (`key`, `value`) => `void` | | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#unlistenfn)\> A promise resolving to a function to unlisten to the event. ###### Implementation of `IStore.onChange` ##### onKeyChange() ```ts onKeyChange(key, cb): Promise ``` Listen to changes on a store key. ###### Type Parameters | Type Parameter | | ------ | | `T` | ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `key` | `string` | | | `cb` | (`value`) => `void` | | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#unlistenfn)\> A promise resolving to a function to unlisten to the event. ###### Implementation of `IStore.onKeyChange` ##### reload() ```ts reload(): Promise ``` Attempts to load the on-disk state at the store's `path` into memory. This method is useful if the on-disk state was edited by the user and you want to synchronize the changes. Note: This method does not emit change events. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Implementation of `IStore.reload` ##### reset() ```ts reset(): Promise ``` Resets the store to its `default` value. If no default value has been set, this method behaves identical to [`clear`](/taurify/api/namespacestore/#clear). ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Implementation of `IStore.reset` ##### save() ```ts save(): Promise ``` Saves the store to disk at the store's `path`. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Implementation of `IStore.save` ##### set() ```ts set(key, value): Promise ``` Inserts a key-value pair into the store. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `key` | `string` | | | `value` | `unknown` | | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Implementation of `IStore.set` ##### values() ```ts values(): Promise ``` Returns a list of all values in the store. ###### Type Parameters | Type Parameter | | ------ | | `T` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`T`[]\> ###### Implementation of `IStore.values` *** ### Store A key-value store persisted by the backend layer. #### Extends - [`Resource`](/taurify/api/namespacecore/#resource) #### Implements - `IStore` #### Accessors ##### rid ###### Get Signature ```ts get rid(): number ``` ###### Returns `number` ###### Inherited from [`Resource`](/taurify/api/namespacecore/#resource).[`rid`](/taurify/api/namespacecore/#rid) #### Methods ##### clear() ```ts clear(): Promise ``` Clears the store, removing all key-value pairs. Note: To clear the storage and reset it to its `default` value, use [`reset`](/taurify/api/namespacestore/#reset-1) instead. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Implementation of `IStore.clear` ##### close() ```ts close(): Promise ``` Destroys and cleans up this resource from memory. **You should not call any method on this object anymore and should drop any reference to it.** ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Implementation of `IStore.close` ###### Inherited from [`Resource`](/taurify/api/namespacecore/#resource).[`close`](/taurify/api/namespacecore/#close) ##### delete() ```ts delete(key): Promise ``` Removes a key-value pair from the store. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `key` | `string` | | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> ###### Implementation of `IStore.delete` ##### entries() ```ts entries(): Promise<[string, T][]> ``` Returns a list of all entries in the store. ###### Type Parameters | Type Parameter | | ------ | | `T` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`string`, `T`][]\> ###### Implementation of `IStore.entries` ##### get() ```ts get(key): Promise ``` Returns the value for the given `key` or `undefined` if the key does not exist. ###### Type Parameters | Type Parameter | | ------ | | `T` | ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `key` | `string` | | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`undefined` \| `T`\> ###### Implementation of `IStore.get` ##### has() ```ts has(key): Promise ``` Returns `true` if the given `key` exists in the store. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `key` | `string` | | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> ###### Implementation of `IStore.has` ##### keys() ```ts keys(): Promise ``` Returns a list of all keys in the store. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`[]\> ###### Implementation of `IStore.keys` ##### length() ```ts length(): Promise ``` Returns the number of key-value pairs in the store. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`number`\> ###### Implementation of `IStore.length` ##### onChange() ```ts onChange(cb): Promise ``` Listen to changes on the store. ###### Type Parameters | Type Parameter | | ------ | | `T` | ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `cb` | (`key`, `value`) => `void` | | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#unlistenfn)\> A promise resolving to a function to unlisten to the event. ###### Implementation of `IStore.onChange` ##### onKeyChange() ```ts onKeyChange(key, cb): Promise ``` Listen to changes on a store key. ###### Type Parameters | Type Parameter | | ------ | | `T` | ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `key` | `string` | | | `cb` | (`value`) => `void` | | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#unlistenfn)\> A promise resolving to a function to unlisten to the event. ###### Implementation of `IStore.onKeyChange` ##### reload() ```ts reload(): Promise ``` Attempts to load the on-disk state at the store's `path` into memory. This method is useful if the on-disk state was edited by the user and you want to synchronize the changes. Note: This method does not emit change events. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Implementation of `IStore.reload` ##### reset() ```ts reset(): Promise ``` Resets the store to its `default` value. If no default value has been set, this method behaves identical to [`clear`](/taurify/api/namespacestore/#clear-1). ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Implementation of `IStore.reset` ##### save() ```ts save(): Promise ``` Saves the store to disk at the store's `path`. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Implementation of `IStore.save` ##### set() ```ts set(key, value): Promise ``` Inserts a key-value pair into the store. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `key` | `string` | | | `value` | `unknown` | | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Implementation of `IStore.set` ##### values() ```ts values(): Promise ``` Returns a list of all values in the store. ###### Type Parameters | Type Parameter | | ------ | | `T` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`T`[]\> ###### Implementation of `IStore.values` ##### get() ```ts static get(path): Promise ``` Gets an already loaded store. If the store is not loaded, returns `null`. In this case you must [load](/taurify/api/namespacestore/#load) it. This function is more useful when you already know the store is loaded and just need to access its instance. Prefer [Store.load](/taurify/api/namespacestore/#load) otherwise. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `path` | `string` | Path of the store. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`null` \| [`Store`](/taurify/api/namespacestore/#store)\> ###### Example ```typescript import { Store } from '../../store'; let store = await Store.get('store.json'); if (!store) { store = await Store.load('store.json'); } ``` ##### load() ```ts static load(path, options?): Promise ``` Create a new Store or load the existing store with the path. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `path` | `string` | Path to save the store in `app_data_dir` | | `options`? | [`StoreOptions`](/taurify/api/namespacestore/#storeoptions) | Store configuration options | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Store`](/taurify/api/namespacestore/#store)\> ###### Example ```typescript import { Store } from '../../store'; const store = await Store.load('store.json'); ``` ## Type Aliases ### StoreOptions ```ts type StoreOptions: object; ``` Options to create a store #### Type declaration | Name | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `autoSave`? | `boolean` \| `number` | Auto save on modification with debounce duration in milliseconds, it's 100ms by default, pass in `false` to disable it | | | `createNew`? | `boolean` | Force create a new store with default values even if it already exists. | | | `deserializeFnName`? | `string` | Name of a deserialize function registered in the rust side plugin builder | | | `serializeFnName`? | `string` | Name of a serialize function registered in the rust side plugin builder | | ## Functions ### getStore() ```ts function getStore(path): Promise ``` Gets an already loaded store. If the store is not loaded, returns `null`. In this case you must [load](/taurify/api/namespacestore/#load) it. This function is more useful when you already know the store is loaded and just need to access its instance. Prefer [Store.load](/taurify/api/namespacestore/#load) otherwise. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `path` | `string` | Path of the store. | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Store`](/taurify/api/namespacestore/#store) \| `null`\> #### Example ```typescript import { getStore } from '../../store'; const store = await getStore('store.json'); ``` *** ### load() ```ts function load(path, options?): Promise ``` Create a new Store or load the existing store with the path. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `path` | `string` | Path to save the store in `app_data_dir` | | `options`? | [`StoreOptions`](/taurify/api/namespacestore/#storeoptions) | Store configuration options | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Store`](/taurify/api/namespacestore/#store)\> #### Example ```typescript import { Store } from '../../store'; const store = await Store.load('store.json'); ``` # tray ## Classes ### TrayIcon Tray icon class and associated methods. This type constructor is private, instead, you should use the static method [`TrayIcon.new`](/taurify/api/namespacetray/#new). #### Warning Unlike Rust, javascript does not have any way to run cleanup code when an object is being removed by garbage collection, but this tray icon will be cleaned up when the tauri app exists, however if you want to cleanup this object early, you need to call [`TrayIcon.close`](/taurify/api/namespacecore/#close). #### Example ```ts import { TrayIcon } from '@crabnebula/taurify-api/tray'; const tray = await TrayIcon.new({ tooltip: 'awesome tray tooltip' }); tray.set_tooltip('new tooltip'); ``` #### Extends - [`Resource`](/taurify/api/namespacecore/#resource) #### Properties | Property | Modifier | Type | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `id` | `public` | `string` | The id associated with this tray icon. | | #### Accessors ##### rid ###### Get Signature ```ts get rid(): number ``` ###### Returns `number` ###### Inherited from [`Resource`](/taurify/api/namespacecore/#resource).[`rid`](/taurify/api/namespacecore/#rid) #### Methods ##### close() ```ts close(): Promise ``` Destroys and cleans up this resource from memory. **You should not call any method on this object anymore and should drop any reference to it.** ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Inherited from [`Resource`](/taurify/api/namespacecore/#resource).[`close`](/taurify/api/namespacecore/#close) ##### setIcon() ```ts setIcon(icon): Promise ``` Sets a new tray icon. If `null` is provided, it will remove the icon. ###### Parameters | Parameter | Type | | ------ | ------ | | `icon` | \| `null` \| `string` \| `number`[] \| [`ArrayBuffer`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) \| [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\> \| [`Image`](/taurify/api/namespaceimage/#image) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### setIconAsTemplate() ```ts setIconAsTemplate(asTemplate): Promise ``` Sets the current icon as a [template](https://developer.apple.com/documentation/appkit/nsimage/1520017-template?language=objc). **macOS only** ###### Parameters | Parameter | Type | | ------ | ------ | | `asTemplate` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### setMenu() ```ts setMenu(menu): Promise ``` Sets a new tray menu. #### Platform-specific: - **Linux**: once a menu is set it cannot be removed so `null` has no effect ###### Parameters | Parameter | Type | | ------ | ------ | | `menu` | `null` \| [`Submenu`](/taurify/api/namespacemenu/#submenu) \| [`Menu`](/taurify/api/namespacemenu/#menu) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### ~~setMenuOnLeftClick()~~ ```ts setMenuOnLeftClick(onLeft): Promise ``` Disable or enable showing the tray menu on left click. #### Platform-specific: - **Linux**: Unsupported. ###### Parameters | Parameter | Type | | ------ | ------ | | `onLeft` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Deprecated use [`TrayIcon.setShowMenuOnLeftClick`](/taurify/api/namespacetray/#setshowmenuonleftclick) instead. ##### setShowMenuOnLeftClick() ```ts setShowMenuOnLeftClick(onLeft): Promise ``` Disable or enable showing the tray menu on left click. #### Platform-specific: - **Linux**: Unsupported. ###### Parameters | Parameter | Type | | ------ | ------ | | `onLeft` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### setTempDirPath() ```ts setTempDirPath(path): Promise ``` Sets the tray icon temp dir path. **Linux only**. On Linux, we need to write the icon to the disk and usually it will be `$XDG_RUNTIME_DIR/tray-icon` or `$TEMP/tray-icon`. ###### Parameters | Parameter | Type | | ------ | ------ | | `path` | `null` \| `string` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### setTitle() ```ts setTitle(title): Promise ``` Sets the tooltip for this tray icon. #### Platform-specific: - **Linux:** The title will not be shown unless there is an icon as well. The title is useful for numerical and other frequently updated information. In general, it shouldn't be shown unless a user requests it as it can take up a significant amount of space on the user's panel. This may not be shown in all visualizations. - **Windows:** Unsupported ###### Parameters | Parameter | Type | | ------ | ------ | | `title` | `null` \| `string` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### setTooltip() ```ts setTooltip(tooltip): Promise ``` Sets the tooltip for this tray icon. #### Platform-specific: - **Linux:** Unsupported ###### Parameters | Parameter | Type | | ------ | ------ | | `tooltip` | `null` \| `string` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### setVisible() ```ts setVisible(visible): Promise ``` Show or hide this tray icon. ###### Parameters | Parameter | Type | | ------ | ------ | | `visible` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### getById() ```ts static getById(id): Promise ``` Gets a tray icon using the provided id. ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`null` \| [`TrayIcon`](/taurify/api/namespacetray/#trayicon)\> ##### new() ```ts static new(options?): Promise ``` Creates a new [`TrayIcon`](/taurify/api/namespacetray/#trayicon) #### Platform-specific: - **Linux:** Sometimes the icon won't be visible unless a menu is set. Setting an empty [`Menu`](/taurify/api/namespacemenu/#menu) is enough. ###### Parameters | Parameter | Type | | ------ | ------ | | `options`? | [`TrayIconOptions`](/taurify/api/namespacetray/#trayiconoptions) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`TrayIcon`](/taurify/api/namespacetray/#trayicon)\> ##### removeById() ```ts static removeById(id): Promise ``` Removes a tray icon using the provided id from tauri's internal state. Note that this may cause the tray icon to disappear if it wasn't cloned somewhere else or referenced by JS. ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ## Interfaces ### TrayIconOptions [`TrayIcon`](/taurify/api/namespacetray/#new) creation options #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `action?` | (`event`: [`TrayIconEvent`](/taurify/api/namespacetray/#trayiconevent)) => `void` | A handler for an event on the tray icon. | | | `icon?` | \| `string` \| `number`[] \| [`ArrayBuffer`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) \| [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\> \| [`Image`](/taurify/api/namespaceimage/#image) | The tray icon which could be icon bytes or path to the icon file. | | | `iconAsTemplate?` | `boolean` | Use the icon as a [template](https://developer.apple.com/documentation/appkit/nsimage/1520017-template?language=objc). **macOS only**. | | | `id?` | `string` | The tray icon id. If undefined, a random one will be assigned | | | `menu?` | [`Submenu`](/taurify/api/namespacemenu/#submenu) \| [`Menu`](/taurify/api/namespacemenu/#menu) | The tray icon menu | | | ~~`menuOnLeftClick?`~~ | `boolean` | Whether to show the tray menu on left click or not, default is `true`. #### Platform-specific: - **Linux**: Unsupported. **Deprecated** use [`TrayIconOptions.showMenuOnLeftClick`](/taurify/api/namespacetray/#showmenuonleftclick) instead. | | | `showMenuOnLeftClick?` | `boolean` | Whether to show the tray menu on left click or not, default is `true`. #### Platform-specific: - **Linux**: Unsupported. | | | `tempDirPath?` | `string` | The tray icon temp dir path. **Linux only**. On Linux, we need to write the icon to the disk and usually it will be `$XDG_RUNTIME_DIR/tray-icon` or `$TEMP/tray-icon`. | | | `title?` | `string` | The tray title #### Platform-specific - **Linux:** The title will not be shown unless there is an icon as well. The title is useful for numerical and other frequently updated information. In general, it shouldn't be shown unless a user requests it as it can take up a significant amount of space on the user's panel. This may not be shown in all visualizations. - **Windows:** Unsupported. | | | `tooltip?` | `string` | The tray icon tooltip | | ## Type Aliases ### MouseButton ```ts type MouseButton: "Left" | "Right" | "Middle"; ``` *** ### MouseButtonState ```ts type MouseButtonState: "Up" | "Down"; ``` *** ### TrayIconClickEvent ```ts type TrayIconClickEvent: object; ``` #### Type declaration | Name | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `button` | [`MouseButton`](/taurify/api/namespacetray/#mousebutton) | Mouse button that triggered this event. | | | `buttonState` | [`MouseButtonState`](/taurify/api/namespacetray/#mousebuttonstate) | Mouse button state when this event was triggered. | | *** ### TrayIconEvent ```ts type TrayIconEvent: | TrayIconEventBase<"Click"> & TrayIconClickEvent | TrayIconEventBase<"DoubleClick"> & Omit | TrayIconEventBase<"Enter"> | TrayIconEventBase<"Move"> | TrayIconEventBase<"Leave">; ``` Describes a tray icon event. #### Platform-specific: - **Linux**: Unsupported. The event is not emitted even though the icon is shown, the icon will still show a context menu on right click. *** ### TrayIconEventBase\ ```ts type TrayIconEventBase: object; ``` #### Type Parameters | Type Parameter | | ------ | | `T` *extends* [`TrayIconEventType`](/taurify/api/namespacetray/#trayiconeventtype) | #### Type declaration | Name | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `id` | `string` | Id of the tray icon which triggered this event. | | | `position` | [`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition) | Physical position of the click the triggered this event. | | | `rect` | `object` | Position and size of the tray icon. | | | `rect.position` | [`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition) | - | | | `rect.size` | [`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize) | - | | | `type` | `T` | The tray icon event type | | *** ### TrayIconEventType ```ts type TrayIconEventType: | "Click" | "DoubleClick" | "Enter" | "Move" | "Leave"; ``` # updater ## Classes ### Update A rust-backed resource. The resource lives in the main process and does not exist in the Javascript world, and thus will not be cleaned up automatiacally except on application exit. If you want to clean it up early, call [`Resource.close`](/taurify/api/namespacecore/#close) #### Example ```typescript import { Resource, invoke } from '@crabnebula/taurify-api/core'; export class DatabaseHandle extends Resource { static async open(path: string): Promise { const rid: number = await invoke('open_db', { path }); return new DatabaseHandle(rid); } async execute(sql: string): Promise { await invoke('execute_sql', { rid: this.rid, sql }); } } ``` #### Extends - [`Resource`](/taurify/api/namespacecore/#resource) #### Constructors ##### new Update() ```ts new Update(metadata): Update ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `metadata` | `UpdateMetadata` | ###### Returns [`Update`](/taurify/api/namespaceupdater/#update) ###### Overrides [`Resource`](/taurify/api/namespacecore/#resource).[`constructor`](/taurify/api/namespacecore/#constructors-2) #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `body?` | `string` | | | `currentVersion` | `string` | | | `date?` | `string` | | | `kind` | `"app"` \| `"assets"` | | | `version` | `string` | | #### Accessors ##### rid ###### Get Signature ```ts get rid(): number ``` ###### Returns `number` ###### Inherited from [`Resource`](/taurify/api/namespacecore/#resource).[`rid`](/taurify/api/namespacecore/#rid) #### Methods ##### close() ```ts close(): Promise ``` Destroys and cleans up this resource from memory. **You should not call any method on this object anymore and should drop any reference to it.** ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Overrides [`Resource`](/taurify/api/namespacecore/#resource).[`close`](/taurify/api/namespacecore/#close) ##### download() ```ts download(onEvent?, options?): Promise ``` Download the updater package ###### Parameters | Parameter | Type | | ------ | ------ | | `onEvent`? | (`progress`) => `void` | | `options`? | [`DownloadOptions`](/taurify/api/namespaceupdater/#downloadoptions) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### downloadAndInstall() ```ts downloadAndInstall(onEvent?, options?): Promise ``` Downloads the updater package and installs it ###### Parameters | Parameter | Type | | ------ | ------ | | `onEvent`? | (`progress`) => `void` | | `options`? | [`DownloadOptions`](/taurify/api/namespaceupdater/#downloadoptions) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### install() ```ts install(): Promise ``` Install downloaded updater package ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ## Interfaces ### CheckOptions Options used when checking for updates #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `timeout?` | `number` | Timeout in milliseconds | | *** ### DownloadOptions Options used when downloading an update #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `timeout?` | `number` | Timeout in milliseconds | | ## Type Aliases ### DownloadEvent ```ts type DownloadEvent: object | object | object; ``` Updater download event ## Functions ### check() ```ts function check(options?): Promise ``` Check for updates, resolves to `null` if no updates are available #### Parameters | Parameter | Type | | ------ | ------ | | `options`? | [`CheckOptions`](/taurify/api/namespaceupdater/#checkoptions) | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Update`](/taurify/api/namespaceupdater/#update) \| `null`\> # webview Provides APIs to create webviews, communicate with other webviews and manipulate the current webview. #### Webview events Events can be listened to using [Webview.listen](/taurify/api/namespacewebview/#listen): ```typescript import { getCurrentWebview } from "@crabnebula/taurify-api/webview"; getCurrentWebview().listen("my-webview-event", ({ event, payload }) => { }); ``` ## References ### Color Re-exports [Color](/taurify/api/namespacewindow/#color-1) ### DragDropEvent Re-exports [DragDropEvent](/taurify/api/namespacewindow/#dragdropevent) ## Classes ### Webview Create new webview or get a handle to an existing one. Webviews 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 `_`. #### Example ```typescript import { Window } from "@crabnebula/taurify-api/window" import { Webview } from "@crabnebula/taurify-api/webview" const appWindow = new Window('uniqueLabel'); appWindow.once('tauri://created', async function () { // `new Webview` Should be called after the window is successfully created, // or webview may not be attached to the window since window is not created yet. // loading embedded asset: const webview = new Webview(appWindow, 'theUniqueLabel', { url: 'path/to/page.html', // create a webview with specific logical position and size x: 0, y: 0, width: 800, height: 600, }); // alternatively, load a remote URL: const webview = new Webview(appWindow, 'theUniqueLabel', { url: 'https://github.com/tauri-apps/tauri', // create a webview with specific logical position and size x: 0, y: 0, width: 800, height: 600, }); webview.once('tauri://created', function () { // webview successfully created }); webview.once('tauri://error', function (e) { // an error happened creating the webview }); // emit an event to the backend await webview.emit("some-event", "data"); // listen to an event from the backend const unlisten = await webview.listen("event-name", e => { }); unlisten(); }); ``` #### Extended by - [`WebviewWindow`](/taurify/api/namespacewebviewwindow/#webviewwindow) #### Constructors ##### new Webview() ```ts new Webview( window, label, options): Webview ``` Creates a new Webview. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `window` | [`Window`](/taurify/api/namespacewindow/#window) | the window to add this webview to. | | `label` | `string` | The unique webview label. Must be alphanumeric: `a-zA-Z-/:_`. | | `options` | [`WebviewOptions`](/taurify/api/namespacewebview/#webviewoptions) | - | ###### Returns [`Webview`](/taurify/api/namespacewebview/#webview) The [Webview](/taurify/api/namespacewebview/#webview) instance to communicate with the webview. ###### Example ```typescript import { Window } from '@crabnebula/taurify-api/window' import { Webview } from '@crabnebula/taurify-api/webview' const appWindow = new Window('my-label') appWindow.once('tauri://created', async function() { const webview = new Webview(appWindow, 'my-label', { url: 'https://github.com/tauri-apps/tauri', // create a webview with specific logical position and size x: 0, y: 0, width: 800, height: 600, }); webview.once('tauri://created', function () { // webview successfully created }); webview.once('tauri://error', function (e) { // an error happened creating the webview }); }); ``` #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `label` | `string` | The webview label. It is a unique identifier for the webview, can be used to reference it later. | | | `listeners` | [`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)\<`string`, [`EventCallback`](/taurify/api/namespaceevent/#eventcallbackt)\<`any`\>[]\> | Local event listeners. | | | `window` | [`Window`](/taurify/api/namespacewindow/#window) | The window hosting this webview. | | #### Methods ##### clearAllBrowsingData() ```ts clearAllBrowsingData(): Promise ``` Clears all browsing data for this webview. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; await getCurrentWebview().clearAllBrowsingData(); ``` ##### close() ```ts close(): Promise ``` Closes the webview. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; await getCurrentWebview().close(); ``` ##### emit() ```ts emit(event, payload?): Promise ``` Emits an event to all [targets](/taurify/api/namespaceevent/#eventtarget). ###### Type Parameters | Type Parameter | | ------ | | `T` | ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `event` | `string` | Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. | | `payload`? | `T` | Event payload. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; await getCurrentWebview().emit('webview-loaded', { loggedIn: true, token: 'authToken' }); ``` ##### emitTo() ```ts emitTo( target, event, payload?): Promise ``` Emits an event to all [targets](/taurify/api/namespaceevent/#eventtarget) matching the given target. ###### Type Parameters | Type Parameter | | ------ | | `T` | ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `target` | `string` \| [`EventTarget`](/taurify/api/namespaceevent/#eventtarget) | Label of the target Window/Webview/WebviewWindow or raw [EventTarget](/taurify/api/namespaceevent/#eventtarget) object. | | `event` | `string` | Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. | | `payload`? | `T` | Event payload. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; await getCurrentWebview().emitTo('main', 'webview-loaded', { loggedIn: true, token: 'authToken' }); ``` ##### hide() ```ts hide(): Promise ``` Hide the webview. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; await getCurrentWebview().hide(); ``` ##### listen() ```ts listen(event, handler): Promise ``` Listen to an emitted event on this webview. ###### Type Parameters | Type Parameter | | ------ | | `T` | ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `event` | [`EventName`](/taurify/api/namespaceevent/#eventname) | Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. | | `handler` | [`EventCallback`](/taurify/api/namespaceevent/#eventcallbackt)\<`T`\> | Event handler. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#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. ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; const unlisten = await getCurrentWebview().listen('state-changed', (event) => { console.log(`Got error: ${payload}`); }); // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted unlisten(); ``` ##### once() ```ts once(event, handler): Promise ``` Listen to an emitted event on this webview only once. ###### Type Parameters | Type Parameter | | ------ | | `T` | ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `event` | [`EventName`](/taurify/api/namespaceevent/#eventname) | Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. | | `handler` | [`EventCallback`](/taurify/api/namespaceevent/#eventcallbackt)\<`T`\> | Event handler. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#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. ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; const unlisten = await getCurrent().once('initialized', (event) => { console.log(`Webview initialized!`); }); // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted unlisten(); ``` ##### onDragDropEvent() ```ts onDragDropEvent(handler): Promise ``` Listen to a file drop event. The listener is triggered when the user hovers the selected files on the webview, drops the files or cancels the operation. ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | [`EventCallback`](/taurify/api/namespaceevent/#eventcallbackt)\<[`DragDropEvent`](/taurify/api/namespacewindow/#dragdropevent)\> | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#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. ###### Example ```typescript import { getCurrentWebview } from "@crabnebula/taurify-api/webview"; const unlisten = await getCurrentWebview().onDragDropEvent((event) => { if (event.payload.type === 'over') { console.log('User hovering', event.payload.position); } else if (event.payload.type === 'drop') { console.log('User dropped', event.payload.paths); } else { console.log('File drop cancelled'); } }); // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted unlisten(); ``` When the debugger panel is open, the drop position of this event may be inaccurate due to a known limitation. To retrieve the correct drop position, please detach the debugger. ##### position() ```ts position(): Promise ``` The position of the top-left hand corner of the webview's client area relative to the top-left hand corner of the desktop. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition)\> The webview's position. ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; const position = await getCurrentWebview().position(); ``` ##### reparent() ```ts reparent(window): Promise ``` Moves this webview to the given label. ###### Parameters | Parameter | Type | | ------ | ------ | | `window` | `string` \| [`Window`](/taurify/api/namespacewindow/#window) \| [`WebviewWindow`](/taurify/api/namespacewebviewwindow/#webviewwindow) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; await getCurrentWebview().reparent('other-window'); ``` ##### setAutoResize() ```ts setAutoResize(autoResize): Promise ``` Sets whether the webview should automatically grow and shrink its size and position when the parent window resizes. ###### Parameters | Parameter | Type | | ------ | ------ | | `autoResize` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; await getCurrentWebview().setAutoResize(true); ``` ##### setBackgroundColor() ```ts setBackgroundColor(color): Promise ``` Specify the webview background color. #### Platfrom-specific: - **macOS / iOS**: Not implemented. - **Windows**: - On Windows 7, transparency is not supported and the alpha value will be ignored. - On Windows higher than 7: translucent colors are not supported so any alpha value other than `0` will be replaced by `255` ###### Parameters | Parameter | Type | | ------ | ------ | | `color` | `null` \| [`Color`](/taurify/api/namespacewindow/#color-1) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ##### setFocus() ```ts setFocus(): Promise ``` Bring the webview to front and focus. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; await getCurrentWebview().setFocus(); ``` ##### setPosition() ```ts setPosition(position): Promise ``` Sets the webview position. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `position` | [`LogicalPosition`](/taurify/api/namespacedpi/#logicalposition) \| [`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition) \| [`Position`](/taurify/api/namespacedpi/#position) | The new position, in logical or physical pixels. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrent, LogicalPosition } from '@crabnebula/taurify-api/webview'; await getCurrentWebview().setPosition(new LogicalPosition(600, 500)); ``` ##### setSize() ```ts setSize(size): Promise ``` Resizes the webview. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `size` | [`LogicalSize`](/taurify/api/namespacedpi/#logicalsize) \| [`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize) \| [`Size`](/taurify/api/namespacedpi/#size) | The logical or physical size. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrent, LogicalSize } from '@crabnebula/taurify-api/webview'; await getCurrentWebview().setSize(new LogicalSize(600, 500)); ``` ##### setZoom() ```ts setZoom(scaleFactor): Promise ``` Set webview zoom level. ###### Parameters | Parameter | Type | | ------ | ------ | | `scaleFactor` | `number` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; await getCurrentWebview().setZoom(1.5); ``` ##### show() ```ts show(): Promise ``` Show the webview. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; await getCurrentWebview().show(); ``` ##### size() ```ts size(): Promise ``` The physical size of the webview's client area. The client area is the content of the webview, excluding the title bar and borders. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize)\> The webview's size. ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; const size = await getCurrentWebview().size(); ``` ##### getAll() ```ts static getAll(): Promise ``` Gets a list of instances of `Webview` for all available webviews. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Webview`](/taurify/api/namespacewebview/#webview)[]\> ##### getByLabel() ```ts static getByLabel(label): Promise ``` Gets the Webview for the webview associated with the given label. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `label` | `string` | The webview label. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`null` \| [`Webview`](/taurify/api/namespacewebview/#webview)\> The Webview instance to communicate with the webview or null if the webview doesn't exist. ###### Example ```typescript import { Webview } from '@crabnebula/taurify-api/webview'; const mainWebview = Webview.getByLabel('main'); ``` ##### getCurrent() ```ts static getCurrent(): Webview ``` Get an instance of `Webview` for the current webview. ###### Returns [`Webview`](/taurify/api/namespacewebview/#webview) ## Interfaces ### WebviewOptions Configuration for the webview to create. #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `acceptFirstMouse?` | `boolean` | Whether clicking an inactive webview also clicks through to the webview on macOS. | | | `allowLinkPreview?` | `boolean` | on macOS and iOS there is a link preview on long pressing links, this is enabled by default. see https://docs.rs/objc2-web-kit/latest/objc2_web_kit/struct.WKWebView.html#method.allowsLinkPreview | | | `backgroundColor?` | [`Color`](/taurify/api/namespacewindow/#color-1) | Set the window and webview background color. #### Platform-specific: - **macOS / iOS**: Not implemented. - **Windows**: - On Windows 7, alpha channel is ignored. - On Windows 8 and newer, if alpha channel is not `0`, it will be ignored. | | | `backgroundThrottling?` | [`BackgroundThrottlingPolicy`](/taurify/api/namespacewindow/#backgroundthrottlingpolicy) | Change the default background throttling behaviour. By default, browsers use a suspend policy that will throttle timers and even unload the whole tab (view) to free resources after roughly 5 minutes when a view became minimized or hidden. This will pause all tasks until the documents visibility state changes back from hidden to visible by bringing the view back to the foreground. ## Platform-specific - **Linux / Windows / Android**: Unsupported. Workarounds like a pending WebLock transaction might suffice. - **iOS**: Supported since version 17.0+. - **macOS**: Supported since version 14.0+. see https://github.com/tauri-apps/tauri/issues/5250#issuecomment-2569380578 | | | `devtools?` | `boolean` | Whether web inspector, which is usually called browser devtools, is enabled or not. Enabled by default. This API works in **debug** builds, but requires `devtools` feature flag to enable it in **release** builds. #### Platform-specific - macOS: This will call private functions on **macOS**. - Android: Open `chrome://inspect/#devices` in Chrome to get the devtools window. Wry's `WebView` devtools API isn't supported on Android. - iOS: Open Safari > Develop > [Your Device Name] > [Your WebView] to get the devtools window. | | | `disableInputAccessoryView?` | `boolean` | Allows disabling the input accessory view on iOS. The accessory view is the view that appears above the keyboard when a text input element is focused. It usually displays a view with "Done", "Next" buttons. | | | `dragDropEnabled?` | `boolean` | Whether the drag and drop is enabled or not on the webview. By default it is enabled. Disabling it is required to use HTML5 drag and drop on the frontend on Windows. | | | `focus?` | `boolean` | Whether the webview should have focus or not | | | `height` | `number` | The initial height. | | | `incognito?` | `boolean` | Whether or not the webview should be launched in incognito mode. #### Platform-specific - **Android:** Unsupported. | | | `javascriptDisabled?` | `boolean` | Whether we should disable JavaScript code execution on the webview or not. | | | `proxyUrl?` | `string` | The proxy URL for the WebView for all network requests. Must be either a `http://` or a `socks5://` URL. #### Platform-specific - **macOS**: Requires the `macos-proxy` feature flag and only compiles for macOS 14+. | | | `transparent?` | `boolean` | Whether the webview is transparent or not. Note that on `macOS` this requires the `macos-private-api` feature flag, enabled under `tauri.conf.json > app > macOSPrivateApi`. WARNING: Using private APIs on `macOS` prevents your application from being accepted to the `App Store`. | | | `url?` | `string` | Remote URL or local file path to open. - URL such as `https://github.com/tauri-apps` is opened directly on a Tauri webview. - data: URL such as `data:text/html,...` is only supported with the `webview-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). | | | `useHttpsScheme?` | `boolean` | Sets whether the custom protocols should use `https://.localhost` instead of the default `http://.localhost` on Windows and Android. Defaults to `false`. #### Note Using a `https` scheme will NOT allow mixed content when trying to fetch `http` endpoints and therefore will not match the behavior of the `://localhost` protocols used on macOS and Linux. #### Warning Changing this value between releases will change the IndexedDB, cookies and localstorage location and your app will not be able to access them. | | | `userAgent?` | `string` | The user agent for the webview. | | | `width` | `number` | The initial width. | | | `x` | `number` | The initial vertical position. | | | `y` | `number` | The initial horizontal position. | | | `zoomHotkeysEnabled?` | `boolean` | Whether page zooming by hotkeys is enabled #### Platform-specific: - **Windows**: Controls WebView2's [`IsZoomControlEnabled`](https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/winrt/microsoft_web_webview2_core/corewebview2settings?view=webview2-winrt-1.0.2420.47#iszoomcontrolenabled) setting. - **MacOS / Linux**: Injects a polyfill that zooms in and out with `ctrl/command` + `-/=`, 20% in each step, ranging from 20% to 1000%. Requires `webview:allow-set-webview-zoom` permission - **Android / iOS**: Unsupported. | | ## Functions ### getAllWebviews() ```ts function getAllWebviews(): Promise ``` Gets a list of instances of `Webview` for all available webviews. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Webview`](/taurify/api/namespacewebview/#webview)[]\> *** ### getCurrentWebview() ```ts function getCurrentWebview(): Webview ``` Get an instance of `Webview` for the current webview. #### Returns [`Webview`](/taurify/api/namespacewebview/#webview) # webviewWindow ## References ### Color Re-exports [Color](/taurify/api/namespacewindow/#color-1) ### DragDropEvent Re-exports [DragDropEvent](/taurify/api/namespacewindow/#dragdropevent) ## Classes ### WebviewWindow Create new webview or get a handle to an existing one. Webviews 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 `_`. #### Example ```typescript import { Window } from "@crabnebula/taurify-api/window" import { Webview } from "@crabnebula/taurify-api/webview" const appWindow = new Window('uniqueLabel'); appWindow.once('tauri://created', async function () { // `new Webview` Should be called after the window is successfully created, // or webview may not be attached to the window since window is not created yet. // loading embedded asset: const webview = new Webview(appWindow, 'theUniqueLabel', { url: 'path/to/page.html', // create a webview with specific logical position and size x: 0, y: 0, width: 800, height: 600, }); // alternatively, load a remote URL: const webview = new Webview(appWindow, 'theUniqueLabel', { url: 'https://github.com/tauri-apps/tauri', // create a webview with specific logical position and size x: 0, y: 0, width: 800, height: 600, }); webview.once('tauri://created', function () { // webview successfully created }); webview.once('tauri://error', function (e) { // an error happened creating the webview }); // emit an event to the backend await webview.emit("some-event", "data"); // listen to an event from the backend const unlisten = await webview.listen("event-name", e => { }); unlisten(); }); ``` #### Extends - [`Webview`](/taurify/api/namespacewebview/#webview).[`Window`](/taurify/api/namespacewindow/#window) #### Constructors ##### new WebviewWindow() ```ts new WebviewWindow(label, options): WebviewWindow ``` Creates a new [Window](/taurify/api/namespacewindow/#window) hosting a [Webview](/taurify/api/namespacewebview/#webview). ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `label` | `string` | The unique webview label. Must be alphanumeric: `a-zA-Z-/:_`. | | `options` | [`Omit`](https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys)\<[`WebviewOptions`](/taurify/api/namespacewebview/#webviewoptions), `"width"` \| `"height"` \| `"x"` \| `"y"`\> & [`WindowOptions`](/taurify/api/namespacewindow/#windowoptions) | - | ###### Returns [`WebviewWindow`](/taurify/api/namespacewebviewwindow/#webviewwindow) The [WebviewWindow](/taurify/api/namespacewebviewwindow/#webviewwindow) instance to communicate with the window and webview. ###### Example ```typescript import { WebviewWindow } from '@crabnebula/taurify-api/webviewWindow' const webview = new WebviewWindow('my-label', { url: 'https://github.com/tauri-apps/tauri' }); webview.once('tauri://created', function () { // webview successfully created }); webview.once('tauri://error', function (e) { // an error happened creating the webview }); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`constructor`](/taurify/api/namespacewindow/#constructors-1) #### Properties | Property | Type | Description | Inherited from | Defined in | | ------ | ------ | ------ | ------ | ------ | | `label` | `string` | The webview label. It is a unique identifier for the webview, can be used to reference it later. | [`Window`](/taurify/api/namespacewindow/#window).[`label`](/taurify/api/namespacewindow/#label) | | | `listeners` | [`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)\<`string`, [`EventCallback`](/taurify/api/namespaceevent/#eventcallbackt)\<`any`\>[]\> | Local event listeners. | [`Window`](/taurify/api/namespacewindow/#window).[`listeners`](/taurify/api/namespacewindow/#listeners) | | | `window` | [`Window`](/taurify/api/namespacewindow/#window) | The window hosting this webview. | [`Webview`](/taurify/api/namespacewebview/#webview).[`window`](/taurify/api/namespacewebview/#window) | | #### Methods ##### center() ```ts center(): Promise ``` Centers the window. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().center(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`center`](/taurify/api/namespacewindow/#center) ##### clearAllBrowsingData() ```ts clearAllBrowsingData(): Promise ``` Clears all browsing data for this webview. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; await getCurrentWebview().clearAllBrowsingData(); ``` ###### Inherited from [`Webview`](/taurify/api/namespacewebview/#webview).[`clearAllBrowsingData`](/taurify/api/namespacewebview/#clearallbrowsingdata) ##### clearEffects() ```ts clearEffects(): Promise ``` Clear any applied effects if possible. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`clearEffects`](/taurify/api/namespacewindow/#cleareffects) ##### close() ```ts close(): Promise ``` Closes the webview. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; await getCurrentWebview().close(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`close`](/taurify/api/namespacewindow/#close) ##### destroy() ```ts destroy(): Promise ``` Destroys the window. Behaves like [Window.close](/taurify/api/namespacewindow/#close) but forces the window close instead of emitting a closeRequested event. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().destroy(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`destroy`](/taurify/api/namespacewindow/#destroy) ##### emit() ```ts emit(event, payload?): Promise ``` Emits an event to all [targets](/taurify/api/namespaceevent/#eventtarget). ###### Type Parameters | Type Parameter | | ------ | | `T` | ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `event` | `string` | Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. | | `payload`? | `T` | Event payload. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; await getCurrentWebview().emit('webview-loaded', { loggedIn: true, token: 'authToken' }); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`emit`](/taurify/api/namespacewindow/#emit) ##### emitTo() ```ts emitTo( target, event, payload?): Promise ``` Emits an event to all [targets](/taurify/api/namespaceevent/#eventtarget) matching the given target. ###### Type Parameters | Type Parameter | | ------ | | `T` | ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `target` | `string` \| [`EventTarget`](/taurify/api/namespaceevent/#eventtarget) | Label of the target Window/Webview/WebviewWindow or raw [EventTarget](/taurify/api/namespaceevent/#eventtarget) object. | | `event` | `string` | Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. | | `payload`? | `T` | Event payload. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; await getCurrentWebview().emitTo('main', 'webview-loaded', { loggedIn: true, token: 'authToken' }); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`emitTo`](/taurify/api/namespacewindow/#emitto) ##### hide() ```ts hide(): Promise ``` Hide the webview. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; await getCurrentWebview().hide(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`hide`](/taurify/api/namespacewindow/#hide) ##### innerPosition() ```ts innerPosition(): Promise ``` The position of the top-left hand corner of the window's client area relative to the top-left hand corner of the desktop. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition)\> The window's inner position. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const position = await getCurrentWindow().innerPosition(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`innerPosition`](/taurify/api/namespacewindow/#innerposition) ##### innerSize() ```ts innerSize(): Promise ``` The physical size of the window's client area. The client area is the content of the window, excluding the title bar and borders. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize)\> The window's inner size. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const size = await getCurrentWindow().innerSize(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`innerSize`](/taurify/api/namespacewindow/#innersize) ##### isAlwaysOnTop() ```ts isAlwaysOnTop(): Promise ``` Whether the window is configured to be always on top of other windows or not. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> Whether the window is visible or not. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const alwaysOnTop = await getCurrentWindow().isAlwaysOnTop(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`isAlwaysOnTop`](/taurify/api/namespacewindow/#isalwaysontop) ##### isClosable() ```ts isClosable(): Promise ``` Gets the window's native close button state. #### Platform-specific - **iOS / Android:** Unsupported. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> Whether the window's native close button is enabled or not. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const closable = await getCurrentWindow().isClosable(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`isClosable`](/taurify/api/namespacewindow/#isclosable) ##### isDecorated() ```ts isDecorated(): Promise ``` Gets the window's current decorated state. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> Whether the window is decorated or not. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const decorated = await getCurrentWindow().isDecorated(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`isDecorated`](/taurify/api/namespacewindow/#isdecorated) ##### isEnabled() ```ts isEnabled(): Promise ``` Whether the window is enabled or disabled. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setEnabled(false); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`isEnabled`](/taurify/api/namespacewindow/#isenabled) ##### isFocused() ```ts isFocused(): Promise ``` Gets the window's current focus state. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> Whether the window is focused or not. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const focused = await getCurrentWindow().isFocused(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`isFocused`](/taurify/api/namespacewindow/#isfocused) ##### isFullscreen() ```ts isFullscreen(): Promise ``` Gets the window's current fullscreen state. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> Whether the window is in fullscreen mode or not. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const fullscreen = await getCurrentWindow().isFullscreen(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`isFullscreen`](/taurify/api/namespacewindow/#isfullscreen) ##### isMaximizable() ```ts isMaximizable(): Promise ``` Gets the window's native maximize button state. #### Platform-specific - **Linux / iOS / Android:** Unsupported. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> Whether the window's native maximize button is enabled or not. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const maximizable = await getCurrentWindow().isMaximizable(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`isMaximizable`](/taurify/api/namespacewindow/#ismaximizable) ##### isMaximized() ```ts isMaximized(): Promise ``` Gets the window's current maximized state. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> Whether the window is maximized or not. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const maximized = await getCurrentWindow().isMaximized(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`isMaximized`](/taurify/api/namespacewindow/#ismaximized) ##### isMinimizable() ```ts isMinimizable(): Promise ``` Gets the window's native minimize button state. #### Platform-specific - **Linux / iOS / Android:** Unsupported. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> Whether the window's native minimize button is enabled or not. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const minimizable = await getCurrentWindow().isMinimizable(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`isMinimizable`](/taurify/api/namespacewindow/#isminimizable) ##### isMinimized() ```ts isMinimized(): Promise ``` Gets the window's current minimized state. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const minimized = await getCurrentWindow().isMinimized(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`isMinimized`](/taurify/api/namespacewindow/#isminimized) ##### isResizable() ```ts isResizable(): Promise ``` Gets the window's current resizable state. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> Whether the window is resizable or not. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const resizable = await getCurrentWindow().isResizable(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`isResizable`](/taurify/api/namespacewindow/#isresizable) ##### isVisible() ```ts isVisible(): Promise ``` Gets the window's current visible state. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> Whether the window is visible or not. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const visible = await getCurrentWindow().isVisible(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`isVisible`](/taurify/api/namespacewindow/#isvisible) ##### listen() ```ts listen(event, handler): Promise ``` Listen to an emitted event on this webivew window. ###### Type Parameters | Type Parameter | | ------ | | `T` | ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `event` | [`EventName`](/taurify/api/namespaceevent/#eventname) | Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. | | `handler` | [`EventCallback`](/taurify/api/namespaceevent/#eventcallbackt)\<`T`\> | Event handler. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#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. ###### Example ```typescript import { WebviewWindow } from '@crabnebula/taurify-api/webviewWindow'; const unlisten = await WebviewWindow.getCurrent().listen('state-changed', (event) => { console.log(`Got error: ${payload}`); }); // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted unlisten(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`listen`](/taurify/api/namespacewindow/#listen) ##### maximize() ```ts maximize(): Promise ``` Maximizes the window. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().maximize(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`maximize`](/taurify/api/namespacewindow/#maximize) ##### minimize() ```ts minimize(): Promise ``` Minimizes the window. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().minimize(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`minimize`](/taurify/api/namespacewindow/#minimize) ##### once() ```ts once(event, handler): Promise ``` Listen to an emitted event on this webview window only once. ###### Type Parameters | Type Parameter | | ------ | | `T` | ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `event` | [`EventName`](/taurify/api/namespaceevent/#eventname) | Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. | | `handler` | [`EventCallback`](/taurify/api/namespaceevent/#eventcallbackt)\<`T`\> | Event handler. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#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. ###### Example ```typescript import { WebviewWindow } from '@crabnebula/taurify-api/webviewWindow'; const unlisten = await WebviewWindow.getCurrent().once('initialized', (event) => { console.log(`Webview initialized!`); }); // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted unlisten(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`once`](/taurify/api/namespacewindow/#once) ##### onCloseRequested() ```ts onCloseRequested(handler): Promise ``` Listen to window close requested. Emitted when the user requests to closes the window. ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | (`event`) => `void` \| [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#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. ###### Example ```typescript import { getCurrentWindow } from "@crabnebula/taurify-api/window"; import { confirm } from '@crabnebula/taurify-api/dialog'; const unlisten = await getCurrentWindow().onCloseRequested(async (event) => { const confirmed = await confirm('Are you sure?'); if (!confirmed) { // user did not confirm closing the window; let's prevent it event.preventDefault(); } }); // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted unlisten(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`onCloseRequested`](/taurify/api/namespacewindow/#oncloserequested) ##### onDragDropEvent() ```ts onDragDropEvent(handler): Promise ``` Listen to a file drop event. The listener is triggered when the user hovers the selected files on the webview, drops the files or cancels the operation. ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | [`EventCallback`](/taurify/api/namespaceevent/#eventcallbackt)\<[`DragDropEvent`](/taurify/api/namespacewindow/#dragdropevent)\> | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#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. ###### Example ```typescript import { getCurrentWebview } from "@crabnebula/taurify-api/webview"; const unlisten = await getCurrentWebview().onDragDropEvent((event) => { if (event.payload.type === 'over') { console.log('User hovering', event.payload.position); } else if (event.payload.type === 'drop') { console.log('User dropped', event.payload.paths); } else { console.log('File drop cancelled'); } }); // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted unlisten(); ``` When the debugger panel is open, the drop position of this event may be inaccurate due to a known limitation. To retrieve the correct drop position, please detach the debugger. ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`onDragDropEvent`](/taurify/api/namespacewindow/#ondragdropevent) ##### onFocusChanged() ```ts onFocusChanged(handler): Promise ``` Listen to window focus change. ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | [`EventCallback`](/taurify/api/namespaceevent/#eventcallbackt)\<`boolean`\> | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#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. ###### Example ```typescript import { getCurrentWindow } from "@crabnebula/taurify-api/window"; const unlisten = await getCurrentWindow().onFocusChanged(({ payload: focused }) => { console.log('Focus changed, window is focused? ' + focused); }); // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted unlisten(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`onFocusChanged`](/taurify/api/namespacewindow/#onfocuschanged) ##### onMoved() ```ts onMoved(handler): Promise ``` Listen to window move. ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | [`EventCallback`](/taurify/api/namespaceevent/#eventcallbackt)\<[`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition)\> | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#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. ###### Example ```typescript import { getCurrentWindow } from "@crabnebula/taurify-api/window"; const unlisten = await getCurrentWindow().onMoved(({ payload: position }) => { console.log('Window moved', position); }); // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted unlisten(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`onMoved`](/taurify/api/namespacewindow/#onmoved) ##### onResized() ```ts onResized(handler): Promise ``` Listen to window resize. ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | [`EventCallback`](/taurify/api/namespaceevent/#eventcallbackt)\<[`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize)\> | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#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. ###### Example ```typescript import { getCurrentWindow } from "@crabnebula/taurify-api/window"; const unlisten = await getCurrentWindow().onResized(({ payload: size }) => { console.log('Window resized', size); }); // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted unlisten(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`onResized`](/taurify/api/namespacewindow/#onresized) ##### onScaleChanged() ```ts onScaleChanged(handler): Promise ``` Listen to window scale change. Emitted when the window's scale factor has changed. The following user actions can cause DPI changes: - Changing the display's resolution. - Changing the display's scale factor (e.g. in Control Panel on Windows). - Moving the window to a display with a different scale factor. ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | [`EventCallback`](/taurify/api/namespaceevent/#eventcallbackt)\<[`ScaleFactorChanged`](/taurify/api/namespacewindow/#scalefactorchanged)\> | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#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. ###### Example ```typescript import { getCurrentWindow } from "@crabnebula/taurify-api/window"; const unlisten = await getCurrentWindow().onScaleChanged(({ payload }) => { console.log('Scale changed', payload.scaleFactor, payload.size); }); // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted unlisten(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`onScaleChanged`](/taurify/api/namespacewindow/#onscalechanged) ##### onThemeChanged() ```ts onThemeChanged(handler): Promise ``` Listen to the system theme change. ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | [`EventCallback`](/taurify/api/namespaceevent/#eventcallbackt)\<[`Theme`](/taurify/api/namespacewindow/#theme-2)\> | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#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. ###### Example ```typescript import { getCurrentWindow } from "@crabnebula/taurify-api/window"; const unlisten = await getCurrentWindow().onThemeChanged(({ payload: theme }) => { console.log('New theme: ' + theme); }); // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted unlisten(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`onThemeChanged`](/taurify/api/namespacewindow/#onthemechanged) ##### outerPosition() ```ts outerPosition(): Promise ``` The position of the top-left hand corner of the window relative to the top-left hand corner of the desktop. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition)\> The window's outer position. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const position = await getCurrentWindow().outerPosition(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`outerPosition`](/taurify/api/namespacewindow/#outerposition) ##### outerSize() ```ts outerSize(): Promise ``` The physical size of the entire window. These dimensions include the title bar and borders. If you don't want that (and you usually don't), use inner_size instead. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize)\> The window's outer size. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const size = await getCurrentWindow().outerSize(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`outerSize`](/taurify/api/namespacewindow/#outersize) ##### position() ```ts position(): Promise ``` The position of the top-left hand corner of the webview's client area relative to the top-left hand corner of the desktop. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition)\> The webview's position. ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; const position = await getCurrentWebview().position(); ``` ###### Inherited from [`Webview`](/taurify/api/namespacewebview/#webview).[`position`](/taurify/api/namespacewebview/#position) ##### reparent() ```ts reparent(window): Promise ``` Moves this webview to the given label. ###### Parameters | Parameter | Type | | ------ | ------ | | `window` | `string` \| [`Window`](/taurify/api/namespacewindow/#window) \| [`WebviewWindow`](/taurify/api/namespacewebviewwindow/#webviewwindow) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; await getCurrentWebview().reparent('other-window'); ``` ###### Inherited from [`Webview`](/taurify/api/namespacewebview/#webview).[`reparent`](/taurify/api/namespacewebview/#reparent) ##### requestUserAttention() ```ts requestUserAttention(requestType): Promise ``` Requests user attention to the window, this has no effect if the application is already focused. How requesting for user attention manifests is platform dependent, see `UserAttentionType` for details. Providing `null` will unset the request for user attention. Unsetting the request for user attention might not be done automatically by the WM when the window receives input. #### Platform-specific - **macOS:** `null` has no effect. - **Linux:** Urgency levels have the same effect. ###### Parameters | Parameter | Type | | ------ | ------ | | `requestType` | `null` \| [`UserAttentionType`](/taurify/api/namespacewindow/#userattentiontype) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().requestUserAttention(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`requestUserAttention`](/taurify/api/namespacewindow/#requestuserattention) ##### scaleFactor() ```ts scaleFactor(): Promise ``` The scale factor that can be used to map physical pixels to logical pixels. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`number`\> The window's monitor scale factor. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const factor = await getCurrentWindow().scaleFactor(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`scaleFactor`](/taurify/api/namespacewindow/#scalefactor) ##### setAlwaysOnBottom() ```ts setAlwaysOnBottom(alwaysOnBottom): Promise ``` Whether the window should always be below other windows. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `alwaysOnBottom` | `boolean` | Whether the window should always be below other windows or not. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setAlwaysOnBottom(true); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setAlwaysOnBottom`](/taurify/api/namespacewindow/#setalwaysonbottom) ##### setAlwaysOnTop() ```ts setAlwaysOnTop(alwaysOnTop): Promise ``` Whether the window should always be on top of other windows. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `alwaysOnTop` | `boolean` | Whether the window should always be on top of other windows or not. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setAlwaysOnTop(true); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setAlwaysOnTop`](/taurify/api/namespacewindow/#setalwaysontop) ##### setAutoResize() ```ts setAutoResize(autoResize): Promise ``` Sets whether the webview should automatically grow and shrink its size and position when the parent window resizes. ###### Parameters | Parameter | Type | | ------ | ------ | | `autoResize` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; await getCurrentWebview().setAutoResize(true); ``` ###### Inherited from [`Webview`](/taurify/api/namespacewebview/#webview).[`setAutoResize`](/taurify/api/namespacewebview/#setautoresize) ##### setBackgroundColor() ```ts setBackgroundColor(color): Promise ``` Set the window and webview background color. #### Platform-specific: - **Android / iOS:** Unsupported for the window layer. - **macOS / iOS**: Not implemented for the webview layer. - **Windows**: - alpha channel is ignored for the window layer. - On Windows 7, alpha channel is ignored for the webview layer. - On Windows 8 and newer, if alpha channel is not `0`, it will be ignored. ###### Parameters | Parameter | Type | | ------ | ------ | | `color` | [`Color`](/taurify/api/namespacewindow/#color-1) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setBackgroundColor`](/taurify/api/namespacewindow/#setbackgroundcolor) ##### setBadgeCount() ```ts setBadgeCount(count?): Promise ``` Sets the badge count. It is app wide and not specific to this window. #### Platform-specific - **Windows**: Unsupported. Use @{linkcode Window.setOverlayIcon} instead. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `count`? | `number` | The badge count. Use `undefined` to remove the badge. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setBadgeCount(5); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setBadgeCount`](/taurify/api/namespacewindow/#setbadgecount) ##### setBadgeLabel() ```ts setBadgeLabel(label?): Promise ``` Sets the badge cont **macOS only**. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `label`? | `string` | The badge label. Use `undefined` to remove the badge. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setBadgeLabel("Hello"); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setBadgeLabel`](/taurify/api/namespacewindow/#setbadgelabel) ##### setClosable() ```ts setClosable(closable): Promise ``` Sets whether the window's native close button is enabled or not. #### Platform-specific - **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 - **iOS / Android:** Unsupported. ###### Parameters | Parameter | Type | | ------ | ------ | | `closable` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setClosable(false); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setClosable`](/taurify/api/namespacewindow/#setclosable) ##### setContentProtected() ```ts setContentProtected(protected_): Promise ``` Prevents the window contents from being captured by other apps. ###### Parameters | Parameter | Type | | ------ | ------ | | `protected_` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setContentProtected(true); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setContentProtected`](/taurify/api/namespacewindow/#setcontentprotected) ##### setCursorGrab() ```ts setCursorGrab(grab): Promise ``` Grabs the cursor, preventing it from leaving the window. There's no guarantee that the cursor will be hidden. You should hide it by yourself if you want so. #### Platform-specific - **Linux:** Unsupported. - **macOS:** This locks the cursor in a fixed location, which looks visually awkward. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `grab` | `boolean` | `true` to grab the cursor icon, `false` to release it. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setCursorGrab(true); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setCursorGrab`](/taurify/api/namespacewindow/#setcursorgrab) ##### setCursorIcon() ```ts setCursorIcon(icon): Promise ``` Modifies the cursor icon of the window. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `icon` | [`CursorIcon`](/taurify/api/namespacewindow/#cursoricon) | The new cursor icon. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setCursorIcon('help'); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setCursorIcon`](/taurify/api/namespacewindow/#setcursoricon) ##### setCursorPosition() ```ts setCursorPosition(position): Promise ``` Changes the position of the cursor in window coordinates. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `position` | [`LogicalPosition`](/taurify/api/namespacedpi/#logicalposition) \| [`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition) \| [`Position`](/taurify/api/namespacedpi/#position) | The new cursor position. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow, LogicalPosition } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setCursorPosition(new LogicalPosition(600, 300)); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setCursorPosition`](/taurify/api/namespacewindow/#setcursorposition) ##### setCursorVisible() ```ts setCursorVisible(visible): Promise ``` Modifies the cursor's visibility. #### Platform-specific - **Windows:** The cursor is only hidden within the confines of the window. - **macOS:** The cursor is hidden as long as the window has input focus, even if the cursor is outside of the window. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `visible` | `boolean` | If `false`, this will hide the cursor. If `true`, this will show the cursor. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setCursorVisible(false); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setCursorVisible`](/taurify/api/namespacewindow/#setcursorvisible) ##### setDecorations() ```ts setDecorations(decorations): Promise ``` Whether the window should have borders and bars. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `decorations` | `boolean` | Whether the window should have borders and bars. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setDecorations(false); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setDecorations`](/taurify/api/namespacewindow/#setdecorations) ##### setEffects() ```ts setEffects(effects): Promise ``` Set window effects. ###### Parameters | Parameter | Type | | ------ | ------ | | `effects` | [`Effects`](/taurify/api/namespacewindow/#effects) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setEffects`](/taurify/api/namespacewindow/#seteffects) ##### setEnabled() ```ts setEnabled(enabled): Promise ``` Enable or disable the window. ###### Parameters | Parameter | Type | | ------ | ------ | | `enabled` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setEnabled(false); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setEnabled`](/taurify/api/namespacewindow/#setenabled) ##### setFocus() ```ts setFocus(): Promise ``` Bring the webview to front and focus. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; await getCurrentWebview().setFocus(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setFocus`](/taurify/api/namespacewindow/#setfocus) ##### setFullscreen() ```ts setFullscreen(fullscreen): Promise ``` Sets the window fullscreen state. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `fullscreen` | `boolean` | Whether the window should go to fullscreen or not. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setFullscreen(true); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setFullscreen`](/taurify/api/namespacewindow/#setfullscreen) ##### setIcon() ```ts setIcon(icon): Promise ``` Sets the window icon. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `icon` | \| `string` \| `number`[] \| [`ArrayBuffer`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) \| [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\> \| [`Image`](/taurify/api/namespaceimage/#image) | Icon bytes or path to the icon file. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setIcon('/tauri/awesome.png'); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setIcon`](/taurify/api/namespacewindow/#seticon) ##### setIgnoreCursorEvents() ```ts setIgnoreCursorEvents(ignore): Promise ``` Changes the cursor events behavior. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `ignore` | `boolean` | `true` to ignore the cursor events; `false` to process them as usual. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setIgnoreCursorEvents(true); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setIgnoreCursorEvents`](/taurify/api/namespacewindow/#setignorecursorevents) ##### setMaximizable() ```ts setMaximizable(maximizable): Promise ``` Sets whether the window's native maximize button is enabled or not. If resizable is set to false, this setting is ignored. #### Platform-specific - **macOS:** Disables the "zoom" button in the window titlebar, which is also used to enter fullscreen mode. - **Linux / iOS / Android:** Unsupported. ###### Parameters | Parameter | Type | | ------ | ------ | | `maximizable` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setMaximizable(false); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setMaximizable`](/taurify/api/namespacewindow/#setmaximizable) ##### setMaxSize() ```ts setMaxSize(size): Promise ``` Sets the window maximum inner size. If the `size` argument is undefined, the constraint is unset. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `size` | \| `undefined` \| `null` \| [`LogicalSize`](/taurify/api/namespacedpi/#logicalsize) \| [`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize) \| [`Size`](/taurify/api/namespacedpi/#size) | The logical or physical inner size, or `null` to unset the constraint. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow, LogicalSize } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setMaxSize(new LogicalSize(600, 500)); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setMaxSize`](/taurify/api/namespacewindow/#setmaxsize) ##### setMinimizable() ```ts setMinimizable(minimizable): Promise ``` Sets whether the window's native minimize button is enabled or not. #### Platform-specific - **Linux / iOS / Android:** Unsupported. ###### Parameters | Parameter | Type | | ------ | ------ | | `minimizable` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setMinimizable(false); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setMinimizable`](/taurify/api/namespacewindow/#setminimizable) ##### setMinSize() ```ts setMinSize(size): Promise ``` Sets the window minimum inner size. If the `size` argument is not provided, the constraint is unset. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `size` | \| `undefined` \| `null` \| [`LogicalSize`](/taurify/api/namespacedpi/#logicalsize) \| [`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize) \| [`Size`](/taurify/api/namespacedpi/#size) | The logical or physical inner size, or `null` to unset the constraint. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow, PhysicalSize } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setMinSize(new PhysicalSize(600, 500)); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setMinSize`](/taurify/api/namespacewindow/#setminsize) ##### setOverlayIcon() ```ts setOverlayIcon(icon?): Promise ``` Sets the overlay icon. **Windows only** The overlay icon can be set for every window. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `icon`? | \| `string` \| `number`[] \| [`ArrayBuffer`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) \| [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\> \| [`Image`](/taurify/api/namespaceimage/#image) | Icon bytes or path to the icon file. Use `undefined` to remove the overlay icon. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setOverlayIcon("/tauri/awesome.png"); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setOverlayIcon`](/taurify/api/namespacewindow/#setoverlayicon) ##### setPosition() ```ts setPosition(position): Promise ``` Sets the webview position. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `position` | [`LogicalPosition`](/taurify/api/namespacedpi/#logicalposition) \| [`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition) \| [`Position`](/taurify/api/namespacedpi/#position) | The new position, in logical or physical pixels. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrent, LogicalPosition } from '@crabnebula/taurify-api/webview'; await getCurrentWebview().setPosition(new LogicalPosition(600, 500)); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setPosition`](/taurify/api/namespacewindow/#setposition) ##### setProgressBar() ```ts setProgressBar(state): Promise ``` Sets the taskbar progress state. #### Platform-specific - **Linux / macOS**: Progress bar is app-wide and not specific to this window. - **Linux**: Only supported desktop environments with `libunity` (e.g. GNOME). ###### Parameters | Parameter | Type | | ------ | ------ | | `state` | [`ProgressBarState`](/taurify/api/namespacewindow/#progressbarstate) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow, ProgressBarStatus } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setProgressBar({ status: ProgressBarStatus.Normal, progress: 50, }); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setProgressBar`](/taurify/api/namespacewindow/#setprogressbar) ##### setResizable() ```ts setResizable(resizable): Promise ``` Updates the window resizable flag. ###### Parameters | Parameter | Type | | ------ | ------ | | `resizable` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setResizable(false); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setResizable`](/taurify/api/namespacewindow/#setresizable) ##### setShadow() ```ts setShadow(enable): Promise ``` 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 undecorated window have a 1px white border, and on Windows 11, it will have a rounded corners. - **Linux:** Unsupported. ###### Parameters | Parameter | Type | | ------ | ------ | | `enable` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setShadow(false); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setShadow`](/taurify/api/namespacewindow/#setshadow) ##### setSize() ```ts setSize(size): Promise ``` Resizes the webview. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `size` | [`LogicalSize`](/taurify/api/namespacedpi/#logicalsize) \| [`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize) \| [`Size`](/taurify/api/namespacedpi/#size) | The logical or physical size. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrent, LogicalSize } from '@crabnebula/taurify-api/webview'; await getCurrentWebview().setSize(new LogicalSize(600, 500)); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setSize`](/taurify/api/namespacewindow/#setsize) ##### setSizeConstraints() ```ts setSizeConstraints(constraints): Promise ``` Sets the window inner size constraints. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `constraints` | `undefined` \| `null` \| [`WindowSizeConstraints`](/taurify/api/namespacewindow/#windowsizeconstraints) | The logical or physical inner size, or `null` to unset the constraint. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setSizeConstraints({ minWidth: 300 }); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setSizeConstraints`](/taurify/api/namespacewindow/#setsizeconstraints) ##### setSkipTaskbar() ```ts setSkipTaskbar(skip): Promise ``` Whether the window icon should be hidden from the taskbar or not. #### Platform-specific - **macOS:** Unsupported. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `skip` | `boolean` | true to hide window icon, false to show it. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setSkipTaskbar(true); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setSkipTaskbar`](/taurify/api/namespacewindow/#setskiptaskbar) ##### setTheme() ```ts setTheme(theme?): Promise ``` Set window theme, pass in `null` or `undefined` to follow system theme #### Platform-specific - **Linux / macOS**: Theme is app-wide and not specific to this window. - **iOS / Android:** Unsupported. ###### Parameters | Parameter | Type | | ------ | ------ | | `theme`? | `null` \| [`Theme`](/taurify/api/namespacewindow/#theme-2) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setTheme`](/taurify/api/namespacewindow/#settheme) ##### setTitle() ```ts setTitle(title): Promise ``` Sets the window title. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `title` | `string` | The new title | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setTitle('Tauri'); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setTitle`](/taurify/api/namespacewindow/#settitle) ##### setTitleBarStyle() ```ts setTitleBarStyle(style): Promise ``` Sets the title bar style. **macOS only**. ###### Parameters | Parameter | Type | | ------ | ------ | | `style` | [`TitleBarStyle`](/taurify/api/namespacewindow/#titlebarstyle-1) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setTitleBarStyle`](/taurify/api/namespacewindow/#settitlebarstyle) ##### setVisibleOnAllWorkspaces() ```ts setVisibleOnAllWorkspaces(visible): Promise ``` Sets whether the window should be visible on all workspaces or virtual desktops. #### Platform-specific - **Windows / iOS / Android:** Unsupported. ###### Parameters | Parameter | Type | | ------ | ------ | | `visible` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`setVisibleOnAllWorkspaces`](/taurify/api/namespacewindow/#setvisibleonallworkspaces) ##### setZoom() ```ts setZoom(scaleFactor): Promise ``` Set webview zoom level. ###### Parameters | Parameter | Type | | ------ | ------ | | `scaleFactor` | `number` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; await getCurrentWebview().setZoom(1.5); ``` ###### Inherited from [`Webview`](/taurify/api/namespacewebview/#webview).[`setZoom`](/taurify/api/namespacewebview/#setzoom) ##### show() ```ts show(): Promise ``` Show the webview. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; await getCurrentWebview().show(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`show`](/taurify/api/namespacewindow/#show) ##### size() ```ts size(): Promise ``` The physical size of the webview's client area. The client area is the content of the webview, excluding the title bar and borders. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize)\> The webview's size. ###### Example ```typescript import { getCurrentWebview } from '@crabnebula/taurify-api/webview'; const size = await getCurrentWebview().size(); ``` ###### Inherited from [`Webview`](/taurify/api/namespacewebview/#webview).[`size`](/taurify/api/namespacewebview/#size) ##### startDragging() ```ts startDragging(): Promise ``` Starts dragging the window. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().startDragging(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`startDragging`](/taurify/api/namespacewindow/#startdragging) ##### startResizeDragging() ```ts startResizeDragging(direction): Promise ``` Starts resize-dragging the window. ###### Parameters | Parameter | Type | | ------ | ------ | | `direction` | `ResizeDirection` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().startResizeDragging(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`startResizeDragging`](/taurify/api/namespacewindow/#startresizedragging) ##### theme() ```ts theme(): Promise ``` Gets the window's current theme. #### Platform-specific - **macOS:** Theme was introduced on macOS 10.14. Returns `light` on macOS 10.13 and below. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`null` \| [`Theme`](/taurify/api/namespacewindow/#theme-2)\> The window theme. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const theme = await getCurrentWindow().theme(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`theme`](/taurify/api/namespacewindow/#theme) ##### title() ```ts title(): Promise ``` Gets the window's current title. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const title = await getCurrentWindow().title(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`title`](/taurify/api/namespacewindow/#title) ##### toggleMaximize() ```ts toggleMaximize(): Promise ``` Toggles the window maximized state. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().toggleMaximize(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`toggleMaximize`](/taurify/api/namespacewindow/#togglemaximize) ##### unmaximize() ```ts unmaximize(): Promise ``` Unmaximizes the window. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().unmaximize(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`unmaximize`](/taurify/api/namespacewindow/#unmaximize) ##### unminimize() ```ts unminimize(): Promise ``` Unminimizes the window. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().unminimize(); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`unminimize`](/taurify/api/namespacewindow/#unminimize) ##### getAll() ```ts static getAll(): Promise ``` Gets a list of instances of `Webview` for all available webviews. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`WebviewWindow`](/taurify/api/namespacewebviewwindow/#webviewwindow)[]\> ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`getAll`](/taurify/api/namespacewindow/#getall) ##### getByLabel() ```ts static getByLabel(label): Promise ``` Gets the Webview for the webview associated with the given label. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `label` | `string` | The webview label. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`null` \| [`WebviewWindow`](/taurify/api/namespacewebviewwindow/#webviewwindow)\> The Webview instance to communicate with the webview or null if the webview doesn't exist. ###### Example ```typescript import { Webview } from '@crabnebula/taurify-api/webviewWindow'; const mainWebview = Webview.getByLabel('main'); ``` ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`getByLabel`](/taurify/api/namespacewindow/#getbylabel) ##### getCurrent() ```ts static getCurrent(): WebviewWindow ``` Get an instance of `Webview` for the current webview. ###### Returns [`WebviewWindow`](/taurify/api/namespacewebviewwindow/#webviewwindow) ###### Inherited from [`Window`](/taurify/api/namespacewindow/#window).[`getCurrent`](/taurify/api/namespacewindow/#getcurrent) ## Functions ### getAllWebviewWindows() ```ts function getAllWebviewWindows(): Promise ``` Gets a list of instances of `Webview` for all available webview windows. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`WebviewWindow`](/taurify/api/namespacewebviewwindow/#webviewwindow)[]\> *** ### getCurrentWebviewWindow() ```ts function getCurrentWebviewWindow(): WebviewWindow ``` Get an instance of `Webview` for the current webview window. #### Returns [`WebviewWindow`](/taurify/api/namespacewebviewwindow/#webviewwindow) # window Provides APIs to create windows, communicate with other windows and manipulate the current window. #### Window events Events can be listened to using [Window.listen](/taurify/api/namespacewindow/#listen): ```typescript import { getCurrentWindow } from "@crabnebula/taurify-api/window"; getCurrentWindow().listen("my-window-event", ({ event, payload }) => { }); ``` ## References ### LogicalPosition Re-exports [LogicalPosition](/taurify/api/namespacedpi/#logicalposition) ### LogicalSize Re-exports [LogicalSize](/taurify/api/namespacedpi/#logicalsize) ### PhysicalPosition Re-exports [PhysicalPosition](/taurify/api/namespacedpi/#physicalposition) ### PhysicalSize Re-exports [PhysicalSize](/taurify/api/namespacedpi/#physicalsize) ## Enumerations ### BackgroundThrottlingPolicy Background throttling policy #### Enumeration Members ##### Disabled ```ts Disabled: "disabled"; ``` ##### Suspend ```ts Suspend: "suspend"; ``` ##### Throttle ```ts Throttle: "throttle"; ``` *** ### Effect Platform-specific window effects #### Enumeration Members ##### Acrylic ```ts Acrylic: "acrylic"; ``` **Windows 10/11** #### Notes This effect has bad performance when resizing/dragging the window on Windows 10 v1903+ and Windows 11 build 22000. ##### ~~AppearanceBased~~ ```ts AppearanceBased: "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. ##### Blur ```ts Blur: "blur"; ``` **Windows 7/10/11(22H1) Only** #### Notes This effect has bad performance when resizing/dragging the window on Windows 11 build 22621. ##### ContentBackground ```ts ContentBackground: "contentBackground"; ``` **macOS 10.14+** ##### ~~Dark~~ ```ts Dark: "dark"; ``` **macOS 10.14-** ###### Deprecated since macOS 10.14. Use a semantic material instead. ##### FullScreenUI ```ts FullScreenUI: "fullScreenUI"; ``` **macOS 10.14+** ##### HeaderView ```ts HeaderView: "headerView"; ``` **macOS 10.14+** ##### HudWindow ```ts HudWindow: "hudWindow"; ``` **macOS 10.14+** ##### ~~Light~~ ```ts Light: "light"; ``` **macOS 10.14-** ###### Deprecated since macOS 10.14. Use a semantic material instead. ##### ~~MediumLight~~ ```ts MediumLight: "mediumLight"; ``` **macOS 10.14-** ###### Deprecated since macOS 10.14. Use a semantic material instead. ##### Menu ```ts Menu: "menu"; ``` **macOS 10.11+** ##### Mica ```ts Mica: "mica"; ``` **Windows 11 Only** ##### Popover ```ts Popover: "popover"; ``` **macOS 10.11+** ##### Selection ```ts Selection: "selection"; ``` **macOS 10.10+** ##### Sheet ```ts Sheet: "sheet"; ``` **macOS 10.14+** ##### Sidebar ```ts Sidebar: "sidebar"; ``` **macOS 10.11+** ##### Tabbed ```ts Tabbed: "tabbed"; ``` Tabbed effect that matches the system dark perefence **Windows 11 Only** ##### TabbedDark ```ts TabbedDark: "tabbedDark"; ``` Tabbed effect with dark mode but only if dark mode is enabled on the system **Windows 11 Only** ##### TabbedLight ```ts TabbedLight: "tabbedLight"; ``` Tabbed effect with light mode **Windows 11 Only** ##### Titlebar ```ts Titlebar: "titlebar"; ``` **macOS 10.10+** ##### Tooltip ```ts Tooltip: "tooltip"; ``` **macOS 10.14+** ##### ~~UltraDark~~ ```ts UltraDark: "ultraDark"; ``` **macOS 10.14-** ###### Deprecated since macOS 10.14. Use a semantic material instead. ##### UnderPageBackground ```ts UnderPageBackground: "underPageBackground"; ``` **macOS 10.14+** ##### UnderWindowBackground ```ts UnderWindowBackground: "underWindowBackground"; ``` **macOS 10.14+** ##### WindowBackground ```ts WindowBackground: "windowBackground"; ``` **macOS 10.14+** *** ### EffectState Window effect state **macOS only** #### See https://developer.apple.com/documentation/appkit/nsvisualeffectview/state #### Enumeration Members ##### Active ```ts Active: "active"; ``` Make window effect state always active **macOS only** ##### FollowsWindowActiveState ```ts FollowsWindowActiveState: "followsWindowActiveState"; ``` Make window effect state follow the window's active state **macOS only** ##### Inactive ```ts Inactive: "inactive"; ``` Make window effect state always inactive **macOS only** *** ### ProgressBarStatus #### Enumeration Members ##### Error ```ts Error: "error"; ``` Error state. **Treated as Normal on linux** ##### Indeterminate ```ts Indeterminate: "indeterminate"; ``` Indeterminate state. **Treated as Normal on Linux and macOS** ##### None ```ts None: "none"; ``` Hide progress bar. ##### Normal ```ts Normal: "normal"; ``` Normal state. ##### Paused ```ts Paused: "paused"; ``` Paused state. **Treated as Normal on Linux** *** ### UserAttentionType Attention type to request on a window. #### Enumeration Members ##### Critical ```ts Critical: 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. ##### Informational ```ts Informational: 2; ``` #### Platform-specific - **macOS:** Bounces the dock icon once. - **Windows:** Flashes the taskbar button until the application is in focus. ## Classes ### CloseRequestedEvent #### Constructors ##### new CloseRequestedEvent() ```ts new CloseRequestedEvent(event): CloseRequestedEvent ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `event` | [`Event`](/taurify/api/namespaceevent/#eventt)\<`unknown`\> | ###### Returns [`CloseRequestedEvent`](/taurify/api/namespacewindow/#closerequestedevent) #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `event` | [`EventName`](/taurify/api/namespaceevent/#eventname) | Event name | | | `id` | `number` | Event identifier used to unlisten | | #### Methods ##### isPreventDefault() ```ts isPreventDefault(): boolean ``` ###### Returns `boolean` ##### preventDefault() ```ts preventDefault(): void ``` ###### Returns `void` *** ### Window Create new 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 `_`. #### Example ```typescript import { Window } from "@crabnebula/taurify-api/window" const appWindow = new Window('theUniqueLabel'); appWindow.once('tauri://created', function () { // window successfully created }); appWindow.once('tauri://error', function (e) { // an error happened creating the window }); // emit an event to the backend await appWindow.emit("some-event", "data"); // listen to an event from the backend const unlisten = await appWindow.listen("event-name", e => {}); unlisten(); ``` #### Extended by - [`WebviewWindow`](/taurify/api/namespacewebviewwindow/#webviewwindow) #### Constructors ##### new Window() ```ts new Window(label, options): Window ``` Creates a new Window. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `label` | `string` | The unique window label. Must be alphanumeric: `a-zA-Z-/:_`. | | `options` | [`WindowOptions`](/taurify/api/namespacewindow/#windowoptions) | - | ###### Returns [`Window`](/taurify/api/namespacewindow/#window) The [Window](/taurify/api/namespacewindow/#window) instance to communicate with the window. ###### Example ```typescript import { Window } from '@crabnebula/taurify-api/window'; const appWindow = new Window('my-label'); appWindow.once('tauri://created', function () { // window successfully created }); appWindow.once('tauri://error', function (e) { // an error happened creating the window }); ``` #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `label` | `string` | The window label. It is a unique identifier for the window, can be used to reference it later. | | | `listeners` | [`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)\<`string`, [`EventCallback`](/taurify/api/namespaceevent/#eventcallbackt)\<`any`\>[]\> | Local event listeners. | | #### Methods ##### center() ```ts center(): Promise ``` Centers the window. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().center(); ``` ##### clearEffects() ```ts clearEffects(): Promise ``` Clear any applied effects if possible. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### close() ```ts close(): Promise ``` Closes the window. Note this emits a closeRequested event so you can intercept it. To force window close, use [Window.destroy](/taurify/api/namespacewindow/#destroy). ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().close(); ``` ##### destroy() ```ts destroy(): Promise ``` Destroys the window. Behaves like [Window.close](/taurify/api/namespacewindow/#close) but forces the window close instead of emitting a closeRequested event. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().destroy(); ``` ##### emit() ```ts emit(event, payload?): Promise ``` Emits an event to all [targets](/taurify/api/namespaceevent/#eventtarget). ###### Type Parameters | Type Parameter | | ------ | | `T` | ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `event` | `string` | Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. | | `payload`? | `T` | Event payload. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().emit('window-loaded', { loggedIn: true, token: 'authToken' }); ``` ##### emitTo() ```ts emitTo( target, event, payload?): Promise ``` Emits an event to all [targets](/taurify/api/namespaceevent/#eventtarget) matching the given target. ###### Type Parameters | Type Parameter | | ------ | | `T` | ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `target` | `string` \| [`EventTarget`](/taurify/api/namespaceevent/#eventtarget) | Label of the target Window/Webview/WebviewWindow or raw [EventTarget](/taurify/api/namespaceevent/#eventtarget) object. | | `event` | `string` | Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. | | `payload`? | `T` | Event payload. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().emit('main', 'window-loaded', { loggedIn: true, token: 'authToken' }); ``` ##### hide() ```ts hide(): Promise ``` Sets the window visibility to false. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().hide(); ``` ##### innerPosition() ```ts innerPosition(): Promise ``` The position of the top-left hand corner of the window's client area relative to the top-left hand corner of the desktop. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition)\> The window's inner position. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const position = await getCurrentWindow().innerPosition(); ``` ##### innerSize() ```ts innerSize(): Promise ``` The physical size of the window's client area. The client area is the content of the window, excluding the title bar and borders. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize)\> The window's inner size. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const size = await getCurrentWindow().innerSize(); ``` ##### isAlwaysOnTop() ```ts isAlwaysOnTop(): Promise ``` Whether the window is configured to be always on top of other windows or not. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> Whether the window is visible or not. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const alwaysOnTop = await getCurrentWindow().isAlwaysOnTop(); ``` ##### isClosable() ```ts isClosable(): Promise ``` Gets the window's native close button state. #### Platform-specific - **iOS / Android:** Unsupported. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> Whether the window's native close button is enabled or not. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const closable = await getCurrentWindow().isClosable(); ``` ##### isDecorated() ```ts isDecorated(): Promise ``` Gets the window's current decorated state. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> Whether the window is decorated or not. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const decorated = await getCurrentWindow().isDecorated(); ``` ##### isEnabled() ```ts isEnabled(): Promise ``` Whether the window is enabled or disabled. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setEnabled(false); ``` ##### isFocused() ```ts isFocused(): Promise ``` Gets the window's current focus state. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> Whether the window is focused or not. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const focused = await getCurrentWindow().isFocused(); ``` ##### isFullscreen() ```ts isFullscreen(): Promise ``` Gets the window's current fullscreen state. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> Whether the window is in fullscreen mode or not. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const fullscreen = await getCurrentWindow().isFullscreen(); ``` ##### isMaximizable() ```ts isMaximizable(): Promise ``` Gets the window's native maximize button state. #### Platform-specific - **Linux / iOS / Android:** Unsupported. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> Whether the window's native maximize button is enabled or not. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const maximizable = await getCurrentWindow().isMaximizable(); ``` ##### isMaximized() ```ts isMaximized(): Promise ``` Gets the window's current maximized state. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> Whether the window is maximized or not. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const maximized = await getCurrentWindow().isMaximized(); ``` ##### isMinimizable() ```ts isMinimizable(): Promise ``` Gets the window's native minimize button state. #### Platform-specific - **Linux / iOS / Android:** Unsupported. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> Whether the window's native minimize button is enabled or not. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const minimizable = await getCurrentWindow().isMinimizable(); ``` ##### isMinimized() ```ts isMinimized(): Promise ``` Gets the window's current minimized state. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const minimized = await getCurrentWindow().isMinimized(); ``` ##### isResizable() ```ts isResizable(): Promise ``` Gets the window's current resizable state. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> Whether the window is resizable or not. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const resizable = await getCurrentWindow().isResizable(); ``` ##### isVisible() ```ts isVisible(): Promise ``` Gets the window's current visible state. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\> Whether the window is visible or not. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const visible = await getCurrentWindow().isVisible(); ``` ##### listen() ```ts listen(event, handler): Promise ``` Listen to an emitted event on this window. ###### Type Parameters | Type Parameter | | ------ | | `T` | ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `event` | [`EventName`](/taurify/api/namespaceevent/#eventname) | Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. | | `handler` | [`EventCallback`](/taurify/api/namespaceevent/#eventcallbackt)\<`T`\> | Event handler. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#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. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const unlisten = await getCurrentWindow().listen('state-changed', (event) => { console.log(`Got error: ${payload}`); }); // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted unlisten(); ``` ##### maximize() ```ts maximize(): Promise ``` Maximizes the window. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().maximize(); ``` ##### minimize() ```ts minimize(): Promise ``` Minimizes the window. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().minimize(); ``` ##### once() ```ts once(event, handler): Promise ``` Listen to an emitted event on this window only once. ###### Type Parameters | Type Parameter | | ------ | | `T` | ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `event` | [`EventName`](/taurify/api/namespaceevent/#eventname) | Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. | | `handler` | [`EventCallback`](/taurify/api/namespaceevent/#eventcallbackt)\<`T`\> | Event handler. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#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. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const unlisten = await getCurrentWindow().once('initialized', (event) => { console.log(`Window initialized!`); }); // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted unlisten(); ``` ##### onCloseRequested() ```ts onCloseRequested(handler): Promise ``` Listen to window close requested. Emitted when the user requests to closes the window. ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | (`event`) => `void` \| [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#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. ###### Example ```typescript import { getCurrentWindow } from "@crabnebula/taurify-api/window"; import { confirm } from '@crabnebula/taurify-api/dialog'; const unlisten = await getCurrentWindow().onCloseRequested(async (event) => { const confirmed = await confirm('Are you sure?'); if (!confirmed) { // user did not confirm closing the window; let's prevent it event.preventDefault(); } }); // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted unlisten(); ``` ##### onDragDropEvent() ```ts onDragDropEvent(handler): Promise ``` Listen to a file drop event. The listener is triggered when the user hovers the selected files on the webview, drops the files or cancels the operation. ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | [`EventCallback`](/taurify/api/namespaceevent/#eventcallbackt)\<[`DragDropEvent`](/taurify/api/namespacewindow/#dragdropevent)\> | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#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. ###### Example ```typescript import { getCurrentWindow } from "@crabnebula/taurify-api/webview"; const unlisten = await getCurrentWindow().onDragDropEvent((event) => { if (event.payload.type === 'over') { console.log('User hovering', event.payload.position); } else if (event.payload.type === 'drop') { console.log('User dropped', event.payload.paths); } else { console.log('File drop cancelled'); } }); // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted unlisten(); ``` ##### onFocusChanged() ```ts onFocusChanged(handler): Promise ``` Listen to window focus change. ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | [`EventCallback`](/taurify/api/namespaceevent/#eventcallbackt)\<`boolean`\> | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#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. ###### Example ```typescript import { getCurrentWindow } from "@crabnebula/taurify-api/window"; const unlisten = await getCurrentWindow().onFocusChanged(({ payload: focused }) => { console.log('Focus changed, window is focused? ' + focused); }); // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted unlisten(); ``` ##### onMoved() ```ts onMoved(handler): Promise ``` Listen to window move. ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | [`EventCallback`](/taurify/api/namespaceevent/#eventcallbackt)\<[`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition)\> | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#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. ###### Example ```typescript import { getCurrentWindow } from "@crabnebula/taurify-api/window"; const unlisten = await getCurrentWindow().onMoved(({ payload: position }) => { console.log('Window moved', position); }); // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted unlisten(); ``` ##### onResized() ```ts onResized(handler): Promise ``` Listen to window resize. ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | [`EventCallback`](/taurify/api/namespaceevent/#eventcallbackt)\<[`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize)\> | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#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. ###### Example ```typescript import { getCurrentWindow } from "@crabnebula/taurify-api/window"; const unlisten = await getCurrentWindow().onResized(({ payload: size }) => { console.log('Window resized', size); }); // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted unlisten(); ``` ##### onScaleChanged() ```ts onScaleChanged(handler): Promise ``` Listen to window scale change. Emitted when the window's scale factor has changed. The following user actions can cause DPI changes: - Changing the display's resolution. - Changing the display's scale factor (e.g. in Control Panel on Windows). - Moving the window to a display with a different scale factor. ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | [`EventCallback`](/taurify/api/namespaceevent/#eventcallbackt)\<[`ScaleFactorChanged`](/taurify/api/namespacewindow/#scalefactorchanged)\> | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#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. ###### Example ```typescript import { getCurrentWindow } from "@crabnebula/taurify-api/window"; const unlisten = await getCurrentWindow().onScaleChanged(({ payload }) => { console.log('Scale changed', payload.scaleFactor, payload.size); }); // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted unlisten(); ``` ##### onThemeChanged() ```ts onThemeChanged(handler): Promise ``` Listen to the system theme change. ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | [`EventCallback`](/taurify/api/namespaceevent/#eventcallbackt)\<[`Theme`](/taurify/api/namespacewindow/#theme-2)\> | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`UnlistenFn`](/taurify/api/namespaceevent/#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. ###### Example ```typescript import { getCurrentWindow } from "@crabnebula/taurify-api/window"; const unlisten = await getCurrentWindow().onThemeChanged(({ payload: theme }) => { console.log('New theme: ' + theme); }); // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted unlisten(); ``` ##### outerPosition() ```ts outerPosition(): Promise ``` The position of the top-left hand corner of the window relative to the top-left hand corner of the desktop. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition)\> The window's outer position. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const position = await getCurrentWindow().outerPosition(); ``` ##### outerSize() ```ts outerSize(): Promise ``` The physical size of the entire window. These dimensions include the title bar and borders. If you don't want that (and you usually don't), use inner_size instead. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize)\> The window's outer size. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const size = await getCurrentWindow().outerSize(); ``` ##### requestUserAttention() ```ts requestUserAttention(requestType): Promise ``` Requests user attention to the window, this has no effect if the application is already focused. How requesting for user attention manifests is platform dependent, see `UserAttentionType` for details. Providing `null` will unset the request for user attention. Unsetting the request for user attention might not be done automatically by the WM when the window receives input. #### Platform-specific - **macOS:** `null` has no effect. - **Linux:** Urgency levels have the same effect. ###### Parameters | Parameter | Type | | ------ | ------ | | `requestType` | `null` \| [`UserAttentionType`](/taurify/api/namespacewindow/#userattentiontype) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().requestUserAttention(); ``` ##### scaleFactor() ```ts scaleFactor(): Promise ``` The scale factor that can be used to map physical pixels to logical pixels. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`number`\> The window's monitor scale factor. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const factor = await getCurrentWindow().scaleFactor(); ``` ##### setAlwaysOnBottom() ```ts setAlwaysOnBottom(alwaysOnBottom): Promise ``` Whether the window should always be below other windows. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `alwaysOnBottom` | `boolean` | Whether the window should always be below other windows or not. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setAlwaysOnBottom(true); ``` ##### setAlwaysOnTop() ```ts setAlwaysOnTop(alwaysOnTop): Promise ``` Whether the window should always be on top of other windows. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `alwaysOnTop` | `boolean` | Whether the window should always be on top of other windows or not. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setAlwaysOnTop(true); ``` ##### setBackgroundColor() ```ts setBackgroundColor(color): Promise ``` Sets the window background color. #### Platform-specific: - **Windows:** alpha channel is ignored. - **iOS / Android:** Unsupported. ###### Parameters | Parameter | Type | | ------ | ------ | | `color` | [`Color`](/taurify/api/namespacewindow/#color-1) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ##### setBadgeCount() ```ts setBadgeCount(count?): Promise ``` Sets the badge count. It is app wide and not specific to this window. #### Platform-specific - **Windows**: Unsupported. Use @{linkcode Window.setOverlayIcon} instead. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `count`? | `number` | The badge count. Use `undefined` to remove the badge. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setBadgeCount(5); ``` ##### setBadgeLabel() ```ts setBadgeLabel(label?): Promise ``` Sets the badge cont **macOS only**. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `label`? | `string` | The badge label. Use `undefined` to remove the badge. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setBadgeLabel("Hello"); ``` ##### setClosable() ```ts setClosable(closable): Promise ``` Sets whether the window's native close button is enabled or not. #### Platform-specific - **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 - **iOS / Android:** Unsupported. ###### Parameters | Parameter | Type | | ------ | ------ | | `closable` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setClosable(false); ``` ##### setContentProtected() ```ts setContentProtected(protected_): Promise ``` Prevents the window contents from being captured by other apps. ###### Parameters | Parameter | Type | | ------ | ------ | | `protected_` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setContentProtected(true); ``` ##### setCursorGrab() ```ts setCursorGrab(grab): Promise ``` Grabs the cursor, preventing it from leaving the window. There's no guarantee that the cursor will be hidden. You should hide it by yourself if you want so. #### Platform-specific - **Linux:** Unsupported. - **macOS:** This locks the cursor in a fixed location, which looks visually awkward. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `grab` | `boolean` | `true` to grab the cursor icon, `false` to release it. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setCursorGrab(true); ``` ##### setCursorIcon() ```ts setCursorIcon(icon): Promise ``` Modifies the cursor icon of the window. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `icon` | [`CursorIcon`](/taurify/api/namespacewindow/#cursoricon) | The new cursor icon. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setCursorIcon('help'); ``` ##### setCursorPosition() ```ts setCursorPosition(position): Promise ``` Changes the position of the cursor in window coordinates. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `position` | [`LogicalPosition`](/taurify/api/namespacedpi/#logicalposition) \| [`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition) \| [`Position`](/taurify/api/namespacedpi/#position) | The new cursor position. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow, LogicalPosition } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setCursorPosition(new LogicalPosition(600, 300)); ``` ##### setCursorVisible() ```ts setCursorVisible(visible): Promise ``` Modifies the cursor's visibility. #### Platform-specific - **Windows:** The cursor is only hidden within the confines of the window. - **macOS:** The cursor is hidden as long as the window has input focus, even if the cursor is outside of the window. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `visible` | `boolean` | If `false`, this will hide the cursor. If `true`, this will show the cursor. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setCursorVisible(false); ``` ##### setDecorations() ```ts setDecorations(decorations): Promise ``` Whether the window should have borders and bars. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `decorations` | `boolean` | Whether the window should have borders and bars. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setDecorations(false); ``` ##### setEffects() ```ts setEffects(effects): Promise ``` Set window effects. ###### Parameters | Parameter | Type | | ------ | ------ | | `effects` | [`Effects`](/taurify/api/namespacewindow/#effects) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### setEnabled() ```ts setEnabled(enabled): Promise ``` Enable or disable the window. ###### Parameters | Parameter | Type | | ------ | ------ | | `enabled` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setEnabled(false); ``` ##### setFocus() ```ts setFocus(): Promise ``` Bring the window to front and focus. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setFocus(); ``` ##### setFullscreen() ```ts setFullscreen(fullscreen): Promise ``` Sets the window fullscreen state. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `fullscreen` | `boolean` | Whether the window should go to fullscreen or not. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setFullscreen(true); ``` ##### setIcon() ```ts setIcon(icon): Promise ``` Sets the window icon. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `icon` | \| `string` \| `number`[] \| [`ArrayBuffer`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) \| [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\> \| [`Image`](/taurify/api/namespaceimage/#image) | Icon bytes or path to the icon file. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setIcon('/tauri/awesome.png'); ``` ##### setIgnoreCursorEvents() ```ts setIgnoreCursorEvents(ignore): Promise ``` Changes the cursor events behavior. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `ignore` | `boolean` | `true` to ignore the cursor events; `false` to process them as usual. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setIgnoreCursorEvents(true); ``` ##### setMaximizable() ```ts setMaximizable(maximizable): Promise ``` Sets whether the window's native maximize button is enabled or not. If resizable is set to false, this setting is ignored. #### Platform-specific - **macOS:** Disables the "zoom" button in the window titlebar, which is also used to enter fullscreen mode. - **Linux / iOS / Android:** Unsupported. ###### Parameters | Parameter | Type | | ------ | ------ | | `maximizable` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setMaximizable(false); ``` ##### setMaxSize() ```ts setMaxSize(size): Promise ``` Sets the window maximum inner size. If the `size` argument is undefined, the constraint is unset. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `size` | \| `undefined` \| `null` \| [`LogicalSize`](/taurify/api/namespacedpi/#logicalsize) \| [`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize) \| [`Size`](/taurify/api/namespacedpi/#size) | The logical or physical inner size, or `null` to unset the constraint. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow, LogicalSize } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setMaxSize(new LogicalSize(600, 500)); ``` ##### setMinimizable() ```ts setMinimizable(minimizable): Promise ``` Sets whether the window's native minimize button is enabled or not. #### Platform-specific - **Linux / iOS / Android:** Unsupported. ###### Parameters | Parameter | Type | | ------ | ------ | | `minimizable` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setMinimizable(false); ``` ##### setMinSize() ```ts setMinSize(size): Promise ``` Sets the window minimum inner size. If the `size` argument is not provided, the constraint is unset. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `size` | \| `undefined` \| `null` \| [`LogicalSize`](/taurify/api/namespacedpi/#logicalsize) \| [`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize) \| [`Size`](/taurify/api/namespacedpi/#size) | The logical or physical inner size, or `null` to unset the constraint. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow, PhysicalSize } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setMinSize(new PhysicalSize(600, 500)); ``` ##### setOverlayIcon() ```ts setOverlayIcon(icon?): Promise ``` Sets the overlay icon. **Windows only** The overlay icon can be set for every window. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `icon`? | \| `string` \| `number`[] \| [`ArrayBuffer`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) \| [`Uint8Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\<`ArrayBufferLike`\> \| [`Image`](/taurify/api/namespaceimage/#image) | Icon bytes or path to the icon file. Use `undefined` to remove the overlay icon. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setOverlayIcon("/tauri/awesome.png"); ``` ##### setPosition() ```ts setPosition(position): Promise ``` Sets the window outer position. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `position` | [`LogicalPosition`](/taurify/api/namespacedpi/#logicalposition) \| [`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition) \| [`Position`](/taurify/api/namespacedpi/#position) | The new position, in logical or physical pixels. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow, LogicalPosition } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setPosition(new LogicalPosition(600, 500)); ``` ##### setProgressBar() ```ts setProgressBar(state): Promise ``` Sets the taskbar progress state. #### Platform-specific - **Linux / macOS**: Progress bar is app-wide and not specific to this window. - **Linux**: Only supported desktop environments with `libunity` (e.g. GNOME). ###### Parameters | Parameter | Type | | ------ | ------ | | `state` | [`ProgressBarState`](/taurify/api/namespacewindow/#progressbarstate) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow, ProgressBarStatus } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setProgressBar({ status: ProgressBarStatus.Normal, progress: 50, }); ``` ##### setResizable() ```ts setResizable(resizable): Promise ``` Updates the window resizable flag. ###### Parameters | Parameter | Type | | ------ | ------ | | `resizable` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setResizable(false); ``` ##### setShadow() ```ts setShadow(enable): Promise ``` 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 undecorated window have a 1px white border, and on Windows 11, it will have a rounded corners. - **Linux:** Unsupported. ###### Parameters | Parameter | Type | | ------ | ------ | | `enable` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setShadow(false); ``` ##### setSize() ```ts setSize(size): Promise ``` Resizes the window with a new inner size. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `size` | [`LogicalSize`](/taurify/api/namespacedpi/#logicalsize) \| [`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize) \| [`Size`](/taurify/api/namespacedpi/#size) | The logical or physical inner size. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow, LogicalSize } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setSize(new LogicalSize(600, 500)); ``` ##### setSizeConstraints() ```ts setSizeConstraints(constraints): Promise ``` Sets the window inner size constraints. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `constraints` | `undefined` \| `null` \| [`WindowSizeConstraints`](/taurify/api/namespacewindow/#windowsizeconstraints) | The logical or physical inner size, or `null` to unset the constraint. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setSizeConstraints({ minWidth: 300 }); ``` ##### setSkipTaskbar() ```ts setSkipTaskbar(skip): Promise ``` Whether the window icon should be hidden from the taskbar or not. #### Platform-specific - **macOS:** Unsupported. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `skip` | `boolean` | true to hide window icon, false to show it. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setSkipTaskbar(true); ``` ##### setTheme() ```ts setTheme(theme?): Promise ``` Set window theme, pass in `null` or `undefined` to follow system theme #### Platform-specific - **Linux / macOS**: Theme is app-wide and not specific to this window. - **iOS / Android:** Unsupported. ###### Parameters | Parameter | Type | | ------ | ------ | | `theme`? | `null` \| [`Theme`](/taurify/api/namespacewindow/#theme-2) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### setTitle() ```ts setTitle(title): Promise ``` Sets the window title. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `title` | `string` | The new title | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().setTitle('Tauri'); ``` ##### setTitleBarStyle() ```ts setTitleBarStyle(style): Promise ``` Sets the title bar style. **macOS only**. ###### Parameters | Parameter | Type | | ------ | ------ | | `style` | [`TitleBarStyle`](/taurify/api/namespacewindow/#titlebarstyle-1) | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### setVisibleOnAllWorkspaces() ```ts setVisibleOnAllWorkspaces(visible): Promise ``` Sets whether the window should be visible on all workspaces or virtual desktops. #### Platform-specific - **Windows / iOS / Android:** Unsupported. ###### Parameters | Parameter | Type | | ------ | ------ | | `visible` | `boolean` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> ##### show() ```ts show(): Promise ``` Sets the window visibility to true. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().show(); ``` ##### startDragging() ```ts startDragging(): Promise ``` Starts dragging the window. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().startDragging(); ``` ##### startResizeDragging() ```ts startResizeDragging(direction): Promise ``` Starts resize-dragging the window. ###### Parameters | Parameter | Type | | ------ | ------ | | `direction` | `ResizeDirection` | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().startResizeDragging(); ``` ##### theme() ```ts theme(): Promise ``` Gets the window's current theme. #### Platform-specific - **macOS:** Theme was introduced on macOS 10.14. Returns `light` on macOS 10.13 and below. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`null` \| [`Theme`](/taurify/api/namespacewindow/#theme-2)\> The window theme. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const theme = await getCurrentWindow().theme(); ``` ##### title() ```ts title(): Promise ``` Gets the window's current title. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`string`\> ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; const title = await getCurrentWindow().title(); ``` ##### toggleMaximize() ```ts toggleMaximize(): Promise ``` Toggles the window maximized state. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().toggleMaximize(); ``` ##### unmaximize() ```ts unmaximize(): Promise ``` Unmaximizes the window. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().unmaximize(); ``` ##### unminimize() ```ts unminimize(): Promise ``` Unminimizes the window. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\> A promise indicating the success or failure of the operation. ###### Example ```typescript import { getCurrentWindow } from '@crabnebula/taurify-api/window'; await getCurrentWindow().unminimize(); ``` ##### getAll() ```ts static getAll(): Promise ``` Gets a list of instances of `Window` for all available windows. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Window`](/taurify/api/namespacewindow/#window)[]\> ##### getByLabel() ```ts static getByLabel(label): Promise ``` Gets the Window associated with the given label. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `label` | `string` | The window label. | ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`null` \| [`Window`](/taurify/api/namespacewindow/#window)\> The Window instance to communicate with the window or null if the window doesn't exist. ###### Example ```typescript import { Window } from '@crabnebula/taurify-api/window'; const mainWindow = Window.getByLabel('main'); ``` ##### getCurrent() ```ts static getCurrent(): Window ``` Get an instance of `Window` for the current window. ###### Returns [`Window`](/taurify/api/namespacewindow/#window) ##### getFocusedWindow() ```ts static getFocusedWindow(): Promise ``` Gets the focused window. ###### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`null` \| [`Window`](/taurify/api/namespacewindow/#window)\> The Window instance or `undefined` if there is not any focused window. ###### Example ```typescript import { Window } from '@crabnebula/taurify-api/window'; const focusedWindow = Window.getFocusedWindow(); ``` ## Interfaces ### Effects The window effects configuration object #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `color?` | [`Color`](/taurify/api/namespacewindow/#color-1) | Window effect color. Affects [Effect.Blur](/taurify/api/namespacewindow/#blur) and [Effect.Acrylic](/taurify/api/namespacewindow/#acrylic) only on Windows 10 v1903+. Doesn't have any effect on Windows 7 or Windows 11. | | | `effects` | [`Effect`](/taurify/api/namespacewindow/#effect)[] | List of Window effects to apply to the Window. Conflicting effects will apply the first one and ignore the rest. | | | `radius?` | `number` | Window effect corner radius **macOS Only** | | | `state?` | [`EffectState`](/taurify/api/namespacewindow/#effectstate) | Window effect state **macOS Only** | | *** ### Monitor Allows you to retrieve information about a given monitor. #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `name` | `null` \| `string` | Human-readable name of the monitor | | | `position` | [`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition) | the Top-left corner position of the monitor relative to the larger full screen area. | | | `scaleFactor` | `number` | The scale factor that can be used to map physical pixels to logical pixels. | | | `size` | [`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize) | The monitor's resolution. | | | `workArea` | `object` | The monitor's work area. | | | `workArea.position` | [`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition) | - | | | `workArea.size` | [`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize) | - | | *** ### ProgressBarState #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `progress?` | `number` | The progress bar progress. This can be a value ranging from `0` to `100` | | | `status?` | [`ProgressBarStatus`](/taurify/api/namespacewindow/#progressbarstatus) | The progress bar status. | | *** ### ScaleFactorChanged The payload for the `scaleChange` event. #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `scaleFactor` | `number` | The new window scale factor. | | | `size` | [`PhysicalSize`](/taurify/api/namespacedpi/#physicalsize) | The new window size | | *** ### WindowOptions Configuration for the window to create. #### Properties | Property | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `allowLinkPreview?` | `boolean` | on macOS and iOS there is a link preview on long pressing links, this is enabled by default. see https://docs.rs/objc2-web-kit/latest/objc2_web_kit/struct.WKWebView.html#method.allowsLinkPreview | | | `alwaysOnBottom?` | `boolean` | Whether the window should always be below other windows. | | | `alwaysOnTop?` | `boolean` | Whether the window should always be on top of other windows or not. | | | `backgroundColor?` | [`Color`](/taurify/api/namespacewindow/#color-1) | Set the window background color. #### Platform-specific: - **Android / iOS:** Unsupported. - **Windows**: alpha channel is ignored. | | | `backgroundThrottling?` | [`BackgroundThrottlingPolicy`](/taurify/api/namespacewindow/#backgroundthrottlingpolicy) | Change the default background throttling behaviour. ## Platform-specific - **Linux / Windows / Android**: Unsupported. Workarounds like a pending WebLock transaction might suffice. - **iOS**: Supported since version 17.0+. - **macOS**: Supported since version 14.0+. see https://github.com/tauri-apps/tauri/issues/5250#issuecomment-2569380578 | | | `center?` | `boolean` | Show window in the center of the screen.. | | | `closable?` | `boolean` | Whether the window's native close button is enabled or not. Defaults to `true`. | | | `contentProtected?` | `boolean` | Prevents the window contents from being captured by other apps. | | | `decorations?` | `boolean` | Whether the window should have borders and bars or not. | | | `disableInputAccessoryView?` | `boolean` | Allows disabling the input accessory view on iOS. The accessory view is the view that appears above the keyboard when a text input element is focused. It usually displays a view with "Done", "Next" buttons. | | | `focus?` | `boolean` | Whether the window will be initially focused or not. | | | `fullscreen?` | `boolean` | Whether the window is in fullscreen mode or not. | | | `height?` | `number` | The initial height. | | | `hiddenTitle?` | `boolean` | If `true`, sets the window title to be hidden on macOS. | | | `javascriptDisabled?` | `boolean` | Whether we should disable JavaScript code execution on the webview or not. | | | `maxHeight?` | `number` | The maximum height. Only applies if `maxWidth` is also set. | | | `maximizable?` | `boolean` | Whether the window's native maximize button is enabled or not. Defaults to `true`. | | | `maximized?` | `boolean` | Whether the window should be maximized upon creation or not. | | | `maxWidth?` | `number` | The maximum width. Only applies if `maxHeight` is also set. | | | `minHeight?` | `number` | The minimum height. Only applies if `minWidth` is also set. | | | `minimizable?` | `boolean` | Whether the window's native minimize button is enabled or not. Defaults to `true`. | | | `minWidth?` | `number` | The minimum width. Only applies if `minHeight` is also set. | | | `parent?` | `string` \| [`Window`](/taurify/api/namespacewindow/#window) \| [`WebviewWindow`](/taurify/api/namespacewebviewwindow/#webviewwindow) | Sets a parent to the window to be created. Can be either a [`Window`](/taurify/api/namespacewindow/#window) or a label of the window. #### Platform-specific - **Windows**: This sets the passed parent as an owner window to the window to be created. From [MSDN owned windows docs](https://docs.microsoft.com/en-us/windows/win32/winmsg/window-features#owned-windows): - An owned window is always above its owner in the z-order. - The system automatically destroys an owned window when its owner is destroyed. - An owned window is hidden when its owner is minimized. - **Linux**: This makes the new window transient for parent, see - **macOS**: This adds the window as a child of parent, see | | | `preventOverflow?` | `boolean` \| `PreventOverflowMargin` | Prevent the window from overflowing the working area (e.g. monitor size - taskbar size) on creation, which means the window size will be limited to `monitor size - taskbar size` Can either be set to `true` or to a PreventOverflowMargin object to set an additional margin that should be considered to determine the working area (in this case the window size will be limited to `monitor size - taskbar size - margin`) **NOTE**: The overflow check is only performed on window creation, resizes can still overflow #### Platform-specific - **iOS / Android:** Unsupported. | | | `resizable?` | `boolean` | Whether the window is resizable or not. | | | `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 undecorated window have a 1px white border, and on Windows 11, it will have a rounded corners. - **Linux:** Unsupported. | | | `skipTaskbar?` | `boolean` | Whether or not the window icon should be added to the taskbar. | | | `tabbingIdentifier?` | `string` | Defines the window [tabbing identifier](https://developer.apple.com/documentation/appkit/nswindow/1644704-tabbingidentifier) on macOS. Windows with the same tabbing identifier will be grouped together. If the tabbing identifier is not set, automatic tabbing will be disabled. | | | `theme?` | [`Theme`](/taurify/api/namespacewindow/#theme-2) | The initial window theme. Defaults to the system theme. Only implemented on Windows and macOS 10.14+. | | | `title?` | `string` | Window title. | | | `titleBarStyle?` | [`TitleBarStyle`](/taurify/api/namespacewindow/#titlebarstyle-1) | The style of the macOS title bar. | | | `transparent?` | `boolean` | Whether the window is transparent or not. Note that on `macOS` this requires the `macos-private-api` feature flag, enabled under `tauri.conf.json > app > macOSPrivateApi`. WARNING: Using private APIs on `macOS` prevents your application from being accepted to the `App Store`. | | | `visible?` | `boolean` | Whether the window should be immediately visible upon creation or not. | | | `visibleOnAllWorkspaces?` | `boolean` | Whether the window should be visible on all workspaces or virtual desktops. #### Platform-specific - **Windows / iOS / Android:** Unsupported. | | | `width?` | `number` | The initial width. | | | `windowEffects?` | [`Effects`](/taurify/api/namespacewindow/#effects) | 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 | | | `x?` | `number` | The initial vertical position. Only applies if `y` is also set. | | | `y?` | `number` | The initial horizontal position. Only applies if `x` is also set. | | *** ### WindowSizeConstraints #### Properties | Property | Type | Defined in | | ------ | ------ | ------ | | `maxHeight?` | `number` | | | `maxWidth?` | `number` | | | `minHeight?` | `number` | | | `minWidth?` | `number` | | ## Type Aliases ### Color ```ts type Color: [number, number, number] | [number, number, number, number] | object | string; ``` An RGBA color. Each value has minimum of 0 and maximum of 255. It can be either a string `#ffffff`, an array of 3 or 4 elements or an object. *** ### CursorIcon ```ts type 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"; ``` *** ### DragDropEvent ```ts type DragDropEvent: object | object | object | object; ``` The drag and drop event types. *** ### Theme ```ts type Theme: "light" | "dark"; ``` *** ### TitleBarStyle ```ts type TitleBarStyle: "visible" | "transparent" | "overlay"; ``` ## Functions ### availableMonitors() ```ts function availableMonitors(): Promise ``` Returns the list of all the monitors available on the system. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Monitor`](/taurify/api/namespacewindow/#monitor)[]\> #### Example ```typescript import { availableMonitors } from '@crabnebula/taurify-api/window'; const monitors = await availableMonitors(); ``` *** ### currentMonitor() ```ts function currentMonitor(): Promise ``` Returns the monitor on which the window currently resides. Returns `null` if current monitor can't be detected. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Monitor`](/taurify/api/namespacewindow/#monitor) \| `null`\> #### Example ```typescript import { currentMonitor } from '@crabnebula/taurify-api/window'; const monitor = await currentMonitor(); ``` *** ### cursorPosition() ```ts function cursorPosition(): Promise ``` Get the cursor position relative to the top-left hand corner of the desktop. Note that the top-left hand corner of the desktop is not necessarily the same as the screen. If the user uses a desktop with multiple monitors, the top-left hand corner of the desktop is the top-left hand corner of the main monitor on Windows and macOS or the top-left of the leftmost monitor on X11. The coordinates can be negative if the top-left hand corner of the window is outside of the visible screen region. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`PhysicalPosition`](/taurify/api/namespacedpi/#physicalposition)\> *** ### getAllWindows() ```ts function getAllWindows(): Promise ``` Gets a list of instances of `Window` for all available windows. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Window`](/taurify/api/namespacewindow/#window)[]\> *** ### getCurrentWindow() ```ts function getCurrentWindow(): Window ``` Get an instance of `Window` for the current window. #### Returns [`Window`](/taurify/api/namespacewindow/#window) *** ### monitorFromPoint() ```ts function monitorFromPoint(x, y): Promise ``` Returns the monitor that contains the given point. Returns `null` if can't find any. #### Parameters | Parameter | Type | | ------ | ------ | | `x` | `number` | | `y` | `number` | #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Monitor`](/taurify/api/namespacewindow/#monitor) \| `null`\> #### Example ```typescript import { monitorFromPoint } from '@crabnebula/taurify-api/window'; const monitor = await monitorFromPoint(100.0, 200.0); ``` *** ### primaryMonitor() ```ts function primaryMonitor(): Promise ``` Returns the primary monitor of the system. Returns `null` if it can't identify any monitor as a primary one. #### Returns [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Monitor`](/taurify/api/namespacewindow/#monitor) \| `null`\> #### Example ```typescript import { primaryMonitor } from '@crabnebula/taurify-api/window'; const monitor = await primaryMonitor(); ``` # Backend Your Taurify frontend has full access to the [Taurify API]. To extend its functionality and access native operating system interfaces not available in the API, you can run backend code using JavaScript levaraging [Deno]. :::tip Deno is fully compatible with Node.js so you can take advantage of both ecosystems! ::: :::caution Currently Deno is only supported on desktop. See the [tracking issue](https://github.com/denoland/rusty_v8/issues/1640) for more information. ::: ```ts import { runEventLoop } from 'npm:@crabnebula/taurify-api/deno' import { appConfigDir } from 'npm:@crabnebula/taurify-api/path' import { join } from 'node:path' const configDir = await appConfigDir() const path = join(configDir, 'taurify.txt') await Deno.mkdir(configDir, { recursive: true }) await Deno.writeTextFile(path, "Hello World") // poll the Taurify app, waiting for events runEventLoop() ``` ## API The backend can run arbitrary JavaScript code, and Taurify provides primitives to access the [Taurify API] and communicate with your frontend. ### Taurify API The JavaScript backend have full access to the [Taurify API], just like your frontend. This enables you to have consistency between your frontend and backend code while leveraging all features of the Taurify API. For example, you can easily create a tray icon from your backend: ```ts import { runEventLoop } from 'npm:@crabnebula/taurify-api/deno' import { defaultWindowIcon } from 'npm:@crabnebula/taurify-api/app' import { TrayIcon } from 'npm:@crabnebula/taurify-api/tray' import { Menu } from 'npm:@crabnebula/taurify-api/menu' async function createTrayIcon() { await TrayIcon.new({ icon: await defaultWindowIcon(), menu: await Menu.new({ items: [ { text: 'App', action: (e) => { console.log('item clicked', e) } } ] }), action: (e) => { console.log('tray event', e) } }) } await createTrayIcon() runEventLoop() ``` ### Communicating with the Frontend To send messages between frontend and backend you can either use the [event system] or define commands. A command is a backend function that can be called by the frontend: ```ts import { registerCommand, runEventLoop } from 'npm:@crabnebula/taurify-api/deno' type LoginRequest = { user: string, password: string } registerCommand('login' /* command name */, async (args) => { const { user, password } = args; return { status: 200, message: 'authenticated' } }) runEventLoop() ``` To execute the command, use the [`invoke`] API on your frontend: ```ts import { invoke } from '@crabnebula-dev/taurify-api' type LoginResponse = { status: number, message: string } const response = await invoke('login', { user: 'taurify', password: 'taurify-app' }) assert(response.status, 200) ``` [Taurify API]: /taurify/api [Deno]: https://deno.com [event system]: /taurify/api/namespaceevent [invoke]: /taurify/api/namespacecore/#invoke # Command Line Interface import CommandTabs from "@components/CommandTabs.astro"; The Taurify command line interface (CLI) is the way to interact with Taurify server and services. ## List of Commands | Command | Description | | --------------------------------------- | --------------------------------------------------------------------------------- | | [`init`](#init) | Initialize a Taurify application for the Web app in the current working directory | | [`dev`](#dev) | Run your app in development mode | | [`run`](#run) | Run your app in production mode | | [`build`](#build) | Build your app and upload to CrabNebula Cloud | | [`update`](#update) | Distribute a frontend-only update to your app via CrabNebula Cloud | | [`keypair`](#keypair) | Manage Taurify key pairs | | [`keypair generate`](#keypair-generate) | Generate a new keypair | | [`submit`](#submit) | Submit your Android app to Google Play | | [`job`](#job) | Get information of a previous build | ### `init` ``` Initialize a Taurify application for the Web app in the current working directory Usage: taurify init [OPTIONS] Options: --product-name The name of your product -v, --verbose... Enables verbose logging --identifier Canonical identifier, e.g. com.yourcompany.app --project-path Path to your project --org-slug Org slug in the CrabNebula Cloud --app-slug App slug in the CrabNebula Cloud --icon Path to the application icon --platforms [...] Platform support: mac, windows, linux, ios, android, e.g. "mac ios" --package-manager Package manager: npm, yarn, pnpm --password Password for signing key --dev-url URL to load in dev, e.g. https://localhost:3000 -r, --run-before-dev Script to run before starting the app in development mode, e.g. "npm run dev" --run-before-build Script to run before building the app --bootstrap Register your organization in the CrabNebula Cloud [possible values: true, false] -h, --help Print help -V, --version Print version ``` ### `dev` ``` Run your app in development mode Usage: taurify dev [OPTIONS] Options: -c, --config-path path to the taurify.json configuration file. Defaults to /taurify.json -v, --verbose... Enables verbose logging --mobile target mobile instead of desktop -h, --help Print help -V, --version Print version ``` ### `run` ``` Run your app in production mode Usage: taurify run [OPTIONS] Options: -c, --config-path path to the taurify.json configuration file. Defaults to /taurify.json -v, --verbose... Enables verbose logging --mobile target mobile instead of desktop -h, --help Print help -V, --version Print version ``` ### `build` ``` Build your app and upload to CrabNebula Cloud Usage: taurify build [OPTIONS] --cn-api-key Options: -c, --config-path path to the taurify.json configuration file. Defaults to /taurify.json -v, --verbose... Enables verbose logging --mobile target mobile instead of desktop --cn-api-key CrabNebula Cloud API key to upload the artifacts [env: CN_API_KEY] -p, --platforms [...] -h, --help Print help -V, --version Print version ``` ### `update` ``` Distribute a frontend-only update to your app via CrabNebula Cloud Usage: taurify update [OPTIONS] --cn-api-key Options: -c, --config-path path to the taurify.json configuration file. Defaults to /taurify.json -v, --verbose... Enables verbose logging --cn-api-key CrabNebula Cloud API key to upload the artifacts [env: CN_API_KEY] --notes Release notes --notes-file Read release notes from file -h, --help Print help -V, --version Print version ``` ### `keypair` ``` Manage Taurify key pairs Usage: taurify keypair [OPTIONS] Commands: generate Generate a new keypair help Print this message or the help of the given subcommand(s) Options: -v, --verbose... Enables verbose logging -h, --help Print help -V, --version Print version ``` #### `keypair generate` ``` Generate a new keypair Usage: taurify keypair generate [OPTIONS] Options: -c, --config-path path to the taurify.json configuration file. Defaults to /taurify.json -v, --verbose... Enables verbose logging -h, --help Print help -V, --version Print version ``` ### `submit` ``` Submit your Android app to Google Play Usage: taurify submit [OPTIONS] --service-account-key-path --channel Options: -f, --format list of file formats to submit [possible values: apk, aab] -v, --verbose... Enables verbose logging --config-path path to the taurify.json configuration file. Defaults to /taurify.json --service-account-key-path path to the Google Service Account JSON private key used to authenticate --channel Release channel. Maps to a Android tracks. Common names are `alpha`, `beta`, `qa` and `production`. -h, --help Print help (see a summary with '-h') -V, --version Print version ``` ### `job` ``` Get information of a previous build Usage: taurify job [OPTIONS] --cn-api-key Arguments: Build ID Options: --cn-api-key CrabNebula Cloud API key to upload the artifacts [env: CN_API_KEY] -v, --verbose... Enables verbose logging -c, --config-path path to the taurify.json configuration file. Defaults to /taurify.json -h, --help Print help -V, --version Print version ``` # Configuration Taurify configuration. Defines metadata about your application for the installers and the runtime options. **Object Properties**: - android - app (required) - backend - beforeBuildCommand - beforeDevCommand - cloudAppSlug - cloudOrgSlug - copyright - description - devSrc - identifier (required) - iOS - linux - longDescription - macOS - productionSrc - productName (required) - publicKey - version (required) - windows ### android [`AndroidConfig`](#androidconfig) | `null` Configuration for Android. ### app [`AppConfig`](#appconfig) Application configuration. ### backend [`Backend`](#backend) | `null` Backend configuration. ### beforeBuildCommand `string` | `null` A script that is executed before building your app when running `taurify build` or `taurify run`. By default, we use one of "build:taurify" or "build" if it exists in your package.json file. ### beforeDevCommand `string` | `null` A script that is executed before starting your app when running `taurify dev`. By default, we use one of "dev:taurify", "dev", "serve" or "start" if it exists in your package.json file. ### cloudAppSlug `string` | `null` Slug of the CrabNebula Cloud application to create releases containing the build artifacts. ### cloudOrgSlug `string` | `null` Slug of the CrabNebula Cloud organization this app belongs to. ### copyright `string` | `null` Legal copyright. ### description `string` | `null` Application short description. Added to the package installers. ### devSrc [`AppSource`](#appsource) | `null` URL or path to load in development. Automatically inferred for Vite, Webpack, Next.js, create-react-app, esbuild and Parcel. ### identifier `string` App bundle identifier. Usually in reverse domain format like `com.company.appname`. Must be unique across applications. ### iOS [`IosConfig`](#iosconfig) | `null` Configuration for iOS. ### linux [`LinuxConfig`](#linuxconfig) | `null` Configuration for Linux. ### longDescription `string` | `null` Application long description. Added to the package installers. ### macOS [`MacosConfig`](#macosconfig) | `null` Configuration for macOS. ### productionSrc [`AppSource`](#appsource) | `null` URL or path to load in production. Automatically inferred for Vite, Webpack, Next.js, create-react-app, esbuild and Parcel. ### productName `string` Product name. ### publicKey `string` | `null` Public key that is used to verify assets and updates. ### version [`Version`](#version) Application version. ### windows [`WindowsConfig`](#windowsconfig) | `null` Configuration for Windows. ## Definitions ### ActivationPolicy **One of the following**: - `"regular"` Corresponds to NSApplicationActivationPolicyRegular. - `"accessory"` Corresponds to NSApplicationActivationPolicyAccessory. - `"prohibited"` Corresponds to NSApplicationActivationPolicyProhibited. ### AndroidBundle `"apk"` | `"aab"` Android bundles. ### AndroidConfig Android configuration. **Object Properties**: - targets ##### targets [`AndroidTargetConfig`](#androidtargetconfig)[] **Default**: `[]` ### AndroidTargetConfig Android target configuration. **Object Properties**: - bundle (required) ##### bundle [`AndroidBundle`](#androidbundle) ### AppConfig App configuration. **Object Properties**: - activationPolicy - desktopDeepLinks - fileAssociations - icon - menu - mobileDeepLinks - singleInstance - trays - windows ##### activationPolicy [`ActivationPolicy`](#activationpolicy) | `null` macOS activation policy. ##### desktopDeepLinks [`DesktopDeepLink`](#desktopdeeplink)[] | `null` Desktop deep links. ##### fileAssociations [`FileAssociation`](#fileassociation)[] | `null` File associations to register your app as an option to open a list of file extensions. ##### icon `string` | `null` Path to your app icon. Must be either a PNG or a SVG file. ##### menu [`Menu`](#menu) | `null` Application menu. On macOS this is the menu that is populated in the top bar. On Linux and Windows, this is the default window menu unless a specific configured. ##### mobileDeepLinks [`MobileDeepLink`](#mobiledeeplink)[] | `null` Mobile deep links. ##### singleInstance `boolean` Whether the app should prevent multiple instances to be executed at the same time or not. ##### trays [`Tray`](#tray)[] | `null` trays ##### windows [`WindowConfig`](#windowconfig)[] | `null` Definitions for windows that are created when the app is executed. ### AppSource `string` | `string` formatted as `uri` Source of the application. Defines which asset or URL to load. ### Backend **Object Properties**: - entryPoint - flavor (required) - path (required) ##### entryPoint `string` | `null` ##### flavor `"deno"` ##### path `string` ### BackgroundThrottlingPolicy **One of the following**: - `"disabled"` A policy where background throttling is disabled - `"suspend"` A policy where a web view that’s not in a window fully suspends tasks. This is usually the default behavior in case no policy is set. - `"throttle"` A policy where a web view that’s not in a window limits processing, but does not fully suspend tasks. Background throttling policy. ### BundleTypeRole **One of the following**: - `"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 App's role. ### CheckMenuItem A menu item that has a checkbox next to it. **Object Properties**: - accelerator - checked (required) - enabled - id - text (required) ##### accelerator `string` | `null` A shortcut that can be used to trigger this menu such as `Ctrl + Shift + L`. ##### checked `boolean` Whether the checkbox is checked or not. ##### enabled `boolean` | `null` Whether the menu item is enabled or not. ##### id `string` | `null` Item identifier. Can be used to reference this item at runtime. ##### text `string` Text that is displayed on this menu item. ### Color **Any of the following**: - `string` pattern of `^#?([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$` Color hex string, for example: #fff, #ffffff, or #ffffffff. - `integer` formatted as `uint8` | `integer` formatted as `uint8` | `integer` formatted as `uint8`[] maximum of `3` items, minimum of `3` items Array of RGB colors. Each value has minimum of 0 and maximum of 255. - `integer` formatted as `uint8` | `integer` formatted as `uint8` | `integer` formatted as `uint8` | `integer` formatted as `uint8`[] maximum of `4` items, minimum of `4` items Array of RGBA colors. Each value has minimum of 0 and maximum of 255. - Object of red, green, blue, alpha color values. Each value has minimum of 0 and maximum of 255. **Object Properties**: - alpha - blue (required) - green (required) - red (required) ##### alpha `integer` formatted as `uint8` **Default**: `255` ##### blue `integer` formatted as `uint8` ##### green `integer` formatted as `uint8` ##### red `integer` formatted as `uint8` ### DesktopDeepLink Desktop deep link protocol **Object Properties**: - name - role - schemes (required) ##### name `string` | `null` The protocol name. **macOS-only** and maps to `CFBundleTypeName`. Defaults to `<bundle-id>.<schemes[0]>` ##### role [`BundleTypeRole`](#bundletyperole) The app's role for these schemes. **macOS-only** and maps to `CFBundleTypeRole`. **Default**: `"editor"` ##### schemes `string`[] URL schemes to associate with this app without `://`. For example `my-app` ### FileAssociation **Object Properties**: - description - extensions (required) - mimeType - name - role ##### description `string` | `null` The association description. Windows-only. It is displayed on the Type column on Windows Explorer. ##### extensions `string`[] File extensions to associate with this app. e.g. ‘png’ ##### mimeType `string` | `null` The mime-type e.g. ‘image/png’ or ‘text/plain’. Linux-only. ##### name `string` | `null` The name. Maps to CFBundleTypeName on macOS. Defaults to the first extension. ##### role [`BundleTypeRole`](#bundletyperole) The app’s role with respect to the type. Maps to `CFBundleTypeRole` on macOS. Defaults to [`BundleTypeRole::Editor`] **Default**: `"editor"` ### Icon **Any of the following**: - [`NativeIcon`](#nativeicon) Icon that is defined by the operating system. - `string` Icon from image. An icon that can be added to a menu item. ### IconMenuItem A menu item that has an associated icon. **Object Properties**: - accelerator - enabled - icon (required) - id - text (required) ##### accelerator `string` | `null` A shortcut that can be used to trigger this menu such as `Ctrl + Shift + L`. ##### enabled `boolean` | `null` Whether the menu item is enabled or not. ##### icon [`Icon`](#icon) The icon to display. ##### id `string` | `null` Item identifier. Can be used to reference this item at runtime. ##### text `string` Text that is displayed on this menu item. ### InfoPlist **Any of the following**: - **Allows additional properties**: `true` - `string` ### IosBundle `"app-store-connect"` | `"release-testing"` | `"debugging"` iOS target. ### IosConfig iOS configuration. **Object Properties**: - infoPlist - targets ##### infoPlist [`InfoPlist`](#infoplist) | `null` ##### targets [`IosTargetConfig`](#iostargetconfig)[] **Default**: `[]` ### IosTargetConfig iOS target configuration. **Object Properties**: - bundle (required) ##### bundle [`IosBundle`](#iosbundle) ### LinuxBundle `"appimage"` | `"debian"` Linux bundles. ### LinuxConfig Linux configuration. **Object Properties**: - targets ##### targets [`LinuxTargetConfig`](#linuxtargetconfig)[] **Default**: `[]` ### LinuxTargetConfig Linux target configuration. **Object Properties**: - bundle (required) ##### bundle [`LinuxBundle`](#linuxbundle) ### LogicalPosition Position coordinates struct. **Object Properties**: - x (required) - y (required) ##### x `number` formatted as `double` X coordinate. ##### y `number` formatted as `double` Y coordinate. ### MacosArch `"all"` | `"arm64"` | `"x64"` | `"universal"` ### MacosBundle `"dmg"` ### MacosConfig macOS configuration. **Object Properties**: - arch (required) - infoPlist - targets ##### arch [`MacosArch`](#macosarch) ##### infoPlist [`InfoPlist`](#infoplist) | `null` ##### targets [`MacosTargetConfig`](#macostargetconfig)[] **Default**: `[]` ### MacosTargetConfig MacOS target configuration. **Object Properties**: - bundle (required) ##### bundle [`MacosBundle`](#macosbundle) ### Menu Menu that can be attached to an application, window or tray icon. **Object Properties**: - accelerator - checked - enabled - icon - id - items - text ##### accelerator `string` | `null` A shortcut that can be used to trigger this menu such as `Ctrl + Shift + L`. ##### checked `boolean` | `null` Whether it is checked or not. By default, a checkbox is not associated with the menu. ##### enabled `boolean` | `null` Whether it is enabled or not. Defaults to `true`. ##### icon [`Icon`](#icon) | `null` An icon to display in the menu entry. ##### id `string` | `null` Menu identifier. Can be used to reference this menu at runtime. ##### items [`MenuItemKind`](#menuitemkind)[] | `null` List of items that are displayed when this menu is opened. ##### text `string` | `null` Text that is displayed in the menu entry. ### MenuItem **Object Properties**: - accelerator - enabled - id - text (required) ##### accelerator `string` | `null` A shortcut that can be used to trigger this menu such as `Ctrl + Shift + L`. ##### enabled `boolean` | `null` Whether the menu item is enabled or not. ##### id `string` | `null` Item identifier. Can be used to reference this item at runtime. ##### text `string` Text that is displayed on this menu item. ### MenuItemKind **Any of the following**: - [`PredefinedMenuItem`](#predefinedmenuitem) Predefined menu item. - [`CheckMenuItem`](#checkmenuitem) Checked menu item. - [`Submenu`](#submenu) Submenu. - [`IconMenuItem`](#iconmenuitem) Icon menu item. - [`MenuItem`](#menuitem) Regular menu item. Collection of available menu items. ### MobileDeepLink Mobile deep link. **Object Properties**: - host (required) - pathPrefix ##### host `string` ##### pathPrefix `string`[] **Default**: `[]` ### NativeIcon **One of the following**: - `"Add"` An add item template image. - `"Advanced"` Advanced preferences toolbar icon for the preferences window. - `"Bluetooth"` A Bluetooth template image. - `"Bookmarks"` Bookmarks image suitable for a template. - `"Caution"` A caution image. - `"ColorPanel"` A color panel toolbar icon. - `"ColumnView"` A column view mode template image. - `"Computer"` A computer icon. - `"EnterFullScreen"` An enter full-screen mode template image. - `"Everyone"` Permissions for all users. - `"ExitFullScreen"` An exit full-screen mode template image. - `"FlowView"` A cover flow view mode template image. - `"Folder"` A folder image. - `"FolderBurnable"` A burnable folder icon. - `"FolderSmart"` A smart folder icon. - `"FollowLinkFreestanding"` A link template image. - `"FontPanel"` A font panel toolbar icon. - `"GoLeft"` A `go back` template image. - `"GoRight"` A `go forward` template image. - `"Home"` Home image suitable for a template. - `"IChatTheater"` An iChat Theater template image. - `"IconView"` An icon view mode template image. - `"Info"` An information toolbar icon. - `"InvalidDataFreestanding"` A template image used to denote invalid data. - `"LeftFacingTriangle"` A generic left-facing triangle template image. - `"ListView"` A list view mode template image. - `"LockLocked"` A locked padlock template image. - `"LockUnlocked"` An unlocked padlock template image. - `"MenuMixedState"` A horizontal dash, for use in menus. - `"MenuOnState"` A check mark template image, for use in menus. - `"MobileMe"` A MobileMe icon. - `"MultipleDocuments"` A drag image for multiple items. - `"Network"` A network icon. - `"Path"` A path button template image. - `"PreferencesGeneral"` General preferences toolbar icon for the preferences window. - `"QuickLook"` A Quick Look template image. - `"RefreshFreestanding"` A refresh template image. - `"Refresh"` A refresh template image. - `"Remove"` A remove item template image. - `"RevealFreestanding"` A reveal contents template image. - `"RightFacingTriangle"` A generic right-facing triangle template image. - `"Share"` A share view template image. - `"Slideshow"` A slideshow template image. - `"SmartBadge"` A badge for a `smart` item. - `"StatusAvailable"` Small green indicator, similar to iChat's available image. - `"StatusNone"` Small clear indicator. - `"StatusPartiallyAvailable"` Small yellow indicator, similar to iChat's idle image. - `"StatusUnavailable"` Small red indicator, similar to iChat's unavailable image. - `"StopProgressFreestanding"` A stop progress template image. - `"StopProgress"` A stop progress button template image. - `"TrashEmpty"` An image of the empty trash can. - `"TrashFull"` An image of the full trash can. - `"User"` Permissions for a single user. - `"UserAccounts"` User account toolbar icon for the preferences window. - `"UserGroup"` Permissions for a group of users. - `"UserGuest"` Permissions for guests. Icon defined by the operating system. ### Predefined `"Separator"` | `"Copy"` | `"Cut"` | `"Paste"` | `"SelectAll"` | `"Undo"` | `"Redo"` | `"Minimize"` | `"Maximize"` | `"Fullscreen"` | `"Hide"` | `"HideOthers"` | `"ShowAll"` | `"CloseWindow"` | `"Quit"` | `"About"` | `"Services"` Predefined menu item options. ### PredefinedMenuItem A predefined menu item is defined by the operating system. It has a default behavior and text. **Object Properties**: - item (required) - text ##### item [`Predefined`](#predefined) The predefined item. ##### text `string` | `null` Overrides the item text if desired. ### PreventOverflowConfig **Any of the following**: - `boolean` Enable prevent overflow or not - [`PreventOverflowMargin`](#preventoverflowmargin) Enable prevent overflow with a margin so that the window's size + this margin won't overflow the workarea Prevent overflow with a margin ### PreventOverflowMargin Enable prevent overflow with a margin so that the window's size + this margin won't overflow the workarea **Object Properties**: - height (required) - width (required) ##### height `integer` formatted as `uint32` Vertical margin in physical unit ##### width `integer` formatted as `uint32` Horizontal margin in physical unit ### Submenu A submenu is a menu item that opens a list of items when clicked. **Object Properties**: - enabled - id - items (required) - text (required) ##### enabled `boolean` | `null` Whether the menu item is enabled or not. ##### id `string` | `null` Submenu identifier. Can be used to reference this submenu at runtime. ##### items [`MenuItemKind`](#menuitemkind)[] List of items that are displayed when this submenu is opened. ##### text `string` Text that is displayed on this menu item. ### Theme **One of the following**: - `"Light"` Light theme. - `"Dark"` Dark theme. ### TitleBarStyle **One of the following**: - `"Visible"` A normal title bar. - `"Transparent"` Makes the title bar transparent, so the window background color is shown instead. Useful if you don't need to have actual HTML under the title bar. This lets you avoid the caveats of using `TitleBarStyle::Overlay`. Will be more useful when Tauri lets you set a custom window background color. - `"Overlay"` Shows the title bar as a transparent overlay over the window's content. Keep in mind: - The height of the title bar is different on different OS versions, which can lead to window the controls and title not being where you don't expect. - 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 <https://github.com/tauri-apps/tauri/issues/4316>. - The color of the window title depends on the system theme. ### Tray A tray icon that is displayed in the operating system taskbar. **Object Properties**: - icon - iconAsTemplate - id - menu - showMenuOnLeftClick - title - tooltip ##### icon `string` | `null` Path to the icon to display, relative to the dist folder. ##### iconAsTemplate `boolean` | `null` Whether the icon should be a template icon or not. On macOS, a template icon is not colored and follows the system theme. ##### id `string` | `null` Tray icon id. Can be used to reference it at runtime. ##### menu [`Menu`](#menu) | `null` A menu that is shown when the tray icon receives a right click. To also show the menu on left click, enable the `menuOnLeftClick` option. ##### showMenuOnLeftClick `boolean` | `null` Whether the associated menu should be displayed when the icon receives a left click. By default, only a right click opens the menu. ##### title `string` | `null` A title that is added next to the tray icon. ##### tooltip `string` | `null` A label that is displayed when the tray icon is hovered. ### Version `string` pattern of `^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$` ### WebviewUrl **Any of the following**: - `string` formatted as `uri` An external URL. Must use either the `http` or `https` schemes. - `string` The path portion of an app URL. For instance, to load `tauri://localhost/users/john`, you can simply provide `users/john` in this configuration. ### WindowConfig Window configuration. **Object Properties**: - acceptFirstMouse - additionalBrowserArgs - allowLinkPreview - alwaysOnBottom - alwaysOnTop - backgroundColor - backgroundThrottling - center - closable - contentProtected - decorations - disableInputAccessoryView - dragDropEnabled - focus - fullscreen - height - hiddenTitle - incognito - javascriptDisabled - label - maxHeight - maximizable - maximized - maxWidth - menu - minHeight - minimizable - minWidth - parent - persistState - preventOverflow - proxyUrl - resizable - shadow - skipTaskbar - tabbingIdentifier - theme - title - titleBarStyle - trafficLightPosition - transparent - url - userAgent - visible - visibleOnAllWorkspaces - width - x - y - zoomHotkeysEnabled ##### acceptFirstMouse `boolean` | `null` Whether clicking an inactive window also clicks through to the webview on macOS. ##### 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. ##### allowLinkPreview `boolean` on macOS and iOS there is a link preview on long pressing links, this is enabled by default. see https://docs.rs/objc2-web-kit/latest/objc2_web_kit/struct.WKWebView.html#method.allowsLinkPreview **Default**: `true` ##### alwaysOnBottom `boolean` | `null` Whether the window should always be below other windows. ##### alwaysOnTop `boolean` | `null` Whether the window should always be on top of other windows. ##### backgroundColor [`Color`](#color) | `null` Set the window and webview background color. ###### Platform-specific: - **Windows**: alpha channel is ignored for the window layer. - **Windows**: On Windows 7, alpha channel is ignored for the webview layer. - **Windows**: On Windows 8 and newer, if alpha channel is not `0`, it will be ignored for the webview layer. ##### backgroundThrottling [`BackgroundThrottlingPolicy`](#backgroundthrottlingpolicy) | `null` Change the default background throttling behaviour. By default, browsers use a suspend policy that will throttle timers and even unload the whole tab (view) to free resources after roughly 5 minutes when a view became minimized or hidden. This will pause all tasks until the documents visibility state changes back from hidden to visible by bringing the view back to the foreground. ###### Platform-specific - **Linux / Windows / Android**: Unsupported. Workarounds like a pending WebLock transaction might suffice. - **iOS**: Supported since version 17.0+. - **macOS**: Supported since version 14.0+. see https://github.com/tauri-apps/tauri/issues/5250#issuecomment-2569380578 ##### center `boolean` | `null` Whether or not the window starts centered or not. ##### closable `boolean` | `null` Whether the window's native close button is enabled or not. ###### Platform-specific - **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" - **iOS / Android:** Unsupported. ##### contentProtected `boolean` | `null` Prevents the window contents from being captured by other apps. ##### decorations `boolean` | `null` Whether the window should have borders and bars. ##### disableInputAccessoryView `boolean` Allows disabling the input accessory view on iOS. The accessory view is the view that appears above the keyboard when a text input element is focused. It usually displays a view with "Done", "Next" buttons. ##### dragDropEnabled `boolean` | `null` Whether the drag and drop is enabled or not on the webview. By default, it is enabled. Disabling it is required to use HTML5 drag and drop on the frontend on Windows. ##### focus `boolean` | `null` Whether the window will be initially focused or not. ##### fullscreen `boolean` | `null` Whether the window starts as fullscreen or not. ##### height `number` | `null` formatted as `double` The window height. ##### hiddenTitle `boolean` | `null` If `true`, sets the window title to be hidden on macOS. ##### incognito `boolean` | `null` Whether or not the webview should be launched in incognito mode. ###### Platform-specific: - **Android**: Unsupported. ##### javascriptDisabled `boolean` Whether we should disable JavaScript code execution on the webview or not. ##### label `string` Window label. Must be unique. **Default**: `"main"` ##### maxHeight `number` | `null` formatted as `double` The max window height. ##### maximizable `boolean` | `null` Whether the window's native maximize button is enabled or not. If resizable is set to false, this setting is ignored. ###### Platform-specific - **macOS:** Disables the "zoom" button in the window titlebar, which is also used to enter fullscreen mode. - **Linux / iOS / Android:** Unsupported. ##### maximized `boolean` | `null` Whether the window is maximized or not. ##### maxWidth `number` | `null` formatted as `double` The max window width. ##### menu [`Menu`](#menu) | `null` Window menu. Only applied on Windows and Linux. To change the macOS app menu, see the top-level `menu` option. ##### minHeight `number` | `null` formatted as `double` The min window height. ##### minimizable `boolean` | `null` Whether the window's native minimize button is enabled or not. ###### Platform-specific - **Linux / iOS / Android:** Unsupported. ##### minWidth `number` | `null` formatted as `double` The min window width. ##### parent `string` | `null` Sets the window associated with this label to be the parent of the window to be created. ###### Platform-specific - **Windows**: This sets the passed parent as an owner window to the window to be created. From [MSDN owned windows docs](https://docs.microsoft.com/en-us/windows/win32/winmsg/window-features#owned-windows): - An owned window is always above its owner in the z-order. - The system automatically destroys an owned window when its owner is destroyed. - An owned window is hidden when its owner is minimized. - **Linux**: This makes the new window transient for parent, see <https://docs.gtk.org/gtk3/method.Window.set_transient_for.html> - **macOS**: This adds the window as a child of parent, see <https://developer.apple.com/documentation/appkit/nswindow/1419152-addchildwindow?language=objc> ##### persistState [`WindowState`](#windowstate) | `null` Persist the given state of the window when the app is reopened. This is a bitflag string in the form of `size | position | visible | etc` which determine the window state we should restore. Available flags: size, position, maximized, visible, decorations, fullscreen ##### preventOverflow [`PreventOverflowConfig`](#preventoverflowconfig) | `null` Whether or not to prevent the window from overflowing the workarea ###### Platform-specific - **iOS / Android:** Unsupported. ##### proxyUrl `string` | `null` formatted as `uri` The proxy URL for the WebView for all network requests. Must be either a `http://` or a `socks5://` URL. ###### Platform-specific - **macOS**: Requires the `macos-proxy` feature flag and only compiles for macOS 14+. ##### resizable `boolean` | `null` Whether the window is resizable or not. When resizable is set to false, native window's maximize button is automatically disabled. ##### shadow `boolean` | `null` 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. ##### skipTaskbar `boolean` | `null` If `true`, hides the window icon from the taskbar on Windows and Linux. ##### tabbingIdentifier `string` | `null` Defines the window [tabbing identifier] for macOS. Windows with matching tabbing identifiers will be grouped together. If the tabbing identifier is not set, automatic tabbing will be disabled. [tabbing identifier]: https://developer.apple.com/documentation/appkit/nswindow/1644704-tabbingidentifier ##### theme [`Theme`](#theme) | `null` The initial window theme. Defaults to the system theme. Only implemented on Windows and macOS 10.14+. ##### title `string` | `null` The window title. ##### titleBarStyle [`TitleBarStyle`](#titlebarstyle) | `null` The style of the macOS title bar. ##### trafficLightPosition [`LogicalPosition`](#logicalposition) | `null` The position of the window controls on macOS. Requires titleBarStyle: Overlay and decorations: true. ##### transparent `boolean` | `null` Whether the window is transparent or not. Note that on `macOS` this requires the `macos-private-api` feature flag, enabled under `tauri > macOSPrivateApi`. WARNING: Using private APIs on `macOS` prevents your application from being accepted to the `App Store`. ##### url [`WebviewUrl`](#webviewurl) | `null` URL to open. Can be a full remote URL or a subpath of the app URL. ##### userAgent `string` | `null` The user agent for the webview ##### visible `boolean` | `null` Whether the window is visible or not. ##### visibleOnAllWorkspaces `boolean` | `null` Whether the window should be visible on all workspaces or virtual desktops. ###### Platform-specific - **Windows / iOS / Android:** Unsupported. ##### width `number` | `null` formatted as `double` The window width. ##### x `number` | `null` formatted as `double` The horizontal position of the window's top left corner ##### y `number` | `null` formatted as `double` The vertical position of the window's top left corner ##### zoomHotkeysEnabled `boolean` | `null` Whether page zooming by hotkeys is enabled ###### Platform-specific: - **Windows**: Controls WebView2's [`IsZoomControlEnabled`](https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/winrt/microsoft_web_webview2_core/corewebview2settings?view=webview2-winrt-1.0.2420.47#iszoomcontrolenabled) setting. - **MacOS / Linux**: Injects a polyfill that zooms in and out with `ctrl/command` + `-/=`, 20% in each step, ranging from 20% to 1000%. Requires `webview:allow-set-webview-zoom` permission - **Android / iOS**: Unsupported. ### WindowsBundle `"nsis"` Windows bundles. ### WindowsConfig Windows configuration. **Object Properties**: - targets ##### targets [`WindowsTargetConfig`](#windowstargetconfig)[] **Default**: `[]` ### WindowsTargetConfig Windows target configuration. **Object Properties**: - bundle (required) ##### bundle [`WindowsBundle`](#windowsbundle) ### WindowState `string` # Developing import CommandTabs from "@components/CommandTabs.astro"; import { Image } from "astro:assets"; import appStoreLight from "../../../assets/taurify/app-store-light.svg"; import appStoreDark from "../../../assets/taurify/app-store-dark.svg"; import googlePlayLight from "../../../assets/taurify/google-play-light.svg"; import googlePlayDark from "../../../assets/taurify/google-play-dark.svg"; The `taurify` CLI inspects your application project to determine default configuration values for your application dev and build scripts, dev server URL and build dist output path. It automatically supports Vite, Webpack, create-react-app, Parcel and esbuild. If it cannot resolve the configuration automatically, you must configure the [`productionSrc`](/taurify/configuration#productionsrc), [`devSrc`](/taurify/configuration#devsrc), [`beforeDevCommand`](/taurify/configuration#beforedevcommand) and [`beforeBuildCommand`](/taurify/configuration#beforebuildcommand) values. For more information, see the [configuration documentation page](/taurify/configuration). ### Desktop The `taurify dev` starts your development server and instantly opens a window that loads your frontend as a native application. #### Opening the Web Inspector You can open the Web Inspector to debug your application by performing a right-click on the webview and clicking "Inspect" or using the `Ctrl + Shift + I` shortcut on Windows and Linux or `Cmd + Option + I` shortcut on macOS. ### Mobile Taurify lets you run your app directly on physical mobile devices or emulators. Additionally, you can use the Taurify mobile app to develop your app without needing to install any dependencies. :::caution To develop your app for mobile, your development server must listen on the local IP address and your mobile device must be connected on the same network. In order to accomplish this, either use the `host` option in your development server (such as the [Vite `--host` CLI option](https://vite.dev/guide/cli.html#dev-server)) or rely on the `TAURIFY_DEV_HOST` or `TAURI_DEV_HOST` environment variable, which contains the IP address that your development server can use to be reachable by the mobile app. Note that the `TAURIFY_DEV_HOST` and `TAURI_DEV_HOST` environment variables are only available on mobile commands. Example Vite configuration, which also configures HMR to work with the mobile app: ```json title=vite.config.js import { defineConfig } from 'vite' const host = process.env.TAURI_DEV_HOST export default defineConfig({ server: { host: host || false, port: 3001, strictPort: false, hmr: host ? { protocol: 'ws', host, port: 3002 } : undefined } }) ``` ::: #### Running on iOS To run your app on iOS, you must have a Mac with Xcode installed. The `taurify dev --ios` command starts your app on a connected physical iOS device, prompting for a simulator to be selected if none is connected. It is recommended to use the `--open` flag to open the app on Xcode for the initial setup. Xcode guides you through the process of connecting a physical device or creating a new simulator. #### Running on Android To run your app on Android, you must have a device with Android Studio installed. The `taurify dev --android` command starts your app on a connected physical Android device, prompting for an Android emulator to be selected if none is connected. It is recommended to use the `--open` flag to open the app on Android Studio for the initial setup. Android Studio guides you through the process of connecting a physical device or creating a new emulator. #### Taurify Mobile App The `taurify dev --mobile` command can be used to start your app for mobile. It prints a QR code that must be read with the Taurify mobile app so you can develop your application on Android and iOS without worrying about Android Studio or Xcode. Download the Taurify app for iOS or Android to start developing your app for mobile: #### Opening the Web Inspector - iOS Safari must be used to access the Web Inspector for your iOS application. Open the Safari on your Mac machine, choose **Safari > Settings** in the menu bar, click **Advanced**, then select **Show features for web developers**. If you are running on a physical device you must enable **Web Inspector** in **Settings > Safari > Advanced**. After following all steps you should see a **Develop** menu in Safari, where you will find the connected devices and applications to inspect. Select your device or simulator and click on **localhost** to open the Safari Developer Tools window. - Android The inspector is enabled by default for Android emulators, but you must enable it for physical devices. Connect your Android device to the computer, open the **Settings** app in the Android device, select **About**, scroll to Build Number and tap that 7 times. This will enable Developer Mode for your Android device and the **Developer Options** settings. To enable application debugging on your device you must enter the **Developer Options** settings, toggle on the developer options switch and enable **USB Debugging**. :::note Each Android distribution has its own way to enable the Developer Mode, please check your manufacturer's documentation for more information. ::: The Web Inspector for Android is powered by Google Chrome's DevTools and can be accessed by navigating to `chrome://inspect` in the Chrome browser on your computer. Your device or emulator should appear in the remote devices list if your Android application is running, and you can open the developer tools by clicking **inspect** on the entry matching your device. # Setting Up import { CardGrid, LinkCard } from "@astrojs/starlight/components"; Application distribution is done through the [CrabNebula Cloud](/cloud). To trigger a new build for your application, first you need to prepare your configuration and environment variables: 1. Setup Cloud The first step is to sign-in to Cloud in the [website](https://web.crabnebula.cloud/), create an organization and an application and store their slugs in the [`cloudOrgSlug`](/taurify/configuration#cloudorgslug) and [`cloudAppSlug`](/taurify/configuration#cloudappslug) configuration values respectively. 2. API Key A Cloud API key is required for the build server to upload your application installers to a new Cloud release. Create a new API key in the Cloud website and set it to the `CN_API_KEY` environment variable. 3. Updater Signing The desktop application updates are shipped through Cloud via the [Packager Updater](/packager/updater). For security reasons each update bundle is signed with a keypair you must own. Run the `taurify keypair generate` command and safely store the private key and password. The private key and its password must be provided in the `PRIVATE_KEY` and `PRIVATE_KEY_PASSWORD` environment variables, and the public key is stored in the `taurify.json` file. :::caution A keypair is generated when you execute `taurify init`. Running the `taurify keypair generate` command overwrites it and can be used when you need to rotate the key. ::: :::tip To rotate the keypair, generate a new one with `taurify keypair generate` to update the app public key used to verify future updates, but use the previous private key to trigger the next build, so the existing application can verify it as a valid update. ::: 4. App Icon Your application icon can be provided in the [`icon`](/taurify/configuration#icon) configuration option. Taurify automatically generates icons in the appropriate sizes and formats for all platforms. To trigger a new release, run `taurify build`. For platform-specific configuration and code signing, see the following guides. {" "} {" "} {" "} # Android import { Steps } from "@astrojs/starlight/components"; Taurify ships universal APK (Android Application Package) and AAB (Android App Bundle) that are ready to be used in the Play Store. ## Codesign Code signing for Android is mandatory. To generate a new signing key, run `taurify jks generate --alias --validity --output ` and follow the prompts. After creating the key, set the following environment variables: - `ANDROID_KEY_ALIAS`: the key alias, provided in the `--alias` option - `ANDROID_KEY_PASSWORD`: the key password you provided in the command prompt - `ANDROID_KEY`: base64 encoded signing key (.jks file) that can be obtained by running `base64 -i ` ## Distributing to Google Play Taurify do not automatically distribute your application to Google Play as that is a violation of the Google Play Developer API Terms of Service (see [API Usage Instructions](https://developers.google.com/android-publisher/api_usage) for more information). Alternatively, the Taurify CLI provides a command that can download the latest Android App Bundle locally and upload it to Google Play. ```sh taurify submit --channel [alpha | beta | qa | production | ] --format aab --service-account-key-path path/to/service-account-key.json ``` The authentication with Google Play requires a [service account](https://developers.google.com/identity/protocols/oauth2/service-account). You can create a service account from the Google Play Console. 1. In the Google Cloud Console go to [Service Accounts](https://console.cloud.google.com/iam-admin/serviceaccounts). 2. Click **Create project** and follow the steps or select an existing project. You will be redirected to the project page. 3. In the project page click **Create service account** and follow the steps. 4. Click on the newly created service account and select the **Keys** tab. 5. Click **Add Key** and select **Create new key** and follow the steps to create a JSON key. The website will download the service account key which must be used with the Taurify CLI. 6. Go to the [Users & Permissions](https://play.google.com/console/users-and-permissions) page on the Google Play Console. 7. Click **Invite new users**. 8. Put an email address for your service account in the email address field and grant the necessary rights to perform actions. 9. Click **Invite user**. # iOS Taurify produces iOS application archives (.ipa files) that can be uploaded to the App Store or debugging app bundles that can used to test locally on physical devices. ## Codesign Code signing on iOS requires enrolling to the [Apple Developer](https://developer.apple.com/) program, which at the time of writing costs 99$ per year. To sign your iOS app you must provide the certificate and mobile provisioning profile via environment variables: - **IOS_CERTIFICATE**: base64 representation of the certificate exported from the Keychain. - **IOS_CERTIFICATE_PASSWORD**: password of the certificate set when exporting it from the Keychain. - **IOS_MOBILE_PROVISION**: base64 representation of the provisioning profile. The following sections explain how to get these values. ### Signing Certificate After enrolling, navigate to the [Certificates] page to create a new Apple Distribution certificate. Download the new certificate and install it to the macOS Keychain. To export the certificate key, open the "Keychain Access" app, expand the certificate's entry, right-click on the key item and select "Export \" item. Select the path of the exported .p12 file and remember its password. Run the following `base64` command to convert the certificate to base64 and copy it to the clipboard: ``` base64 -i | pbcopy ``` The value in the clipboard is now the base64 representation of the signing certificate. Save it and use it as the `IOS_CERTIFICATE` environment variable value. The certificate password must be set to the `IOS_CERTIFICATE_PASSWORD` variable. :::tip[Choose Certificate Type] You must use an appropriate certificate type for each target: - **debugging**: Apple Development or iOS App Development - **app-store-connect**: Apple Distribution or iOS Distribution (App Store Connect and Ad Hoc) - **release-testing**: Apple Distribution or iOS Distribution (App Store Connect and Ad Hoc) ::: ### Provisioning Profile Additionally, you must provide the provisioning profile for your application. In the [Identifiers](https://developer.apple.com/account/resources/identifiers/list) page, create a new App ID and make sure its "Bundle ID" value matches the identifier set in the [`identifier`] configuration. Navigate to the [Profiles](https://developer.apple.com/account/resources/profiles/list) page to create a new provisioning profile. For App Store distribution, it must be an "App Store Connect" profile. Select the appropriate App ID and link the certificate you previously created. After creating the provisioning profile, download it and run the following `base64` command to convert the profile and copy it to the clipboard: ``` base64 -i | pbcopy ``` The value in the clipboard is now the base64 representation of the provisioning profile. Save it and use it as the `IOS_MOBILE_PROVISION` environment variable value. Now you can build your iOS application and distribute on the App Store! ## Submit to App Store Taurify automatically distributes your application to the App Store using the credentials you provide for code signing. :::note Your application must exist in the [App Store Connect] with a matching bundle identifier. ::: [Certificates]: https://developer.apple.com/account/resources/certificates/list [Apple Developer]: https://developer.apple.com [Apple App Store]: https://www.apple.com/app-store/ [App Store Connect]: https://appstoreconnect.apple.com [App Store Connect's Users and Access page]: https://appstoreconnect.apple.com/access/users [`identifier`]: /taurify/configuration#identifier # Linux Taurify distributes Linux applications as Debian packages and AppImage executables. # macOS macOS installers are distributed in the Apple Disk Image (DMG) format. App updates are distributed as raw macOS app bundles. ## Codesign Code signing on macOS requires enrolling to the [Apple Developer](https://developer.apple.com/) program. :::note If you cannot enroll to the Apple Developer program, Taurify generates a wrapper installer application signed by CrabNebula that you can use to distribute your app **outside** the App Store. When triggering a new build, Taurify will automatically create a new release containing the installer in the `installer` release channel.
To download the installer, use the `https://cdn.crabnebula.app/download///latest/%20Installer.zip?channel=installer` CDN link, replacing ``, `` and `` with the configured values.
This is the link that you must share with your users to download your application. It is recommended to sign your apps instead, as it adds another layer of verification to your users. ::: After enrolling, navigate to the [Certificates](https://developer.apple.com/account/resources/certificates/list) page to create a new Developer ID Application (to share your app outside the App Store) or an Apple Distribution (for App Store distribution) certificate. Download the new certificate and install it to the macOS Keychain. To use the certificate for Taurify builds, you must export the certificate from the keychain: 1. Open the `Keychain Access` app, click the _My Certificates_ tab in the _login_ keychain and find your certificate's entry. 2. Expand the entry, double-click on the key item, and select `Export "$KEYNAME"`. 3. Select the path to save the certificate's `.p12` file and define a password for the exported certificate. 4. Convert the `.p12` file to base64 running the following script on the terminal: ``` openssl base64 -in /path/to/certificate.p12 -out certificate-base64.txt ``` 5. Set the contents of the `certificate-base64.txt` file to the `MACOS_CERTIFICATE` environment variable. 6. Set the certificate password to the `MACOS_CERTIFICATE_PASSWORD` environment variable. ## Notarization To notarize your application, you must provide credentials for Taurify to authenticate with Apple: - `APPLE_API_ISSUER`, `APPLE_API_KEY` and `APPLE_API_KEY_PATH`: authenticate using an App Store Connect API key. Open the App Store Connect's Users and Access page, select the Keys tab, click on the Add button and select a name and the Developer access. The `APPLE_API_ISSUER` (Issuer ID) is presented above the keys table, and the `APPLE_API_KEY` is the value on the Key ID column on that table. You also need to download the private key, which can only be done once and is only visible after a page reload (the button is shown on the table row for the newly created key). The private key file path must be set via the `APPLE_API_KEY_PATH` environment variable. - `APPLE_ID`, `APPLE_PASSWORD` and `APPLE_TEAM_ID`: alternatively, to authenticate with your Apple ID, set the `APPLE_ID` to your Apple account email (example: `export APPLE_ID=tauri@icloud.com`) and the `APPLE_PASSWORD` to an app-specific password for the Apple account. :::note Notarization is required when using a Developer ID Application certificate. ::: # Windows Taurify ships a Windows installer that can be signed. ## Codesign You can sign the Windows executables by providing an Azure Key Vault certificate and credentials. 1. Key Vault In the [Azure Portal](https://portal.azure.com/) navigate to the [Key vaults service](https://portal.azure.com/#browse/Microsoft.KeyVault%2Fvaults) to create a new key vault by clicking the "Create" button. The "Key vault name" must be set to the `AZURE_VAULT_NAME` environment variable. 2. Certificate After creating a key vault, select it and go to the "Objects > Certificates" page to create a new certificate and click the "Generate/Import" button. The "Certificate name" must be set to the `AZURE_CERTIFICATE_NAME` environment variable. 3. Credentials The Taurify server must authenticate with Azure in order to load the certificate. In the Azure portal landing page, go to the "Microsoft Entra ID" service and head to the "Manage > App registrations" page. Click "New registration" to create a new app. After creating the app, you are redirected to the application details page where you can see the "Application (client) ID" and "Directory (tenant) ID" values. Set these IDs to the `AZURE_VAULT_ID` and `AZURE_TENANT_ID` environment variables respectively. In the "Manage > Certificates & secrets" page click the "New client secret" button and set the text in the "Value" column as the `AZURE_CLIENT_SECRET` environment variable. After setting up all the credentials, head back to your key vault's page and navigate to the "Access control (IAM)" page. You must assign the "Key Vault Certificate User" and "Key Vault Crypto User" roles to your newly created application. After setting up all these variables, running `taurify build` will produce signed Windows installers! # Auto-Updater import { Tabs, TabItem } from "@astrojs/starlight/components"; import CommandTabs from "@components/CommandTabs.astro"; Taurify includes support for auto updates by providing APIs for your application to securely update itself by fetching new releases on CrabNebula Cloud, installing updates and restarting itself. ## Signing Keys To securely deliver updates, Taurify signs your application and assets generating a signature that is verified by the updater. To generate a new keypair, use the CLI `keypair generate` command: ```sh frame="none" pnpm taurify keypair generate ``` ```sh frame="none" yarn taurify keypair generate ``` ```sh frame="none" npm exec taurify keypair -- generate ``` ```sh frame="none" bunx taurify keypair generate ``` The command will prompt you for the keypair password. Do not lose that password, you will need to define it as the `PRIVATE_KEY_PASSWORD` environment variable to sign your update packages. After generating the keys, the CLI writes the private key and its password in the `key` file and the public key is written to `taurify.json`. The private key must be defined as the `PRIVATE_KEY` environment variable and must be treated as a secret, DO NOT share it, if it is compromised you will need to replace it immediately. ## Triggering Updates To trigger a new update, you can use either the [`taurify build`](/taurify/cli#build) or the [`taurify update`](/taurify/cli#update) commands. ### taurify build The `build` command triggers a new application builds. Your entire application is updated, meaning you can leverage latest Taurify changes and new APIs. ### taurify update The `update` command triggers a new over-the-air update. It is a faster update mechanism where only your application assets are delivered to your existing users. :::tip To learn more about Taurify distribution, see the [step-by-step guide](/taurify/distribute). ::: ## Installing Updates To configure the updater for your application, install the `@crabnebula/taurify-api` package: Use the `check` API to fetch an update if there is one: ```javascript frame="none" import { check } from "@crabnebula/taurify-api/updater"; import { relaunch } from "@crabnebula/taurify-api/process"; try { const update = await check(); if (update) { console.log("found update", update); let contentLength = 0; let downloaded = 0; await update.downloadAndInstall((event) => { switch (event.event) { case "Started": contentLength = event.data.contentLength; console.log("download started, total bytes:", contentLength); break; case "Progress": downloaded += event.data.chunkLength; console.log( "download progress", Math.round((downloaded / contentLength) * 100) ); break; case "Finished": console.log("download finished"); break; } }); console.log("Installation complete, restarting..."); setTimeout(async () => { // the update can either be an app update, or an over-the-air update if (update.kind === "app") { // for app updates we must restart the app await relaunch(); } else { // for over-the-air updates we can just reload the application window.location.reload(); } }, 2000); } else { // there is no updates } } catch (e) { console.error("failed to update", e); } ``` # Visual Studio Code Extension For extra convenience, we provide an extension for [Visual Studio Code](https://code.visualstudio.com/) or other IDEs supporting the same extension API. ![vscode-taurify in action](https://raw.githubusercontent.com/crabnebula-dev/vscode-taurify/8157e8c40d070eb61b79233eceb492ebbf8b8bd3/vscode-taurify.png) You can find it here: * [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=CrabNebula.vscode-taurify) * [Open VSX Registry](https://open-vsx.org/extension/crabnebula/vscode-taurify) * [GitHub Repo (sources)](https://github.com/crabnebula-dev/vscode-taurify) ## Initialize project To enable Taurify for your project, call `vscode-taurify.init` either by clicking on the Taurify status bar item and selecting "Taurify: initialization" or bringing up the command palette and search for the aforementioned action. This brings up a form in which you can set up the specifics of your project. The upper part is specifically for your project, the lower part lets you set up your organizations and the secret tokens for publishing. ## Running your app You can let Taurify run your app in development and production mode. The extension has two actions for that: * `vscode-taurify.dev` - run in development mode * `vscode-taurify.run` - run in production mode ## Publishing your app Depending on what changed, you can select two modes of updates to publish: * `vscode-taurify.full-update` - publish an update of the full app * `vscode-taurify.frontend-update` - publish an update of only the front-end part The front-end part includes anything that would otherwise run in the browser if your app was used as a web app. ## Issues and Contributions If you have any problems using the extension, please send us an [Issue](https://github.com/crabnebula-dev/vscode-taurify/issues). We also accept [Pull Requests](https://github.com/crabnebula-dev/vscode-taurify/pulls). # Devtools # Overview > DevTools for Tauri is currently in **public preview**, so feel free to report any bugs you find and feature requests you might have! > See the [announcement blog post](https://crabnebula.dev/blog/announcing-devtools) for more details. [CrabNebula DevTools](https://devtools.crabnebula.dev) is a set of easy-to-use, graphical developer utilities purpose-built for [Tauri](https://tauri.app). DevTools is designed to give you a quick, high-level overview of your app and then drill down and inspect areas you might otherwise have no access to. # Get Started import { Tabs, TabItem } from "@astrojs/starlight/components"; DevTools consists of a Rust crate to instrument your Tauri app and a web-based graphical user interface to visualize and explore the data captured by the instrumentation. The CrabNebula DevTools is a different Rust crate depending on which version of Tauri you're at. | Tauri Version | DevTools Crate | crates.io | | ------------- | ----------------------- | ------------------------------------------------------ | | v1 | `devtools` | [docs](https://crates.io/crates/devtools) | | v2 | `tauri-plugin-devtools` | [docs](https://crates.io/crates/tauri-plugin-devtools) | ```sh frame="none" cargo add tauri-plugin-devtools ``` ```sh frame="none" cargo add devtools ``` With the crate added to your dependencies, you can now initialize and register the plugin with Tauri. It is strongly recommended to only enable the DevTools in development builds, not only because it won't be useful to your users but also because it may conflict to any other logging system / tooling your app may have. :::tip[Rust standard macros] A possible setup to disable **CrabNebula DevTools** in production using [Rusts `cfg` macros](https://doc.rust-lang.org/stable/std/macro.cfg.html). ::: In the following snippet we use them to disable the **CrabNebula DevTools** in "non-debug" builds. So except for when you build for production through `tauri build` (prepended by your package manager) or `cargo build --release`. ```rust title="./src-tauri/src/lib.rs" #[cfg_attr(mobile, tauri::mobile_entry_point)] fn run() { #[cfg(debug_assertions)] let builder = tauri::Builder::default().plugin(tauri_plugin_devtools::init()); #[cfg(not(debug_assertions))] let builder = tauri::Builder::default(); builder.run(tauri::generate_context!()) .expect("error while running tauri application"); } ``` ```rust title="./src-tauri/src/main.rs" fn main() { #[cfg(debug_assertions)] let builder = tauri::Builder::default().plugin(devtools::init()); #[cfg(not(debug_assertions))] let builder = tauri::Builder::default(); builder.run(tauri::generate_context!()) .expect("error while running tauri application"); } ``` ## DevTools Premium CrabNebula DevTools Premium is a desktop application that offers extended functionality. ### Installation You can download the desktop application from [here](https://web.crabnebula.cloud/crabnebula/devtools-desktop/releases). It is a packaged Tauri application that can connect to your own Tauri application to instrument it. #### Quick Links ### Usage The CrabNebula DevTools desktop application has 2 modes: 1. **Standalone**: this is a standalone Tauri v2 app. It connects to any app with the the `tauri-plugin-devtools` plugin enabled. 2. **Embedded**: the plugin is embedded as a secondary WebView in your own app. It opens as a dettachable drawer. :::caution[Embedded mode] The Embedded mode requires multiple WebViews in your app. This is currently only supported in Tauri v2. ::: To achieve this, you need to add the `tauri-plugin-devtools-app` crate to your dependencies. ```sh frame="none" cargo add tauri-plugin-devtools tauri-plugin-devtools-app ``` Then you can initialize and register the plugin with Tauri. ```rust title="./src-tauri/src/lib.rs" fn run() { let builder = tauri::Builder::default(); #[cfg(debug_assertions)] let builder = builder.plugin(tauri_plugin_devtools::init()).plugin(tauri_plugin_devtools_app::init()); builder .run(tauri::generate_context!()) .expect("error while running tauri application"); } ``` Once setup is done and your app is running, right-click on the window and select the "Open DevTools" menu. Or use the appropriate keyboard shortcut depending on your operating system: - Linux / Windows: `Ctrl` + `Shift` + `M`. - MacOS: `Cmd` + `Shift` + `M`. # Third-Party Libraries The table below enumerates the third-party libraries that we use to build the CrabNebula DevTools for Tauri. ### GitHub Actions | Library | Version | License | | ------------------------------------------------------ | --------- | ------- | | `actions:EmbarkStudios/cargo-deny-action` | `1.*.*` | `` | | `actions:MarcoIeni/release-plz-action` | `0.5.*` | `` | | `actions:Swatinem/rust-cache` | `2.*.*` | `` | | `actions:actions/checkout` | `4.*.*` | `` | | `actions:actions/setup-go` | `5.*.*` | `` | | `actions:actions/setup-node` | `4.*.*` | `` | | `actions:actions/upload-artifact` | `4.*.*` | `` | | `actions:crabnebula-dev/cloud-release` | `main` | `` | | `actions:crate-ci/typos` | `1.19.0` | `` | | `actions:dtolnay/.github/.github/workflows/pre_ci.yml` | `master` | `` | | `actions:dtolnay/rust-toolchain` | `stable` | `` | | `actions:dtolnay/rust-toolchain` | `master` | `` | | `actions:dtolnay/rust-toolchain` | `nightly` | `` | | `actions:pnpm/action-setup` | `2.*.*` | `` | | `actions:pnpm/action-setup` | `3.*.*` | `` | ### JavaScript | Library | Version | License | | -------------------------------------- | ----------- | ------------------- | | `npm:@kobalte/core` | `^ 0.12.6` | `` | | `npm:@kobalte/tailwindcss` | `^ 0.9.0` | `` | | `npm:@shikijs/transformers` | `^ 1.10.3` | `` | | `npm:@solid-primitives/map` | `^ 0.4.11` | `` | | `npm:@solid-primitives/script-loader` | `^ 2.2.0` | `` | | `npm:@solidjs/router` | `^ 0.12.5` | `` | | `npm:@solidjs/testing-library` | `^ 0.8.8` | `` | | `npm:@tanstack/solid-virtual` | `^ 3.8.3` | `` | | `npm:@tauri-apps/api` | `2.0.0` | `Apache-2.0 OR MIT` | | `npm:@tauri-apps/cli` | `2.0.0` | `Apache-2.0 OR MIT` | | `npm:@testing-library/jest-dom` | `^ 6.4.6` | `` | | `npm:@types/testing-library__jest-dom` | `^ 5.14.9` | `` | | `npm:@typescript-eslint/eslint-plugin` | `^ 6.21.0` | `` | | `npm:@typescript-eslint/parser` | `^ 6.21.0` | `` | | `npm:autoprefixer` | `^ 10.4.19` | `` | | `npm:clsx` | `^ 2.1.1` | `` | | `npm:cross-env` | `^ 7.0.3` | `` | | `npm:csp-header` | `^ 5.2.1` | `` | | `npm:csp_evaluator` | `^ 1.1.1` | `` | | `npm:eslint` | `^ 8.57.0` | `` | | `npm:eslint-config-prettier` | `^ 9.1.0` | `` | | `npm:eslint-plugin-solid` | `^ 0.13.2` | `` | | `npm:husky` | `^ 9.0.11` | `` | | `npm:jsdom` | `^ 24.1.0` | `` | | `npm:json-schema-library` | `^ 9.3.5` | `` | | `npm:lint-staged` | `^ 15.2.7` | `` | | `npm:postcss` | `^ 8.4.39` | `` | | `npm:prettier` | `^ 3.3.2` | `` | | `npm:shiki` | `^ 1.10.3` | `` | | `npm:solid-js` | `^ 1.8.18` | `` | | `npm:solid-markdown` | `^ 1.2.2` | `` | | `npm:split.js` | `^ 1.6.5` | `` | | `npm:tailwind-scrollbar` | `^ 3.1.0` | `` | | `npm:tailwindcss` | `^ 3.4.4` | `` | | `npm:typescript` | `^ 5.5.3` | `` | | `npm:vite` | `^ 5.3.3` | `` | | `npm:vite-plugin-solid` | `^ 2.10.2` | `` | | `npm:vitest` | `^ 1.6.0` | `` | | `npm:zod` | `^ 3.23.8` | `` | ### JavaScript | Library | Version | License | | ----------------------------------- | ------------------------------- | ------------------------------------------------------- | | `rust:addr2line` | `0.24.1` | `Apache-2.0 OR MIT` | | `rust:addr2line` | `0.22.0` | `Apache-2.0 OR MIT` | | `rust:adler` | `1.0.2` | `0BSD AND Apache-2.0 AND MIT` | | `rust:adler2` | `2.0.0` | `0BSD OR (MIT OR Apache-2.0)` | | `rust:aes` | `0.8.4` | `MIT OR Apache-2.0` | | `rust:ahash` | `0.7.8` | `MIT OR Apache-2.0` | | `rust:aho-corasick` | `1.1.3` | `Unlicense OR MIT` | | `rust:alloc-no-stdlib` | `2.0.4` | `BSD-3-Clause` | | `rust:alloc-stdlib` | `0.2.2` | `BSD-3-Clause` | | `rust:android-tzdata` | `0.1.1` | `MIT OR Apache-2.0` | | `rust:android_log-sys` | `0.3.1` | `MIT OR Apache-2.0` | | `rust:android_logger` | `0.14.1` | `MIT OR Apache-2.0` | | `rust:android_system_properties` | `0.1.5` | `MIT OR Apache-2.0` | | `rust:anyhow` | `1.0.86` | `MIT OR Apache-2.0` | | `rust:anyhow` | `1.0.89` | `MIT OR Apache-2.0` | | `rust:arbitrary` | `1.3.2` | `MIT OR Apache-2.0` | | `rust:arrayvec` | `0.7.6` | `MIT OR Apache-2.0` | | `rust:ascii` | `1.1.0` | `Apache-2.0 OR MIT` | | `rust:async-broadcast` | `0.5.1` | `MIT OR Apache-2.0` | | `rust:async-channel` | `2.3.1` | `Apache-2.0 OR MIT` | | `rust:async-executor` | `1.13.1` | `Apache-2.0 OR MIT` | | `rust:async-fs` | `1.6.0` | `Apache-2.0 OR MIT` | | `rust:async-io` | `1.13.0` | `Apache-2.0 OR MIT` | | `rust:async-io` | `2.3.4` | `Apache-2.0 OR MIT` | | `rust:async-lock` | `2.8.0` | `Apache-2.0 OR MIT` | | `rust:async-lock` | `3.4.0` | `Apache-2.0 OR MIT` | | `rust:async-process` | `1.8.1` | `Apache-2.0 OR MIT` | | `rust:async-recursion` | `1.1.1` | `MIT OR Apache-2.0` | | `rust:async-signal` | `0.2.10` | `Apache-2.0 OR MIT` | | `rust:async-stream` | `0.3.6` | `MIT` | | `rust:async-stream` | `>= 0.3.5,< 0.4.0` | `` | | `rust:async-stream` | `0.3.5` | `MIT` | | `rust:async-stream-impl` | `0.3.5` | `MIT` | | `rust:async-stream-impl` | `0.3.6` | `MIT` | | `rust:async-task` | `4.7.1` | `Apache-2.0 OR MIT` | | `rust:async-trait` | `0.1.83` | `MIT OR Apache-2.0` | | `rust:async-trait` | `0.1.80` | `MIT OR Apache-2.0` | | `rust:atk` | `0.15.1` | `MIT` | | `rust:atk` | `0.18.0` | `MIT` | | `rust:atk-sys` | `0.15.1` | `MIT` | | `rust:atk-sys` | `0.18.0` | `MIT` | | `rust:atomic-waker` | `1.1.2` | `Apache-2.0 OR MIT` | | `rust:autocfg` | `1.4.0` | `Apache-2.0 OR MIT` | | `rust:autocfg` | `1.3.0` | `Apache-2.0 OR MIT` | | `rust:axum` | `0.6.20` | `MIT` | | `rust:axum-core` | `0.3.4` | `MIT` | | `rust:backtrace` | `0.3.74` | `MIT OR Apache-2.0` | | `rust:backtrace` | `0.3.73` | `MIT OR Apache-2.0` | | `rust:base16ct` | `0.2.0` | `Apache-2.0 OR MIT` | | `rust:base64` | `0.21.7` | `MIT OR Apache-2.0` | | `rust:base64` | `0.22.1` | `MIT OR Apache-2.0` | | `rust:base64` | `0.13.1` | `MIT OR Apache-2.0` | | `rust:base64ct` | `1.6.0` | `Apache-2.0 OR MIT` | | `rust:bitflags` | `2.6.0` | `MIT OR Apache-2.0` | | `rust:bitflags` | `>= 2.6.0,< 3.0.0` | `` | | `rust:bitflags` | `1.3.2` | `MIT OR Apache-2.0` | | `rust:bitvec` | `1.0.1` | `MIT` | | `rust:block` | `0.1.6` | `MIT` | | `rust:block-buffer` | `0.10.4` | `MIT OR Apache-2.0` | | `rust:block-padding` | `0.3.3` | `MIT OR Apache-2.0` | | `rust:block2` | `0.5.1` | `MIT` | | `rust:blocking` | `1.6.1` | `Apache-2.0 OR MIT` | | `rust:borsh` | `1.3.0` | `MIT OR Apache-2.0` | | `rust:borsh-derive` | `1.3.0` | `Apache-2.0` | | `rust:brotli` | `6.0.0` | `BSD-3-Clause OR MIT` | | `rust:brotli` | `3.5.0` | `BSD-3-Clause OR MIT` | | `rust:brotli-decompressor` | `2.5.1` | `BSD-3-Clause OR MIT` | | `rust:brotli-decompressor` | `4.0.1` | `BSD-3-Clause OR MIT` | | `rust:bstr` | `1.9.1` | `MIT OR Apache-2.0` | | `rust:bumpalo` | `3.16.0` | `MIT OR Apache-2.0` | | `rust:byte-unit` | `5.1.4` | `MIT` | | `rust:bytecheck` | `0.6.12` | `MIT` | | `rust:bytecheck_derive` | `0.6.12` | `MIT` | | `rust:bytemuck` | `1.18.0` | `Zlib OR (Apache-2.0 OR MIT)` | | `rust:bytemuck` | `1.16.1` | `Zlib OR (Apache-2.0 OR MIT)` | | `rust:byteorder` | `1.5.0` | `Unlicense OR MIT` | | `rust:bytes` | `>= 1.7.1,< 2.0.0` | `` | | `rust:bytes` | `1.6.0` | `MIT` | | `rust:bytes` | `1.7.2` | `MIT` | | `rust:cairo-rs` | `0.18.5` | `MIT` | | `rust:cairo-rs` | `0.15.12` | `MIT` | | `rust:cairo-sys-rs` | `0.15.1` | `MIT` | | `rust:cairo-sys-rs` | `0.18.2` | `MIT` | | `rust:camino` | `1.1.9` | `MIT OR Apache-2.0` | | `rust:cargo-platform` | `0.1.8` | `MIT OR Apache-2.0` | | `rust:cargo_metadata` | `0.18.1` | `MIT` | | `rust:cargo_toml` | `0.15.3` | `Apache-2.0 OR MIT` | | `rust:cargo_toml` | `0.17.2` | `Apache-2.0 OR MIT` | | `rust:cbc` | `0.1.2` | `MIT OR Apache-2.0` | | `rust:cc` | `1.1.0` | `MIT OR Apache-2.0` | | `rust:cc` | `1.1.24` | `MIT OR Apache-2.0` | | `rust:cesu8` | `1.1.0` | `Apache-2.0 OR MIT` | | `rust:cfb` | `0.7.3` | `MIT` | | `rust:cfg-expr` | `0.9.1` | `MIT OR Apache-2.0` | | `rust:cfg-expr` | `0.15.8` | `MIT OR Apache-2.0` | | `rust:cfg-if` | `1.0.0` | `Apache-2.0 OR MIT` | | `rust:cfg_aliases` | `0.1.1` | `MIT` | | `rust:cfg_aliases` | `0.2.1` | `MIT` | | `rust:chrono` | `0.4.38` | `MIT OR Apache-2.0` | | `rust:chunked_transfer` | `1.5.0` | `MIT OR Apache-2.0` | | `rust:cipher` | `0.4.4` | `MIT OR Apache-2.0` | | `rust:cocoa` | `0.26.0` | `MIT OR Apache-2.0` | | `rust:cocoa` | `>= 0.26.0,< 0.27.0` | `` | | `rust:cocoa` | `0.24.1` | `MIT OR Apache-2.0` | | `rust:cocoa-foundation` | `0.2.0` | `MIT OR Apache-2.0` | | `rust:cocoa-foundation` | `0.1.2` | `MIT OR Apache-2.0` | | `rust:color_quant` | `1.1.0` | `MIT` | | `rust:colored` | `>= 2.1.0,< 3.0.0` | `` | | `rust:colored` | `2.1.0` | `MPL-2.0` | | `rust:combine` | `4.6.7` | `MIT` | | `rust:concurrent-queue` | `2.5.0` | `Apache-2.0 OR MIT` | | `rust:const-oid` | `0.9.6` | `Apache-2.0 OR MIT` | | `rust:const-random` | `0.1.18` | `MIT OR Apache-2.0` | | `rust:const-random-macro` | `0.1.16` | `MIT OR Apache-2.0` | | `rust:convert_case` | `0.4.0` | `MIT` | | `rust:core-foundation` | `0.10.0` | `MIT OR Apache-2.0` | | `rust:core-foundation` | `0.9.4` | `MIT OR Apache-2.0` | | `rust:core-foundation-sys` | `0.8.6` | `MIT OR Apache-2.0` | | `rust:core-foundation-sys` | `0.8.7` | `MIT OR Apache-2.0` | | `rust:core-graphics` | `0.22.3` | `MIT OR Apache-2.0` | | `rust:core-graphics` | `0.24.0` | `MIT OR Apache-2.0` | | `rust:core-graphics-types` | `0.2.0` | `MIT OR Apache-2.0` | | `rust:core-graphics-types` | `0.1.3` | `MIT OR Apache-2.0` | | `rust:cpufeatures` | `0.2.14` | `MIT OR Apache-2.0` | | `rust:cpufeatures` | `0.2.12` | `MIT OR Apache-2.0` | | `rust:crc32fast` | `1.4.2` | `MIT OR Apache-2.0` | | `rust:crossbeam-channel` | `0.5.13` | `MIT OR Apache-2.0` | | `rust:crossbeam-deque` | `0.8.5` | `MIT OR Apache-2.0` | | `rust:crossbeam-epoch` | `0.9.18` | `MIT OR Apache-2.0` | | `rust:crossbeam-utils` | `0.8.20` | `MIT OR Apache-2.0` | | `rust:crunchy` | `0.2.2` | `MIT` | | `rust:crypto-bigint` | `0.5.5` | `Apache-2.0 OR MIT` | | `rust:crypto-common` | `0.1.6` | `MIT OR Apache-2.0` | | `rust:cssparser` | `0.27.2` | `MPL-2.0` | | `rust:cssparser-macros` | `0.6.1` | `MPL-2.0` | | `rust:ctor` | `0.2.8` | `Apache-2.0 OR MIT` | | `rust:curve25519-dalek` | `4.1.3` | `BSD-3-Clause` | | `rust:curve25519-dalek-derive` | `0.1.1` | `MIT OR Apache-2.0` | | `rust:darling` | `0.20.10` | `MIT` | | `rust:darling_core` | `0.20.10` | `MIT` | | `rust:darling_macro` | `0.20.10` | `MIT` | | `rust:der` | `0.7.9` | `Apache-2.0 OR MIT` | | `rust:deranged` | `0.3.11` | `MIT OR Apache-2.0` | | `rust:derivative` | `2.2.0` | `Apache-2.0 AND MIT` | | `rust:derive_arbitrary` | `1.3.2` | `MIT OR Apache-2.0` | | `rust:derive_more` | `0.99.18` | `MIT` | | `rust:devtools-core` | `>= 0.3.5,< 0.4.0` | `` | | `rust:devtools-wire-format` | `>= 0.5.2,< 0.6.0` | `` | | `rust:digest` | `0.10.7` | `MIT OR Apache-2.0` | | `rust:dirs` | `5.0.1` | `MIT OR Apache-2.0` | | `rust:dirs-next` | `2.0.0` | `MIT OR Apache-2.0` | | `rust:dirs-sys` | `0.4.1` | `MIT OR Apache-2.0` | | `rust:dirs-sys-next` | `0.1.2` | `MIT OR Apache-2.0` | | `rust:dispatch` | `0.2.0` | `MIT` | | `rust:displaydoc` | `0.2.5` | `MIT OR Apache-2.0` | | `rust:dlopen2` | `0.7.0` | `MIT` | | `rust:dlopen2_derive` | `0.4.0` | `MIT` | | `rust:dlv-list` | `0.5.2` | `MIT OR Apache-2.0` | | `rust:doctest-file` | `1.0.0` | `0BSD` | | `rust:dpi` | `0.1.1` | `Apache-2.0` | | `rust:dtoa` | `1.0.9` | `MIT OR Apache-2.0` | | `rust:dtoa-short` | `0.3.5` | `MPL-2.0` | | `rust:dunce` | `1.0.5` | `CC0-1.0 OR (MIT-0 OR Apache-2.0)` | | `rust:dunce` | `1.0.4` | `CC0-1.0 OR (MIT-0 OR Apache-2.0)` | | `rust:dyn-clone` | `1.0.17` | `MIT OR Apache-2.0` | | `rust:ecdsa` | `0.16.9` | `Apache-2.0 OR MIT` | | `rust:ed25519` | `2.2.3` | `Apache-2.0 OR MIT` | | `rust:ed25519-dalek` | `2.1.1` | `BSD-3-Clause` | | `rust:either` | `1.13.0` | `MIT OR Apache-2.0` | | `rust:either` | `1.12.0` | `MIT OR Apache-2.0` | | `rust:elliptic-curve` | `0.13.8` | `Apache-2.0 OR MIT` | | `rust:embed-resource` | `2.5.0` | `MIT` | | `rust:embed-resource` | `2.4.2` | `MIT` | | `rust:embed_plist` | `1.2.2` | `MIT OR Apache-2.0` | | `rust:encoding_rs` | `0.8.34` | `(Apache-2.0 OR MIT) AND BSD-3-Clause` | | `rust:enumflags2` | `0.7.10` | `MIT OR Apache-2.0` | | `rust:enumflags2_derive` | `0.7.10` | `MIT OR Apache-2.0` | | `rust:env_filter` | `0.1.2` | `MIT OR Apache-2.0` | | `rust:equivalent` | `1.0.1` | `Apache-2.0 OR MIT` | | `rust:erased-serde` | `0.4.5` | `MIT OR Apache-2.0` | | `rust:errno` | `0.3.9` | `MIT OR Apache-2.0` | | `rust:event-listener` | `3.1.0` | `Apache-2.0 OR MIT` | | `rust:event-listener` | `5.3.1` | `Apache-2.0 OR MIT` | | `rust:event-listener` | `2.5.3` | `Apache-2.0 OR MIT` | | `rust:event-listener-strategy` | `0.5.2` | `Apache-2.0 OR MIT` | | `rust:fastrand` | `2.1.0` | `Apache-2.0 OR MIT` | | `rust:fastrand` | `2.1.1` | `Apache-2.0 OR MIT` | | `rust:fastrand` | `1.9.0` | `Apache-2.0 OR MIT` | | `rust:fdeflate` | `0.3.4` | `MIT OR Apache-2.0` | | `rust:fdeflate` | `0.3.5` | `MIT OR Apache-2.0` | | `rust:fern` | `0.6.2` | `MIT` | | `rust:ff` | `0.13.0` | `MIT OR Apache-2.0` | | `rust:fiat-crypto` | `0.2.9` | `MIT OR Apache-2.0 OR BSD-1-Clause` | | `rust:field-offset` | `0.3.6` | `MIT OR Apache-2.0` | | `rust:filetime` | `0.2.25` | `MIT OR Apache-2.0` | | `rust:filetime` | `0.2.23` | `MIT OR Apache-2.0` | | `rust:fixedbitset` | `0.4.2` | `MIT OR Apache-2.0` | | `rust:flate2` | `1.0.30` | `MIT OR Apache-2.0` | | `rust:flate2` | `1.0.34` | `MIT OR Apache-2.0` | | `rust:fluent-uri` | `0.1.4` | `MIT` | | `rust:fnv` | `1.0.7` | `Apache-2.0 AND MIT` | | `rust:foreign-types` | `0.5.0` | `Apache-2.0 AND MIT` | | `rust:foreign-types` | `0.3.2` | `MIT OR Apache-2.0` | | `rust:foreign-types-macros` | `0.2.3` | `MIT OR Apache-2.0` | | `rust:foreign-types-shared` | `0.1.1` | `MIT OR Apache-2.0` | | `rust:foreign-types-shared` | `0.3.1` | `MIT OR Apache-2.0` | | `rust:form_urlencoded` | `1.2.1` | `MIT OR Apache-2.0` | | `rust:funty` | `2.0.0` | `MIT` | | `rust:futf` | `0.1.5` | `MIT OR Apache-2.0` | | `rust:futures` | `>= 0.3.30,< 0.4.0` | `` | | `rust:futures` | `0.3.30` | `MIT OR Apache-2.0` | | `rust:futures-channel` | `0.3.30` | `MIT OR Apache-2.0` | | `rust:futures-core` | `0.3.30` | `MIT OR Apache-2.0` | | `rust:futures-executor` | `0.3.30` | `MIT OR Apache-2.0` | | `rust:futures-io` | `0.3.30` | `MIT OR Apache-2.0` | | `rust:futures-lite` | `2.3.0` | `Apache-2.0 OR MIT` | | `rust:futures-lite` | `1.13.0` | `Apache-2.0 OR MIT` | | `rust:futures-macro` | `0.3.30` | `MIT OR Apache-2.0` | | `rust:futures-sink` | `0.3.30` | `MIT OR Apache-2.0` | | `rust:futures-task` | `0.3.30` | `MIT OR Apache-2.0` | | `rust:futures-util` | `0.3.30` | `MIT OR Apache-2.0` | | `rust:fxhash` | `0.2.1` | `Apache-2.0 OR MIT` | | `rust:gdk` | `0.15.4` | `MIT` | | `rust:gdk` | `0.18.0` | `MIT` | | `rust:gdk-pixbuf` | `0.18.5` | `MIT` | | `rust:gdk-pixbuf` | `0.15.11` | `MIT` | | `rust:gdk-pixbuf-sys` | `0.15.10` | `MIT` | | `rust:gdk-pixbuf-sys` | `0.18.0` | `MIT` | | `rust:gdk-sys` | `0.18.0` | `MIT` | | `rust:gdk-sys` | `0.15.1` | `MIT` | | `rust:gdkwayland-sys` | `0.18.0` | `MIT` | | `rust:gdkwayland-sys` | `0.15.3` | `MIT` | | `rust:gdkx11` | `0.18.0` | `MIT` | | `rust:gdkx11-sys` | `0.18.0` | `MIT` | | `rust:gdkx11-sys` | `0.15.1` | `MIT` | | `rust:generator` | `0.7.5` | `MIT OR Apache-2.0` | | `rust:generic-array` | `0.14.7` | `MIT` | | `rust:getrandom` | `0.2.15` | `MIT OR Apache-2.0` | | `rust:getrandom` | `0.1.16` | `MIT OR Apache-2.0` | | `rust:gimli` | `0.29.0` | `MIT OR Apache-2.0` | | `rust:gimli` | `0.31.0` | `MIT OR Apache-2.0` | | `rust:gio` | `0.18.4` | `MIT` | | `rust:gio` | `0.15.12` | `MIT` | | `rust:gio-sys` | `0.18.1` | `MIT` | | `rust:gio-sys` | `0.15.10` | `MIT` | | `rust:glib` | `0.18.5` | `MIT` | | `rust:glib` | `0.15.12` | `MIT` | | `rust:glib-macros` | `0.18.5` | `MIT` | | `rust:glib-macros` | `0.15.13` | `MIT` | | `rust:glib-sys` | `0.15.10` | `MIT` | | `rust:glib-sys` | `0.18.1` | `MIT` | | `rust:glob` | `0.3.1` | `MIT OR Apache-2.0` | | `rust:globset` | `0.4.14` | `Unlicense OR MIT` | | `rust:gobject-sys` | `0.15.10` | `MIT` | | `rust:gobject-sys` | `0.18.0` | `MIT` | | `rust:group` | `0.13.0` | `MIT OR Apache-2.0` | | `rust:gtk` | `0.15.5` | `MIT` | | `rust:gtk` | `0.18.1` | `MIT` | | `rust:gtk-sys` | `0.15.3` | `MIT` | | `rust:gtk-sys` | `0.18.0` | `MIT` | | `rust:gtk3-macros` | `0.15.6` | `MIT` | | `rust:gtk3-macros` | `0.18.0` | `MIT` | | `rust:h2` | `0.3.26` | `MIT` | | `rust:hashbrown` | `0.12.3` | `MIT OR Apache-2.0` | | `rust:hashbrown` | `0.15.0` | `MIT OR Apache-2.0` | | `rust:hashbrown` | `0.14.5` | `MIT OR Apache-2.0` | | `rust:heck` | `0.3.3` | `Apache-2.0 AND MIT` | | `rust:heck` | `0.5.0` | `MIT OR Apache-2.0` | | `rust:heck` | `0.4.1` | `MIT OR Apache-2.0` | | `rust:hermit-abi` | `0.4.0` | `MIT OR Apache-2.0` | | `rust:hermit-abi` | `0.3.9` | `MIT OR Apache-2.0` | | `rust:hex` | `>= 0.4.0,< 0.5.0` | `` | | `rust:hex` | `0.4.3` | `MIT OR Apache-2.0` | | `rust:hkdf` | `0.12.4` | `MIT OR Apache-2.0` | | `rust:hmac` | `0.12.1` | `MIT OR Apache-2.0` | | `rust:html5ever` | `0.26.0` | `MIT OR Apache-2.0` | | `rust:http` | `1.1.0` | `MIT OR Apache-2.0` | | `rust:http` | `>= 0.2.0,< 0.3.0` | `` | | `rust:http` | `0.2.12` | `MIT OR Apache-2.0` | | `rust:http-body` | `1.0.1` | `MIT` | | `rust:http-body` | `0.4.6` | `MIT` | | `rust:http-body-util` | `0.1.2` | `MIT` | | `rust:http-range` | `0.1.5` | `MIT` | | `rust:http-range-header` | `0.3.1` | `MIT` | | `rust:httparse` | `1.9.5` | `MIT OR Apache-2.0` | | `rust:httparse` | `1.8.0` | `MIT OR Apache-2.0` | | `rust:httpdate` | `1.0.3` | `MIT OR Apache-2.0` | | `rust:hyper` | `1.4.1` | `MIT` | | `rust:hyper` | `0.14.28` | `MIT` | | `rust:hyper` | `0.14.30` | `MIT` | | `rust:hyper` | `>= 0.14.0,< 0.15.0` | `` | | `rust:hyper-rustls` | `0.24.2` | `Apache-2.0 OR (ISC OR MIT)` | | `rust:hyper-rustls` | `0.27.3` | `Apache-2.0 OR (ISC OR MIT)` | | `rust:hyper-timeout` | `0.4.1` | `Apache-2.0 OR MIT` | | `rust:hyper-tls` | `0.5.0` | `MIT OR Apache-2.0` | | `rust:hyper-util` | `0.1.9` | `MIT` | | `rust:iana-time-zone` | `0.1.60` | `MIT OR Apache-2.0` | | `rust:iana-time-zone` | `0.1.61` | `MIT OR Apache-2.0` | | `rust:iana-time-zone-haiku` | `0.1.2` | `MIT OR Apache-2.0` | | `rust:ico` | `0.3.0` | `MIT` | | `rust:ident_case` | `1.0.1` | `MIT OR Apache-2.0` | | `rust:idna` | `0.5.0` | `MIT OR Apache-2.0` | | `rust:ignore` | `0.4.22` | `Unlicense OR MIT` | | `rust:image` | `0.24.9` | `MIT OR Apache-2.0` | | `rust:include_dir` | `0.7.4` | `MIT` | | `rust:include_dir` | `>= 0.7.0,< 0.8.0` | `` | | `rust:include_dir_macros` | `0.7.4` | `MIT` | | `rust:indexmap` | `2.6.0` | `Apache-2.0 OR MIT` | | `rust:indexmap` | `2.2.6` | `Apache-2.0 OR MIT` | | `rust:indexmap` | `1.9.3` | `Apache-2.0 OR MIT` | | `rust:infer` | `0.13.0` | `MIT` | | `rust:infer` | `0.16.0` | `MIT` | | `rust:inout` | `0.1.3` | `MIT OR Apache-2.0` | | `rust:instant` | `0.1.13` | `BSD-3-Clause` | | `rust:interprocess` | `2.2.1` | `MIT OR Apache-2.0` | | `rust:interprocess` | `>= 2.0.0,< 3.0.0` | `` | | `rust:io-lifetimes` | `1.0.11` | `Apache-2.0 WITH LLVM-exception OR (Apache-2.0 OR MIT)` | | `rust:ipnet` | `2.10.0` | `MIT OR Apache-2.0` | | `rust:ipnet` | `2.9.0` | `MIT OR Apache-2.0` | | `rust:is-docker` | `0.2.0` | `MIT` | | `rust:is-wsl` | `0.4.0` | `MIT` | | `rust:itertools` | `0.12.1` | `MIT OR Apache-2.0` | | `rust:itertools` | `0.10.5` | `MIT OR Apache-2.0` | | `rust:itoa` | `0.4.8` | `MIT OR Apache-2.0` | | `rust:itoa` | `1.0.11` | `MIT OR Apache-2.0` | | `rust:javascriptcore-rs` | `1.1.2` | `MIT` | | `rust:javascriptcore-rs` | `0.16.0` | `MIT` | | `rust:javascriptcore-rs-sys` | `1.1.1` | `MIT` | | `rust:javascriptcore-rs-sys` | `0.4.0` | `MIT` | | `rust:jni` | `0.20.0` | `MIT OR Apache-2.0` | | `rust:jni` | `0.21.1` | `MIT OR Apache-2.0` | | `rust:jni-sys` | `0.3.0` | `MIT OR Apache-2.0` | | `rust:js-sys` | `0.3.70` | `MIT OR Apache-2.0` | | `rust:js-sys` | `0.3.69` | `MIT OR Apache-2.0` | | `rust:json-patch` | `1.4.0` | `MIT OR Apache-2.0` | | `rust:json-patch` | `2.0.0` | `MIT OR Apache-2.0` | | `rust:jsonptr` | `0.4.7` | `MIT OR Apache-2.0` | | `rust:jsonwebtoken` | `>= 9.0.0,< 10.0.0` | `` | | `rust:jsonwebtoken` | `9.3.0` | `MIT` | | `rust:keyboard-types` | `0.7.0` | `MIT OR Apache-2.0` | | `rust:keyring` | `>= 2.0.0,< 3.0.0` | `` | | `rust:keyring` | `2.3.3` | `MIT OR Apache-2.0` | | `rust:kuchikiki` | `0.8.2` | `MIT` | | `rust:lazy_static` | `1.5.0` | `MIT OR Apache-2.0` | | `rust:libappindicator` | `0.9.0` | `Apache-2.0 OR MIT` | | `rust:libappindicator-sys` | `0.9.0` | `Apache-2.0 OR MIT` | | `rust:libc` | `0.2.159` | `MIT OR Apache-2.0` | | `rust:libc` | `0.2.155` | `MIT OR Apache-2.0` | | `rust:libloading` | `0.7.4` | `ISC` | | `rust:libm` | `0.2.8` | `MIT OR Apache-2.0` | | `rust:libredox` | `0.1.3` | `MIT` | | `rust:linux-keyutils` | `0.2.4` | `Apache-2.0 OR MIT` | | `rust:linux-raw-sys` | `0.3.8` | `Apache-2.0 WITH LLVM-exception OR (Apache-2.0 OR MIT)` | | `rust:linux-raw-sys` | `0.4.14` | `Apache-2.0 WITH LLVM-exception OR (Apache-2.0 OR MIT)` | | `rust:local-ip-address` | `0.5.7` | `MIT OR Apache-2.0` | | `rust:local-ip-address` | `>= 0.5.0,< 0.6.0` | `` | | `rust:lock_api` | `0.4.12` | `MIT OR Apache-2.0` | | `rust:log` | `0.4.22` | `MIT OR Apache-2.0` | | `rust:log` | `>= 0.4.22,< 0.5.0` | `` | | `rust:loom` | `0.5.6` | `MIT` | | `rust:mac` | `0.1.1` | `MIT OR Apache-2.0` | | `rust:malloc_buf` | `0.0.6` | `MIT` | | `rust:markup5ever` | `0.11.0` | `MIT OR Apache-2.0` | | `rust:matchers` | `0.1.0` | `MIT` | | `rust:matches` | `0.1.10` | `MIT` | | `rust:matchit` | `0.7.3` | `MIT AND BSD-3-Clause` | | `rust:memchr` | `2.7.4` | `Unlicense OR MIT` | | `rust:memoffset` | `0.9.1` | `MIT` | | `rust:memoffset` | `0.7.1` | `MIT` | | `rust:mime` | `0.3.17` | `MIT OR Apache-2.0` | | `rust:minisign-verify` | `0.2.2` | `MIT` | | `rust:miniz_oxide` | `0.8.0` | `MIT OR (Zlib OR Apache-2.0)` | | `rust:miniz_oxide` | `0.7.4` | `MIT OR (Zlib OR Apache-2.0)` | | `rust:mio` | `1.0.2` | `MIT` | | `rust:mio` | `0.8.11` | `MIT` | | `rust:muda` | `0.15.1` | `Apache-2.0 OR MIT` | | `rust:multimap` | `0.10.0` | `MIT OR Apache-2.0` | | `rust:native-tls` | `0.2.12` | `MIT OR Apache-2.0` | | `rust:native-tls` | `0.2.11` | `MIT OR Apache-2.0` | | `rust:ndk` | `0.9.0` | `MIT OR Apache-2.0` | | `rust:ndk` | `0.6.0` | `MIT OR Apache-2.0` | | `rust:ndk-context` | `0.1.1` | `MIT OR Apache-2.0` | | `rust:ndk-sys` | `0.3.0` | `MIT OR Apache-2.0` | | `rust:ndk-sys` | `0.6.0+11769913` | `MIT OR Apache-2.0` | | `rust:neli` | `0.6.4` | `BSD-3-Clause` | | `rust:neli-proc-macros` | `0.1.3` | `BSD-3-Clause` | | `rust:new_debug_unreachable` | `1.0.6` | `MIT` | | `rust:nix` | `0.26.4` | `MIT` | | `rust:nodrop` | `0.1.14` | `Apache-2.0 AND MIT` | | `rust:nu-ansi-term` | `0.46.0` | `MIT` | | `rust:num` | `0.4.3` | `MIT OR Apache-2.0` | | `rust:num-bigint` | `0.4.6` | `MIT OR Apache-2.0` | | `rust:num-bigint-dig` | `0.8.4` | `MIT OR Apache-2.0` | | `rust:num-complex` | `0.4.6` | `MIT OR Apache-2.0` | | `rust:num-conv` | `0.1.0` | `MIT OR Apache-2.0` | | `rust:num-integer` | `0.1.46` | `MIT OR Apache-2.0` | | `rust:num-iter` | `0.1.45` | `MIT OR Apache-2.0` | | `rust:num-rational` | `0.4.2` | `MIT OR Apache-2.0` | | `rust:num-traits` | `0.2.19` | `MIT OR Apache-2.0` | | `rust:num_cpus` | `1.16.0` | `MIT OR Apache-2.0` | | `rust:num_enum` | `0.7.3` | `BSD-3-Clause OR (MIT OR Apache-2.0)` | | `rust:num_enum` | `0.5.11` | `BSD-3-Clause OR (MIT OR Apache-2.0)` | | `rust:num_enum_derive` | `0.5.11` | `BSD-3-Clause OR (MIT OR Apache-2.0)` | | `rust:num_enum_derive` | `0.7.3` | `BSD-3-Clause OR (MIT OR Apache-2.0)` | | `rust:num_threads` | `0.1.7` | `MIT OR Apache-2.0` | | `rust:oauth2` | `4.4.2` | `MIT OR Apache-2.0` | | `rust:objc` | `0.2.7` | `MIT` | | `rust:objc` | `>= 0.2.0,< 0.3.0` | `` | | `rust:objc-sys` | `0.3.5` | `MIT` | | `rust:objc2` | `0.5.2` | `MIT` | | `rust:objc2-app-kit` | `0.2.2` | `MIT` | | `rust:objc2-core-data` | `0.2.2` | `MIT` | | `rust:objc2-core-image` | `0.2.2` | `MIT` | | `rust:objc2-encode` | `4.0.3` | `MIT` | | `rust:objc2-foundation` | `0.2.2` | `MIT` | | `rust:objc2-metal` | `0.2.2` | `MIT` | | `rust:objc2-quartz-core` | `0.2.2` | `MIT` | | `rust:objc_exception` | `0.1.2` | `MIT` | | `rust:objc_id` | `0.1.1` | `MIT` | | `rust:object` | `0.36.1` | `Apache-2.0 OR MIT` | | `rust:object` | `0.36.4` | `Apache-2.0 OR MIT` | | `rust:once_cell` | `1.19.0` | `MIT OR Apache-2.0` | | `rust:once_cell` | `1.20.1` | `MIT OR Apache-2.0` | | `rust:open` | `5.3.0` | `MIT` | | `rust:openidconnect` | `>= 3.5.0,< 4.0.0` | `` | | `rust:openidconnect` | `3.5.0` | `MIT` | | `rust:openssl` | `0.10.64` | `Apache-2.0` | | `rust:openssl` | `0.10.66` | `Apache-2.0` | | `rust:openssl-macros` | `0.1.1` | `MIT OR Apache-2.0` | | `rust:openssl-probe` | `0.1.5` | `MIT OR Apache-2.0` | | `rust:openssl-sys` | `0.9.103` | `MIT` | | `rust:openssl-sys` | `0.9.102` | `MIT` | | `rust:option-ext` | `0.2.0` | `MPL-2.0` | | `rust:ordered-float` | `2.10.1` | `MIT` | | `rust:ordered-multimap` | `0.7.3` | `MIT` | | `rust:ordered-stream` | `0.2.0` | `MIT OR Apache-2.0` | | `rust:os_pipe` | `1.2.1` | `MIT` | | `rust:overload` | `0.1.1` | `MIT` | | `rust:p256` | `0.13.2` | `Apache-2.0 OR MIT` | | `rust:p384` | `0.13.0` | `Apache-2.0 OR MIT` | | `rust:pango` | `0.18.3` | `MIT` | | `rust:pango` | `0.15.10` | `MIT` | | `rust:pango-sys` | `0.15.10` | `MIT` | | `rust:pango-sys` | `0.18.0` | `MIT` | | `rust:parking` | `2.2.1` | `Apache-2.0 OR MIT` | | `rust:parking_lot` | `0.12.3` | `MIT OR Apache-2.0` | | `rust:parking_lot_core` | `0.9.10` | `MIT OR Apache-2.0` | | `rust:pathdiff` | `0.2.1` | `MIT OR Apache-2.0` | | `rust:pem` | `3.0.4` | `MIT` | | `rust:pem-rfc7468` | `0.7.0` | `Apache-2.0 OR MIT` | | `rust:percent-encoding` | `2.3.1` | `MIT OR Apache-2.0` | | `rust:petgraph` | `0.6.5` | `MIT OR Apache-2.0` | | `rust:phf` | `0.10.1` | `MIT` | | `rust:phf` | `0.8.0` | `MIT` | | `rust:phf` | `0.11.2` | `MIT` | | `rust:phf_codegen` | `0.10.0` | `MIT` | | `rust:phf_codegen` | `0.8.0` | `MIT` | | `rust:phf_generator` | `0.10.0` | `MIT` | | `rust:phf_generator` | `0.8.0` | `MIT` | | `rust:phf_generator` | `0.11.2` | `MIT` | | `rust:phf_macros` | `0.8.0` | `MIT` | | `rust:phf_macros` | `0.11.2` | `MIT` | | `rust:phf_shared` | `0.8.0` | `MIT` | | `rust:phf_shared` | `0.10.0` | `MIT` | | `rust:phf_shared` | `0.11.2` | `MIT` | | `rust:pin-project` | `1.1.5` | `Apache-2.0 OR MIT` | | `rust:pin-project-internal` | `1.1.5` | `Apache-2.0 OR MIT` | | `rust:pin-project-lite` | `0.2.14` | `Apache-2.0 OR MIT` | | `rust:pin-utils` | `0.1.0` | `MIT OR Apache-2.0` | | `rust:piper` | `0.2.4` | `MIT OR Apache-2.0` | | `rust:pkcs1` | `0.7.5` | `Apache-2.0 OR MIT` | | `rust:pkcs8` | `0.10.2` | `Apache-2.0 OR MIT` | | `rust:pkg-config` | `0.3.31` | `MIT OR Apache-2.0` | | `rust:pkg-config` | `0.3.30` | `MIT OR Apache-2.0` | | `rust:plist` | `1.7.0` | `MIT` | | `rust:png` | `0.17.13` | `MIT OR Apache-2.0` | | `rust:png` | `0.17.14` | `MIT OR Apache-2.0` | | `rust:polling` | `2.8.0` | `Apache-2.0 OR MIT` | | `rust:polling` | `3.7.3` | `Apache-2.0 OR MIT` | | `rust:portable-atomic` | `1.9.0` | `Apache-2.0 OR MIT` | | `rust:powerfmt` | `0.2.0` | `MIT OR Apache-2.0` | | `rust:ppv-lite86` | `0.2.20` | `` | | `rust:ppv-lite86` | `0.2.17` | `MIT OR Apache-2.0` | | `rust:precomputed-hash` | `0.1.1` | `MIT` | | `rust:prettyplease` | `0.2.22` | `MIT OR Apache-2.0` | | `rust:primeorder` | `0.13.6` | `Apache-2.0 OR MIT` | | `rust:proc-macro-crate` | `2.0.2` | `MIT OR Apache-2.0` | | `rust:proc-macro-crate` | `1.3.1` | `MIT OR Apache-2.0` | | `rust:proc-macro-error` | `1.0.4` | `MIT OR Apache-2.0` | | `rust:proc-macro-error-attr` | `1.0.4` | `Apache-2.0 AND MIT` | | `rust:proc-macro-hack` | `0.5.20+deprecated` | `MIT OR Apache-2.0` | | `rust:proc-macro2` | `1.0.86` | `MIT OR Apache-2.0` | | `rust:prost` | `0.12.6` | `Apache-2.0` | | `rust:prost-build` | `>= 0.12.0,< 0.13.0` | `` | | `rust:prost-build` | `0.12.6` | `Apache-2.0` | | `rust:prost-derive` | `0.12.6` | `Apache-2.0` | | `rust:prost-types` | `0.12.6` | `Apache-2.0` | | `rust:ptr_meta` | `0.1.4` | `MIT` | | `rust:ptr_meta_derive` | `0.1.4` | `MIT` | | `rust:quick-xml` | `0.32.0` | `MIT` | | `rust:quinn` | `0.11.5` | `MIT OR Apache-2.0` | | `rust:quinn-proto` | `0.11.8` | `MIT OR Apache-2.0` | | `rust:quinn-udp` | `0.5.5` | `MIT OR Apache-2.0` | | `rust:quote` | `1.0.37` | `MIT OR Apache-2.0` | | `rust:quote` | `1.0.36` | `MIT OR Apache-2.0` | | `rust:radium` | `0.7.0` | `MIT` | | `rust:rand` | `>= 0.8.0,< 0.9.0` | `` | | `rust:rand` | `0.8.5` | `MIT OR Apache-2.0` | | `rust:rand` | `0.7.3` | `MIT OR Apache-2.0` | | `rust:rand_chacha` | `0.3.1` | `MIT OR Apache-2.0` | | `rust:rand_chacha` | `0.2.2` | `MIT OR Apache-2.0` | | `rust:rand_core` | `0.5.1` | `MIT OR Apache-2.0` | | `rust:rand_core` | `0.6.4` | `MIT OR Apache-2.0` | | `rust:rand_hc` | `0.2.0` | `MIT OR Apache-2.0` | | `rust:rand_pcg` | `0.2.1` | `Apache-2.0 AND MIT` | | `rust:raw-window-handle` | `0.5.2` | `MIT OR (Apache-2.0 OR Zlib)` | | `rust:raw-window-handle` | `0.6.2` | `MIT OR (Apache-2.0 OR Zlib)` | | `rust:recvmsg` | `1.0.0` | `0BSD` | | `rust:redox_syscall` | `0.4.1` | `MIT` | | `rust:redox_syscall` | `0.5.2` | `MIT` | | `rust:redox_syscall` | `0.5.7` | `MIT` | | `rust:redox_users` | `0.4.6` | `MIT` | | `rust:redox_users` | `0.4.5` | `MIT` | | `rust:regex` | `1.10.5` | `MIT OR Apache-2.0` | | `rust:regex` | `1.11.0` | `MIT OR Apache-2.0` | | `rust:regex-automata` | `0.4.8` | `MIT OR Apache-2.0` | | `rust:regex-automata` | `0.4.7` | `MIT OR Apache-2.0` | | `rust:regex-automata` | `0.1.10` | `MIT OR (MIT AND Unlicense)` | | `rust:regex-syntax` | `0.8.5` | `MIT OR Apache-2.0` | | `rust:regex-syntax` | `0.8.4` | `MIT OR Apache-2.0` | | `rust:regex-syntax` | `0.6.29` | `MIT OR Apache-2.0` | | `rust:rend` | `0.4.2` | `MIT` | | `rust:reqwest` | `0.12.8` | `MIT OR Apache-2.0` | | `rust:reqwest` | `>= 0.11.0,< 0.12.0` | `` | | `rust:reqwest` | `0.11.27` | `MIT OR Apache-2.0` | | `rust:rfc6979` | `0.4.0` | `Apache-2.0 OR MIT` | | `rust:ring` | `0.17.8` | `` | | `rust:ringbuf` | `0.4.7` | `` | | `rust:ringbuf` | `>= 0.4.4,< 0.5.0` | `` | | `rust:ringbuf` | `0.4.1` | `MIT OR Apache-2.0` | | `rust:rkyv` | `0.7.45` | `MIT` | | `rust:rkyv_derive` | `0.7.45` | `MIT` | | `rust:rsa` | `0.9.6` | `MIT OR Apache-2.0` | | `rust:rust-ini` | `0.21.1` | `MIT` | | `rust:rust_decimal` | `1.36.0` | `MIT` | | `rust:rustc-demangle` | `0.1.24` | `MIT OR Apache-2.0` | | `rust:rustc-hash` | `2.0.0` | `Apache-2.0 OR MIT` | | `rust:rustc_version` | `0.4.0` | `MIT OR Apache-2.0` | | `rust:rustc_version` | `0.4.1` | `MIT OR Apache-2.0` | | `rust:rustix` | `0.38.37` | `Apache-2.0 WITH LLVM-exception OR (Apache-2.0 OR MIT)` | | `rust:rustix` | `0.38.34` | `Apache-2.0 WITH LLVM-exception OR (Apache-2.0 OR MIT)` | | `rust:rustix` | `0.37.27` | `Apache-2.0 WITH LLVM-exception OR (Apache-2.0 OR MIT)` | | `rust:rustls` | `0.23.13` | `Apache-2.0 OR (ISC OR MIT)` | | `rust:rustls` | `0.21.12` | `Apache-2.0 OR (ISC OR MIT)` | | `rust:rustls-pemfile` | `1.0.4` | `Apache-2.0 OR (ISC OR MIT)` | | `rust:rustls-pemfile` | `2.2.0` | `Apache-2.0 OR ISC OR MIT` | | `rust:rustls-pki-types` | `1.9.0` | `MIT OR Apache-2.0` | | `rust:rustls-webpki` | `0.101.7` | `ISC` | | `rust:rustls-webpki` | `0.102.8` | `ISC` | | `rust:rustversion` | `1.0.17` | `MIT OR Apache-2.0` | | `rust:ryu` | `1.0.18` | `Apache-2.0 OR BSL-1.0` | | `rust:same-file` | `1.0.6` | `Unlicense OR MIT` | | `rust:schannel` | `0.1.24` | `MIT` | | `rust:schannel` | `0.1.23` | `MIT` | | `rust:schemars` | `0.8.21` | `MIT` | | `rust:schemars_derive` | `0.8.21` | `MIT` | | `rust:scoped-tls` | `1.0.1` | `MIT OR Apache-2.0` | | `rust:scopeguard` | `1.2.0` | `MIT OR Apache-2.0` | | `rust:sct` | `0.7.1` | `Apache-2.0 OR (ISC OR MIT)` | | `rust:seahash` | `4.1.0` | `MIT` | | `rust:sec1` | `0.7.3` | `Apache-2.0 OR MIT` | | `rust:secret-service` | `3.1.0` | `MIT OR Apache-2.0` | | `rust:security-framework` | `2.11.0` | `MIT OR Apache-2.0` | | `rust:security-framework` | `2.11.1` | `MIT OR Apache-2.0` | | `rust:security-framework-sys` | `2.12.0` | `MIT OR Apache-2.0` | | `rust:security-framework-sys` | `2.11.0` | `MIT OR Apache-2.0` | | `rust:selectors` | `0.22.0` | `MPL-2.0` | | `rust:semver` | `1.0.23` | `MIT OR Apache-2.0` | | `rust:serde` | `>= 1.0.0,< 2.0.0` | `` | | `rust:serde` | `1.0.210` | `MIT OR Apache-2.0` | | `rust:serde` | `1.0.204` | `MIT OR Apache-2.0` | | `rust:serde-untagged` | `0.1.6` | `MIT OR Apache-2.0` | | `rust:serde-value` | `0.7.0` | `MIT` | | `rust:serde_derive` | `1.0.210` | `MIT OR Apache-2.0` | | `rust:serde_derive` | `1.0.204` | `MIT OR Apache-2.0` | | `rust:serde_derive_internals` | `0.29.1` | `MIT OR Apache-2.0` | | `rust:serde_json` | `1.0.120` | `MIT OR Apache-2.0` | | `rust:serde_json` | `>= 1.0.0,< 2.0.0` | `` | | `rust:serde_json` | `1.0.128` | `MIT OR Apache-2.0` | | `rust:serde_path_to_error` | `0.1.16` | `MIT OR Apache-2.0` | | `rust:serde_plain` | `1.0.2` | `MIT OR Apache-2.0` | | `rust:serde_repr` | `0.1.19` | `MIT OR Apache-2.0` | | `rust:serde_spanned` | `0.6.6` | `MIT OR Apache-2.0` | | `rust:serde_spanned` | `0.6.8` | `MIT OR Apache-2.0` | | `rust:serde_urlencoded` | `0.7.1` | `MIT OR Apache-2.0` | | `rust:serde_with` | `3.10.0` | `MIT OR Apache-2.0` | | `rust:serde_with` | `3.8.3` | `MIT OR Apache-2.0` | | `rust:serde_with_macros` | `3.10.0` | `MIT OR Apache-2.0` | | `rust:serde_with_macros` | `3.8.3` | `MIT OR Apache-2.0` | | `rust:serialize-to-javascript` | `0.1.1` | `MIT OR Apache-2.0` | | `rust:serialize-to-javascript-impl` | `0.1.1` | `MIT OR Apache-2.0` | | `rust:servo_arc` | `0.1.1` | `MIT OR Apache-2.0` | | `rust:sha1` | `0.10.6` | `MIT OR Apache-2.0` | | `rust:sha2` | `0.10.8` | `MIT OR Apache-2.0` | | `rust:sharded-slab` | `0.1.7` | `MIT` | | `rust:shared_child` | `1.0.1` | `MIT` | | `rust:shlex` | `1.3.0` | `MIT OR Apache-2.0` | | `rust:signal-hook-registry` | `1.4.2` | `Apache-2.0 OR MIT` | | `rust:signature` | `2.2.0` | `Apache-2.0 OR MIT` | | `rust:simd-adler32` | `0.3.7` | `MIT` | | `rust:simdutf8` | `0.1.5` | `MIT OR Apache-2.0` | | `rust:simple_asn1` | `0.6.2` | `ISC` | | `rust:siphasher` | `0.3.11` | `MIT OR Apache-2.0` | | `rust:slab` | `0.4.9` | `MIT` | | `rust:smallvec` | `1.13.2` | `MIT OR Apache-2.0` | | `rust:socket2` | `0.5.7` | `MIT OR Apache-2.0` | | `rust:socket2` | `0.4.10` | `MIT OR Apache-2.0` | | `rust:softbuffer` | `0.4.6` | `MIT OR Apache-2.0` | | `rust:soup2` | `0.2.1` | `MIT` | | `rust:soup2-sys` | `0.2.0` | `MIT` | | `rust:soup3` | `0.5.0` | `MIT` | | `rust:soup3-sys` | `0.5.0` | `MIT` | | `rust:spin` | `0.9.8` | `MIT` | | `rust:spki` | `0.7.3` | `Apache-2.0 OR MIT` | | `rust:stable_deref_trait` | `1.2.0` | `MIT OR Apache-2.0` | | `rust:state` | `0.5.3` | `MIT OR Apache-2.0` | | `rust:static_assertions` | `1.1.0` | `MIT OR Apache-2.0` | | `rust:string_cache` | `0.8.7` | `MIT OR Apache-2.0` | | `rust:string_cache_codegen` | `0.5.2` | `MIT OR Apache-2.0` | | `rust:strsim` | `0.11.1` | `MIT` | | `rust:subtle` | `2.6.1` | `BSD-3-Clause` | | `rust:swift-rs` | `>= 1.0.7,< 2.0.0` | `` | | `rust:swift-rs` | `1.0.7` | `MIT OR Apache-2.0` | | `rust:syn` | `1.0.109` | `MIT OR Apache-2.0` | | `rust:syn` | `2.0.79` | `MIT OR Apache-2.0` | | `rust:syn` | `2.0.70` | `MIT OR Apache-2.0` | | `rust:syn_derive` | `0.1.8` | `MIT OR Apache-2.0` | | `rust:sync_wrapper` | `1.0.1` | `Apache-2.0` | | `rust:sync_wrapper` | `0.1.2` | `Apache-2.0` | | `rust:system-configuration` | `0.5.1` | `MIT OR Apache-2.0` | | `rust:system-configuration-sys` | `0.5.0` | `MIT OR Apache-2.0` | | `rust:system-deps` | `5.0.0` | `MIT OR Apache-2.0` | | `rust:system-deps` | `6.2.2` | `MIT OR Apache-2.0` | | `rust:tao` | `0.30.2` | `Apache-2.0` | | `rust:tao` | `0.16.9` | `Apache-2.0` | | `rust:tao-macros` | `0.1.2` | `MIT OR Apache-2.0` | | `rust:tao-macros` | `0.1.3` | `MIT OR Apache-2.0` | | `rust:tap` | `1.0.1` | `MIT` | | `rust:tar` | `0.4.42` | `MIT OR Apache-2.0` | | `rust:tar` | `0.4.41` | `MIT OR Apache-2.0` | | `rust:target-lexicon` | `0.12.16` | `Apache-2.0 WITH LLVM-exception` | | `rust:target-lexicon` | `0.12.15` | `Apache-2.0 WITH LLVM-exception` | | `rust:tauri` | `>= 2.0.0,< 3.0.0` | `` | | `rust:tauri` | `1.7.1` | `Apache-2.0 OR MIT` | | `rust:tauri` | `2.0.0` | `Apache-2.0 OR MIT` | | `rust:tauri-build` | `1.5.2` | `Apache-2.0 OR MIT` | | `rust:tauri-build` | `>= 2.0.0,< 3.0.0` | `` | | `rust:tauri-build` | `2.0.0` | `Apache-2.0 OR MIT` | | `rust:tauri-codegen` | `2.0.0` | `Apache-2.0 OR MIT` | | `rust:tauri-codegen` | `1.4.4` | `Apache-2.0 OR MIT` | | `rust:tauri-macros` | `2.0.0` | `Apache-2.0 OR MIT` | | `rust:tauri-macros` | `1.4.5` | `Apache-2.0 OR MIT` | | `rust:tauri-plugin` | `2.0.0` | `Apache-2.0 OR MIT` | | `rust:tauri-plugin` | `>= 2.0.0,< 3.0.0` | `` | | `rust:tauri-plugin-deep-link` | `2.0.0` | `Apache-2.0 OR MIT` | | `rust:tauri-plugin-deep-link` | `>= 2.0.0,< 3.0.0` | `` | | `rust:tauri-plugin-devtools` | `>= 2.0.0,< 3.0.0` | `` | | `rust:tauri-plugin-devtools-app` | `>= 2.0.0,< 3.0.0` | `` | | `rust:tauri-plugin-log` | `>= 2.0.0,< 3.0.0` | `` | | `rust:tauri-plugin-log` | `2.0.0` | `Apache-2.0 OR MIT` | | `rust:tauri-plugin-process` | `2.0.0` | `Apache-2.0 OR MIT` | | `rust:tauri-plugin-process` | `>= 2.0.0,< 3.0.0` | `` | | `rust:tauri-plugin-shell` | `2.0.0` | `Apache-2.0 OR MIT` | | `rust:tauri-plugin-shell` | `>= 2.0.0,< 3.0.0` | `` | | `rust:tauri-plugin-updater` | `>= 2.0.0,< 3.0.0` | `` | | `rust:tauri-plugin-updater` | `2.0.1` | `` | | `rust:tauri-runtime` | `2.0.0` | `Apache-2.0 OR MIT` | | `rust:tauri-runtime` | `0.14.4` | `Apache-2.0 OR MIT` | | `rust:tauri-runtime-wry` | `0.14.9` | `Apache-2.0 OR MIT` | | `rust:tauri-runtime-wry` | `2.0.0` | `Apache-2.0 OR MIT` | | `rust:tauri-utils` | `1.6.0` | `Apache-2.0 OR MIT` | | `rust:tauri-utils` | `2.0.0` | `Apache-2.0 OR MIT` | | `rust:tauri-winres` | `0.1.1` | `MIT` | | `rust:tempfile` | `3.13.0` | `MIT OR Apache-2.0` | | `rust:tempfile` | `3.10.1` | `MIT OR Apache-2.0` | | `rust:tendril` | `0.4.3` | `MIT OR Apache-2.0` | | `rust:thin-slice` | `0.1.1` | `MPL-2.0` | | `rust:thiserror` | `>= 1.0.0,< 2.0.0` | `` | | `rust:thiserror` | `1.0.64` | `MIT OR Apache-2.0` | | `rust:thiserror` | `1.0.61` | `MIT OR Apache-2.0` | | `rust:thiserror-impl` | `1.0.61` | `MIT OR Apache-2.0` | | `rust:thiserror-impl` | `1.0.64` | `MIT OR Apache-2.0` | | `rust:thread_local` | `1.1.8` | `MIT OR Apache-2.0` | | `rust:time` | `0.3.36` | `MIT OR Apache-2.0` | | `rust:time-core` | `0.1.2` | `MIT OR Apache-2.0` | | `rust:time-macros` | `0.2.18` | `MIT OR Apache-2.0` | | `rust:tiny-keccak` | `2.0.2` | `CC0-1.0` | | `rust:tiny_http` | `0.12.0` | `MIT OR Apache-2.0` | | `rust:tiny_http` | `0.11.0` | `MIT OR Apache-2.0` | | `rust:tiny_http` | `>= 0.12.0,< 0.13.0` | `` | | `rust:tinyvec` | `1.8.0` | `Zlib OR (Apache-2.0 OR MIT)` | | `rust:tinyvec_macros` | `0.1.1` | `MIT OR (Apache-2.0 OR Zlib)` | | `rust:tokio` | `>= 1.0.0,< 2.0.0` | `` | | `rust:tokio` | `1.40.0` | `MIT` | | `rust:tokio` | `1.38.0` | `MIT` | | `rust:tokio-io-timeout` | `1.2.0` | `MIT OR Apache-2.0` | | `rust:tokio-macros` | `2.3.0` | `MIT` | | `rust:tokio-macros` | `2.4.0` | `MIT` | | `rust:tokio-native-tls` | `0.3.1` | `MIT` | | `rust:tokio-rustls` | `0.24.1` | `MIT OR Apache-2.0` | | `rust:tokio-rustls` | `0.26.0` | `` | | `rust:tokio-stream` | `0.1.16` | `MIT` | | `rust:tokio-stream` | `0.1.15` | `MIT` | | `rust:tokio-util` | `0.7.12` | `MIT` | | `rust:tokio-util` | `0.7.11` | `MIT` | | `rust:toml` | `0.7.8` | `MIT OR Apache-2.0` | | `rust:toml` | `0.5.11` | `MIT OR Apache-2.0` | | `rust:toml` | `0.8.2` | `MIT OR Apache-2.0` | | `rust:toml` | `0.8.13` | `MIT OR Apache-2.0` | | `rust:toml_datetime` | `0.6.3` | `MIT OR Apache-2.0` | | `rust:toml_datetime` | `0.6.6` | `MIT OR Apache-2.0` | | `rust:toml_edit` | `0.19.15` | `MIT OR Apache-2.0` | | `rust:toml_edit` | `0.22.13` | `MIT OR Apache-2.0` | | `rust:toml_edit` | `0.20.2` | `MIT OR Apache-2.0` | | `rust:tonic` | `>= 0.10.0,< 0.11.0` | `` | | `rust:tonic` | `0.10.2` | `MIT` | | `rust:tonic-build` | `0.10.2` | `MIT` | | `rust:tonic-build` | `>= 0.10.0,< 0.11.0` | `` | | `rust:tonic-health` | `>= 0.10.0,< 0.11.0` | `` | | `rust:tonic-health` | `0.10.2` | `MIT` | | `rust:tonic-web` | `0.10.2` | `MIT` | | `rust:tonic-web` | `>= 0.10.0,< 0.11.0` | `` | | `rust:tower` | `0.4.13` | `MIT` | | `rust:tower` | `>= 0.4.0,< 0.5.0` | `` | | `rust:tower-http` | `0.4.4` | `MIT` | | `rust:tower-http` | `>= 0.4.0,< 0.5.0` | `` | | `rust:tower-layer` | `0.3.3` | `MIT` | | `rust:tower-layer` | `0.3.2` | `MIT` | | `rust:tower-layer` | `>= 0.3.0,< 0.4.0` | `` | | `rust:tower-service` | `0.3.3` | `MIT` | | `rust:tower-service` | `0.3.2` | `MIT` | | `rust:tracing` | `0.1.40` | `MIT` | | `rust:tracing` | `>= 0.1.0,< 0.2.0` | `` | | `rust:tracing-attributes` | `0.1.27` | `MIT` | | `rust:tracing-core` | `0.1.32` | `MIT` | | `rust:tracing-log` | `0.2.0` | `MIT` | | `rust:tracing-subscriber` | `>= 0.3.0,< 0.4.0` | `` | | `rust:tracing-subscriber` | `0.3.18` | `MIT` | | `rust:tray-icon` | `0.19.0` | `MIT OR Apache-2.0` | | `rust:trim-in-place` | `0.1.7` | `MIT` | | `rust:try-lock` | `0.2.5` | `MIT` | | `rust:typeid` | `1.0.2` | `MIT OR Apache-2.0` | | `rust:typenum` | `1.17.0` | `MIT OR Apache-2.0` | | `rust:uds_windows` | `1.1.0` | `MIT` | | `rust:unic-char-property` | `0.9.0` | `MIT OR Apache-2.0` | | `rust:unic-char-range` | `0.9.0` | `MIT OR Apache-2.0` | | `rust:unic-common` | `0.9.0` | `MIT OR Apache-2.0` | | `rust:unic-ucd-ident` | `0.9.0` | `MIT OR Apache-2.0` | | `rust:unic-ucd-version` | `0.9.0` | `MIT OR Apache-2.0` | | `rust:unicode-bidi` | `0.3.15` | `MIT OR Apache-2.0` | | `rust:unicode-bidi` | `0.3.17` | `` | | `rust:unicode-ident` | `1.0.12` | `(MIT OR Apache-2.0) AND Unicode-DFS-2016` | | `rust:unicode-ident` | `1.0.13` | `(MIT OR Apache-2.0) AND Unicode-DFS-2016` | | `rust:unicode-normalization` | `0.1.24` | `` | | `rust:unicode-normalization` | `0.1.23` | `MIT OR Apache-2.0` | | `rust:unicode-segmentation` | `1.11.0` | `MIT OR Apache-2.0` | | `rust:unicode-segmentation` | `1.12.0` | `MIT OR Apache-2.0` | | `rust:untrusted` | `0.9.0` | `ISC` | | `rust:url` | `2.5.2` | `MIT OR Apache-2.0` | | `rust:url` | `>= 2.0.0,< 3.0.0` | `` | | `rust:urlpattern` | `0.3.0` | `MIT` | | `rust:utf-8` | `0.7.6` | `Apache-2.0 AND MIT` | | `rust:utf8-width` | `0.1.7` | `MIT` | | `rust:uuid` | `>= 1.0.0,< 2.0.0` | `` | | `rust:uuid` | `1.10.0` | `Apache-2.0 OR MIT` | | `rust:valuable` | `0.1.0` | `MIT` | | `rust:value-bag` | `1.9.0` | `Apache-2.0 OR MIT` | | `rust:vcpkg` | `0.2.15` | `MIT OR Apache-2.0` | | `rust:version-compare` | `0.0.11` | `MIT` | | `rust:version-compare` | `0.2.0` | `MIT` | | `rust:version_check` | `0.9.4` | `MIT OR Apache-2.0` | | `rust:version_check` | `0.9.5` | `MIT OR Apache-2.0` | | `rust:vswhom` | `0.1.0` | `MIT` | | `rust:vswhom-sys` | `0.1.2` | `MIT` | | `rust:waker-fn` | `1.2.0` | `Apache-2.0 OR MIT` | | `rust:walkdir` | `2.5.0` | `Unlicense OR MIT` | | `rust:want` | `0.3.1` | `MIT` | | `rust:wasi` | `0.11.0+wasi-snapshot-preview1` | `Apache-2.0 WITH LLVM-exception OR (Apache-2.0 OR MIT)` | | `rust:wasi` | `0.9.0+wasi-snapshot-preview1` | `Apache-2.0 WITH LLVM-exception OR (Apache-2.0 OR MIT)` | | `rust:wasite` | `0.1.0` | `Apache-2.0 OR (BSL-1.0 OR MIT)` | | `rust:wasm-bindgen` | `0.2.92` | `MIT OR Apache-2.0` | | `rust:wasm-bindgen` | `0.2.93` | `MIT OR Apache-2.0` | | `rust:wasm-bindgen-backend` | `0.2.92` | `MIT OR Apache-2.0` | | `rust:wasm-bindgen-backend` | `0.2.93` | `MIT OR Apache-2.0` | | `rust:wasm-bindgen-futures` | `0.4.43` | `MIT OR Apache-2.0` | | `rust:wasm-bindgen-futures` | `0.4.42` | `MIT OR Apache-2.0` | | `rust:wasm-bindgen-macro` | `0.2.93` | `MIT OR Apache-2.0` | | `rust:wasm-bindgen-macro` | `0.2.92` | `MIT OR Apache-2.0` | | `rust:wasm-bindgen-macro-support` | `0.2.92` | `MIT OR Apache-2.0` | | `rust:wasm-bindgen-macro-support` | `0.2.93` | `MIT OR Apache-2.0` | | `rust:wasm-bindgen-shared` | `0.2.93` | `MIT OR Apache-2.0` | | `rust:wasm-bindgen-shared` | `0.2.92` | `MIT OR Apache-2.0` | | `rust:wasm-streams` | `0.4.1` | `MIT OR Apache-2.0` | | `rust:web-sys` | `0.3.70` | `MIT OR Apache-2.0` | | `rust:web-sys` | `0.3.69` | `MIT OR Apache-2.0` | | `rust:webkit2gtk` | `0.18.2` | `MIT` | | `rust:webkit2gtk` | `2.0.1` | `MIT` | | `rust:webkit2gtk-sys` | `0.18.0` | `MIT` | | `rust:webkit2gtk-sys` | `2.0.1` | `MIT` | | `rust:webpki-roots` | `0.25.4` | `MPL-2.0` | | `rust:webpki-roots` | `0.26.6` | `MPL-2.0` | | `rust:webview2-com` | `0.33.0` | `MIT` | | `rust:webview2-com` | `0.19.1` | `MIT` | | `rust:webview2-com-macros` | `0.6.0` | `MIT` | | `rust:webview2-com-macros` | `0.8.0` | `MIT` | | `rust:webview2-com-sys` | `0.19.0` | `MIT` | | `rust:webview2-com-sys` | `0.33.0` | `MIT` | | `rust:whoami` | `>= 1.0.0,< 2.0.0` | `` | | `rust:whoami` | `1.5.2` | `Apache-2.0 OR (BSL-1.0 OR MIT)` | | `rust:widestring` | `1.1.0` | `MIT OR Apache-2.0` | | `rust:winapi` | `0.3.9` | `MIT OR Apache-2.0` | | `rust:winapi-i686-pc-windows-gnu` | `0.4.0` | `MIT OR Apache-2.0` | | `rust:winapi-util` | `0.1.9` | `Unlicense OR MIT` | | `rust:winapi-util` | `0.1.8` | `Unlicense OR MIT` | | `rust:winapi-x86_64-pc-windows-gnu` | `0.4.0` | `MIT OR Apache-2.0` | | `rust:window-vibrancy` | `0.5.2` | `Apache-2.0 OR MIT` | | `rust:windows` | `0.48.0` | `MIT OR Apache-2.0` | | `rust:windows` | `0.39.0` | `MIT OR Apache-2.0` | | `rust:windows` | `0.58.0` | `MIT OR Apache-2.0` | | `rust:windows-bindgen` | `0.39.0` | `MIT OR Apache-2.0` | | `rust:windows-core` | `0.58.0` | `MIT OR Apache-2.0` | | `rust:windows-core` | `0.52.0` | `MIT OR Apache-2.0` | | `rust:windows-implement` | `0.39.0` | `MIT OR Apache-2.0` | | `rust:windows-implement` | `0.58.0` | `MIT OR Apache-2.0` | | `rust:windows-interface` | `0.58.0` | `MIT OR Apache-2.0` | | `rust:windows-metadata` | `0.39.0` | `MIT OR Apache-2.0` | | `rust:windows-registry` | `0.3.0` | `MIT OR Apache-2.0` | | `rust:windows-registry` | `0.2.0` | `MIT OR Apache-2.0` | | `rust:windows-result` | `0.2.0` | `MIT OR Apache-2.0` | | `rust:windows-strings` | `0.2.0` | `MIT OR Apache-2.0` | | `rust:windows-strings` | `0.1.0` | `MIT OR Apache-2.0` | | `rust:windows-sys` | `0.52.0` | `MIT OR Apache-2.0` | | `rust:windows-sys` | `0.48.0` | `MIT OR Apache-2.0` | | `rust:windows-sys` | `0.45.0` | `MIT OR Apache-2.0` | | `rust:windows-sys` | `0.59.0` | `MIT OR Apache-2.0` | | `rust:windows-targets` | `0.48.5` | `MIT OR Apache-2.0` | | `rust:windows-targets` | `0.42.2` | `MIT OR Apache-2.0` | | `rust:windows-targets` | `0.52.6` | `MIT OR Apache-2.0` | | `rust:windows-tokens` | `0.39.0` | `MIT OR Apache-2.0` | | `rust:windows-version` | `0.1.1` | `MIT OR Apache-2.0` | | `rust:windows_aarch64_gnullvm` | `0.42.2` | `MIT OR Apache-2.0` | | `rust:windows_aarch64_gnullvm` | `0.48.5` | `MIT OR Apache-2.0` | | `rust:windows_aarch64_gnullvm` | `0.52.6` | `MIT OR Apache-2.0` | | `rust:windows_aarch64_msvc` | `0.42.2` | `MIT OR Apache-2.0` | | `rust:windows_aarch64_msvc` | `0.48.5` | `MIT OR Apache-2.0` | | `rust:windows_aarch64_msvc` | `0.52.6` | `MIT OR Apache-2.0` | | `rust:windows_aarch64_msvc` | `0.39.0` | `MIT OR Apache-2.0` | | `rust:windows_i686_gnu` | `0.39.0` | `MIT OR Apache-2.0` | | `rust:windows_i686_gnu` | `0.42.2` | `MIT OR Apache-2.0` | | `rust:windows_i686_gnu` | `0.52.6` | `MIT OR Apache-2.0` | | `rust:windows_i686_gnu` | `0.48.5` | `MIT OR Apache-2.0` | | `rust:windows_i686_gnullvm` | `0.52.6` | `MIT OR Apache-2.0` | | `rust:windows_i686_msvc` | `0.42.2` | `MIT OR Apache-2.0` | | `rust:windows_i686_msvc` | `0.39.0` | `MIT OR Apache-2.0` | | `rust:windows_i686_msvc` | `0.52.6` | `MIT OR Apache-2.0` | | `rust:windows_i686_msvc` | `0.48.5` | `MIT OR Apache-2.0` | | `rust:windows_x86_64_gnu` | `0.39.0` | `MIT OR Apache-2.0` | | `rust:windows_x86_64_gnu` | `0.52.6` | `MIT OR Apache-2.0` | | `rust:windows_x86_64_gnu` | `0.42.2` | `MIT OR Apache-2.0` | | `rust:windows_x86_64_gnu` | `0.48.5` | `MIT OR Apache-2.0` | | `rust:windows_x86_64_gnullvm` | `0.42.2` | `MIT OR Apache-2.0` | | `rust:windows_x86_64_gnullvm` | `0.48.5` | `MIT OR Apache-2.0` | | `rust:windows_x86_64_gnullvm` | `0.52.6` | `MIT OR Apache-2.0` | | `rust:windows_x86_64_msvc` | `0.39.0` | `MIT OR Apache-2.0` | | `rust:windows_x86_64_msvc` | `0.42.2` | `MIT OR Apache-2.0` | | `rust:windows_x86_64_msvc` | `0.52.6` | `MIT OR Apache-2.0` | | `rust:windows_x86_64_msvc` | `0.48.5` | `MIT OR Apache-2.0` | | `rust:winnow` | `0.6.9` | `MIT` | | `rust:winnow` | `0.6.8` | `MIT` | | `rust:winnow` | `0.5.40` | `MIT` | | `rust:winreg` | `0.52.0` | `MIT` | | `rust:winreg` | `0.50.0` | `MIT` | | `rust:wry` | `0.44.1` | `Apache-2.0 OR MIT` | | `rust:wry` | `0.24.10` | `Apache-2.0 OR MIT` | | `rust:wyz` | `0.5.1` | `MIT` | | `rust:x11` | `2.21.0` | `MIT` | | `rust:x11-dl` | `2.21.0` | `MIT` | | `rust:xattr` | `1.3.1` | `MIT OR Apache-2.0` | | `rust:xdg-home` | `1.3.0` | `MIT` | | `rust:zbus` | `3.15.2` | `MIT` | | `rust:zbus_macros` | `3.15.2` | `MIT` | | `rust:zbus_names` | `2.6.1` | `MIT` | | `rust:zerocopy` | `0.7.35` | `BSD-2-Clause OR (Apache-2.0 OR MIT)` | | `rust:zerocopy-derive` | `0.7.35` | `BSD-2-Clause OR (Apache-2.0 OR MIT)` | | `rust:zeroize` | `1.8.1` | `Apache-2.0 OR MIT` | | `rust:zip` | `2.2.0` | `MIT` | | `rust:zvariant` | `3.15.2` | `MIT` | | `rust:zvariant_derive` | `3.15.2` | `MIT` | | `rust:zvariant_utils` | `1.0.1` | `MIT` | # Calls ![Screenshot of the calls tab showing rows of performance events](@assets/devtools/calls-tab.webp) The Calls tab lists performance-relevant events such as _IPC Calls_, or events. You will find them in a list sorted from oldest to newest, with every event featuring high-level timing information _at a glance_. The `Initiated` column tells you when, _in wall clock time_, the event started and `Time` lets you know how long it took. The `Waterfall` column is designed to give you a rough idea of how performance events _relate to each other_, though for long-running debugging sessions the waterfall view might not be as helpful anymore since blocks will get narrower as time progresses due to being squished by the scale. ### Event Details ![Screenshot of the calls tab with a performance event selected and showing in the detail panel](@assets/devtools/calls-details-1.webp) Clicking on a performance event will reveal the meaty details about an event. Here you will find IPC parameters and response, and what code contributed how much to the total duration of the event. ![Screenshot of the calls tab with details panel active and the second section (inputs) highlighted in red](@assets/devtools/calls-details-1.1.webp) The event inputs are the IPC parameters that the WebView (your frontend code) passed to the Rust core. Event inputs are listed here, so you can quickly gauge whether your frontend code is passing the right values. Note that the values here are captured _after_ being deserialized by Rust, so if there are any inconsistencies in the deserialization they will show up here as well. ![Screenshot of the calls tab with details panel active and the third section (response) highlighted in red](@assets/devtools/calls-details-1.2.webp) The event response is the return value of the Rust function that has been invoked and what has been passed back the WebView. This data is captured _before_ it has been serialized and passed to the WebView though, that's the reason why it looks like a Rust type. This also means that issues or inconsistencies with serialization and evaluation in the WebView are **not** recorded. ![Screenshot of the calls tab with details panel active showing the span popover that reveals additional info about the span](@assets/devtools/calls-details-2.webp) The waterfall section at the top of the details panel shows a breakdown of the whole event duration by its individual spans (spans are durations of time). This lets you see exactly how much time is spent where during the execution of an IPC call. Currently, DevTools tracks the following spans: - `ipc::request` - This is the whole duration of your IPC call. - `ipc::request::run` - This span tracks the execution of your handler function (essentially the function you annotated with `#[tauri::command]`) - `ipc::request::respond` - This tracks how long _responding_ to your request took, this will happen _after_ `ipc::request::run`. - `ipc::request::deserialize_arg` - This tracks how long deserializing an individual IPC parameter took. - `wry::eval` - This represents the time it takes to send something to the WebView proper. This is usually the last span of an IPC request. Note that clicking a spans row will reveal additional information about that component in a dropdown as shown in the screenshot above. ![Screenshot of the calls tab with details panel active showing the work unit popover that reveals additional info about the work unit](@assets/devtools/calls-details-3.webp) Because of Tauri's asynchronous and multithreaded nature, spans can be entered and exited _multiple times_, e.g. when waiting for some disk IO operation to complete, the scheduler will pause the executing code and resume it once the operation is done. This shows in the waterfall views through multiple disjoint blocks called _Work Units_ (a unit of work has been performed). Each colored block means there has been code executing during that time, transparent sections in between indicate the work has been paused by waiting on something else. You can click on a work unit to reveal more information about it, such as detailed timing information and which underlying thread actually performed the work (work can be shifted around between multiple threads in the thread pool) this can be helpful to detect situations where work is shifted between threads unnecessarily. # Console ![Screenshot of the calls tab showing lines of log messages](@assets/devtools/console-tab.webp) The console tab is a rather simple output of all emitted log messages aggregated from your code and all your code's dependencies. Any events you emit using the `log` or `tracing` crates will be captured here. Log messages have associated _Log Levels_ (Trace, Debug, Info, Warn, Error) and messages in the console will be color highlighted accordingly. You also have the option at the top of the console to filter by level, e.g. you can exclude the very verbose Trace and Debug messages. Each log message will also include the source code location that the message originated from whenever available. A message might not always have location information available. :::caution `devtools` is _incompatible_ with `tauri-plugin-log` It fills the same role and comes with additional convenient debugging features so we recommend you use `devtools` for development builds and `tauri-plugin-log` for production builds, this way you get **the best of both worlds**. ::: ### Setup using Rusts cfg macros In the following snippet we use Rusts cfg macros to conditionally enable `devtools` in debug builds and `tauri-plugin-log` when building with release optimizations. ```rust fn main() { #[cfg(debug_assertions)] let devtools = devtools::init(); // initialize the plugin as early as possible let mut builder = tauri::Builder::default(); #[cfg(debug_assertions)] { builder = builder.plugin(devtools); // then register it with Tauri } #[cfg(not(debug_assertions))] { builder = builder.plugin(tauri_plugin_log::Builder::default().targets([LogTarget::LogDir]).build()); } builder.run(tauri::generate_context!("./tauri.conf.json")) .expect("error while running tauri application"); } ``` # Sources ![Screenshot of the sources tab with a file tree on the left and a syntax highlighted index.html source view rendered on the right](@assets/devtools/sources-tab.webp) The sources tab is a utility tab that lets you check out all the files in your project directory, including syntax highlighting and support for images. In the future, this will gain more features and support. It will also get deeper integration with the Console and Calls tab. # Tauri ![Screenshot of the Tauri tab showing a set of loaded configuration files on the left](@assets/devtools/config-tab.webp) The tauri tab lets you inspect the currently loaded configuration. You can hover the name of a configuration key to display its description from the [tauri docs](https://tauri.app/v1/api/config). It can also make an estimation of where a configuration value came from. # Broken Connection import { Steps, Aside, Tabs, TabItem } from "@astrojs/starlight/components"; The Web Client is served through a public URL over HTTP. Because of this, browser extensions and some browser with stricter security settings may interfere with the connection between the instrumentation server and your browser. :::note[Exclusive on DevTools Web] DevTools Premium is not affected by this issue as it runs on your local machine and not in a public URL. ::: ## Adblockers Some adblockers might restrict the access to `localhost` or `127.0.0.1`. By default the instrumentation server (DevTools plugin) will only be accessible on the local network. If you have trouble connecting make sure that your current adblocker does not block traffic to `localhost`. By default the instrumentation will run on `127.0.0.1:3033` but when the port collides with something on your local system it will pick a different one. :::tip[Remove Connection] If you want to be able to connect to the instrumentation through a network or the internet, you will have to proxy or forward the local traffic. ::: ## Brave Browser Shield There is a known issue with the [`Brave Shield`](https://brave.com/shields/) blocking connections to `localhost` when using **CrabNebula DevTools Web**. We do not recommend turning off the shield! You can use the following steps to add an exception tailored for [`devtools.crabnebula.dev`](https://devtools.crabnebula.dev). 1. Enter the following into your address bar: ```text frame="none" brave://settings/shields/filters ``` 2. Scroll down to `Create custom filters` ![Brave browser scroll down to "Create custom filters"](../../../../assets/devtools/troubleshooting/web/step-2-brave-scroll-down.png) 3. Add `localhost` as an exception for `devtools.crabnebula.dev`. ```text frame="none" @@||127.0.0.1^$domain=devtools.crabnebula.dev ``` ![Brave browser create exception](../../../../assets/devtools/troubleshooting/web/step-3-brave-add-exception.png) 4. Save changes! 🎉 ## Safari Not Supported Unfortunately Safari blocks any connections to `localhost` from within websites. The DevTools UI therefore is unable to connect to your instrumented application. Apple has stated that this is intentional on their part and no fix will be issued. # Log plugins If you're running CrabNebula DevTools next to another tracing/log plugin or crate, DevTools will prevent any other logger from being initialized. ```bash thread 'main' panicked at src/main.rs:24:10: error while running tauri application: PluginInitialization("log", "attempted to set a logger after the logging system was already initialized") note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` We recommend using only CrabNebula DevTools in development mode, and any other tracing/tracking crates in production. ```rust fn run() { let mut builder = tauri::Builder::default(); #[cfg(debug_assertions)] { let devtools = tauri_plugin_devtools::init(); builder = builder.plugin(devtools); } #[cfg(not(debug_assertions))] { use tauri_plugin_log::{Builder, Target, TargetKind}; let log_plugin = Builder::default() .targets([ Target::new(TargetKind::Stdout), Target::new(TargetKind::LogDir { file_name: None }), Target::new(TargetKind::Webview), ]) .build(); builder = builder.plugin(log_plugin); } builder .invoke_handler(tauri::generate_handler![greet]) .run(tauri::generate_context!()) .expect("error while running tauri application"); } #[tauri::command] fn greet(name: &str) -> String { format!("Hello, {}! You've been greeted from Rust!", name) } ``` # Packager # Get Started import CommandTabs from "@components/CommandTabs.astro"; > Packager is currently in **public preview**, so feel free to report any bugs you find and feature requests you might have! [Cargo Packager](https://github.com/crabnebula-dev/cargo-packager/) is a tool to package executables as installers or app bundles for macOS, Windows and Linux, available both as a Command Line Interface (CLI) and a Rust library. It also has a compatible auto updater through [cargo-packager-updater](https://github.com/crabnebula-dev/cargo-packager/blob/main/crates/updater) that lets your application update itself when you distribute a new release. ## Supported Packages - macOS - Apple Disk Image (.dmg) - Application Bundle (.app) - Linux - Debian package (.deb) - AppImage (.AppImage) - Pacman (.tar.gz and PKGBUILD) - Windows - NSIS (.exe) - MSI using WiX Toolset (.msi) ## Rust ### CLI The packager is distributed on [crates.io](https://crates.io/crates/cargo-packager) as a cargo subcommand, you can install it using cargo: ```sh frame="none" cargo install cargo-packager --locked ``` You then need to configure your app so the CLI can recognize it. Configuration can be done in `Packager.toml` or `packager.json` in your project or modify `Cargo.toml`. #### Packager.toml The packager configuration can be defined in a standalone Packager.toml file: ```toml title="Packager.toml" name = "my-app" product-name = "MyApp" identifier = "com.packager.example" version = "1.0.0" out-dir = "./dist" before-packaging-command = "cargo build --release" ``` Once you are done configuring your app, run: ```sh frame="none" cargo packager --release ``` ### Configuration By default, the packager reads its configuration from `Packager.toml` (or `packager.json` if it exists) and from the `package.metadata.packager` table in `Cargo.toml`. You can also specify a custom configuration using the `--config` CLI argument. For a full list of configuration options, see [the configuration page](/packager/configuration). ### Building Your Application Before Packaging By default, the packager doesn't build your application, so if your app requires a compilation step, the packager has an option to specify a shell command to be executed before packaging your app: `beforePackagingCommand`. ### Cargo Profiles By default, the packager looks for binaries built using the `debug` profile, if your `beforePackagingCommand` builds your app using `cargo build --release`, you will also need to run the packager in release mode `cargo packager --release`. Otherwise, if you have a custom cargo profile, you will need to specify it using `--profile` CLI argument. For example: ```sh frame="none" cargo packager --profile custom-release-profile ``` ### Library This crate is also published to [crates.io](https://crates.io/crates/cargo-packager) as a library, so that you can integrate into your tooling, just make sure to disable the default-feature flags. ```sh frame="none" cargo add cargo-packager --no-default-features ``` #### Feature Flags - **`cli`**: Enables the CLI specific features and dependencies. - **`tracing`**: Enables `tracing` crate integration. :::note The `cli` feature is enabled by default. You can [disable this feature](https://doc.rust-lang.org/cargo/reference/features.html#the-default-feature) with `default-features = false`. ::: ## Node.js ### CLI The packager is distributed on [NPM](https://npm.io/package/@crabnebula/packager) as a CLI, you can install it with your preferred package manager: You then need to configure your app so the CLI can recognize it. Configuration can be done in your project `package.json` file by using the `packager` key in `packager.json`. Once you are done configuring your app, run: ### Building your application before packaging By default, the packager doesn't build your application, so if your app requires a compilation step, the packager has an option to specify a shell command to be executed before packaging your app: `beforePackagingCommand`. ### Library The packager is also a library that you can import and integrate into your tooling. ## Examples The [`examples`](https://github.com/crabnebula-dev/cargo-packager/tree/main/examples/) directory contains a number of varying examples, if you want to build them all clone the cargo-packager repository and run `cargo r -p cargo-packager -- --release` in the root of the repository. Just make sure to have the tooling for each example installed on your system. You can find what tooling they require by checking the README file in each example. The README also contains a command to build the example alone if you wish. Examples list (non-exhaustive): - [`tauri`](https://github.com/crabnebula-dev/cargo-packager/tree/main/examples/tauri/) - [`wry`](https://github.com/crabnebula-dev/cargo-packager/tree/main/examples/wry/) - [`dioxus`](https://github.com/crabnebula-dev/cargo-packager/tree/main/examples/dioxus/) - [`egui`](https://github.com/crabnebula-dev/cargo-packager/tree/main/examples/egui/) - [`deno`](https://github.com/crabnebula-dev/cargo-packager/tree/main/examples/deno/) - [`slint`](https://github.com/crabnebula-dev/cargo-packager/tree/main/examples/slint/) - [`wails`](https://github.com/crabnebula-dev/cargo-packager/tree/main/examples/wails) # Configuration The packaging config. **Object Properties**: - appimage - authors - beforeEachPackageCommand - beforePackagingCommand - binaries - binariesDir - category - copyright - deb - deepLinkProtocols - description - dmg - enabled - externalBinaries - fileAssociations - formats - homepage - icons - identifier - licenseFile - linux - logLevel - longDescription - macos - name - nsis - outDir - pacman - productName - publisher - resources - targetTriple - version - windows - wix ### appimage [`AppImageConfig`](#appimageconfig) | `null` AppImage configuration. ### authors `string`[] | `null` The package's authors. ### beforeEachPackageCommand [`HookCommand`](#hookcommand) | `null` The command to run before packaging each format for an application. This will run multiple times depending on the formats specifed. ### beforePackagingCommand [`HookCommand`](#hookcommand) | `null` The command to run before starting to package an application. This runs only once. ### binaries [`Binary`](#binary)[] The binaries to package. **Default**: `[]` ### binariesDir `string` | `null` The directory where the [`Config::binaries`] exist. Defaults to [`Config::out_dir`]. ### category [`AppCategory`](#appcategory) | `null` The app's category. ### copyright `string` | `null` The app's copyright. ### deb [`DebianConfig`](#debianconfig) | `null` Debian-specific configuration. ### deepLinkProtocols [`DeepLinkProtocol`](#deeplinkprotocol)[] | `null` Deep-link protocols. ### description `string` | `null` The package's description. ### dmg [`DmgConfig`](#dmgconfig) | `null` Dmg configuration. ### enabled `boolean` Whether this config is enabled or not. Defaults to `true`. **Default**: `true` ### externalBinaries `string`[] | `null` Paths to external binaries to add to the package. The path specified should not include `-<target-triple><.exe>` suffix, it will be auto-added when by the packager when reading these paths, so the actual binary name should have the target platform's target triple appended, as well as `.exe` for Windows. For example, if you're packaging an external binary called `sqlite3`, the packager expects a binary named `sqlite3-x86_64-unknown-linux-gnu` on linux, and `sqlite3-x86_64-pc-windows-gnu.exe` on windows. If you are building a universal binary for MacOS, the packager expects your external binary to also be universal, and named after the target triple, e.g. `sqlite3-universal-apple-darwin`. See <https://developer.apple.com/documentation/apple-silicon/building-a-universal-macos-binary> ### fileAssociations [`FileAssociation`](#fileassociation)[] | `null` The file associations ### formats [`PackageFormat`](#packageformat)[] | `null` The packaging formats to create, if not present, [`PackageFormat::platform_default`] is used. ### homepage `string` | `null` The package's homepage. ### icons `string`[] | `null` The app's icon list. Supports glob patterns. ### identifier `string` | `null` pattern of `^[a-zA-Z0-9-\.]*$` The application identifier in reverse domain name notation (e.g. `com.packager.example`). This string must be unique across applications since it is used in some system configurations. This string must contain only alphanumeric characters (A–Z, a–z, and 0–9), hyphens (-), and periods (.). ### licenseFile `string` | `null` A path to the license file. ### linux [`LinuxConfig`](#linuxconfig) | `null` Linux-specific configuration ### logLevel [`LogLevel`](#loglevel) | `null` The logging level. ### longDescription `string` | `null` The app's long description. ### macos [`MacOsConfig`](#macosconfig) | `null` MacOS-specific configuration. ### name `string` | `null` The app name, this is just an identifier that could be used to filter which app to package using `--packages` cli arg when there is multiple apps in the workspace or in the same config. This field resembles, the `name` field in `Cargo.toml` or `package.json` If `unset`, the CLI will try to auto-detect it from `Cargo.toml` or `package.json` otherwise, it will keep it unset. ### nsis [`NsisConfig`](#nsisconfig) | `null` Nsis configuration. ### outDir `string` The directory where the generated packages will be placed. If [`Config::binaries_dir`] is not set, this is also where the [`Config::binaries`] exist. ### pacman [`PacmanConfig`](#pacmanconfig) | `null` Pacman configuration. ### productName `string` The package's product name, for example "My Awesome App". ### publisher `string` | `null` The app's publisher. Defaults to the second element in [`Config::identifier`](Config::identifier) string. Currently maps to the Manufacturer property of the Windows Installer. ### resources [`Resource`](#resource)[] | `null` The app's resources to package. This a list of either a glob pattern, path to a file, path to a directory or an object of `src` and `target` paths. In the case of using an object, the `src` could be either a glob pattern, path to a file, path to a directory, and the `target` is a path inside the final resources folder in the installed package. #### Format-specific: - **[PackageFormat::Nsis] / [PackageFormat::Wix]**: The resources are placed next to the executable in the root of the packager. - **[PackageFormat::Deb]**: The resources are placed in `usr/lib` of the package. ### targetTriple `string` | `null` The target triple we are packaging for. Defaults to the current OS target triple. ### version `string` The package's version. ### windows [`WindowsConfig`](#windowsconfig) | `null` Windows-specific configuration. ### wix [`WixConfig`](#wixconfig) | `null` WiX configuration. ## Definitions ### AppCategory `"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"` The possible app categories. Corresponds to `LSApplicationCategoryType` on macOS and the GNOME desktop categories on Debian. ### AppImageConfig The Linux AppImage configuration. **Object Properties**: - bins - excludedLibs - files - libs - linuxdeployPlugins ##### bins `string`[] | `null` List of binary paths to include in the final AppImage. For example, if you want `xdg-open`, you'd specify `/usr/bin/xdg-open` ##### excludedLibs `string`[] | `null` List of globs of libraries to exclude from the final AppImage. For example, to exclude libnss3.so, you'd specify `libnss3*` ##### files | `null` List of custom files to add to the appimage package. Maps a dir/file to a dir/file inside the appimage package. **Allows additional properties**: `string` ##### libs `string`[] | `null` List of libs that exist in `/usr/lib*` to be include in the final AppImage. The libs will be searched for, using the command `find -L /usr/lib* -name <libname>` ##### linuxdeployPlugins | `null` A map of [`linuxdeploy`](https://github.com/linuxdeploy/linuxdeploy) plugin name and its URL to be downloaded and executed while packaing the appimage. For example, if you want to use the [`gtk`](https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh) plugin, you'd specify `gtk` as the key and its url as the value. **Allows additional properties**: `string` ### Binary A binary to package within the final package. **Object Properties**: - main - path (required) ##### main `boolean` Whether this is the main binary or not ##### path `string` Path to the binary (without `.exe` on Windows). If it's relative, it will be resolved from [`Config::out_dir`]. ### BundleTypeRole **One of the following**: - `"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 *macOS-only**. Corresponds to CFBundleTypeRole ### DebianConfig The Linux Debian configuration. **Object Properties**: - depends - desktopTemplate - files - priority - section ##### depends [`Dependencies`](#dependencies) | `null` The list of Debian dependencies. ##### desktopTemplate `string` | `null` Path to a custom desktop file Handlebars template. Available variables: `categories`, `comment` (optional), `exec`, `icon` and `name`. Default file contents: ```text [Desktop Entry] Categories={{categories}} {{#if comment}} Comment={{comment}} {{/if}} Exec={{exec}} {{exec_arg}} Icon={{icon}} Name={{name}} Terminal=false Type=Application {{#if mime_type}} MimeType={{mime_type}} {{/if}} ``` The `{{exec_arg}}` will be set to: * "%F", if at least one [Config::file_associations] was specified but no deep link protocols were given. * The "%F" arg means that your application can be invoked with multiple file paths. * "%U", if at least one [Config::deep_link_protocols] was specified. * The "%U" arg means that your application can be invoked with multiple URLs. * If both [Config::file_associations] and [Config::deep_link_protocols] were specified, the "%U" arg will be used, causing the file paths to be passed to your app as `file://` URLs. * An empty string "" (nothing) if neither are given. * This means that your application will never be invoked with any URLs or file paths. To specify a custom `exec_arg`, just use plaintext directly instead of `{{exec_arg}}`: ```text Exec={{exec}} %u ``` See more here: <https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables>. ##### files | `null` List of custom files to add to the deb package. Maps a dir/file to a dir/file inside the debian package. **Allows additional properties**: `string` ##### priority `string` | `null` Change the priority of the Debian Package. By default, it is set to `optional`. Recognized Priorities as of now are : `required`, `important`, `standard`, `optional`, `extra` ##### section `string` | `null` Define the section in Debian Control file. See : <https://www.debian.org/doc/debian-policy/ch-archive.html#s-subsections> ### DeepLinkProtocol Deep link protocol **Object Properties**: - name - role - schemes (required) ##### name `string` | `null` The protocol name. **macOS-only** and maps to `CFBundleTypeName`. Defaults to `<bundle-id>.<schemes[0]>` ##### role [`BundleTypeRole`](#bundletyperole) The app's role for these schemes. **macOS-only** and maps to `CFBundleTypeRole`. **Default**: `"editor"` ##### schemes `string`[] URL schemes to associate with this app without `://`. For example `my-app` ### Dependencies **Any of the following**: - `string`[] The list of dependencies provided directly as a vector of Strings. - `string` A path to the file containing the list of dependences, formatted as one per line: ```text libc6 libxcursor1 libdbus-1-3 libasyncns0 ... ``` A list of dependencies specified as either a list of Strings or as a path to a file that lists the dependencies, one per line. ### DmgConfig The Apple Disk Image (.dmg) configuration. **Object Properties**: - appFolderPosition - appPosition - background - windowPosition - windowSize ##### appFolderPosition [`Position`](#position) | `null` Position of application folder on window. ##### appPosition [`Position`](#position) | `null` Position of application file on window. ##### background `string` | `null` Image to use as the background in dmg file. Accepted formats: `png`/`jpg`/`gif`. ##### windowPosition [`Position`](#position) | `null` Position of volume window on screen. ##### windowSize [`Size`](#size) | `null` Size of volume window. ### FileAssociation A file association configuration. **Object Properties**: - description - extensions (required) - mimeType - name - role ##### description `string` | `null` The association description. **Windows-only**. It is displayed on the `Type` column on Windows Explorer. ##### extensions `string`[] File extensions to associate with this app. e.g. 'png' ##### mimeType `string` | `null` The mime-type e.g. 'image/png' or 'text/plain'. **Linux-only**. ##### name `string` | `null` The name. Maps to `CFBundleTypeName` on macOS. Defaults to the first item in `ext` ##### role [`BundleTypeRole`](#bundletyperole) The app’s role with respect to the type. Maps to `CFBundleTypeRole` on macOS. Defaults to [`BundleTypeRole::Editor`] **Default**: `"editor"` ### HookCommand **Any of the following**: - `string` Run the given script with the default options. - Run the given script with custom options. **Object Properties**: - dir - script (required) ##### dir `string` | `null` The working directory. ##### script `string` The script to execute. Describes a shell command to be executed when a CLI hook is triggered. ### LinuxConfig Linux configuration **Object Properties**: - generateDesktopEntry ##### generateDesktopEntry `boolean` Flag to indicate if desktop entry should be generated. **Default**: `true` ### LogLevel **One of the following**: - `"error"` The "error" level. Designates very serious errors. - `"warn"` The "warn" level. Designates hazardous situations. - `"info"` The "info" level. Designates useful information. - `"debug"` The "debug" level. Designates lower priority information. - `"trace"` The "trace" level. Designates very low priority, often extremely verbose, information. An enum representing the available verbosity levels of the logger. ### MacOsConfig The macOS configuration. **Object Properties**: - backgroundApp - embeddedApps - embeddedProvisionprofilePath - entitlements - exceptionDomain - frameworks - infoPlistPath - minimumSystemVersion - providerShortName - signingIdentity ##### backgroundApp `boolean` Whether this is a background application. If true, the app will not appear in the Dock. Sets the `LSUIElement` flag in the macOS plist file. ##### embeddedApps `string`[] | `null` Apps that need to be packaged within the app. ##### embeddedProvisionprofilePath `string` | `null` Path to the embedded.provisionprofile file for the package. ##### entitlements `string` | `null` Path to the entitlements.plist file. ##### exceptionDomain `string` | `null` The exception domain to use on the macOS .app package. This allows communication to the outside world e.g. a web server you're shipping. ##### frameworks `string`[] | `null` MacOS frameworks that need to be packaged with the app. Each string can either be the name of a framework (without the `.framework` extension, e.g. `"SDL2"`), in which case we will search for that framework in the standard install locations (`~/Library/Frameworks/`, `/Library/Frameworks/`, and `/Network/Library/Frameworks/`), or a path to a specific framework bundle (e.g. `./data/frameworks/SDL2.framework`). Note that this setting just makes cargo-packager copy the specified frameworks into the OS X app bundle (under `Foobar.app/Contents/Frameworks/`); you are still responsible for: - arranging for the compiled binary to link against those frameworks (e.g. by emitting lines like `cargo:rustc-link-lib=framework=SDL2` from your `build.rs` script) - embedding the correct rpath in your binary (e.g. by running `install_name_tool -add_rpath "@executable_path/../Frameworks" path/to/binary` after compiling) ##### infoPlistPath `string` | `null` Path to the Info.plist file for the package. ##### minimumSystemVersion `string` | `null` A version string indicating the minimum MacOS version that the packaged app supports (e.g. `"10.11"`). If you are using this config field, you may also want have your `build.rs` script emit `cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET=10.11`. ##### providerShortName `string` | `null` Provider short name for notarization. ##### signingIdentity `string` | `null` Code signing identity. This is typically of the form: `"Developer ID Application: TEAM_NAME (TEAM_ID)"`. ### NsisCompression **One of the following**: - `"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. - `"off"` Disable compression. Compression algorithms used in the NSIS installer. See <https://nsis.sourceforge.io/Reference/SetCompressor> ### NsisConfig The NSIS format configuration. **Object Properties**: - appdataPaths - compression - customLanguageFiles - displayLanguageSelector - headerImage - installerIcon - installMode - languages - preinstallSection - sidebarImage - template ##### appdataPaths `string`[] | `null` List of paths where your app stores data. This options tells the uninstaller to provide the user with an option (disabled by default) whether they want to rmeove your app data or keep it. The path should use a constant from <https://nsis.sourceforge.io/Docs/Chapter4.html#varconstant> in addition to `$IDENTIFIER`, `$PUBLISHER` and `$PRODUCTNAME`, for example, if you store your app data in `C:\\Users\\<user>\\AppData\\Local\\<your-company-name>\\<your-product-name>` you'd need to specify ```toml [package.metadata.packager.nsis] appdata-paths = ["$LOCALAPPDATA/$PUBLISHER/$PRODUCTNAME"] ``` ##### compression [`NsisCompression`](#nsiscompression) | `null` Set the compression algorithm used to compress files in the installer. See <https://nsis.sourceforge.io/Reference/SetCompressor> ##### customLanguageFiles | `null` An key-value pair where the key is the language and the value is the path to a custom `.nsi` file that holds the translated text for cargo-packager's custom messages. See <https://github.com/crabnebula-dev/cargo-packager/blob/main/crates/packager/src/nsis/languages/English.nsh> for an example `.nsi` file. **Note**: the key must be a valid NSIS language and it must be added to [`NsisConfig`]languages array, **Allows additional properties**: `string` ##### displayLanguageSelector `boolean` 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. ##### headerImage `string` | `null` The path to a bitmap file to display on the header of installers pages. The recommended dimensions are 150px x 57px. ##### installerIcon `string` | `null` The path to an icon file used as the installer icon. ##### installMode [`NSISInstallerMode`](#nsisinstallermode) Whether the installation will be for all users or just the current user. **Default**: `"currentUser"` ##### languages `string`[] | `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 <https://github.com/kichik/nsis/tree/9465c08046f00ccb6eda985abbdbf52c275c6c4d/Contrib/Language%20files> for the complete list of languages. ##### preinstallSection `string` | `null` Logic of an NSIS section that will be ran before the install section. See the available libraries, dlls and global variables here <https://github.com/crabnebula-dev/cargo-packager/blob/main/crates/packager/src/package/nsis/installer.nsi> ###### Example ```toml [package.metadata.packager.nsis] preinstall-section = """ ; Setup custom messages LangString webview2AbortError ${LANG_ENGLISH} "Failed to install WebView2! The app can't run without it. Try restarting the installer." LangString webview2DownloadError ${LANG_ARABIC} "خطأ: فشل تنزيل WebView2 - $0" Section PreInstall ; <section logic here> SectionEnd Section AnotherPreInstall ; <section logic here> SectionEnd """ ``` ##### sidebarImage `string` | `null` The path to a bitmap file for the Welcome page and the Finish page. The recommended dimensions are 164px x 314px. ##### template `string` | `null` A custom `.nsi` template to use. See the default template here <https://github.com/crabnebula-dev/cargo-packager/blob/main/crates/packager/src/package/nsis/installer.nsi> ### NSISInstallerMode **One of the following**: - `"currentUser"` Default mode for the installer. Install the app by default in a directory that doesn't require Administrator access. Installer metadata will be saved under the `HKCU` registry path. - `"perMachine"` Install the app by default in the `Program Files` folder directory requires Administrator access for the installation. Installer metadata will be saved under the `HKLM` registry path. - `"both"` Combines both modes and allows the user to choose at install time whether to install for the current user or per machine. Note that this mode will require Administrator access even if the user wants to install it for the current user only. Installer metadata will be saved under the `HKLM` or `HKCU` registry path based on the user's choice. Install Modes for the NSIS installer. ### PackageFormat **One of the following**: - `"all"` All available package formats for the current platform. See [`PackageFormat::platform_all`] - `"default"` The default list of package formats for the current platform. See [`PackageFormat::platform_default`] - `"app"` The macOS application bundle (.app). - `"dmg"` The macOS DMG package (.dmg). - `"wix"` The Microsoft Software Installer (.msi) through WiX Toolset. - `"nsis"` The NSIS installer (.exe). - `"deb"` The Linux Debian package (.deb). - `"appimage"` The Linux AppImage package (.AppImage). - `"pacman"` The Linux Pacman package (.tar.gz and PKGBUILD) Types of supported packages by [`cargo-packager`](https://docs.rs/cargo-packager). ### PacmanConfig The Linux pacman configuration. **Object Properties**: - conflicts - depends - files - provides - replaces - source ##### conflicts `string`[] | `null` Packages that conflict or cause problems with the app. All these packages and packages providing this item will need to be removed See : <https://wiki.archlinux.org/title/PKGBUILD#conflicts> ##### depends [`Dependencies`](#dependencies) | `null` List of softwares that must be installed for the app to build and run. See : <https://wiki.archlinux.org/title/PKGBUILD#depends> ##### files | `null` List of custom files to add to the pacman package. Maps a dir/file to a dir/file inside the pacman package. **Allows additional properties**: `string` ##### provides `string`[] | `null` Additional packages that are provided by this app. See : <https://wiki.archlinux.org/title/PKGBUILD#provides> ##### replaces `string`[] | `null` Only use if this app replaces some obsolete packages. For example, if you rename any package. See : <https://wiki.archlinux.org/title/PKGBUILD#replaces> ##### source `string`[] | `null` Source of the package to be stored at PKGBUILD. PKGBUILD is a bash script, so version can be referred as ${pkgver} ### Position Position coordinates struct. **Object Properties**: - x (required) - y (required) ##### x `integer` formatted as `uint32` X coordinate. ##### y `integer` formatted as `uint32` Y coordinate. ### Resource **Any of the following**: - `string` Supports glob patterns - An object descriping the src file or directory and its target location in the final package. **Object Properties**: - src (required) - target (required) ##### src `string` The src file or directory, supports glob patterns. ##### target `string` A relative path from the root of the final package. If `src` is a glob, this will always be treated as a directory where all globbed files will be placed under. A path to a resource (with optional glob pattern) or an object of `src` and `target` paths. ### Size Size struct. **Object Properties**: - height (required) - width (required) ##### height `integer` formatted as `uint32` Height. ##### width `integer` formatted as `uint32` Width. ### WindowsConfig The Windows configuration. **Object Properties**: - allowDowngrades - certificateThumbprint - digestAlgorithm - signCommand - timestampUrl - tsp ##### allowDowngrades `boolean` Whether to validate a second app installation, blocking the user from installing an older version if set to `false`. For instance, if `1.2.1` is installed, the user won't be able to install app version `1.2.0` or `1.1.5`. The default value of this flag is `true`. **Default**: `true` ##### certificateThumbprint `string` | `null` The SHA1 hash of the signing certificate. ##### digestAlgorithm `string` | `null` The file digest algorithm to use for creating file signatures. Required for code signing. SHA-256 is recommended. ##### signCommand `string` | `null` Specify a custom command to sign the binaries. This command needs to have a `%1` in it which is just a placeholder for the binary path, which we will detect and replace before calling the command. By Default we use `signtool.exe` which can be found only on Windows so if you are on another platform and want to cross-compile and sign you will need to use another tool like `osslsigncode`. ##### timestampUrl `string` | `null` Server to use during timestamping. ##### tsp `boolean` Whether to use Time-Stamp Protocol (TSP, a.k.a. RFC 3161) for the timestamp server. Your code signing provider may use a TSP timestamp server, like e.g. SSL.com does. If so, enable TSP by setting to true. ### WixConfig The wix format configuration **Object Properties**: - bannerPath - componentGroupRefs - componentRefs - customActionRefs - dialogImagePath - featureGroupRefs - featureRefs - fipsCompliant - fragmentPaths - fragments - languages - mergeModules - mergeRefs - template ##### bannerPath `string` | `null` Path to a bitmap file to use as the installation user interface banner. This bitmap will appear at the top of all but the first page of the installer. The required dimensions are 493px × 58px. ##### componentGroupRefs `string`[] | `null` The ComponentGroup element ids you want to reference from the fragments. ##### componentRefs `string`[] | `null` The Component element ids you want to reference from the fragments. ##### customActionRefs `string`[] | `null` The CustomAction element ids you want to reference from the fragments. ##### dialogImagePath `string` | `null` Path to a bitmap file to use on the installation user interface dialogs. It is used on the welcome and completion dialogs. The required dimensions are 493px × 312px. ##### featureGroupRefs `string`[] | `null` The FeatureGroup element ids you want to reference from the fragments. ##### featureRefs `string`[] | `null` The Feature element ids you want to reference from the fragments. ##### fipsCompliant `boolean` Enables FIPS compliant algorithms. ##### fragmentPaths `string`[] | `null` A list of paths to .wxs files with WiX fragments to use. ##### fragments `string`[] | `null` List of WiX fragments as strings. This is similar to `config.wix.fragments_paths` but is a string so you can define it inline in your config. ```text <?xml version="1.0" encoding="utf-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Fragment> <CustomAction Id="OpenNotepad" Directory="INSTALLDIR" Execute="immediate" ExeCommand="cmd.exe /c notepad.exe" Return="check" /> <InstallExecuteSequence> <Custom Action="OpenNotepad" After="InstallInitialize" /> </InstallExecuteSequence> </Fragment> </Wix> ``` ##### languages [`WixLanguage`](#wixlanguage)[] | `null` The app languages to build. See <https://docs.microsoft.com/en-us/windows/win32/msi/localizing-the-error-and-actiontext-tables>. ##### mergeModules `string`[] | `null` List of merge modules to include in your installer. For example, if you want to include [C++ Redis merge modules] [C++ Redis merge modules]: https://wixtoolset.org/docs/v3/howtos/redistributables_and_install_checks/install_vcredist/ ##### mergeRefs `string`[] | `null` The Merge element ids you want to reference from the fragments. ##### template `string` | `null` By default, the packager uses an internal template. This option allows you to define your own wix file. ### WixLanguage **Any of the following**: - `string` Built-in wix language identifier. - Custom wix language. **Object Properties**: - identifier (required) - path ##### identifier `string` Idenitifier of this language, for example `en-US` ##### path `string` | `null` The path to a locale (`.wxl`) file. See <https://wixtoolset.org/documentation/manual/v3/howtos/ui_and_localization/build_a_localized_version.html>. A wix language. # Packaging Tauri import CommandTabs from "@components/CommandTabs.astro"; The Cargo Packager can be used to package, bundle and update [Tauri apps](https://tauri.app/). ## Creating a Tauri App Package You can create a Tauri app bundle with the following steps. For this, you may [Create a new Tauri app](https://tauri.app/start/create-project/) or can use an existing Tauri app. ### 1. Install the Cargo Packager Cargo packager can be installed with the help of the following commands, depending on the package manager you chose in the previous step: Now, Packager is installed in your application. Next you will add the configuration to use Packager. ### 2. Adding the Configuration Now, you must add configuration to your application. For this, you have to edit the `src-tauri/Cargo.toml` file and add the following snippet to it. ```toml title="src-tauri/Cargo.toml" [package.metadata.packager] before-packaging-command = "cargo tauri build" product-name = "Tauri example" identifier = "com.tauri.example" resources = [ "icons/**" ] icons = [ "icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png", "icons/icon.icns", "icons/icon.ico", ] ``` Additionally, you must configure the dependencies required by Tauri: ```toml title="src-tauri/Cargo.toml" [package.metadata.packager.deb] depends = ["libgtk-3-0", "libwebkit2gtk-4.1-0", "libayatana-appindicator3-1"] section = "rust" [package.metadata.packager.appimage] bins = ["/usr/bin/xdg-open"] libs = [ "WebKitNetworkProcess", "WebKitWebProcess", "libwebkit2gtkinjectedbundle.so", "libayatana-appindicator3.so.1", ] [package.metadata.packager.appimage.linuxdeploy-plugins] "gtk" = "https://raw.githubusercontent.com/tauri-apps/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh" [package.metadata.packager.nsis] appdata-paths = ["$LOCALAPPDATA/$IDENTIFIER"] preinstall-section = """ ; Setup messages ; English LangString webview2AbortError ${LANG_ENGLISH} "Failed to install WebView2! The app can't run without it. Try restarting the installer." LangString webview2DownloadError ${LANG_ENGLISH} "Error: Downloading WebView2 Failed - $0" LangString webview2DownloadSuccess ${LANG_ENGLISH} "WebView2 bootstrapper downloaded successfully" LangString webview2Downloading ${LANG_ENGLISH} "Downloading WebView2 bootstrapper..." LangString webview2InstallError ${LANG_ENGLISH} "Error: Installing WebView2 failed with exit code $1" LangString webview2InstallSuccess ${LANG_ENGLISH} "WebView2 installed successfully" Section PreInstall ; Check if Webview2 is already installed and skip this section ${If} ${RunningX64} ReadRegStr $4 HKLM "SOFTWARE\\WOW6432Node\\Microsoft\\EdgeUpdate\\Clients\\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" "pv" ${Else} ReadRegStr $4 HKLM "SOFTWARE\\Microsoft\\EdgeUpdate\\Clients\\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" "pv" ${EndIf} ReadRegStr $5 HKCU "SOFTWARE\\Microsoft\\EdgeUpdate\\Clients\\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" "pv" StrCmp $4 "" 0 webview2_done StrCmp $5 "" 0 webview2_done Delete "$TEMP\\MicrosoftEdgeWebview2Setup.exe" DetailPrint "$(webview2Downloading)" nsis_tauri_utils::download "https://go.microsoft.com/fwlink/p/?LinkId=2124703" "$TEMP\\MicrosoftEdgeWebview2Setup.exe" Pop $0 ${If} $0 == 0 DetailPrint "$(webview2DownloadSuccess)" ${Else} DetailPrint "$(webview2DownloadError)" Abort "$(webview2AbortError)" ${EndIf} StrCpy $6 "$TEMP\\MicrosoftEdgeWebview2Setup.exe" DetailPrint "$(installingWebview2)" ; $6 holds the path to the webview2 installer ExecWait "$6 /install" $1 ${If} $1 == 0 DetailPrint "$(webview2InstallSuccess)" ${Else} DetailPrint "$(webview2InstallError)" Abort "$(webview2AbortError)" ${EndIf} webview2_done: SectionEnd """ ``` Be sure to replace **`before-packaging-command`** with the command you use to build the Tauri app. :::note The `productName` defined in your `tauri.conf.json` file must match the `Cargo.toml` `[package] name` value otherwise the packager cannot find your application executable. ::: For the complete list of configuration options, see [the configuration page](/packager/configuration). #### 3. Package the App The Tauri app can now be packaged. You can simply use the given commands as per the Package Manager you used to install Cargo Packager. You can now see your Tauri app nicely packaged by the Packager. The app bundles and installers are generated in the `target/release` folder. # Auto-Updater import CommandTabs from "@components/CommandTabs.astro"; The Packager includes support for auto updates for Rust and Node.js applications by providing APIs for your application to securely update itself by fetching new releases on a remote server, installing updates and restarting itself. ## Signing Keys To securely deliver updates, the Packager signs your application generating a signature that is verified by the updater. To generate a new keypair, use the CLI `signer generate` command: The command will prompt you for the keypair password. Do not lose that password, you will need to define it as the `CARGO_PACKAGER_SIGN_PRIVATE_KEY_PASSWORD` environment variable for the packager to sign your update packages. After generating the keys, the CLI prints the private key and the public key. The private key must be defined as the `CARGO_PACKAGER_SIGN_PRIVATE_KEY` environment variable and must be treated as a secret, DO NOT share it, if it is compromised you will need to replace it immediately. Along with the private key, the CLI also prints the public key that must be configured in the application to verify updates. The configuration object is documented later in this guide. ## Rust To configure the updater for your Rust application, add the `cargo-packager-updater` crate: ```sh frame="none" cargo add cargo-packager-updater ``` Start off by importing packager updater: ```rust use cargo_packager_updater::{semver::Version, url::Url}; ``` Create the updater configuration object, with the endpoint of the remote server hosting your app updates and your signing public key and use the `cargo_packager_updater::check_update` API to fetch an update if there is one: ```rust let config = cargo_packager_updater::Config { endpoints: vec![Url::parse("http://myserver.com/updates").expect("Failed to parse URL")], pubkey: String::from(""), ..Default::default() }; let current_version = Version::parse(env!("CARGO_PKG_VERSION")).expect("Failed to parse version"); println!("Current version: {}", current_version); if let Some(update) = cargo_packager_updater::check_update(current_version.clone(), config) .expect("Failed to check for update") { update .download_and_install() .expect("Failed to download and install update"); println!("Update installed") } else { println!("No update available") } ``` Check out the complete [configuration documentation](#configuration). ## Node.js To configure the updater for your Node.js application, install the `@crabnebula/updater` package: Create the updater configuration object, with the endpoint of the remote server hosting your app updates and your signing public key: ```javascript const config = { endpoints: ["http://myserver.com/updates"], pubkey: "", }; ``` Check out the complete [configuration documentation](#configuration). Use the `checkUpdate` API to fetch an update if there is one: ```javascript frame="none" import { checkUpdate } from "@crabnebula/updater"; // insert your config object here const config = { ... }; // here you must use the current app version // usually an environment variable that is injected in your app // (framework-specific), check your framework documentation for ideas on how to do this const currentVersion = "0.1.0"; const update = await checkUpdate(currentVersion, config); if (update !== null) { update.downloadAndInstall(); } else { // there is no updates } ``` ## Configuration The updater configuration object allows you to define a list of endpoints to connect, ### Endpoints The `endpoints` required configuration is a list of URLs that are used to check if a new update is available. The endpoints are queried in order until a valid response is found (subsequent URLs are used as fallback in case the first one cannot be reached). Each endpoint can use the `{{arch}}`, `{{target}}` or `{{current_version}}` variables which are detected and replaced with the appropriate values before making a request to the endpoint: - `{{current_version}}`: The version of the app that is requesting the update. - `{{target}}`: The operating system name (one of `linux`, `windows` or `macos`). - `{{arch}}`: The architecture of the machine (one of `x86_64`, `i686`, `aarch64` or `armv7`). for example `https://releases.myapp.com/{{target}}/{{arch}}/{{current_version}}` can evaluate to `https://releases.myapp.com/windows/x86_64/0.1.0`. ### Pubkey The `pubkey` is a required configuration that defines the public key generated with the `signer generate` Packager CLI command. It is used to verify the authenticity of the update, ensuring it was built using your private key. ### Windows Under the `windows` object you can define the `installerArgs`, a list of string arguments that are given to the NSIS or WiX installers, and the `installMode`, an enum (one of `basicUi`, `quiet` and `passive`) which furthers configure the installer (defaults to `passive`, a mode that does not require the user to interact with the update installation).