Package-level declarations

Types

Link copied to clipboard
external class Channel<T>

A message channel used to stream values from Rust to the frontend.

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

A handle to a listener registered with {@linkcode addPluginListener}.

Link copied to clipboard
open external class Resource

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

Properties

Link copied to clipboard
val PermissionState.Companion.denied: PermissionState
Link copied to clipboard
val PermissionState.Companion.granted: PermissionState
Link copied to clipboard
val PermissionState.Companion.prompt: PermissionState
Link copied to clipboard
val PermissionState.Companion.promptWithRationale: PermissionState
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): 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 a URL that can be loaded by the webview.

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

Checks whether the code is running inside a Tauri webview.

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.