updater
A rust-backed resource.
The resource lives in the main process and does not exist
in the Javascript world, and thus will not be cleaned up automatiacally
except on application exit. If you want to clean it up early, call Resource.close
import { Resource, invoke } from '@crabnebula/taurify-api/core';export class DatabaseHandle extends Resource { static async open(path: string): Promise<DatabaseHandle> { const rid: number = await invoke('open_db', { path }); return new DatabaseHandle(rid); }
async execute(sql: string): Promise<void> { await invoke('execute_sql', { rid: this.rid, sql }); }}new Update(metadata): Update| Parameter | Type |
|---|---|
metadata | UpdateMetadata |
| Property | Type | Defined in |
|---|---|---|
body? | string | |
currentVersion | string | |
date? | string | |
kind | "app" | "assets" | |
version | string |
get rid(): numbernumber
close(): Promise<void>Destroys and cleans up this resource from memory. You should not call any method on this object anymore and should drop any reference to it.
Promise<void>
download(onEvent?, options?): Promise<void>Download the updater package
| Parameter | Type |
|---|---|
onEvent? | (progress) => void |
options? | DownloadOptions |
Promise<void>
downloadAndInstall(onEvent?, options?): Promise<void>Downloads the updater package and installs it
| Parameter | Type |
|---|---|
onEvent? | (progress) => void |
options? | DownloadOptions |
Promise<void>
install(): Promise<void>Install downloaded updater package
Promise<void>
Options used when checking for updates
| Property | Type | Description | Defined in |
|---|---|---|---|
timeout? | number | Timeout in milliseconds |
Options used when downloading an update
| Property | Type | Description | Defined in |
|---|---|---|---|
timeout? | number | Timeout in milliseconds |
type DownloadEvent: object | object | object;Updater download event
function check(options?): Promise<Update | null>Check for updates, resolves to null if no updates are available
| Parameter | Type |
|---|---|
options? | CheckOptions |