mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-05-31 13:39:36 +02:00
chore: update to tauri alpha.16, api alpha.9 (#673)
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
This commit is contained in:
committed by
GitHub
parent
b7c5407cac
commit
5c137365c6
@@ -4,7 +4,7 @@ This plugin provides APIs to access the current process. To spawn child processe
|
||||
|
||||
## Install
|
||||
|
||||
_This plugin requires a Rust version of at least **1.65**_
|
||||
_This plugin requires a Rust version of at least **1.70**_
|
||||
|
||||
There are three general methods of installation that we can recommend.
|
||||
|
||||
|
||||
@@ -7,11 +7,7 @@
|
||||
* @module
|
||||
*/
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
__TAURI_INVOKE__: <T>(cmd: string, args?: unknown) => Promise<T>;
|
||||
}
|
||||
}
|
||||
import { invoke } from "@tauri-apps/api/primitives";
|
||||
|
||||
/**
|
||||
* Exits immediately with the given `exitCode`.
|
||||
@@ -27,7 +23,7 @@ declare global {
|
||||
* @since 2.0.0
|
||||
*/
|
||||
async function exit(code = 0): Promise<void> {
|
||||
return window.__TAURI_INVOKE__("plugin:process|exit", { code });
|
||||
return invoke("plugin:process|exit", { code });
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -43,7 +39,7 @@ async function exit(code = 0): Promise<void> {
|
||||
* @since 2.0.0
|
||||
*/
|
||||
async function relaunch(): Promise<void> {
|
||||
return window.__TAURI_INVOKE__("plugin:process|restart");
|
||||
return invoke("plugin:process|restart");
|
||||
}
|
||||
|
||||
export { exit, relaunch };
|
||||
|
||||
@@ -27,6 +27,6 @@
|
||||
"tslib": "2.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-alpha.8"
|
||||
"@tauri-apps/api": "2.0.0-alpha.9"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
if("__TAURI__"in window){var __TAURI_PROCESS__=function(_){"use strict";return _.exit=async function(_=0){return window.__TAURI_INVOKE__("plugin:process|exit",{code:_})},_.relaunch=async function(){return window.__TAURI_INVOKE__("plugin:process|restart")},_}({});Object.defineProperty(window.__TAURI__,"process",{value:__TAURI_PROCESS__})}
|
||||
if("__TAURI__"in window){var __TAURI_PROCESS__=function(e){"use strict";var n=Object.defineProperty,t=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)},r=(e,n,r)=>(t(e,n,"read from private field"),r?r.call(e):n.get(e));function i(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})({},{Channel:()=>a,PluginListener:()=>o,addPluginListener:()=>_,convertFileSrc:()=>l,invoke:()=>c,transformCallback:()=>i});var s,a=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)})(this,s,(()=>{})),this.id=i((e=>{r(this,s).call(this,e)}))}set onmessage(e){var n,r,i,a;i=e,t(n=this,r=s,"write to private field"),a?a.call(n,i):r.set(n,i)}get onmessage(){return r(this,s)}toJSON(){return`__CHANNEL__:${this.id}`}};s=new WeakMap;var o=class{constructor(e,n,t){this.plugin=e,this.event=n,this.channelId=t}async unregister(){return c(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function _(e,n,t){let r=new a;return r.onmessage=t,c(`plugin:${e}|register_listener`,{event:n,handler:r}).then((()=>new o(e,n,r.id)))}async function c(e,n={},t){return window.__TAURI_INTERNALS__.invoke(e,n,t)}function l(e,n="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(e,n)}return e.exit=async function(e=0){return c("plugin:process|exit",{code:e})},e.relaunch=async function(){return c("plugin:process|restart")},e}({});Object.defineProperty(window.__TAURI__,"process",{value:__TAURI_PROCESS__})}
|
||||
|
||||
Reference in New Issue
Block a user