Defined in: core.ts:34
A channel used to receive ordered streaming messages from the backend.
The ordering logic is preserved from the Tauri implementation: messages carry a monotonically increasing index and are delivered in order, with out-of-order messages queued until the gap is filled.
T = unknown
new Channel<
T>(onmessage?):Channel<T>
Defined in: core.ts:44
(response) => void
Channel<T>
id:
number
Defined in: core.ts:36
The callback id returned from transformCallback.
get onmessage(): (
response) =>void
Defined in: core.ts:101
(response) => void
set onmessage(
handler):void
Defined in: core.ts:97
(response) => void
void
__ZTRON_TO_IPC_KEY__():
string
Defined in: core.ts:105
string
dispose():
void
Defined in: core.ts:93
Client-side end: unregisters this channel's callback from the bridge
registry immediately, without waiting for an in-order end marker from
the backend. Call it when a stream is abandoned client-side (e.g. the
consuming component unmounted) so late backend messages can no longer
reach the dead callback. Idempotent.
void
toJSON():
string
Defined in: core.ts:109
string
Defined in: core.ts:147
A backend-owned resource stored through the resource table.
Lives in the main process and is released explicitly via close.
new Resource(
rid):Resource
Defined in: core.ts:154
number
get rid():
number
Defined in: core.ts:150
number
close():
Promise<void>
Defined in: core.ts:159
Destroys and cleans up this resource from memory.
Promise<void>
constSERIALIZE_TO_IPC_FN:"__ZTRON_TO_IPC_KEY__"="__ZTRON_TO_IPC_KEY__"
Defined in: core.ts:12
A key used by special types to define how they serialize across the IPC.
If this value changes, keep it in sync with the inject package.
addPluginListener<
T>(plugin,event,cb):Promise<() =>Promise<void>>
Defined in: core.ts:181
Registers a backend plugin listener, mirroring Tauri's
addPluginListener (plugin:<plugin>|__listener / __unlistener
commands). Plugins like log use this instead of named events because
event names cannot contain |.
T = unknown
string
string
(payload) => void
Promise<() => Promise<void>>
A promise resolving to an unlisten function.
convertFileSrc(
filePath,protocol?):string
Defined in: core.ts:137
Converts a device file path to an URL that can be loaded by the WebView.
string
The file path.
string
The protocol to use. Defaults to asset.
string
The URL usable as a source in the WebView.
invoke<
T>(cmd,args?,options?):Promise<T>
Defined in: core.ts:122
Sends a message to the backend.
T
string
The command name.
InvokeArgs = {}
The optional arguments to pass to the command.
The request options.
Promise<T>
A promise resolving or rejecting to the backend response.
isZtron():
boolean
Defined in: core.ts:165
Whether the current context is a Ztron WebView.
boolean
transformCallback<
T>(callback?,once?):number
Defined in: core.ts:20
Stores a callback in a known location and returns an identifier the backend
can use to eval() it later.
T = unknown
(response) => void
boolean = false
number
A unique identifier associated with the callback.
Re-exports InvokeArgs
Re-exports InvokeOptions