Skip to content

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
ParameterType
metadataUpdateMetadata

Update

Resource.constructor

PropertyTypeDefined in
body?string
currentVersionstring
date?string
kind"app" | "assets"
versionstring

get rid(): number

number

Resource.rid

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>

Resource.close

download(onEvent?, options?): Promise<void>

Download the updater package

ParameterType
onEvent?(progress) => void
options?DownloadOptions

Promise<void>

downloadAndInstall(onEvent?, options?): Promise<void>

Downloads the updater package and installs it

ParameterType
onEvent?(progress) => void
options?DownloadOptions

Promise<void>

install(): Promise<void>

Install downloaded updater package

Promise<void>

Options used when checking for updates

PropertyTypeDescriptionDefined in
timeout?numberTimeout in milliseconds

Options used when downloading an update

PropertyTypeDescriptionDefined in
timeout?numberTimeout 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

ParameterType
options?CheckOptions

Promise<Update | null>