Aller au contenu
Tauri

app

Ce contenu n’est pas encore disponible dans votre langue.

Type Aliases

DataStoreIdentifier

type DataStoreIdentifier: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number];

Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/app.ts#L9

Functions

defaultWindowIcon()

function defaultWindowIcon(): Promise<Image | null>

Get the default window icon.

Returns

Promise<Image | null>

Example

import { defaultWindowIcon } from '@tauri-apps/api/app';
await defaultWindowIcon();

Since

2.0.0

Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/app.ts#L174


fetchDataStoreIdentifiers()

function fetchDataStoreIdentifiers(): Promise<DataStoreIdentifier[]>

Fetches the data store identifiers on macOS and iOS.

See https://developer.apple.com/documentation/webkit/wkwebsitedatastore for more information.

Returns

Promise<DataStoreIdentifier[]>

Example

import { fetchDataStoreIdentifiers } from '@tauri-apps/api/app';
const ids = await fetchDataStoreIdentifiers();

Since

2.4.0

Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/app.ts#L136


getIdentifier()

function getIdentifier(): Promise<string>

Gets the application identifier.

Returns

Promise<string>

The application identifier as configured in tauri.conf.json.

Example

import { getIdentifier } from '@tauri-apps/api/app';
const identifier = await getIdentifier();

Since

2.4.0

Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/app.ts#L89


getName()

function getName(): Promise<string>

Gets the application name.

Returns

Promise<string>

Example

import { getName } from '@tauri-apps/api/app';
const appName = await getName();

Since

1.0.0

Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/app.ts#L58


getTauriVersion()

function getTauriVersion(): Promise<string>

Gets the Tauri version.

Returns

Promise<string>

Example

import { getTauriVersion } from '@tauri-apps/api/app';
const tauriVersion = await getTauriVersion();

Since

1.0.0

Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/app.ts#L73


getVersion()

function getVersion(): Promise<string>

Gets the application version.

Returns

Promise<string>

Example

import { getVersion } from '@tauri-apps/api/app';
const appVersion = await getVersion();

Since

1.0.0

Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/app.ts#L44


hide()

function hide(): Promise<void>

Hides the application on macOS.

Returns

Promise<void>

Example

import { hide } from '@tauri-apps/api/app';
await hide();

Since

1.2.0

Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/app.ts#L119


removeDataStore()

function removeDataStore(uuid): Promise<DataStoreIdentifier[]>

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

ParameterType
uuidDataStoreIdentifier

Returns

Promise<DataStoreIdentifier[]>

Example

import { fetchDataStoreIdentifiers, removeDataStore } from '@tauri-apps/api/app';
for (const id of (await fetchDataStoreIdentifiers())) {
await removeDataStore(id);
}

Since

2.4.0

Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/app.ts#L157


setDockVisibility()

function setDockVisibility(visible): Promise<void>

Sets the dock visibility for the application on macOS.

Parameters

ParameterTypeDescription
visiblebooleanwhether the dock should be visible or not

Returns

Promise<void>

Since

2.5.0

Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/app.ts#L205


setTheme()

function setTheme(theme?): Promise<void>

Set app’s theme, pass in null or undefined to follow system theme

Parameters

ParameterType
theme?null | Theme

Returns

Promise<void>

Example

import { setTheme } from '@tauri-apps/api/app';
await setTheme('dark');

Platform-specific

  • iOS / Android: Unsupported.

Since

2.0.0

Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/app.ts#L195


show()

function show(): Promise<void>

Shows the application on macOS. This function does not automatically focus any specific app window.

Returns

Promise<void>

Example

import { show } from '@tauri-apps/api/app';
await show();

Since

1.2.0

Source: https://github.com/tauri-apps/tauri/blob/dev/packages/api/src/app.ts#L104


© 2025 Tauri Contributors. CC-BY / MIT