Package-level declarations

Types

Link copied to clipboard
sealed external interface BackgroundThrottlingPolicy

Background throttling policy

Link copied to clipboard
sealed external interface BaseDirectory
Link copied to clipboard
sealed external interface BundleType

Bundle type of the current application.

Link copied to clipboard
external class Channel<T>
Link copied to clipboard
external class CloseRequestedEvent
Link copied to clipboard
typealias Color = Any

An RGBA color. Each value has minimum of 0 and maximum of 255.

Link copied to clipboard
sealed external interface CursorIcon
Link copied to clipboard
typealias DataStoreIdentifier = ERROR CLASS: Symbol not found for js.array.ReadonlyArray<kotlin/Double>

Identifier type used for data stores on macOS and iOS.

Link copied to clipboard
typealias DragDropEvent = Any

The drag and drop event types.

Link copied to clipboard
sealed external interface Effect

Platform-specific window effects

Link copied to clipboard
external interface Effects

The window effects configuration object

Link copied to clipboard
sealed external interface EffectState

Window effect state macOS only

Link copied to clipboard
external interface Event<T>
Link copied to clipboard
typealias EventCallback<T> = (event: Event<T>) -> Unit
Link copied to clipboard
typealias EventName = Any
Link copied to clipboard
typealias EventTarget = Any
Link copied to clipboard
external object global
Link copied to clipboard
external class Image : Resource

An RGBA Image in row-major order from top to bottom.

Link copied to clipboard
external interface ImageSize
Link copied to clipboard
typealias InvokeArgs = Any

Command arguments.

Link copied to clipboard
external interface InvokeOptions
Link copied to clipboard
external class LogicalPosition

A position represented in logical pixels. For an explanation of what logical pixels are, see description of {@linkcode LogicalSize}.

Link copied to clipboard
external interface LogicalPositionObject
Link copied to clipboard
external interface LogicalPositionObjectTemp
Link copied to clipboard
external interface LogicalPositionToJSONResult
Link copied to clipboard
external class 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.

Link copied to clipboard
external interface LogicalSizeObject
Link copied to clipboard
external interface LogicalSizeObjectTemp
Link copied to clipboard
external interface LogicalSizeToJSONResult
Link copied to clipboard
typealias MenuIcon = Any

A type that represents an icon that can be used in menu items.

Link copied to clipboard
external interface MockIPCOptions

Options for mockIPC.

Link copied to clipboard
external interface Monitor

Allows you to retrieve information about a given monitor.

Link copied to clipboard
external interface MonitorWorkArea
Link copied to clipboard
sealed external interface MouseButton
Link copied to clipboard
sealed external interface MouseButtonState
Link copied to clipboard
external interface OnBackButtonPressPayload

Payload for the onBackButtonPress event.

Link copied to clipboard
external interface Options
Link copied to clipboard
sealed external interface PermissionState
Link copied to clipboard
external class PhysicalPosition

A position represented in physical pixels.

Link copied to clipboard
external interface PhysicalPositionObject
Link copied to clipboard
external interface PhysicalPositionObjectTemp
Link copied to clipboard
external interface PhysicalPositionToJSONResult
Link copied to clipboard
external class PhysicalSize

A size represented in physical pixels.

Link copied to clipboard
external interface PhysicalSizeObject
Link copied to clipboard
external interface PhysicalSizeObjectTemp
Link copied to clipboard
external interface PhysicalSizeToJSONResult
Link copied to clipboard
external class PluginListener
Link copied to clipboard
external class Position

A position represented either in physical or in logical pixels.

Link copied to clipboard
external interface PositionToJSONResult
Link copied to clipboard
external interface PreventOverflowMargin

Minimum margin to work area

Link copied to clipboard
external interface ProgressBarState
Link copied to clipboard
sealed external interface ProgressBarStatus
Link copied to clipboard
sealed external interface ResizeDirection
Link copied to clipboard
open external class Resource

A rust-backed resource stored through tauri::Manager::resources_table API.

Link copied to clipboard
external interface ScaleFactorChanged

The payload for the scaleChange event.

Link copied to clipboard
sealed external interface ScrollBarStyle

The scrollbar style to use in the webview.

Link copied to clipboard
external class Size

A size represented either in physical or in logical pixels.

Link copied to clipboard
external interface SizeToJSONResult
Link copied to clipboard
sealed external interface TauriEvent
Link copied to clipboard
external interface Temp0
Link copied to clipboard
external interface Temp1
Link copied to clipboard
external interface Temp2
Link copied to clipboard
external interface Temp3
Link copied to clipboard
external interface Temp4
Link copied to clipboard
external interface Temp5
Link copied to clipboard
sealed external interface Temp6
Link copied to clipboard
sealed external interface Theme
Link copied to clipboard
sealed external interface TitleBarStyle
Link copied to clipboard
external class TrayIcon : Resource

Tray icon class and associated methods. This type constructor is private, instead, you should use the static method {@linkcode TrayIcon.new}.

Link copied to clipboard
external interface TrayIconClickEvent
Link copied to clipboard
typealias TrayIconEvent = Any

Describes a tray icon event.

Link copied to clipboard
external interface TrayIconEventBase<T : TrayIconEventType>
Link copied to clipboard
external interface TrayIconEventBaseRect
Link copied to clipboard
sealed external interface TrayIconEventType
Link copied to clipboard
external interface TrayIconOptions

{@link TrayIcon.new|TrayIcon} creation options

Link copied to clipboard
typealias UnlistenFn = () -> Unit
Link copied to clipboard
sealed external interface UserAttentionType

Attention type to request on a window.

Link copied to clipboard
open external class Webview

Create new webview or get a handle to an existing one.

Link copied to clipboard
typealias WebviewLabel = String
Link copied to clipboard
external interface WebviewOptions

Configuration for the webview to create.

Link copied to clipboard
open external class WebviewWindow : Webview
Link copied to clipboard
external interface WebviewWindowOptions : <ERROR CLASS> ERROR CLASS: Symbol not found for JsAny, WindowOptions
Link copied to clipboard
open external class Window

Create new window or get a handle to an existing one.

Link copied to clipboard
typealias WindowLabel = String
Link copied to clipboard
external interface WindowOptions

Configuration for the window to create.

Link copied to clipboard
external interface WindowSizeConstraints

Properties

Link copied to clipboard
external val SERIALIZE_TO_IPC_FN: Any?

Functions

Link copied to clipboard
external fun <T> addPluginListener(plugin: String, event: String, cb: (payload: T) -> Unit): ERROR CLASS: Symbol not found for js.promise.Promise<tauri/apps/api/PluginListener>

Adds a listener to a plugin event.

Link copied to clipboard
external fun appCacheDir(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns the path to the suggested directory for your app's cache files. Resolves to ${cacheDir}/${bundleIdentifier}, where bundleIdentifier is the identifier value configured in tauri.conf.json.

Link copied to clipboard
external fun appConfigDir(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns the path to the suggested directory for your app's config files. Resolves to ${configDir}/${bundleIdentifier}, where bundleIdentifier is the identifier value configured in tauri.conf.json.

Link copied to clipboard
external fun appDataDir(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns the path to the suggested directory for your app's data files. Resolves to ${dataDir}/${bundleIdentifier}, where bundleIdentifier is the identifier value configured in tauri.conf.json.

Link copied to clipboard
external fun appLocalDataDir(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns the path to the suggested directory for your app's local data files. Resolves to ${localDataDir}/${bundleIdentifier}, where bundleIdentifier is the identifier value configured in tauri.conf.json.

Link copied to clipboard
external fun appLogDir(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns the path to the suggested directory for your app's log files.

Link copied to clipboard
external fun audioDir(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns the path to the user's audio directory.

Link copied to clipboard
external fun availableMonitors(): ERROR CLASS: Symbol not found for js.promise.Promise<ERROR CLASS: Symbol not found for js.array.ReadonlyArray<tauri/apps/api/Monitor>>

Returns the list of all the monitors available on the system.

Link copied to clipboard
external fun basename(path: String, ext: String = definedExternally): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns the last portion of a path. Trailing directory separators are ignored.

Link copied to clipboard
external fun cacheDir(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns the path to the user's cache directory.

Link copied to clipboard
external fun <T> checkPermissions(plugin: String): ERROR CLASS: Symbol not found for js.promise.Promise<T>

Get permission state for a plugin.

Link copied to clipboard
external fun clearMocks()

Clears mocked functions/data injected by the other functions in this module. When using a test runner that doesn't provide a fresh window object for each test, calling this function will reset tauri specific properties.

Link copied to clipboard
external fun configDir(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns the path to the user's config directory.

Link copied to clipboard
external fun convertFileSrc(filePath: String, protocol: String = definedExternally): 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 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.

Link copied to clipboard
external fun currentMonitor(): ERROR CLASS: Symbol not found for js.promise.Promise<tauri/apps/api/Monitor?>

Returns the monitor on which the window currently resides. Returns null if current monitor can't be detected.

Link copied to clipboard
external fun cursorPosition(): ERROR CLASS: Symbol not found for js.promise.Promise<tauri/apps/api/PhysicalPosition>

Get the cursor position relative to the top-left hand corner of the desktop.

Link copied to clipboard
external fun dataDir(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns the path to the user's data directory.

Link copied to clipboard
external fun defaultWindowIcon(): ERROR CLASS: Symbol not found for js.promise.Promise<tauri/apps/api/Image?>

Gets the default window icon.

Link copied to clipboard
external fun delimiter(): String

Returns the platform-specific path segment delimiter:

Link copied to clipboard
external fun desktopDir(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns the path to the user's desktop directory.

Link copied to clipboard
external fun dirname(path: String): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns the parent directory of a given path. Trailing directory separators are ignored.

Link copied to clipboard
external fun documentDir(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns the path to the user's document directory.

Link copied to clipboard
external fun downloadDir(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns the path to the user's download directory.

Link copied to clipboard
external fun <T> emit(event: String, payload: T = definedExternally): ERROR CLASS: Symbol not found for js.promise.Promise<ERROR CLASS: Symbol not found for js.core.Void>

Emits an event to all {@link EventTarget|targets}.

Link copied to clipboard
external fun <T> emitTo(target: EventTarget, event: String, payload: T = definedExternally): ERROR CLASS: Symbol not found for js.promise.Promise<ERROR CLASS: Symbol not found for js.core.Void>
external fun <T> emitTo(target: String, event: String, payload: T = definedExternally): ERROR CLASS: Symbol not found for js.promise.Promise<ERROR CLASS: Symbol not found for js.core.Void>

Emits an event to all {@link EventTarget|targets} matching the given target.

Link copied to clipboard
external fun executableDir(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns the path to the user's executable directory.

Link copied to clipboard
external fun extname(path: String): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns the extension of the path.

Link copied to clipboard
external fun fetchDataStoreIdentifiers(): ERROR CLASS: Symbol not found for js.promise.Promise<ERROR CLASS: Symbol not found for js.array.ReadonlyArray<{tauri/apps/api/DataStoreIdentifier=} ERROR CLASS: Symbol not found for js.array.ReadonlyArray<kotlin/Double>>>

Fetches the data store identifiers on macOS and iOS.

Link copied to clipboard
external fun fontDir(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns the path to the user's font directory.

Link copied to clipboard
external fun getAllWebviews(): ERROR CLASS: Symbol not found for js.promise.Promise<ERROR CLASS: Symbol not found for js.array.ReadonlyArray<tauri/apps/api/Webview>>

Gets a list of instances of Webview for all available webviews.

Link copied to clipboard
external fun getAllWebviewWindows(): ERROR CLASS: Symbol not found for js.promise.Promise<ERROR CLASS: Symbol not found for js.array.ReadonlyArray<tauri/apps/api/WebviewWindow>>

Gets a list of instances of Webview for all available webview windows.

Link copied to clipboard
external fun getAllWindows(): ERROR CLASS: Symbol not found for js.promise.Promise<ERROR CLASS: Symbol not found for js.array.ReadonlyArray<tauri/apps/api/Window>>

Gets a list of instances of Window for all available windows.

Link copied to clipboard
external fun getBundleType(): ERROR CLASS: Symbol not found for js.promise.Promise<tauri/apps/api/BundleType>

Gets the application bundle type.

Link copied to clipboard
external fun getCurrentWebview(): Webview

Get an instance of Webview for the current webview.

Link copied to clipboard

Get an instance of Webview for the current webview window.

Link copied to clipboard
external fun getCurrentWindow(): Window

Get an instance of Window for the current window.

Link copied to clipboard
external fun getIdentifier(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Gets the application identifier.

Link copied to clipboard
external fun getName(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Gets the application name.

Link copied to clipboard
external fun getTauriVersion(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Gets the Tauri framework version used by this application.

Link copied to clipboard
external fun getVersion(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Gets the application version.

Link copied to clipboard
external fun hide(): ERROR CLASS: Symbol not found for js.promise.Promise<ERROR CLASS: Symbol not found for js.core.Void>

Hides the application on macOS.

Link copied to clipboard
external fun homeDir(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns the path to the user's home directory.

Link copied to clipboard
external fun <T> invoke(cmd: String, args: InvokeArgs = definedExternally, options: InvokeOptions = definedExternally): ERROR CLASS: Symbol not found for js.promise.Promise<T>

Sends a message to the backend.

Link copied to clipboard
external fun isAbsolute(path: String): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/Boolean>

Returns whether the path is absolute or not.

Link copied to clipboard
external fun isTauri(): Boolean
Link copied to clipboard
external fun join(vararg paths: String): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Joins all given path segments together using the platform-specific separator as a delimiter, then normalizes the resulting path.

Link copied to clipboard
external fun <T> listen(event: EventName, handler: EventCallback<T>, options: Options = definedExternally): ERROR CLASS: Symbol not found for js.promise.Promise<{tauri/apps/api/UnlistenFn=} kotlin/Function0<kotlin/Unit>>

Listen to an emitted event to any {@link EventTarget|target}.

Link copied to clipboard
external fun localDataDir(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns the path to the user's local data directory.

Link copied to clipboard
external fun mockConvertFileSrc(osName: String)

Mock convertFileSrc function

Link copied to clipboard
external fun mockIPC(cb: (cmd: String, InvokeArgs?) -> Any?, options: MockIPCOptions = definedExternally)

Intercepts all IPC requests with the given mock handler.

Link copied to clipboard
external fun mockWindows(current: String, vararg _additionalWindows: String)

Mocks one or many window labels. In non-tauri context it is required to call this function before using the @tauri-apps/api/window module.

Link copied to clipboard
external fun monitorFromPoint(x: Double, y: Double): ERROR CLASS: Symbol not found for js.promise.Promise<tauri/apps/api/Monitor?>

Returns the monitor that contains the given point. Returns null if can't find any.

Link copied to clipboard
external fun normalize(path: String): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Normalizes the given path, resolving '..' and '.' segments and resolve symbolic links.

Link copied to clipboard
external fun onBackButtonPress(handler: (payload: OnBackButtonPressPayload) -> Unit): ERROR CLASS: Symbol not found for js.promise.Promise<tauri/apps/api/PluginListener>

Listens to the backButton event on Android.

Link copied to clipboard
external fun <T> once(event: EventName, handler: EventCallback<T>, options: Options = definedExternally): ERROR CLASS: Symbol not found for js.promise.Promise<{tauri/apps/api/UnlistenFn=} kotlin/Function0<kotlin/Unit>>

Listens once to an emitted event to any {@link EventTarget|target}.

Link copied to clipboard
external fun pictureDir(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns the path to the user's picture directory.

Link copied to clipboard
external fun primaryMonitor(): ERROR CLASS: Symbol not found for js.promise.Promise<tauri/apps/api/Monitor?>

Returns the primary monitor of the system. Returns null if it can't identify any monitor as a primary one.

Link copied to clipboard
external fun publicDir(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns the path to the user's public directory.

Link copied to clipboard
external fun removeDataStore(uuid: {tauri/apps/api/DataStoreIdentifier=} ERROR CLASS: Symbol not found for js.array.ReadonlyArray<kotlin/Double>): ERROR CLASS: Symbol not found for js.promise.Promise<ERROR CLASS: Symbol not found for js.core.Void>

Removes the data store with the given identifier.

Link copied to clipboard
external fun <T> requestPermissions(plugin: String): ERROR CLASS: Symbol not found for js.promise.Promise<T>

Request permissions.

Link copied to clipboard
external fun resolve(vararg paths: String): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Resolves a sequence of paths or path segments into an absolute path.

Link copied to clipboard
external fun resolveResource(resourcePath: String): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Resolve the path to a resource file.

Link copied to clipboard
external fun resourceDir(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns the path to the application's resource directory. To resolve a resource path, see {@linkcode resolveResource}.

Link copied to clipboard
external fun runtimeDir(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns the path to the user's runtime directory.

Link copied to clipboard
external fun sep(): String

Returns the platform-specific path segment separator:

Link copied to clipboard
external fun setDockVisibility(visible: Boolean): ERROR CLASS: Symbol not found for js.promise.Promise<ERROR CLASS: Symbol not found for js.core.Void>

Sets the dock visibility for the application on macOS.

Link copied to clipboard
external fun setTheme(theme: Theme? = definedExternally): ERROR CLASS: Symbol not found for js.promise.Promise<ERROR CLASS: Symbol not found for js.core.Void>

Sets the application's theme. Pass in null or undefined to follow the system theme.

Link copied to clipboard
external fun show(): ERROR CLASS: Symbol not found for js.promise.Promise<ERROR CLASS: Symbol not found for js.core.Void>

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

Link copied to clipboard
external fun tempDir(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns a temporary directory.

Link copied to clipboard
external fun templateDir(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns the path to the user's template directory.

Link copied to clipboard
external fun <T> transformCallback(callback: (response: T) -> Unit = definedExternally, once: Boolean = definedExternally): Double

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.

Link copied to clipboard
external fun <T> transformImage(image: ERROR CLASS: Symbol not found for js.array.ReadonlyArray<kotlin/Double>??): T
external fun <T> transformImage(image: ERROR CLASS: Symbol not found for js.buffer.ArrayBuffer??): T
external fun <T> transformImage(image: ERROR CLASS: Symbol not found for js.typedarrays.Uint8Array<ERROR CLASS: Symbol not found for js.buffer.ArrayBuffer>??): T
external fun <T> transformImage(image: String?): T
external fun <T> transformImage(image: Image?): T

Transforms image from various types into a type acceptable by Rust.

Link copied to clipboard
external fun videoDir(): ERROR CLASS: Symbol not found for js.promise.Promise<kotlin/String>

Returns the path to the user's video directory.