refactor(updater): migrate to tauri's new resource table (#899)
* refactor(updater): migrate to tauri's new resource table * fmt * fmt * Create updater-js-started-event.mdpull/912/head
parent
8505a756b5
commit
0879a87a7e
@ -0,0 +1,6 @@
|
||||
---
|
||||
"updater": "patch"
|
||||
"updater-js": "patch"
|
||||
---
|
||||
|
||||
Fix `Started` event not emitted to JS when downloading update.
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
"updater": "patch"
|
||||
---
|
||||
|
||||
**Breaking change**: Changed `Update::download` and `Update::download_and_install` first argument to take `FnMut` instead of just `Fn`.
|
@ -1 +1 @@
|
||||
if("__TAURI__"in window){var __TAURI_PLUGIN_UPDATER__=function(e){"use strict";function t(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}var r;"function"==typeof SuppressedError&&SuppressedError;class n{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,r.set(this,(()=>{})),this.id=function(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((e=>{t(this,r,"f").call(this,e)}))}set onmessage(e){!function(e,t,r,n,a){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?a.call(e,r):a?a.value=r:t.set(e,r)}(this,r,e,"f")}get onmessage(){return t(this,r,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function a(e,t={},r){return window.__TAURI_INTERNALS__.invoke(e,t,r)}r=new WeakMap;class o{constructor(e){this.available=e.available,this.currentVersion=e.currentVersion,this.version=e.version,this.date=e.date,this.body=e.body}async downloadAndInstall(e){const t=new n;return null!=e&&(t.onmessage=e),a("plugin:updater|download_and_install",{onEvent:t})}}return e.Update=o,e.check=async function(e){return e?.headers&&(e.headers=Array.from(new Headers(e.headers).entries())),a("plugin:updater|check",{...e}).then((e=>e.available?new o(e):null))},e}({});Object.defineProperty(window.__TAURI__,"updater",{value:__TAURI_PLUGIN_UPDATER__})}
|
||||
if("__TAURI__"in window){var __TAURI_PLUGIN_UPDATER__=function(e){"use strict";function r(e,r,t,n){if("a"===t&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof r?e!==r||!n:!r.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?n:"a"===t?n.call(e):n?n.value:r.get(e)}function t(e,r,t,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof r?e!==r||!s:!r.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,t):s?s.value=t:r.set(e,t),t}var n,s;"function"==typeof SuppressedError&&SuppressedError;class i{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,n.set(this,(()=>{})),this.id=function(e,r=!1){return window.__TAURI_INTERNALS__.transformCallback(e,r)}((e=>{r(this,n,"f").call(this,e)}))}set onmessage(e){t(this,n,e,"f")}get onmessage(){return r(this,n,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}async function a(e,r={},t){return window.__TAURI_INTERNALS__.invoke(e,r,t)}n=new WeakMap;class o{get rid(){return r(this,s,"f")}constructor(e){s.set(this,void 0),t(this,s,e,"f")}async close(){return a("plugin:resources|close",{rid:this.rid})}}s=new WeakMap;class c extends o{constructor(e){super(e.rid),this.available=e.available,this.currentVersion=e.currentVersion,this.version=e.version,this.date=e.date,this.body=e.body}async downloadAndInstall(e){const r=new i;return e&&(r.onmessage=e),a("plugin:updater|download_and_install",{onEvent:r,rid:this.rid})}}return e.Update=c,e.check=async function(e){return e?.headers&&(e.headers=Array.from(new Headers(e.headers).entries())),a("plugin:updater|check",{...e}).then((e=>e.available?new c(e):null))},e}({});Object.defineProperty(window.__TAURI__,"updater",{value:__TAURI_PLUGIN_UPDATER__})}
|
||||
|
Loading…
Reference in new issue