跳过到内容
Tauri

@tauri-apps/plugin-updater

Update

继承自

  • 资源

构造函数

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

Update

覆盖

Resource.constructor

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

属性

属性类型描述定义在
availableboolean已弃用 这始终为 true,当使用 check 时,请检查返回值是否为 null来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L57
body?string-来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L61
currentVersionstring-来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L58
date?string-来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L60
rawJsonRecord<string, unknown>-来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L62
versionstring-来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L59

访问器

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

number

继承自

Resource.rid

来源: undefined

方法

close()
close(): Promise<void>

销毁并清理内存中的此资源。您不应再在此对象上调用任何方法,并应删除对其的任何引用。

返回值

Promise<void>

覆盖

Resource.close

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

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

下载更新器包

参数
参数类型
onEvent?(progress) => void
options?DownloadOptions
返回值

Promise<void>

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

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

下载更新器包并安装它

参数
参数类型
onEvent?(progress) => void
options?DownloadOptions
返回值

Promise<void>

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

install()
install(): Promise<void>

安装下载的更新器包

返回值

Promise<void>

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

接口

CheckOptions

检查更新时使用的选项

属性

属性类型描述定义在
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?number超时时间,以毫秒为单位来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L16

DownloadOptions

下载更新时使用的选项

属性

属性类型描述定义在
headers?HeadersInit请求标头来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/updater/guest-js/index.ts#L32
timeout?number超时时间,以毫秒为单位来源: 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

参数

参数类型
options?CheckOptions

返回值

Promise<Update | null>

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


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