跳到内容
Tauri

@tauri-apps/plugin-updater

  • 资源

new Update(metadata): Update
参数类型
元数据UpdateMetadata

更新

Resource.constructor

来源https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L69

属性类型描述定义于
available布尔值 (boolean)已废弃 这始终为 true,使用 check 时请检查返回值是否为 null来源https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L61
body?string-来源https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L65
currentVersionstring-来源https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L62
date?string-来源https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L64
rawJsonRecord<string, unknown>-来源https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L66
versionstring-来源https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L63

get rid(): number

数字

Resource.rid

来源: 未定义

close(): Promise<void>

销毁并从内存中清理此资源。您不应再对此对象调用任何方法,并应放弃对它的任何引用。

Promise<void>

Resource.close

来源https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L129

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

下载更新包

参数类型
onEvent?(progress) => void
选项?DownloadOptions

Promise<void>

来源https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L80

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

下载并安装更新包

参数类型
onEvent?(progress) => void
选项?DownloadOptions

Promise<void>

来源https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L113

install(): Promise<void>

安装下载的更新包

Promise<void>

来源https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L98

检查更新时使用的选项

属性类型描述定义于
allowDowngrades?布尔值 (boolean)允许降级到以前的版本,不检查当前版本是否大于可用版本。来源https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L28
headers?HeadersInit请求头来源https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L12
proxy?string检查和下载更新时使用的代理 URL。来源https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L20
target?string正在运行的应用程序的目标标识符。这会发送到后端。来源https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L24
timeout?数字超时时间,单位毫秒来源https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L16

下载更新时使用的选项

属性类型描述定义于
headers?HeadersInit请求头来源https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L36
timeout?数字超时时间,单位毫秒来源https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L40

type DownloadEvent: object | object | object;

更新器下载事件

来源https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L53

function check(options?): Promise<Update | null>

检查更新,如果没有可用更新,则解析为 null

参数类型
选项?CheckOptions

Promise<Update | null>

来源https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L136


© 2025 Tauri 贡献者。CC-BY / MIT