@tauri-apps/plugin-updater
类
更新
扩展
资源
构造函数
new Update()
new Update(metadata): Update
参数
参数 | 类型 |
---|---|
metadata | UpdateMetadata |
返回值
覆盖
Resource.constructor
来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L62
属性
访问器
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 |
返回值
来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L126
© 2025 Tauri 贡献者。CC-BY / MIT