Skip to content

app

Type Aliases

NewInstance

type NewInstance: object;

Type declaration

NameTypeDefined in
argsstring[]
cwdstring

Functions

defaultWindowIcon()

function defaultWindowIcon(): Promise<Image | null>

Get the default window icon.

Returns

Promise<Image | null>

Example

import { defaultWindowIcon } from '@crabnebula/taurify-api/app';
await defaultWindowIcon();

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

ParameterType
cb(instance) => void

Returns

Promise<void>


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 '@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();