app
type DataStoreIdentifier: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number];type NewInstance: object;| Name | Type | Defined in |
|---|---|---|
args | string[] | |
cwd | string |
function defaultWindowIcon(): Promise<Image | null>Get the default window icon.
import { defaultWindowIcon } from '@crabnebula/taurify-api/app';await defaultWindowIcon();function fetchDataStoreIdentifiers(): Promise<DataStoreIdentifier[]>Fetches the data store identifiers on macOS and iOS.
See https://developer.apple.com/documentation/webkit/wkwebsitedatastore for more information.
Promise<DataStoreIdentifier[]>
import { fetchDataStoreIdentifiers } from '@crabnebula/taurify-api/app';const ids = await fetchDataStoreIdentifiers();function getIdentifier(): Promise<string>Gets the application identifier.
Promise<string>
The application identifier as configured in tauri.conf.json.
import { getIdentifier } from '@crabnebula/taurify-api/app';const identifier = await getIdentifier();function getName(): Promise<string>Gets the application name.
Promise<string>
import { getName } from '@crabnebula/taurify-api/app';const appName = await getName();function getTauriVersion(): Promise<string>Gets the Tauri version.
Promise<string>
import { getTauriVersion } from '@crabnebula/taurify-api/app';const tauriVersion = await getTauriVersion();function getVersion(): Promise<string>Gets the application version.
Promise<string>
import { getVersion } from '@crabnebula/taurify-api/app';const appVersion = await getVersion();function hide(): Promise<void>Hides the application on macOS.
Promise<void>
import { hide } from '@crabnebula/taurify-api/app';await hide();function onNewInstance(cb): Promise<void>| Parameter | Type |
|---|---|
cb | (instance) => void |
Promise<void>
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.
| Parameter | Type |
|---|---|
uuid | DataStoreIdentifier |
Promise<DataStoreIdentifier[]>
import { fetchDataStoreIdentifiers, removeDataStore } from '@crabnebula/taurify-api/app';for (const id of (await fetchDataStoreIdentifiers())) { await removeDataStore(id);}function setDockVisibility(visible): Promise<void>Sets the dock visibility for the application on macOS.
| Parameter | Type | Description |
|---|---|---|
visible | boolean | whether the dock should be visible or not |
Promise<void>
function setTheme(theme?): Promise<void>Set app’s theme, pass in null or undefined to follow system theme
| Parameter | Type |
|---|---|
theme? | null | Theme |
Promise<void>
import { setTheme } from '@crabnebula/taurify-api/app';await setTheme('dark');- iOS / Android: Unsupported.
function show(): Promise<void>Shows the application on macOS. This function does not automatically focus any specific app window.
Promise<void>
import { show } from '@crabnebula/taurify-api/app';await show();