Package-level declarations

Types

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

Command arguments.

Link copied to clipboard
external interface InvokeOptions
Link copied to clipboard
sealed external interface PermissionState
Link copied to clipboard
external class PluginListener
Link copied to clipboard
open external class Resource

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

Properties

Functions

Link copied to clipboard
external fun <T> addPluginListener(plugin: String, event: String, cb: (payload: T) -> Unit): Promise<PluginListener>

Adds a listener to a plugin event.

Link copied to clipboard
external fun <T> checkPermissions(plugin: String): Promise<T>

Get permission state for a plugin.

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 <T> invoke(cmd: String, args: InvokeArgs = definedExternally, options: InvokeOptions = definedExternally): Promise<T>

Sends a message to the backend.

Link copied to clipboard
external fun isTauri(): Boolean
Link copied to clipboard
external fun <T> requestPermissions(plugin: String): Promise<T>

Request permissions.

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.