chore(deps): tauri 2.0.0-rc.3 (#1671)

* chore(deps): tauri 2.0.0-rc.3

* fix builds

* fix deep link [skip ci]
This commit is contained in:
Lucas Fernandes Nogueira authored and GitHub committed 2024-08-17 07:40:57 -03:00
1 parent 4dd7f5ddd8
commit 5d170a5444
70 files changed
+411 -277

No files matched your search

+1 -1
View File
@@ -25,6 +25,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -1,5 +1,5 @@
### Permission Table
## Permission Table
<table>
<tr>
+1 -1
View File
@@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -15,7 +15,7 @@ disable the automatic start on boot.
- `allow-disable`
- `allow-is-enabled`
### Permission Table
## Permission Table
<table>
<tr>
+1 -1
View File
@@ -25,6 +25,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -16,7 +16,7 @@ It allows all barcode related features.
- `allow-scan`
- `allow-vibrate`
### Permission Table
## Permission Table
<table>
<tr>
+1 -1
View File
@@ -25,6 +25,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -12,7 +12,7 @@ It allows acccess to all biometric commands.
- `allow-authenticate`
- `allow-status`
### Permission Table
## Permission Table
<table>
<tr>
+1 -1
View File
@@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -4,7 +4,7 @@ Allows reading the CLI matches
- `allow-cli-matches`
### Permission Table
## Permission Table
<table>
<tr>
+1 -1
View File
@@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -8,7 +8,7 @@ Clipboard interaction needs to be explicitly enabled.
### Permission Table
## Permission Table
<table>
<tr>
+1 -1
View File
@@ -10,7 +10,7 @@
"tauri": "tauri"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-rc.0",
"@tauri-apps/api": "2.0.0-rc.1",
"@tauri-apps/plugin-deep-link": "2.0.0-rc.0"
},
"devDependencies": {
+1 -1
View File
@@ -25,6 +25,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -4,7 +4,7 @@ Allows reading the opened deep link via the get_current command
- `allow-get-current`
### Permission Table
## Permission Table
<table>
<tr>
+11 -7
View File
@@ -24,24 +24,28 @@ fn init_deep_link<R: Runtime, C: DeserializeOwned>(
#[cfg(target_os = "android")]
{
use tauri::{
ipc::{Channel, InvokeBody},
ipc::{Channel, InvokeResponseBody},
Emitter,
};
let handle = _api.register_android_plugin(PLUGIN_IDENTIFIER, "DeepLinkPlugin")?;
#[derive(serde::Deserialize)]
struct Event {
url: String,
}
let app_handle = app.clone();
handle.run_mobile_plugin::<()>(
"setEventHandler",
imp::EventHandler {
handler: Channel::new(move |event| {
println!("got channel event: {:?}", &event);
let url = match event {
InvokeBody::Json(payload) => payload
.get("url")
.and_then(|v| v.as_str())
.map(|s| s.to_owned()),
InvokeResponseBody::Json(payload) => {
serde_json::from_str::<Event>(&payload)
.ok()
.map(|payload| payload.url)
}
_ => None,
};
+1 -1
View File
@@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -16,7 +16,7 @@ All dialog types are enabled.
- `allow-save`
- `allow-open`
### Permission Table
## Permission Table
<table>
<tr>
+1 -1
View File
@@ -25,6 +25,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -30,7 +30,7 @@ On Windows the webview data folder access is denied.
- `read-app-specific-dirs-recursive`
- `deny-default`
### Permission Table
## Permission Table
<table>
<tr>
+1 -1
View File
@@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -1,5 +1,5 @@
### Permission Table
## Permission Table
<table>
<tr>
+2 -2
View File
@@ -4,7 +4,7 @@
use serde::{de::DeserializeOwned, Serialize};
use tauri::{
ipc::{Channel, InvokeBody},
ipc::{Channel, InvokeResponseBody},
plugin::PluginApi,
AppHandle, Runtime,
};
@@ -36,7 +36,7 @@ impl<R: Runtime> Geolocation<R> {
) -> crate::Result<u32> {
let channel = Channel::new(move |event| {
let payload = match event {
InvokeBody::Json(payload) => serde_json::from_value::<WatchEvent>(payload)
InvokeResponseBody::Json(payload) => serde_json::from_str::<WatchEvent>(&payload)
.unwrap_or_else(|error| {
WatchEvent::Error(format!(
"Couldn't deserialize watch event payload: `{error}`"
+2 -2
View File
@@ -4,7 +4,7 @@
use serde::{de::DeserializeOwned, Serialize};
use tauri::{
ipc::{Channel, InvokeBody},
ipc::{Channel, InvokeResponseBody},
plugin::{PluginApi, PluginHandle},
AppHandle, Runtime,
};
@@ -51,7 +51,7 @@ impl<R: Runtime> Geolocation<R> {
) -> crate::Result<u32> {
let channel = Channel::new(move |event| {
let payload = match event {
InvokeBody::Json(payload) => serde_json::from_value::<WatchEvent>(dbg!(payload))
InvokeResponseBody::Json(payload) => serde_json::from_str::<WatchEvent>(&payload)
.unwrap_or_else(|error| {
WatchEvent::Error(format!(
"Couldn't deserialize watch event payload: `{error}`"
+1 -1
View File
@@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -7,7 +7,7 @@ registered or unregistered.
### Permission Table
## Permission Table
<table>
<tr>
+1 -1
View File
@@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -1,5 +1,5 @@
### Permission Table
## Permission Table
<table>
<tr>
+1 -1
View File
@@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -18,7 +18,7 @@ All fetch operations are enabled.
- `allow-fetch-read-body`
- `allow-fetch-send`
### Permission Table
## Permission Table
<table>
<tr>
+1 -1
View File
@@ -25,6 +25,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -4,7 +4,7 @@ Allows the log command
- `allow-log`
### Permission Table
## Permission Table
<table>
<tr>
+1 -1
View File
@@ -25,6 +25,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -14,7 +14,7 @@ Writing to tags needs to be manually enabled.
- `allow-is-available`
- `allow-scan`
### Permission Table
## Permission Table
<table>
<tr>
+1 -1
View File
@@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -26,7 +26,7 @@ It allows all notification related features.
- `allow-create-channel`
- `allow-permission-state`
### Permission Table
## Permission Table
<table>
<tr>
+1 -1
View File
@@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -18,7 +18,7 @@ All information except the host name are available.
- `allow-platform`
- `allow-version`
### Permission Table
## Permission Table
<table>
<tr>
+1 -1
View File
@@ -25,6 +25,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -4,7 +4,7 @@ Allows the move_window command
- `allow-move-window`
### Permission Table
## Permission Table
<table>
<tr>
+1 -1
View File
@@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -12,7 +12,7 @@ the application.
- `allow-exit`
- `allow-restart`
### Permission Table
## Permission Table
<table>
<tr>
+1 -1
View File
@@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -12,7 +12,7 @@ scope pre-configured. It will allow opening `http(s)://`,
- `allow-open`
### Permission Table
## Permission Table
<table>
<tr>
+1 -1
View File
@@ -25,6 +25,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -16,7 +16,7 @@ Also allows to load or close a connection.
- `allow-load`
- `allow-select`
### Permission Table
## Permission Table
<table>
<tr>
@@ -8,7 +8,7 @@
"tauri": "tauri"
},
"devDependencies": {
"@tauri-apps/cli": "^2.0.0-rc.0",
"@tauri-apps/cli": "2.0.0-rc.3",
"vite": "^5.0.12",
"typescript": "^5.3.3"
}
+1 -1
View File
@@ -25,6 +25,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -22,7 +22,7 @@ All operations are enabled by default.
- `allow-set`
- `allow-values`
### Permission Table
## Permission Table
<table>
<tr>
+1 -1
View File
@@ -25,6 +25,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -18,7 +18,7 @@ All non-destructive operations are enabled by default.
- `allow-save-store-record`
- `allow-save`
### Permission Table
## Permission Table
<table>
<tr>
+2 -1
View File
@@ -40,9 +40,10 @@ infer = "0.15"
[target."cfg(target_os = \"windows\")".dependencies]
zip = { version = "2", default-features = false, optional = true }
windows-sys = { version = "0.52.0", features = [
windows-sys = { version = "0.59.0", features = [
"Win32_Foundation",
"Win32_UI_WindowsAndMessaging",
"Win32_UI_Shell",
] }
[target."cfg(target_os = \"linux\")".dependencies]
+1 -1
View File
@@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -15,7 +15,7 @@ is enabled.
- `allow-install`
- `allow-download-and-install`
### Permission Table
## Permission Table
<table>
<tr>
+1 -1
View File
@@ -647,7 +647,7 @@ impl Update {
unsafe {
ShellExecuteW(
0,
std::ptr::null_mut(),
w!("open"),
file.as_ptr(),
parameters.as_ptr(),
+1 -1
View File
@@ -25,6 +25,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -12,7 +12,7 @@ All operations are enabled by default.
- `allow-upload`
- `allow-download`
### Permission Table
## Permission Table
<table>
<tr>
+1 -1
View File
@@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -5,7 +5,7 @@ Allows connecting and sending data to a WebSocket server
- `allow-connect`
- `allow-send`
### Permission Table
## Permission Table
<table>
<tr>
+1 -1
View File
@@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_PLUGIN_WINDOW_STATE__=function(e){"use strict";var t,i,n,a;function l(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}async function s(e,t={},i){return window.__TAURI_INTERNALS__.invoke(e,t,i)}"function"==typeof SuppressedError&&SuppressedError;class r{get rid(){return function(e,t,i,n){if("a"===i&&!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"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)}(this,t,"f")}constructor(e){t.set(this,void 0),function(e,t,i,n,a){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");t.set(e,i)}(this,t,e)}async close(){return s("plugin:resources|close",{rid:this.rid})}}t=new WeakMap;class o{constructor(e,t){this.type="Logical",this.width=e,this.height=t}}class u{constructor(e,t){this.type="Physical",this.width=e,this.height=t}toLogical(e){return new o(this.width/e,this.height/e)}}class c{constructor(e,t){this.type="Logical",this.x=e,this.y=t}}class d{constructor(e,t){this.type="Physical",this.x=e,this.y=t}toLogical(e){return new c(this.x/e,this.y/e)}}async function w(e,t){await s("plugin:event|unlisten",{event:e,eventId:t})}async function h(e,t,i){var n;const a="string"==typeof(null==i?void 0:i.target)?{kind:"AnyLabel",label:i.target}:null!==(n=null==i?void 0:i.target)&&void 0!==n?n:{kind:"Any"};return s("plugin:event|listen",{event:e,target:a,handler:l(t)}).then((t=>async()=>w(e,t)))}!function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_CREATED="tauri://window-created",e.WEBVIEW_CREATED="tauri://webview-created",e.DRAG_ENTER="tauri://drag-enter",e.DRAG_OVER="tauri://drag-over",e.DRAG_DROP="tauri://drag-drop",e.DRAG_LEAVE="tauri://drag-leave"}(i||(i={}));class b extends r{constructor(e){super(e)}static async new(e,t,i){return s("plugin:image|new",{rgba:y(e),width:t,height:i}).then((e=>new b(e)))}static async fromBytes(e){return s("plugin:image|from_bytes",{bytes:y(e)}).then((e=>new b(e)))}static async fromPath(e){return s("plugin:image|from_path",{path:e}).then((e=>new b(e)))}async rgba(){return s("plugin:image|rgba",{rid:this.rid}).then((e=>new Uint8Array(e)))}async size(){return s("plugin:image|size",{rid:this.rid})}}function y(e){return null==e?null:"string"==typeof e?e:e instanceof Uint8Array?Array.from(e):e instanceof ArrayBuffer?Array.from(new Uint8Array(e)):e instanceof b?e.rid:e}!function(e){e[e.Critical=1]="Critical",e[e.Informational=2]="Informational"}(n||(n={}));class p{constructor(e){this._preventDefault=!1,this.event=e.event,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}function g(){return new v(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}function _(){return window.__TAURI_INTERNALS__.metadata.windows.map((e=>new v(e.label,{skip:!0})))}!function(e){e.None="none",e.Normal="normal",e.Indeterminate="indeterminate",e.Paused="paused",e.Error="error"}(a||(a={}));const m=["tauri://created","tauri://error"];class v{constructor(e,t={}){var i;this.label=e,this.listeners=Object.create(null),(null==t?void 0:t.skip)||s("plugin:window|create",{options:{...t,parent:"string"==typeof t.parent?t.parent:null===(i=t.parent)||void 0===i?void 0:i.label,label:e}}).then((async()=>this.emit("tauri://created"))).catch((async e=>this.emit("tauri://error",e)))}static getByLabel(e){var t;return null!==(t=_().find((t=>t.label===e)))&&void 0!==t?t:null}static getCurrent(){return g()}static getAll(){return _()}static async getFocusedWindow(){for(const e of _())if(await e.isFocused())return e;return null}async listen(e,t){return this._handleTauriEvent(e,t)?()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)}:h(e,t,{target:{kind:"Window",label:this.label}})}async once(e,t){return this._handleTauriEvent(e,t)?()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)}:async function(e,t,i){return h(e,(i=>{w(e,i.id),t(i)}),i)}(e,t,{target:{kind:"Window",label:this.label}})}async emit(e,t){if(!m.includes(e))return async function(e,t){await s("plugin:event|emit",{event:e,payload:t})}(e,t);for(const i of this.listeners[e]||[])i({event:e,id:-1,payload:t})}async emitTo(e,t,i){if(!m.includes(t))return async function(e,t,i){const n="string"==typeof e?{kind:"AnyLabel",label:e}:e;await s("plugin:event|emit_to",{target:n,event:t,payload:i})}(e,t,i);for(const e of this.listeners[t]||[])e({event:t,id:-1,payload:i})}_handleTauriEvent(e,t){return!!m.includes(e)&&(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0)}async scaleFactor(){retuLine truncated
if("__TAURI__"in window){var __TAURI_PLUGIN_WINDOW_STATE__=function(e){"use strict";var t,i,n,a;function l(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}async function s(e,t={},i){return window.__TAURI_INTERNALS__.invoke(e,t,i)}"function"==typeof SuppressedError&&SuppressedError;class r{get rid(){return function(e,t,i,n){if("a"===i&&!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"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)}(this,t,"f")}constructor(e){t.set(this,void 0),function(e,t,i,n,a){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");t.set(e,i)}(this,t,e)}async close(){return s("plugin:resources|close",{rid:this.rid})}}t=new WeakMap;class o{constructor(e,t){this.type="Logical",this.width=e,this.height=t}}class u{constructor(e,t){this.type="Physical",this.width=e,this.height=t}toLogical(e){return new o(this.width/e,this.height/e)}}class c{constructor(e,t){this.type="Logical",this.x=e,this.y=t}}class d{constructor(e,t){this.type="Physical",this.x=e,this.y=t}toLogical(e){return new c(this.x/e,this.y/e)}}async function w(e,t){await s("plugin:event|unlisten",{event:e,eventId:t})}async function h(e,t,i){var n;const a="string"==typeof(null==i?void 0:i.target)?{kind:"AnyLabel",label:i.target}:null!==(n=null==i?void 0:i.target)&&void 0!==n?n:{kind:"Any"};return s("plugin:event|listen",{event:e,target:a,handler:l(t)}).then((t=>async()=>w(e,t)))}!function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_CREATED="tauri://window-created",e.WEBVIEW_CREATED="tauri://webview-created",e.DRAG_ENTER="tauri://drag-enter",e.DRAG_OVER="tauri://drag-over",e.DRAG_DROP="tauri://drag-drop",e.DRAG_LEAVE="tauri://drag-leave"}(i||(i={}));class b extends r{constructor(e){super(e)}static async new(e,t,i){return s("plugin:image|new",{rgba:y(e),width:t,height:i}).then((e=>new b(e)))}static async fromBytes(e){return s("plugin:image|from_bytes",{bytes:y(e)}).then((e=>new b(e)))}static async fromPath(e){return s("plugin:image|from_path",{path:e}).then((e=>new b(e)))}async rgba(){return s("plugin:image|rgba",{rid:this.rid}).then((e=>new Uint8Array(e)))}async size(){return s("plugin:image|size",{rid:this.rid})}}function y(e){return null==e?null:"string"==typeof e?e:e instanceof Uint8Array?Array.from(e):e instanceof ArrayBuffer?Array.from(new Uint8Array(e)):e instanceof b?e.rid:e}!function(e){e[e.Critical=1]="Critical",e[e.Informational=2]="Informational"}(n||(n={}));class p{constructor(e){this._preventDefault=!1,this.event=e.event,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}function g(){return new v(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}async function _(){return s("plugin:window|get_all_windows").then((e=>e.map((e=>new v(e,{skip:!0})))))}!function(e){e.None="none",e.Normal="normal",e.Indeterminate="indeterminate",e.Paused="paused",e.Error="error"}(a||(a={}));const m=["tauri://created","tauri://error"];class v{constructor(e,t={}){var i;this.label=e,this.listeners=Object.create(null),(null==t?void 0:t.skip)||s("plugin:window|create",{options:{...t,parent:"string"==typeof t.parent?t.parent:null===(i=t.parent)||void 0===i?void 0:i.label,label:e}}).then((async()=>this.emit("tauri://created"))).catch((async e=>this.emit("tauri://error",e)))}static async getByLabel(e){var t;return null!==(t=(await _()).find((t=>t.label===e)))&&void 0!==t?t:null}static getCurrent(){return g()}static async getAll(){return _()}static async getFocusedWindow(){for(const e of await _())if(await e.isFocused())return e;return null}async listen(e,t){return this._handleTauriEvent(e,t)?()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)}:h(e,t,{target:{kind:"Window",label:this.label}})}async once(e,t){return this._handleTauriEvent(e,t)?()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)}:async function(e,t,i){return h(e,(i=>{w(e,i.id),t(i)}),i)}(e,t,{target:{kind:"Window",label:this.label}})}async emit(e,t){if(!m.includes(e))return async function(e,t){await s("plugin:event|emit",{event:e,payload:t})}(e,t);for(const i of this.listeners[e]||[])i({event:e,id:-1,payload:t})}async emitTo(e,t,i){if(!m.includes(t))return async function(e,t,i){const n="string"==typeof e?{kind:"AnyLabel",label:e}:e;await s("plugin:event|emit_to",{target:n,event:t,payload:i})}(e,t,i);for(const e of this.listeners[t]||[])e({event:t,id:-1,payload:i})}_handleTauriEvent(e,t){return!!m.includes(e)&&(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[tLine truncated
+1 -1
View File
@@ -25,6 +25,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.0"
"@tauri-apps/api": "^2.0.0-rc.1"
}
}
@@ -13,7 +13,7 @@ All operations are enabled by default.
- `allow-restore-state`
- `allow-save-window-state`
### Permission Table
## Permission Table
<table>
<tr>