app
Type Aliases
DataStoreIdentifier
type DataStoreIdentifier: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number];NewInstance
type NewInstance: object;Type declaration
| Name | Type | Defined in |
|---|---|---|
args | string[] | |
cwd | string |
Functions
defaultWindowIcon()
function defaultWindowIcon(): Promise<Image | null>Get the default window icon.
Returns
Example
import { defaultWindowIcon } from '@crabnebula/taurify-api/app';await defaultWindowIcon();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 '@crabnebula/taurify-api/app';const ids = await fetchDataStoreIdentifiers();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 '@crabnebula/taurify-api/app';const identifier = await getIdentifier();getName()
function getName(): Promise<string>Gets the application name.
Returns
Promise<string>
Example
import { getName } from '@crabnebula/taurify-api/app';const appName = await getName();getTauriVersion()
function getTauriVersion(): Promise<string>Gets the Tauri version.
Returns
Promise<string>
Example
import { getTauriVersion } from '@crabnebula/taurify-api/app';const tauriVersion = await getTauriVersion();getVersion()
function getVersion(): Promise<string>Gets the application version.
Returns
Promise<string>
Example
import { getVersion } from '@crabnebula/taurify-api/app';const appVersion = await getVersion();hide()
function hide(): Promise<void>Hides the application on macOS.
Returns
Promise<void>
Example
import { hide } from '@crabnebula/taurify-api/app';await hide();onNewInstance()
function onNewInstance(cb): Promise<void>Parameters
| Parameter | Type |
|---|---|
cb | (instance) => void |
Returns
Promise<void>
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
| Parameter | Type |
|---|---|
uuid | DataStoreIdentifier |
Returns
Promise<DataStoreIdentifier[]>
Example
import { fetchDataStoreIdentifiers, removeDataStore } from '@crabnebula/taurify-api/app';for (const id of (await fetchDataStoreIdentifiers())) { await removeDataStore(id);}setDockVisibility()
function setDockVisibility(visible): Promise<void>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<void>
setTheme()
function setTheme(theme?): Promise<void>Set app’s theme, pass in null or undefined to follow system theme
Parameters
| Parameter | Type |
|---|---|
theme? | null | Theme |
Returns
Promise<void>
Example
import { setTheme } from '@crabnebula/taurify-api/app';await setTheme('dark');Platform-specific
- iOS / Android: Unsupported.
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 '@crabnebula/taurify-api/app';await show();