@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 |
currentVersion | string | - | 来源: 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 |
rawJson | Record <string , unknown > | - | 来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L66 |
version | string | - | 来源: 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 |
来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L136
© 2025 Tauri 贡献者。CC-BY / MIT