跳转到内容
Tauri

@tauri-apps/plugin-updater

更新

扩展

  • 资源

构造函数

new Update()
new Update(metadata): Update
参数
参数类型
metadataUpdateMetadata
返回值

更新

覆盖

Resource.constructor

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

属性

属性类型定义在
available布尔值来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L55
body?字符串来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L59
currentVersion字符串来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L56
date?字符串来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L58
version字符串来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L57

访问器

rid
获取签名
get rid(): number
返回值

数字

继承自

Resource.rid

来源: 未定义

方法

close()
close(): Promise<void>

销毁并从内存中清除此资源。 不应再调用此对象上的任何方法,并应丢弃对此对象的任何引用。

返回值

Promise<void>

覆盖

Resource.close

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

download()
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#L72

downloadAndInstall()
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#L104

install()
install(): Promise<void>

安装下载的更新包

返回值

Promise<void>

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

接口

CheckOptions

检查更新时使用的选项

属性

属性类型描述定义在
headers?Header 初始化请求头来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L12
proxy?字符串检查和下载更新时使用的代理URL。来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L20
target?字符串运行应用的标识符。这将被发送到后端。来源: 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

DownloadOptions

下载更新时使用的选项

属性

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

类型别名

DownloadEvent

type DownloadEvent: object | object | object;

更新器下载事件

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

函数

check()

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#L126


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