From 9a79dc085870e0c1a5df13481ff271b8c6cc3b78 Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Fri, 12 May 2023 04:18:00 -0700 Subject: [PATCH] refactor(core): remove window endpoints (#6947) --- .changes/ipc-scope-remove-enable-tauri-api.md | 6 + .changes/remove-macros-command-module.md | 5 + .changes/remove-window.md | 6 + core/tauri-config-schema/schema.json | 5 - core/tauri-macros/src/command_module.rs | 303 --- core/tauri-macros/src/lib.rs | 40 +- core/tauri-utils/src/config.rs | 7 +- core/tauri/scripts/bundle.global.js | 3 +- core/tauri/src/endpoints.rs | 116 - core/tauri/src/endpoints/window.rs | 364 --- core/tauri/src/error.rs | 26 +- core/tauri/src/hooks.rs | 3 - core/tauri/src/lib.rs | 2 - core/tauri/src/scope/ipc.rs | 40 +- core/tauri/src/test/mod.rs | 12 +- core/tauri/src/window.rs | 13 +- examples/api/dist/assets/index.css | 2 +- examples/api/dist/assets/index.js | 41 +- examples/api/src-tauri/src/lib.rs | 5 - examples/api/src/App.svelte | 111 +- examples/api/src/views/Cli.svelte | 29 - examples/api/src/views/Window.svelte | 438 ---- tooling/api/docs/js-api.json | 2 +- tooling/api/src/helpers/event.ts | 3 +- tooling/api/src/helpers/tauri.ts | 37 - tooling/api/src/index.ts | 3 +- tooling/api/src/mocks.ts | 15 + tooling/api/src/window.ts | 2327 ----------------- tooling/cli/schema.json | 5 - 29 files changed, 76 insertions(+), 3893 deletions(-) create mode 100644 .changes/ipc-scope-remove-enable-tauri-api.md create mode 100644 .changes/remove-macros-command-module.md create mode 100644 .changes/remove-window.md delete mode 100644 core/tauri-macros/src/command_module.rs delete mode 100644 core/tauri/src/endpoints.rs delete mode 100644 core/tauri/src/endpoints/window.rs delete mode 100644 examples/api/src/views/Cli.svelte delete mode 100644 examples/api/src/views/Window.svelte delete mode 100644 tooling/api/src/helpers/tauri.ts delete mode 100644 tooling/api/src/window.ts diff --git a/.changes/ipc-scope-remove-enable-tauri-api.md b/.changes/ipc-scope-remove-enable-tauri-api.md new file mode 100644 index 00000000000..a18968c84dc --- /dev/null +++ b/.changes/ipc-scope-remove-enable-tauri-api.md @@ -0,0 +1,6 @@ +--- +"tauri": patch +"tauri-utils": patch +--- + +Remove `enable_tauri_api` from the IPC scope. diff --git a/.changes/remove-macros-command-module.md b/.changes/remove-macros-command-module.md new file mode 100644 index 00000000000..c5a5e1eef10 --- /dev/null +++ b/.changes/remove-macros-command-module.md @@ -0,0 +1,5 @@ +--- +"tauri-macros": patch +--- + +Removed the module command macros. diff --git a/.changes/remove-window.md b/.changes/remove-window.md new file mode 100644 index 00000000000..e83dd99a24a --- /dev/null +++ b/.changes/remove-window.md @@ -0,0 +1,6 @@ +--- +"tauri": patch +"api": patch +--- + +Moved the `window` JS APIs to its own plugin in the plugins-workspace repository. diff --git a/core/tauri-config-schema/schema.json b/core/tauri-config-schema/schema.json index 45358778519..b3b219fc71a 100644 --- a/core/tauri-config-schema/schema.json +++ b/core/tauri-config-schema/schema.json @@ -2508,11 +2508,6 @@ "items": { "type": "string" } - }, - "enableTauriAPI": { - "description": "Enables access to the Tauri API.", - "default": false, - "type": "boolean" } }, "additionalProperties": false diff --git a/core/tauri-macros/src/command_module.rs b/core/tauri-macros/src/command_module.rs deleted file mode 100644 index 476d74ef075..00000000000 --- a/core/tauri-macros/src/command_module.rs +++ /dev/null @@ -1,303 +0,0 @@ -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - -use heck::{ToLowerCamelCase, ToSnakeCase}; -use proc_macro::TokenStream; -use proc_macro2::{Span, TokenStream as TokenStream2}; - -use quote::{format_ident, quote, quote_spanned}; -use syn::{ - parse::{Parse, ParseStream}, - parse_quote, - spanned::Spanned, - Data, DeriveInput, Error, Fields, Ident, ItemFn, LitStr, Token, -}; - -pub(crate) fn generate_command_enum(mut input: DeriveInput) -> TokenStream { - let mut deserialize_functions = TokenStream2::new(); - let mut errors = TokenStream2::new(); - - input.attrs.push(parse_quote!(#[allow(dead_code)])); - - match &mut input.data { - Data::Enum(data_enum) => { - for variant in &mut data_enum.variants { - let mut feature: Option = None; - let mut error_message: Option = None; - - for attr in &variant.attrs { - if attr.path.is_ident("cmd") { - let r = attr - .parse_args_with(|input: ParseStream| { - if let Ok(f) = input.parse::() { - feature.replace(f); - input.parse::()?; - let error_message_raw: LitStr = input.parse()?; - error_message.replace(error_message_raw.value()); - } - Ok(quote!()) - }) - .unwrap_or_else(syn::Error::into_compile_error); - errors.extend(r); - } - } - - if let Some(f) = feature { - let error_message = if let Some(e) = error_message { - let e = e.to_string(); - quote!(#e) - } else { - quote!("This API is not enabled in the allowlist.") - }; - - let deserialize_function_name = quote::format_ident!("__{}_deserializer", variant.ident); - deserialize_functions.extend(quote! { - #[cfg(not(#f))] - #[allow(non_snake_case)] - fn #deserialize_function_name<'de, D, T>(deserializer: D) -> ::std::result::Result - where - D: ::serde::de::Deserializer<'de>, - { - ::std::result::Result::Err(::serde::de::Error::custom(crate::Error::ApiNotAllowlisted(#error_message.into()).to_string())) - } - }); - - let deserialize_function_name = deserialize_function_name.to_string(); - - variant - .attrs - .push(parse_quote!(#[cfg_attr(not(#f), serde(deserialize_with = #deserialize_function_name))])); - } - } - } - _ => { - return Error::new( - Span::call_site(), - "`command_enum` is only implemented for enums", - ) - .to_compile_error() - .into() - } - }; - - TokenStream::from(quote! { - #errors - #input - #deserialize_functions - }) -} - -pub(crate) fn generate_run_fn(input: DeriveInput) -> TokenStream { - let name = &input.ident; - let data = &input.data; - - let mut errors = TokenStream2::new(); - - let mut is_async = false; - - let attrs = input.attrs; - for attr in attrs { - if attr.path.is_ident("cmd") { - let r = attr - .parse_args_with(|input: ParseStream| { - if let Ok(token) = input.parse::() { - is_async = token == "async"; - } - Ok(quote!()) - }) - .unwrap_or_else(syn::Error::into_compile_error); - errors.extend(r); - } - } - - let maybe_await = if is_async { quote!(.await) } else { quote!() }; - let maybe_async = if is_async { quote!(async) } else { quote!() }; - - let mut matcher; - - match data { - Data::Enum(data_enum) => { - matcher = TokenStream2::new(); - - for variant in &data_enum.variants { - let variant_name = &variant.ident; - - let mut feature = None; - - for attr in &variant.attrs { - if attr.path.is_ident("cmd") { - let r = attr - .parse_args_with(|input: ParseStream| { - if let Ok(f) = input.parse::() { - feature.replace(f); - input.parse::()?; - let _: LitStr = input.parse()?; - } - Ok(quote!()) - }) - .unwrap_or_else(syn::Error::into_compile_error); - errors.extend(r); - } - } - - let maybe_feature_check = if let Some(f) = feature { - quote!(#[cfg(#f)]) - } else { - quote!() - }; - - let (fields_in_variant, variables) = match &variant.fields { - Fields::Unit => (quote_spanned! { variant.span() => }, quote!()), - Fields::Unnamed(fields) => { - let mut variables = TokenStream2::new(); - for i in 0..fields.unnamed.len() { - let variable_name = format_ident!("value{}", i); - variables.extend(quote!(#variable_name,)); - } - (quote_spanned! { variant.span() => (#variables) }, variables) - } - Fields::Named(fields) => { - let mut variables = TokenStream2::new(); - for field in &fields.named { - let ident = field.ident.as_ref().unwrap(); - variables.extend(quote!(#ident,)); - } - ( - quote_spanned! { variant.span() => { #variables } }, - variables, - ) - } - }; - - let mut variant_execute_function_name = format_ident!( - "{}", - variant_name.to_string().to_snake_case().to_lowercase() - ); - variant_execute_function_name.set_span(variant_name.span()); - - matcher.extend(quote_spanned! { - variant.span() => #maybe_feature_check #name::#variant_name #fields_in_variant => #name::#variant_execute_function_name(context, #variables)#maybe_await.map(Into::into), - }); - } - - matcher.extend(quote! { - _ => Err(crate::error::into_anyhow("API not in the allowlist (https://tauri.app/docs/api/config#tauri.allowlist)")), - }); - } - _ => { - return Error::new( - Span::call_site(), - "CommandModule is only implemented for enums", - ) - .to_compile_error() - .into() - } - }; - - let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl(); - - let expanded = quote! { - #errors - impl #impl_generics #name #ty_generics #where_clause { - pub #maybe_async fn run(self, context: crate::endpoints::InvokeContext) -> super::Result { - match self { - #matcher - } - } - } - }; - - TokenStream::from(expanded) -} - -/// Attributes for the module enum variant handler. -pub struct HandlerAttributes { - allowlist: Ident, -} - -impl Parse for HandlerAttributes { - fn parse(input: ParseStream) -> syn::Result { - Ok(Self { - allowlist: input.parse()?, - }) - } -} - -pub enum AllowlistCheckKind { - Runtime, - Serde, -} - -pub struct HandlerTestAttributes { - allowlist: Ident, - error_message: String, - allowlist_check_kind: AllowlistCheckKind, -} - -impl Parse for HandlerTestAttributes { - fn parse(input: ParseStream) -> syn::Result { - let allowlist = input.parse()?; - input.parse::()?; - let error_message_raw: LitStr = input.parse()?; - let error_message = error_message_raw.value(); - let allowlist_check_kind = - if let (Ok(_), Ok(i)) = (input.parse::(), input.parse::()) { - if i == "runtime" { - AllowlistCheckKind::Runtime - } else { - AllowlistCheckKind::Serde - } - } else { - AllowlistCheckKind::Serde - }; - - Ok(Self { - allowlist, - error_message, - allowlist_check_kind, - }) - } -} - -pub fn command_handler(attributes: HandlerAttributes, function: ItemFn) -> TokenStream2 { - let allowlist = attributes.allowlist; - - quote!( - #[cfg(#allowlist)] - #function - ) -} - -pub fn command_test(attributes: HandlerTestAttributes, function: ItemFn) -> TokenStream2 { - let allowlist = attributes.allowlist; - let error_message = attributes.error_message.as_str(); - let signature = function.sig.clone(); - - let enum_variant_name = function.sig.ident.to_string().to_lower_camel_case(); - let response = match attributes.allowlist_check_kind { - AllowlistCheckKind::Runtime => { - let test_name = function.sig.ident.clone(); - quote!(super::Cmd::#test_name(crate::test::mock_invoke_context())) - } - AllowlistCheckKind::Serde => quote! { - serde_json::from_str::(&format!(r#"{{ "cmd": "{}", "data": null }}"#, #enum_variant_name)) - }, - }; - - quote!( - #[cfg(#allowlist)] - #function - - #[cfg(not(#allowlist))] - #[allow(unused_variables)] - #[quickcheck_macros::quickcheck] - #signature { - if let Err(e) = #response { - assert!(e.to_string().contains(#error_message)); - } else { - panic!("unexpected response"); - } - } - ) -} diff --git a/core/tauri-macros/src/lib.rs b/core/tauri-macros/src/lib.rs index 87b152e35c5..9d5616a8e5f 100644 --- a/core/tauri-macros/src/lib.rs +++ b/core/tauri-macros/src/lib.rs @@ -4,10 +4,9 @@ use crate::context::ContextItems; use proc_macro::TokenStream; -use syn::{parse_macro_input, DeriveInput, ItemFn}; +use syn::{parse_macro_input, DeriveInput}; mod command; -mod command_module; mod mobile; mod runtime; @@ -81,40 +80,3 @@ pub fn default_runtime(attributes: TokenStream, input: TokenStream) -> TokenStre let input = parse_macro_input!(input as DeriveInput); runtime::default_runtime(attributes, input).into() } - -/// Prepares the command module enum. -#[doc(hidden)] -#[proc_macro_derive(CommandModule, attributes(cmd))] -pub fn derive_command_module(input: TokenStream) -> TokenStream { - let input = parse_macro_input!(input as DeriveInput); - command_module::generate_run_fn(input) -} - -/// Adds a `run` method to an enum (one of the tauri endpoint modules). -/// The `run` method takes a `tauri::endpoints::InvokeContext` -/// and returns a `tauri::Result`. -/// It matches on each enum variant and call a method with name equal to the variant name, lowercased and snake_cased, -/// passing the context and the variant's fields as arguments. -/// That function must also return the same `Result`. -#[doc(hidden)] -#[proc_macro_attribute] -pub fn command_enum(_: TokenStream, input: TokenStream) -> TokenStream { - let input = parse_macro_input!(input as DeriveInput); - command_module::generate_command_enum(input) -} - -#[doc(hidden)] -#[proc_macro_attribute] -pub fn module_command_handler(attributes: TokenStream, input: TokenStream) -> TokenStream { - let attributes = parse_macro_input!(attributes as command_module::HandlerAttributes); - let input = parse_macro_input!(input as ItemFn); - command_module::command_handler(attributes, input).into() -} - -#[doc(hidden)] -#[proc_macro_attribute] -pub fn module_command_test(attributes: TokenStream, input: TokenStream) -> TokenStream { - let attributes = parse_macro_input!(attributes as command_module::HandlerTestAttributes); - let input = parse_macro_input!(input as ItemFn); - command_module::command_test(attributes, input).into() -} diff --git a/core/tauri-utils/src/config.rs b/core/tauri-utils/src/config.rs index e66a43597fd..bfab234227f 100644 --- a/core/tauri-utils/src/config.rs +++ b/core/tauri-utils/src/config.rs @@ -1019,9 +1019,6 @@ pub struct RemoteDomainAccessScope { /// The list of plugins that are allowed in this scope. #[serde(default)] pub plugins: Vec, - /// Enables access to the Tauri API. - #[serde(default, rename = "enableTauriAPI", alias = "enable-tauri-api")] - pub enable_tauri_api: bool, } /// Security configuration. @@ -3344,7 +3341,6 @@ mod build { let domain = str_lit(&self.domain); let windows = vec_lit(&self.windows, str_lit); let plugins = vec_lit(&self.plugins, str_lit); - let enable_tauri_api = self.enable_tauri_api; literal_struct!( tokens, @@ -3352,8 +3348,7 @@ mod build { scheme, domain, windows, - plugins, - enable_tauri_api + plugins ); } } diff --git a/core/tauri/scripts/bundle.global.js b/core/tauri/scripts/bundle.global.js index e34b86a27de..9a10547e642 100644 --- a/core/tauri/scripts/bundle.global.js +++ b/core/tauri/scripts/bundle.global.js @@ -1,3 +1,2 @@ -"use strict";var __TAURI_IIFE__=(()=>{var E=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var Z=Object.prototype.hasOwnProperty;var g=(t,e)=>{for(var n in e)E(t,n,{get:e[n],enumerable:!0})},J=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Q(e))!Z.call(t,s)&&s!==n&&E(t,s,{get:()=>e[s],enumerable:!(o=q(e,s))||o.enumerable});return t};var K=t=>J(E({},"__esModule",{value:!0}),t);var k=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var C=(t,e,n)=>(k(t,e,"read from private field"),n?n.call(t):e.get(t)),F=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},O=(t,e,n,o)=>(k(t,e,"write to private field"),o?o.call(t,n):e.set(t,n),n);var Ue={};g(Ue,{event:()=>R,invoke:()=>Ne,path:()=>S,tauri:()=>T,window:()=>I});var R={};g(R,{TauriEvent:()=>A,emit:()=>te,listen:()=>ee,once:()=>ne});var T={};g(T,{Channel:()=>D,convertFileSrc:()=>X,invoke:()=>r,transformCallback:()=>m});function Y(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function m(t,e=!1){let n=Y(),o=`_${n}`;return Object.defineProperty(window,o,{value:s=>(e&&Reflect.deleteProperty(window,o),t?.(s)),writable:!1,configurable:!0}),n}var d,D=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0;F(this,d,()=>{});this.id=m(e=>{C(this,d).call(this,e)})}set onmessage(e){O(this,d,e)}get onmessage(){return C(this,d)}toJSON(){return`__CHANNEL__:${this.id}`}};d=new WeakMap;async function r(t,e={}){return new Promise((n,o)=>{let s=m(M=>{n(M),Reflect.deleteProperty(window,`_${c}`)},!0),c=m(M=>{o(M),Reflect.deleteProperty(window,`_${s}`)},!0);window.__TAURI_IPC__({cmd:t,callback:s,error:c,...e})})}function X(t,e="asset"){let n=encodeURIComponent(t);return navigator.userAgent.includes("Windows")?`https://${e}.localhost/${n}`:`${e}://localhost/${n}`}async function N(t,e){await r("plugin:event|unlisten",{event:t,eventId:e})}async function b(t,e,n){await r("plugin:event|emit",{event:t,windowLabel:e,payload:n})}async function h(t,e,n){return r("plugin:event|listen",{event:t,windowLabel:e,handler:m(n)}).then(o=>async()=>N(t,o))}async function _(t,e,n){return h(t,e,o=>{n(o),N(t,o.id).catch(()=>{})})}var A=(l=>(l.WINDOW_RESIZED="tauri://resize",l.WINDOW_MOVED="tauri://move",l.WINDOW_CLOSE_REQUESTED="tauri://close-requested",l.WINDOW_CREATED="tauri://window-created",l.WINDOW_DESTROYED="tauri://destroyed",l.WINDOW_FOCUS="tauri://focus",l.WINDOW_BLUR="tauri://blur",l.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",l.WINDOW_THEME_CHANGED="tauri://theme-changed",l.WINDOW_FILE_DROP="tauri://file-drop",l.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",l.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",l.MENU="tauri://menu",l))(A||{});async function ee(t,e){return h(t,null,e)}async function ne(t,e){return _(t,null,e)}async function te(t,e){return b(t,void 0,e)}var S={};g(S,{BaseDirectory:()=>U,appCacheDir:()=>oe,appConfigDir:()=>ie,appDataDir:()=>ae,appLocalDataDir:()=>re,appLogDir:()=>Ee,audioDir:()=>se,basename:()=>xe,cacheDir:()=>le,configDir:()=>ce,dataDir:()=>ue,delimiter:()=>De,desktopDir:()=>de,dirname:()=>ze,documentDir:()=>me,downloadDir:()=>pe,executableDir:()=>ye,extname:()=>Se,fontDir:()=>ge,homeDir:()=>he,isAbsolute:()=>Le,join:()=>Re,localDataDir:()=>be,normalize:()=>Ae,pictureDir:()=>_e,publicDir:()=>we,resolve:()=>Te,resolveResource:()=>ve,resourceDir:()=>Pe,runtimeDir:()=>fe,sep:()=>Ce,templateDir:()=>We,videoDir:()=>Me});function z(){return navigator.appVersion.includes("Win")}var U=(a=>(a[a.Audio=1]="Audio",a[a.Cache=2]="Cache",a[a.Config=3]="Config",a[a.Data=4]="Data",a[a.LocalData=5]="LocalData",a[a.Document=6]="Document",a[a.Download=7]="Download",a[a.Picture=8]="Picture",a[a.Public=9]="Public",a[a.Video=10]="Video",a[a.Resource=11]="Resource",a[a.Temp=12]="Temp",a[a.AppConfig=13]="AppConfig",a[a.AppData=14]="AppData",a[a.AppLocalData=15]="AppLocalData",a[a.AppCache=16]="AppCache",a[a.AppLog=17]="AppLog",a[a.Desktop=18]="Desktop",a[a.Executable=19]="Executable",a[a.Font=20]="Font",a[a.Home=21]="Home",a[a.Runtime=22]="Runtime",a[a.Template=23]="Template",a))(U||{});async function ie(){return r("plugin:path|resolve_directory",{directory:13})}async function ae(){return r("plugin:path|resolve_directory",{directory:14})}async function re(){return r("plugin:path|resolve_directory",{directory:15})}async function oe(){return r("plugin:path|resolve_directory",{directory:16})}async function se(){return r("plugin:path|resolve_directory",{directory:1})}async function le(){return r("plugin:path|resolve_directory",{directory:2})}async function ce(){return r("plugin:path|resolve_directory",{directory:3})}async function ue(){return r("plugin:path|resolve_directory",{directory:4})}async function de(){return r("plugin:path|resolve_directory",{directory:18})}async function me(){return r("plugin:path|resolve_directory",{directory:6})}async function pe(){return r("plugin:path|resolve_directory",{directory:7})}async function ye(){return r("plugin:path|resolve_directory",{directory:19})}async function ge(){return r("plugin:path|resolve_directory",{directory:20})}async function he(){return r("plugin:path|resolve_directory",{directory:21})}async function be(){return r("plugin:path|resolve_directory",{directory:5})}async function _e(){return r("plugin:path|resolve_directory",{directory:8})}async function we(){return r("plugin:path|resolve_directory",{directory:9})}async function Pe(){return r("plugin:path|resolve_directory",{directory:11})}async function ve(t){return r("plugin:path|resolve_directory",{directory:11,path:t})}async function fe(){return r("plugin:path|resolve_directory",{directory:22})}async function We(){return r("plugin:path|resolve_directory",{directory:23})}async function Me(){return r("plugin:path|resolve_directory",{directory:10})}async function Ee(){return r("plugin:path|resolve_directory",{directory:17})}var Ce=z()?"\\":"/",De=z()?";":":";async function Te(...t){return r("plugin:path|resolve",{paths:t})}async function Ae(t){return r("plugin:path|normalize",{path:t})}async function Re(...t){return r("plugin:path|join",{paths:t})}async function ze(t){return r("plugin:path|dirname",{path:t})}async function Se(t){return r("plugin:path|extname",{path:t})}async function xe(t,e){return r("plugin:path|basename",{path:t,ext:e})}async function Le(t){return r("plugin:path|isAbsolute",{path:t})}var I={};g(I,{CloseRequestedEvent:()=>W,LogicalPosition:()=>P,LogicalSize:()=>w,PhysicalPosition:()=>y,PhysicalSize:()=>p,UserAttentionType:()=>V,WebviewWindow:()=>u,WebviewWindowHandle:()=>v,WindowManager:()=>f,appWindow:()=>x,availableMonitors:()=>Oe,currentMonitor:()=>ke,getAll:()=>$,getCurrent:()=>Ie,primaryMonitor:()=>Fe});async function i(t){return r("tauri",t)}var w=class{constructor(e,n){this.type="Logical";this.width=e,this.height=n}},p=class{constructor(e,n){this.type="Physical";this.width=e,this.height=n}toLogical(e){return new w(this.width/e,this.height/e)}},P=class{constructor(e,n){this.type="Logical";this.x=e,this.y=n}},y=class{constructor(e,n){this.type="Physical";this.x=e,this.y=n}toLogical(e){return new P(this.x/e,this.y/e)}},V=(n=>(n[n.Critical=1]="Critical",n[n.Informational=2]="Informational",n))(V||{});function Ie(){return new u(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function $(){return window.__TAURI_METADATA__.__windows.map(t=>new u(t.label,{skip:!0}))}var H=["tauri://created","tauri://error"],v=class{constructor(e){this.label=e,this.listeners=Object.create(null)}async listen(e,n){return this._handleTauriEvent(e,n)?Promise.resolve(()=>{let o=this.listeners[e];o.splice(o.indexOf(n),1)}):h(e,this.label,n)}async once(e,n){return this._handleTauriEvent(e,n)?Promise.resolve(()=>{let o=this.listeners[e];o.splice(o.indexOf(n),1)}):_(e,this.label,n)}async emit(e,n){if(H.includes(e)){for(let o of this.listeners[e]||[])o({event:e,id:-1,windowLabel:this.label,payload:n});return Promise.resolve()}return b(e,this.label,n)}_handleTauriEvent(e,n){return H.includes(e)?(e in this.listeners?this.listeners[e].push(n):this.listeners[e]=[n],!0):!1}},f=class extends v{async scaleFactor(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})}async innerPosition(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}}).then(({x:e,y:n})=>new y(e,n))}async outerPosition(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(({x:e,y:n})=>new y(e,n))}async innerSize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(({width:e,height:n})=>new p(e,n))}async outerSize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(({width:e,height:n})=>new p(e,n))}async isFullscreen(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})}async isMinimized(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMinimized"}}}})}async isMaximized(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})}async isDecorated(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})}async isResizable(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})}async isVisible(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})}async title(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"title"}}}})}async theme(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"theme"}}}})}async center(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"center"}}}})}async requestUserAttention(e){let n=null;return e&&(e===1?n={type:"Critical"}:n={type:"Informational"}),i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:n}}}})}async setResizable(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:e}}}})}async setTitle(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:e}}}})}async maximize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})}async unmaximize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})}async toggleMaximize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"toggleMaximize"}}}})}async minimize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})}async unminimize(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})}async show(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})}async hide(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})}async close(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})}async setDecorations(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:e}}}})}async setShadow(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setShadow",payload:e}}}})}async setAlwaysOnTop(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:e}}}})}async setContentProtected(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setContentProtected",payload:e}}}})}async setSize(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSize",payload:{type:e.type,data:{width:e.width,height:e.height}}}}}})}async setMinSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setMaxSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaxSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setFullscreen(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:e}}}})}async setFocus(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})}async setIcon(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIcon",payload:{icon:typeof e=="string"?e:Array.from(e)}}}}})}async setSkipTaskbar(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:e}}}})}async setCursorGrab(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorGrab",payload:e}}}})}async setCursorVisible(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorVisible",payload:e}}}})}async setCursorIcon(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorIcon",payload:e}}}})}async setCursorPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setIgnoreCursorEvents(e){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIgnoreCursorEvents",payload:e}}}})}async startDragging(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})}async onResized(e){return this.listen("tauri://resize",n=>{n.payload=j(n.payload),e(n)})}async onMoved(e){return this.listen("tauri://move",n=>{n.payload=G(n.payload),e(n)})}async onCloseRequested(e){return this.listen("tauri://close-requested",n=>{let o=new W(n);Promise.resolve(e(o)).then(()=>{if(!o.isPreventDefault())return this.close()})})}async onFocusChanged(e){let n=await this.listen("tauri://focus",s=>{e({...s,payload:!0})}),o=await this.listen("tauri://blur",s=>{e({...s,payload:!1})});return()=>{n(),o()}}async onScaleChanged(e){return this.listen("tauri://scale-change",e)}async onMenuClicked(e){return this.listen("tauri://menu",e)}async onFileDropEvent(e){let n=await this.listen("tauri://file-drop",c=>{e({...c,payload:{type:"drop",paths:c.payload}})}),o=await this.listen("tauri://file-drop-hover",c=>{e({...c,payload:{type:"hover",paths:c.payload}})}),s=await this.listen("tauri://file-drop-cancelled",c=>{e({...c,payload:{type:"cancel"}})});return()=>{n(),o(),s()}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},W=class{constructor(e){this._preventDefault=!1;this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}},u=class extends f{constructor(e,n={}){super(e),n?.skip||i({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:{label:e,...n}}}}).then(async()=>this.emit("tauri://created")).catch(async o=>this.emit("tauri://error",o))}static getByLabel(e){return $().some(n=>n.label===e)?new u(e,{skip:!0}):null}},x;"__TAURI_METADATA__"in window?x=new u(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn(`Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label. -Note that this is not an issue if running this frontend on a browser instead of a Tauri window.`),x=new u("main",{skip:!0}));function L(t){return t===null?null:{name:t.name,scaleFactor:t.scaleFactor,position:G(t.position),size:j(t.size)}}function G(t){return new y(t.x,t.y)}function j(t){return new p(t.width,t.height)}async function ke(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}).then(L)}async function Fe(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}).then(L)}async function Oe(){return i({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}).then(t=>t.map(L))}var Ne=r;return K(Ue);})(); +"use strict";var __TAURI_IIFE__=(()=>{var d=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var p=(n,e)=>{for(var i in e)d(n,i,{get:e[i],enumerable:!0})},O=(n,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of k(e))!I.call(n,a)&&a!==i&&d(n,a,{get:()=>e[a],enumerable:!(o=R(e,a))||o.enumerable});return n};var L=n=>O(d({},"__esModule",{value:!0}),n);var D=(n,e,i)=>{if(!e.has(n))throw TypeError("Cannot "+i)};var g=(n,e,i)=>(D(n,e,"read from private field"),i?i.call(n):e.get(n)),b=(n,e,i)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,i)},A=(n,e,i,o)=>(D(n,e,"write to private field"),o?o.call(n,i):e.set(n,i),i);var Pn={};p(Pn,{event:()=>v,invoke:()=>hn,path:()=>h,tauri:()=>y});var v={};p(v,{TauriEvent:()=>W,emit:()=>$,listen:()=>F,once:()=>S});var y={};p(y,{Channel:()=>m,convertFileSrc:()=>T,invoke:()=>t,transformCallback:()=>u});function x(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function u(n,e=!1){let i=x(),o=`_${i}`;return Object.defineProperty(window,o,{value:a=>(e&&Reflect.deleteProperty(window,o),n?.(a)),writable:!1,configurable:!0}),i}var c,m=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0;b(this,c,()=>{});this.id=u(e=>{g(this,c).call(this,e)})}set onmessage(e){A(this,c,e)}get onmessage(){return g(this,c)}toJSON(){return`__CHANNEL__:${this.id}`}};c=new WeakMap;async function t(n,e={}){return new Promise((i,o)=>{let a=u(l=>{i(l),Reflect.deleteProperty(window,`_${P}`)},!0),P=u(l=>{o(l),Reflect.deleteProperty(window,`_${a}`)},!0);window.__TAURI_IPC__({cmd:n,callback:a,error:P,...e})})}function T(n,e="asset"){let i=encodeURIComponent(n);return navigator.userAgent.includes("Windows")?`https://${e}.localhost/${i}`:`${e}://localhost/${i}`}async function E(n,e){await t("plugin:event|unlisten",{event:n,eventId:e})}async function w(n,e,i){await t("plugin:event|emit",{event:n,windowLabel:e,payload:i})}async function f(n,e,i){return t("plugin:event|listen",{event:n,windowLabel:e,handler:u(i)}).then(o=>async()=>E(n,o))}async function C(n,e,i){return f(n,e,o=>{i(o),E(n,o.id).catch(()=>{})})}var W=(s=>(s.WINDOW_RESIZED="tauri://resize",s.WINDOW_MOVED="tauri://move",s.WINDOW_CLOSE_REQUESTED="tauri://close-requested",s.WINDOW_CREATED="tauri://window-created",s.WINDOW_DESTROYED="tauri://destroyed",s.WINDOW_FOCUS="tauri://focus",s.WINDOW_BLUR="tauri://blur",s.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",s.WINDOW_THEME_CHANGED="tauri://theme-changed",s.WINDOW_FILE_DROP="tauri://file-drop",s.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",s.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",s.MENU="tauri://menu",s))(W||{});async function F(n,e){return f(n,null,e)}async function S(n,e){return C(n,null,e)}async function $(n,e){return w(n,void 0,e)}var h={};p(h,{BaseDirectory:()=>N,appCacheDir:()=>j,appConfigDir:()=>H,appDataDir:()=>V,appLocalDataDir:()=>M,appLogDir:()=>un,audioDir:()=>z,basename:()=>vn,cacheDir:()=>G,configDir:()=>q,dataDir:()=>J,delimiter:()=>ln,desktopDir:()=>K,dirname:()=>yn,documentDir:()=>Q,downloadDir:()=>Y,executableDir:()=>Z,extname:()=>fn,fontDir:()=>X,homeDir:()=>B,isAbsolute:()=>_n,join:()=>mn,localDataDir:()=>nn,normalize:()=>gn,pictureDir:()=>en,publicDir:()=>rn,resolve:()=>dn,resolveResource:()=>on,resourceDir:()=>tn,runtimeDir:()=>sn,sep:()=>pn,templateDir:()=>an,videoDir:()=>cn});function _(){return navigator.appVersion.includes("Win")}var N=(r=>(r[r.Audio=1]="Audio",r[r.Cache=2]="Cache",r[r.Config=3]="Config",r[r.Data=4]="Data",r[r.LocalData=5]="LocalData",r[r.Document=6]="Document",r[r.Download=7]="Download",r[r.Picture=8]="Picture",r[r.Public=9]="Public",r[r.Video=10]="Video",r[r.Resource=11]="Resource",r[r.Temp=12]="Temp",r[r.AppConfig=13]="AppConfig",r[r.AppData=14]="AppData",r[r.AppLocalData=15]="AppLocalData",r[r.AppCache=16]="AppCache",r[r.AppLog=17]="AppLog",r[r.Desktop=18]="Desktop",r[r.Executable=19]="Executable",r[r.Font=20]="Font",r[r.Home=21]="Home",r[r.Runtime=22]="Runtime",r[r.Template=23]="Template",r))(N||{});async function H(){return t("plugin:path|resolve_directory",{directory:13})}async function V(){return t("plugin:path|resolve_directory",{directory:14})}async function M(){return t("plugin:path|resolve_directory",{directory:15})}async function j(){return t("plugin:path|resolve_directory",{directory:16})}async function z(){return t("plugin:path|resolve_directory",{directory:1})}async function G(){return t("plugin:path|resolve_directory",{directory:2})}async function q(){return t("plugin:path|resolve_directory",{directory:3})}async function J(){return t("plugin:path|resolve_directory",{directory:4})}async function K(){return t("plugin:path|resolve_directory",{directory:18})}async function Q(){return t("plugin:path|resolve_directory",{directory:6})}async function Y(){return t("plugin:path|resolve_directory",{directory:7})}async function Z(){return t("plugin:path|resolve_directory",{directory:19})}async function X(){return t("plugin:path|resolve_directory",{directory:20})}async function B(){return t("plugin:path|resolve_directory",{directory:21})}async function nn(){return t("plugin:path|resolve_directory",{directory:5})}async function en(){return t("plugin:path|resolve_directory",{directory:8})}async function rn(){return t("plugin:path|resolve_directory",{directory:9})}async function tn(){return t("plugin:path|resolve_directory",{directory:11})}async function on(n){return t("plugin:path|resolve_directory",{directory:11,path:n})}async function sn(){return t("plugin:path|resolve_directory",{directory:22})}async function an(){return t("plugin:path|resolve_directory",{directory:23})}async function cn(){return t("plugin:path|resolve_directory",{directory:10})}async function un(){return t("plugin:path|resolve_directory",{directory:17})}var pn=_()?"\\":"/",ln=_()?";":":";async function dn(...n){return t("plugin:path|resolve",{paths:n})}async function gn(n){return t("plugin:path|normalize",{path:n})}async function mn(...n){return t("plugin:path|join",{paths:n})}async function yn(n){return t("plugin:path|dirname",{path:n})}async function fn(n){return t("plugin:path|extname",{path:n})}async function vn(n,e){return t("plugin:path|basename",{path:n,ext:e})}async function _n(n){return t("plugin:path|isAbsolute",{path:n})}var hn=t;return L(Pn);})(); window.__TAURI__ = __TAURI_IIFE__ diff --git a/core/tauri/src/endpoints.rs b/core/tauri/src/endpoints.rs deleted file mode 100644 index 2bd7bb586df..00000000000 --- a/core/tauri/src/endpoints.rs +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - -use crate::{ - hooks::{InvokeError, InvokeMessage, InvokeResolver}, - Config, Invoke, PackageInfo, Runtime, Window, -}; -pub use anyhow::Result; -use serde::{Deserialize, Serialize}; -use serde_json::Value as JsonValue; - -use std::sync::Arc; - -mod window; - -/// The context passed to the invoke handler. -pub struct InvokeContext { - pub window: Window, - pub config: Arc, - pub package_info: PackageInfo, -} - -#[cfg(test)] -impl Clone for InvokeContext { - fn clone(&self) -> Self { - Self { - window: self.window.clone(), - config: self.config.clone(), - package_info: self.package_info.clone(), - } - } -} - -/// The response for a JS `invoke` call. -pub struct InvokeResponse { - json: Result, -} - -impl From for InvokeResponse { - fn from(value: T) -> Self { - Self { - json: serde_json::to_value(value).map_err(Into::into), - } - } -} - -#[derive(Deserialize)] -#[serde(tag = "module", content = "message")] -enum Module { - Window(Box), -} - -impl Module { - fn run( - self, - window: Window, - resolver: InvokeResolver, - config: Arc, - package_info: PackageInfo, - ) { - let context = InvokeContext { - window, - config, - package_info, - }; - match self { - Self::Window(cmd) => resolver.respond_async(async move { - cmd - .run(context) - .await - .and_then(|r| r.json) - .map_err(InvokeError::from_anyhow) - }), - } - } -} - -pub(crate) fn handle( - module: String, - invoke: Invoke, - config: Arc, - package_info: &PackageInfo, -) { - let Invoke { message, resolver } = invoke; - let InvokeMessage { - mut payload, - window, - .. - } = message; - - if let JsonValue::Object(ref mut obj) = payload { - obj.insert("module".to_string(), JsonValue::String(module.clone())); - } - - match serde_json::from_value::(payload) { - Ok(module) => module.run(window, resolver, config, package_info.clone()), - Err(e) => { - let message = e.to_string(); - if message.starts_with("unknown variant") { - let mut s = message.split('`'); - s.next(); - if let Some(unknown_variant_name) = s.next() { - if unknown_variant_name == module { - return resolver.reject(format!( - "The `{module}` module is not enabled. You must enable one of its APIs in the allowlist.", - )); - } else if module == "Window" { - return resolver.reject(window::into_allowlist_error(unknown_variant_name).to_string()); - } - } - } - resolver.reject(message); - } - } -} diff --git a/core/tauri/src/endpoints/window.rs b/core/tauri/src/endpoints/window.rs deleted file mode 100644 index 925c5815e1f..00000000000 --- a/core/tauri/src/endpoints/window.rs +++ /dev/null @@ -1,364 +0,0 @@ -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - -#![allow(unused_imports)] - -use super::{InvokeContext, InvokeResponse}; -#[cfg(window_create)] -use crate::runtime::{webview::WindowBuilder, Dispatch}; -use crate::{ - runtime::{ - window::dpi::{Position, Size}, - UserAttentionType, - }, - utils::config::WindowConfig, - CursorIcon, Icon, Manager, Runtime, -}; -use serde::Deserialize; -use tauri_macros::{command_enum, module_command_handler, CommandModule}; - -#[derive(Deserialize)] -#[serde(untagged)] -pub enum IconDto { - #[cfg(any(feature = "icon-png", feature = "icon-ico"))] - File(std::path::PathBuf), - #[cfg(any(feature = "icon-png", feature = "icon-ico"))] - Raw(Vec), - Rgba { - rgba: Vec, - width: u32, - height: u32, - }, -} - -impl From for Icon { - fn from(icon: IconDto) -> Self { - match icon { - #[cfg(any(feature = "icon-png", feature = "icon-ico"))] - IconDto::File(path) => Self::File(path), - #[cfg(any(feature = "icon-png", feature = "icon-ico"))] - IconDto::Raw(raw) => Self::Raw(raw), - IconDto::Rgba { - rgba, - width, - height, - } => Self::Rgba { - rgba, - width, - height, - }, - } - } -} - -/// Window management API descriptor. -#[derive(Deserialize)] -#[serde(tag = "type", content = "payload", rename_all = "camelCase")] -pub enum WindowManagerCmd { - // Getters - ScaleFactor, - InnerPosition, - OuterPosition, - InnerSize, - OuterSize, - IsFullscreen, - IsMinimized, - IsMaximized, - IsDecorated, - IsResizable, - IsVisible, - Title, - CurrentMonitor, - PrimaryMonitor, - AvailableMonitors, - Theme, - // Setters - #[cfg(window_center)] - Center, - #[cfg(window_request_user_attention)] - RequestUserAttention(Option), - #[cfg(window_set_resizable)] - SetResizable(bool), - #[cfg(window_set_title)] - SetTitle(String), - #[cfg(window_maximize)] - Maximize, - #[cfg(window_unmaximize)] - Unmaximize, - #[cfg(all(window_maximize, window_unmaximize))] - ToggleMaximize, - #[cfg(window_minimize)] - Minimize, - #[cfg(window_unminimize)] - Unminimize, - #[cfg(window_show)] - Show, - #[cfg(window_hide)] - Hide, - #[cfg(window_close)] - Close, - #[cfg(window_set_decorations)] - SetDecorations(bool), - #[cfg(window_set_shadow)] - SetShadow(bool), - #[cfg(window_set_always_on_top)] - #[serde(rename_all = "camelCase")] - SetAlwaysOnTop(bool), - #[cfg(window_set_content_protected)] - SetContentProtected(bool), - #[cfg(window_set_size)] - SetSize(Size), - #[cfg(window_set_min_size)] - SetMinSize(Option), - #[cfg(window_set_max_size)] - SetMaxSize(Option), - #[cfg(window_set_position)] - SetPosition(Position), - #[cfg(window_set_fullscreen)] - SetFullscreen(bool), - #[cfg(window_set_focus)] - SetFocus, - #[cfg(window_set_icon)] - SetIcon { - icon: IconDto, - }, - #[cfg(window_set_skip_taskbar)] - SetSkipTaskbar(bool), - #[cfg(window_set_cursor_grab)] - SetCursorGrab(bool), - #[cfg(window_set_cursor_visible)] - SetCursorVisible(bool), - #[cfg(window_set_cursor_icon)] - SetCursorIcon(CursorIcon), - #[cfg(window_set_cursor_position)] - SetCursorPosition(Position), - #[cfg(window_set_ignore_cursor_events)] - SetIgnoreCursorEvents(bool), - #[cfg(window_start_dragging)] - StartDragging, - #[cfg(window_print)] - Print, - // internals - #[cfg(all(window_maximize, window_unmaximize))] - #[serde(rename = "__toggleMaximize")] - InternalToggleMaximize, - #[cfg(any(debug_assertions, feature = "devtools"))] - #[serde(rename = "__toggleDevtools")] - InternalToggleDevtools, -} - -pub fn into_allowlist_error(variant: &str) -> crate::Error { - match variant { - "center" => crate::Error::ApiNotAllowlisted("window > center".to_string()), - "requestUserAttention" => { - crate::Error::ApiNotAllowlisted("window > requestUserAttention".to_string()) - } - "setResizable" => crate::Error::ApiNotAllowlisted("window > setResizable".to_string()), - "setTitle" => crate::Error::ApiNotAllowlisted("window > setTitle".to_string()), - "maximize" => crate::Error::ApiNotAllowlisted("window > maximize".to_string()), - "unmaximize" => crate::Error::ApiNotAllowlisted("window > unmaximize".to_string()), - "toggleMaximize" => { - crate::Error::ApiNotAllowlisted("window > maximize and window > unmaximize".to_string()) - } - "minimize" => crate::Error::ApiNotAllowlisted("window > minimize".to_string()), - "unminimize" => crate::Error::ApiNotAllowlisted("window > unminimize".to_string()), - "show" => crate::Error::ApiNotAllowlisted("window > show".to_string()), - "hide" => crate::Error::ApiNotAllowlisted("window > hide".to_string()), - "close" => crate::Error::ApiNotAllowlisted("window > close".to_string()), - "setDecorations" => crate::Error::ApiNotAllowlisted("window > setDecorations".to_string()), - "setShadow" => crate::Error::ApiNotAllowlisted("window > setShadow".to_string()), - "setAlwaysOnTop" => crate::Error::ApiNotAllowlisted("window > setAlwaysOnTop".to_string()), - "setContentProtected" => { - crate::Error::ApiNotAllowlisted("window > setContentProtected".to_string()) - } - "setSize" => crate::Error::ApiNotAllowlisted("window > setSize".to_string()), - "setMinSize" => crate::Error::ApiNotAllowlisted("window > setMinSize".to_string()), - "setMaxSize" => crate::Error::ApiNotAllowlisted("window > setMaxSize".to_string()), - "setPosition" => crate::Error::ApiNotAllowlisted("window > setPosition".to_string()), - "setFullscreen" => crate::Error::ApiNotAllowlisted("window > setFullscreen".to_string()), - "setIcon" => crate::Error::ApiNotAllowlisted("window > setIcon".to_string()), - "setSkipTaskbar" => crate::Error::ApiNotAllowlisted("window > setSkipTaskbar".to_string()), - "setCursorGrab" => crate::Error::ApiNotAllowlisted("window > setCursorGrab".to_string()), - "setCursorVisible" => crate::Error::ApiNotAllowlisted("window > setCursorVisible".to_string()), - "setCursorIcon" => crate::Error::ApiNotAllowlisted("window > setCursorIcon".to_string()), - "setCursorPosition" => { - crate::Error::ApiNotAllowlisted("window > setCursorPosition".to_string()) - } - "setIgnoreCursorEvents" => { - crate::Error::ApiNotAllowlisted("window > setIgnoreCursorEvents".to_string()) - } - "startDragging" => crate::Error::ApiNotAllowlisted("window > startDragging".to_string()), - "print" => crate::Error::ApiNotAllowlisted("window > print".to_string()), - "__toggleMaximize" => { - crate::Error::ApiNotAllowlisted("window > maximize and window > unmaximize".to_string()) - } - "__toggleDevtools" => crate::Error::ApiNotAllowlisted("devtools".to_string()), - _ => crate::Error::ApiNotAllowlisted("window".to_string()), - } -} - -/// The API descriptor. -#[command_enum] -#[derive(Deserialize, CommandModule)] -#[cmd(async)] -#[serde(tag = "cmd", content = "data", rename_all = "camelCase")] -pub enum Cmd { - #[cmd(window_create, "window > create")] - CreateWebview { options: Box }, - Manage { - label: Option, - cmd: WindowManagerCmd, - }, -} - -impl Cmd { - #[module_command_handler(window_create)] - async fn create_webview( - context: InvokeContext, - mut options: Box, - ) -> super::Result<()> { - options.additional_browser_args = None; - crate::window::WindowBuilder::from_config(&context.window, *options) - .build() - .map_err(crate::error::into_anyhow)?; - Ok(()) - } - - async fn manage( - context: InvokeContext, - label: Option, - cmd: WindowManagerCmd, - ) -> super::Result { - Self::_manage(context, label, cmd) - .await - .map_err(crate::error::into_anyhow) - } - - async fn _manage( - context: InvokeContext, - label: Option, - cmd: WindowManagerCmd, - ) -> crate::Result { - let window = match label { - Some(l) if !l.is_empty() => context - .window - .get_window(&l) - .ok_or(crate::Error::WebviewNotFound)?, - _ => context.window, - }; - match cmd { - // Getters - WindowManagerCmd::ScaleFactor => return Ok(window.scale_factor()?.into()), - WindowManagerCmd::InnerPosition => return Ok(window.inner_position()?.into()), - WindowManagerCmd::OuterPosition => return Ok(window.outer_position()?.into()), - WindowManagerCmd::InnerSize => return Ok(window.inner_size()?.into()), - WindowManagerCmd::OuterSize => return Ok(window.outer_size()?.into()), - WindowManagerCmd::IsFullscreen => return Ok(window.is_fullscreen()?.into()), - WindowManagerCmd::IsMinimized => return Ok(window.is_minimized()?.into()), - WindowManagerCmd::IsMaximized => return Ok(window.is_maximized()?.into()), - WindowManagerCmd::IsDecorated => return Ok(window.is_decorated()?.into()), - WindowManagerCmd::IsResizable => return Ok(window.is_resizable()?.into()), - WindowManagerCmd::IsVisible => return Ok(window.is_visible()?.into()), - WindowManagerCmd::Title => return Ok(window.title()?.into()), - WindowManagerCmd::CurrentMonitor => return Ok(window.current_monitor()?.into()), - WindowManagerCmd::PrimaryMonitor => return Ok(window.primary_monitor()?.into()), - WindowManagerCmd::AvailableMonitors => return Ok(window.available_monitors()?.into()), - WindowManagerCmd::Theme => return Ok(window.theme()?.into()), - // Setters - #[cfg(all(desktop, window_center))] - WindowManagerCmd::Center => window.center()?, - #[cfg(all(desktop, window_request_user_attention))] - WindowManagerCmd::RequestUserAttention(request_type) => { - window.request_user_attention(request_type)? - } - #[cfg(all(desktop, window_set_resizable))] - WindowManagerCmd::SetResizable(resizable) => window.set_resizable(resizable)?, - #[cfg(all(desktop, window_set_title))] - WindowManagerCmd::SetTitle(title) => window.set_title(&title)?, - #[cfg(all(desktop, window_maximize))] - WindowManagerCmd::Maximize => window.maximize()?, - #[cfg(all(desktop, window_unmaximize))] - WindowManagerCmd::Unmaximize => window.unmaximize()?, - #[cfg(all(desktop, window_maximize, window_unmaximize))] - WindowManagerCmd::ToggleMaximize => match window.is_maximized()? { - true => window.unmaximize()?, - false => window.maximize()?, - }, - #[cfg(all(desktop, window_minimize))] - WindowManagerCmd::Minimize => window.minimize()?, - #[cfg(all(desktop, window_unminimize))] - WindowManagerCmd::Unminimize => window.unminimize()?, - #[cfg(all(desktop, window_show))] - WindowManagerCmd::Show => window.show()?, - #[cfg(all(desktop, window_hide))] - WindowManagerCmd::Hide => window.hide()?, - #[cfg(all(desktop, window_close))] - WindowManagerCmd::Close => window.close()?, - #[cfg(all(desktop, window_set_decorations))] - WindowManagerCmd::SetDecorations(decorations) => window.set_decorations(decorations)?, - #[cfg(all(desktop, window_set_shadow))] - WindowManagerCmd::SetShadow(enable) => window.set_shadow(enable)?, - #[cfg(all(desktop, window_set_always_on_top))] - WindowManagerCmd::SetAlwaysOnTop(always_on_top) => window.set_always_on_top(always_on_top)?, - #[cfg(all(desktop, window_set_content_protected))] - WindowManagerCmd::SetContentProtected(protected) => { - window.set_content_protected(protected)? - } - #[cfg(all(desktop, window_set_size))] - WindowManagerCmd::SetSize(size) => window.set_size(size)?, - #[cfg(all(desktop, window_set_min_size))] - WindowManagerCmd::SetMinSize(size) => window.set_min_size(size)?, - #[cfg(all(desktop, window_set_max_size))] - WindowManagerCmd::SetMaxSize(size) => window.set_max_size(size)?, - #[cfg(all(desktop, window_set_position))] - WindowManagerCmd::SetPosition(position) => window.set_position(position)?, - #[cfg(all(desktop, window_set_fullscreen))] - WindowManagerCmd::SetFullscreen(fullscreen) => window.set_fullscreen(fullscreen)?, - #[cfg(all(desktop, window_set_focus))] - WindowManagerCmd::SetFocus => window.set_focus()?, - #[cfg(all(desktop, window_set_icon))] - WindowManagerCmd::SetIcon { icon } => window.set_icon(icon.into())?, - #[cfg(all(desktop, window_set_skip_taskbar))] - WindowManagerCmd::SetSkipTaskbar(skip) => window.set_skip_taskbar(skip)?, - #[cfg(all(desktop, window_set_cursor_grab))] - WindowManagerCmd::SetCursorGrab(grab) => window.set_cursor_grab(grab)?, - #[cfg(all(desktop, window_set_cursor_visible))] - WindowManagerCmd::SetCursorVisible(visible) => window.set_cursor_visible(visible)?, - #[cfg(all(desktop, window_set_cursor_icon))] - WindowManagerCmd::SetCursorIcon(icon) => window.set_cursor_icon(icon)?, - #[cfg(all(desktop, window_set_cursor_position))] - WindowManagerCmd::SetCursorPosition(position) => window.set_cursor_position(position)?, - #[cfg(all(desktop, window_set_ignore_cursor_events))] - WindowManagerCmd::SetIgnoreCursorEvents(ignore_cursor) => { - window.set_ignore_cursor_events(ignore_cursor)? - } - #[cfg(all(desktop, window_start_dragging))] - WindowManagerCmd::StartDragging => window.start_dragging()?, - #[cfg(all(desktop, window_print))] - WindowManagerCmd::Print => window.print()?, - // internals - #[cfg(all(desktop, window_maximize, window_unmaximize))] - WindowManagerCmd::InternalToggleMaximize => { - if window.is_resizable()? { - match window.is_maximized()? { - true => window.unmaximize()?, - false => window.maximize()?, - } - } - } - #[cfg(all(desktop, any(debug_assertions, feature = "devtools")))] - WindowManagerCmd::InternalToggleDevtools => { - if window.is_devtools_open() { - window.close_devtools(); - } else { - window.open_devtools(); - } - } - #[allow(unreachable_patterns)] - _ => (), - } - #[allow(unreachable_code)] - Ok(().into()) - } -} diff --git a/core/tauri/src/error.rs b/core/tauri/src/error.rs index bd5ecda30ea..cce5b1b43f1 100644 --- a/core/tauri/src/error.rs +++ b/core/tauri/src/error.rs @@ -51,10 +51,7 @@ pub enum Error { AssetNotFound(String), /// Failed to serialize/deserialize. #[error("JSON error: {0}")] - Json(serde_json::Error), - /// Unknown API type. - #[error("unknown API: {0:?}")] - UnknownApi(Option), + Json(#[from] serde_json::Error), /// Failed to execute tauri API. #[error("failed to execute API: {0}")] FailedToExecuteApi(#[from] crate::api::Error), @@ -105,24 +102,3 @@ pub enum Error { #[error("jni error: {0}")] Jni(#[from] jni::errors::Error), } - -pub(crate) fn into_anyhow(err: T) -> anyhow::Error { - anyhow::anyhow!(err.to_string()) -} - -impl Error { - #[allow(dead_code)] - pub(crate) fn into_anyhow(self) -> anyhow::Error { - anyhow::anyhow!(self.to_string()) - } -} - -impl From for Error { - fn from(error: serde_json::Error) -> Self { - if error.to_string().contains("unknown variant") { - Self::UnknownApi(Some(error)) - } else { - Self::Json(error) - } - } -} diff --git a/core/tauri/src/hooks.rs b/core/tauri/src/hooks.rs index 9a4159e783a..4bbe77f0a9d 100644 --- a/core/tauri/src/hooks.rs +++ b/core/tauri/src/hooks.rs @@ -61,9 +61,6 @@ impl PageLoadPayload { pub struct InvokePayload { /// The invoke command. pub cmd: String, - #[serde(rename = "__tauriModule")] - #[doc(hidden)] - pub tauri_module: Option, /// The success callback. pub callback: CallbackFn, /// The error callback. diff --git a/core/tauri/src/lib.rs b/core/tauri/src/lib.rs index f5d97b6a5e7..c47ca5a3d1c 100644 --- a/core/tauri/src/lib.rs +++ b/core/tauri/src/lib.rs @@ -179,8 +179,6 @@ pub mod api; pub(crate) mod app; pub mod async_runtime; pub mod command; -/// The Tauri API endpoints. -mod endpoints; mod error; mod event; mod hooks; diff --git a/core/tauri/src/scope/ipc.rs b/core/tauri/src/scope/ipc.rs index 7837120d1c2..728eb4ec644 100644 --- a/core/tauri/src/scope/ipc.rs +++ b/core/tauri/src/scope/ipc.rs @@ -14,7 +14,6 @@ pub struct RemoteDomainAccessScope { domain: String, windows: Vec, plugins: Vec, - enable_tauri_api: bool, } impl RemoteDomainAccessScope { @@ -25,7 +24,6 @@ impl RemoteDomainAccessScope { domain: domain.into(), windows: Vec::new(), plugins: Vec::new(), - enable_tauri_api: false, } } @@ -47,9 +45,13 @@ impl RemoteDomainAccessScope { self } - /// Enables access to the Tauri API. - pub fn enable_tauri_api(mut self) -> Self { - self.enable_tauri_api = true; + /// Adds the given list of plugins to the allowed plugin list. + pub fn add_plugins(mut self, plugins: I) -> Self + where + I: IntoIterator, + S: Into, + { + self.plugins.extend(plugins.into_iter().map(Into::into)); self } @@ -67,11 +69,6 @@ impl RemoteDomainAccessScope { pub fn plugins(&self) -> &Vec { &self.plugins } - - /// Whether this scope enables Tauri API access or not. - pub fn enables_tauri_api(&self) -> bool { - self.enable_tauri_api - } } pub(crate) struct RemoteAccessError { @@ -99,7 +96,6 @@ impl Scope { domain: s.domain, windows: s.windows, plugins: s.plugins, - enable_tauri_api: s.enable_tauri_api, }) .collect(); @@ -119,7 +115,7 @@ impl Scope { /// app.ipc_scope().configure_remote_access( /// RemoteDomainAccessScope::new("tauri.app") /// .add_window("main") - /// .enable_tauri_api() + /// .add_plugins(["path", "event"]) /// ); /// Ok(()) /// }); @@ -238,7 +234,6 @@ mod tests { InvokePayload { cmd: "plugin:path|is_absolute".into(), - tauri_module: None, callback, error, inner: serde_json::Value::Object(payload), @@ -251,7 +246,6 @@ mod tests { InvokePayload { cmd: format!("plugin:{PLUGIN_NAME}|doSomething"), - tauri_module: None, callback, error, inner: Default::default(), @@ -262,8 +256,7 @@ mod tests { fn scope_not_defined() { let (_app, window) = test_context(vec![RemoteDomainAccessScope::new("app.tauri.app") .add_window("other") - .add_plugin("path") - .enable_tauri_api()]); + .add_plugin("path")]); window.navigate("https://tauri.app".parse().unwrap()); assert_ipc_response::<()>( @@ -280,8 +273,7 @@ mod tests { fn scope_not_defined_for_window() { let (_app, window) = test_context(vec![RemoteDomainAccessScope::new("tauri.app") .add_window("second") - .add_plugin("path") - .enable_tauri_api()]); + .add_plugin("path")]); window.navigate("https://tauri.app".parse().unwrap()); assert_ipc_response::<()>( @@ -295,8 +287,7 @@ mod tests { fn scope_not_defined_for_url() { let (_app, window) = test_context(vec![RemoteDomainAccessScope::new("github.com") .add_window("main") - .add_plugin("path") - .enable_tauri_api()]); + .add_plugin("path")]); window.navigate("https://tauri.app".parse().unwrap()); assert_ipc_response::<()>( @@ -313,12 +304,10 @@ mod tests { let (_app, mut window) = test_context(vec![ RemoteDomainAccessScope::new("tauri.app") .add_window("main") - .add_plugin("path") - .enable_tauri_api(), + .add_plugin("path"), RemoteDomainAccessScope::new("sub.tauri.app") .add_window("main") - .add_plugin("path") - .enable_tauri_api(), + .add_plugin("path"), ]); window.navigate("https://tauri.app".parse().unwrap()); @@ -352,8 +341,7 @@ mod tests { fn subpath_is_allowed() { let (_app, window) = test_context(vec![RemoteDomainAccessScope::new("tauri.app") .add_window("main") - .add_plugin("path") - .enable_tauri_api()]); + .add_plugin("path")]); window.navigate("https://tauri.app/inner/path".parse().unwrap()); assert_ipc_response(&window, path_is_absolute_payload(), Ok(true)); diff --git a/core/tauri/src/test/mod.rs b/core/tauri/src/test/mod.rs index 71c6fec913e..0ee87e32720 100644 --- a/core/tauri/src/test/mod.rs +++ b/core/tauri/src/test/mod.rs @@ -9,7 +9,7 @@ pub use mock_runtime::*; use std::{borrow::Cow, sync::Arc}; -use crate::{Manager, Pattern, WindowBuilder}; +use crate::{Pattern, WindowBuilder}; use tauri_utils::{ assets::{AssetKey, Assets, CspHash}, config::{Config, PatternKind, TauriConfig, WindowUrl}, @@ -81,13 +81,3 @@ pub fn mock_app() -> crate::App { app } - -#[allow(dead_code)] -pub(crate) fn mock_invoke_context() -> crate::endpoints::InvokeContext { - let app = mock_app(); - crate::endpoints::InvokeContext { - window: app.get_window("main").unwrap(), - config: app.config(), - package_info: app.package_info().clone(), - } -} diff --git a/core/tauri/src/window.rs b/core/tauri/src/window.rs index b59872d4c20..28838a6dcc9 100644 --- a/core/tauri/src/window.rs +++ b/core/tauri/src/window.rs @@ -1516,18 +1516,7 @@ impl Window { return Ok(()); } - if let Some(module) = &payload.tauri_module { - if !is_local && scope.map(|s| !s.enables_tauri_api()).unwrap_or_default() { - invoke.resolver.reject(IPC_SCOPE_DOES_NOT_ALLOW); - return Ok(()); - } - crate::endpoints::handle( - module.to_string(), - invoke, - manager.config(), - manager.package_info(), - ); - } else if payload.cmd.starts_with("plugin:") { + if payload.cmd.starts_with("plugin:") { if !is_local { let command = invoke.message.command.replace("plugin:", ""); let plugin_name = command.split('|').next().unwrap().to_string(); diff --git a/examples/api/dist/assets/index.css b/examples/api/dist/assets/index.css index 54d922d053c..2e0a5fe95b7 100644 --- a/examples/api/dist/assets/index.css +++ b/examples/api/dist/assets/index.css @@ -1 +1 @@ -*,::before,::after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x:var(--un-empty,/*!*/ /*!*/);--un-pan-y:var(--un-empty,/*!*/ /*!*/);--un-pinch-zoom:var(--un-empty,/*!*/ /*!*/);--un-scroll-snap-strictness:proximity;--un-ordinal:var(--un-empty,/*!*/ /*!*/);--un-slashed-zero:var(--un-empty,/*!*/ /*!*/);--un-numeric-figure:var(--un-empty,/*!*/ /*!*/);--un-numeric-spacing:var(--un-empty,/*!*/ /*!*/);--un-numeric-fraction:var(--un-empty,/*!*/ /*!*/);--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 #0000;--un-ring-shadow:0 0 #0000;--un-shadow-inset:var(--un-empty,/*!*/ /*!*/);--un-shadow:0 0 #0000;--un-ring-inset:var(--un-empty,/*!*/ /*!*/);--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,0.5);--un-blur:var(--un-empty,/*!*/ /*!*/);--un-brightness:var(--un-empty,/*!*/ /*!*/);--un-contrast:var(--un-empty,/*!*/ /*!*/);--un-drop-shadow:var(--un-empty,/*!*/ /*!*/);--un-grayscale:var(--un-empty,/*!*/ /*!*/);--un-hue-rotate:var(--un-empty,/*!*/ /*!*/);--un-invert:var(--un-empty,/*!*/ /*!*/);--un-saturate:var(--un-empty,/*!*/ /*!*/);--un-sepia:var(--un-empty,/*!*/ /*!*/);--un-backdrop-blur:var(--un-empty,/*!*/ /*!*/);--un-backdrop-brightness:var(--un-empty,/*!*/ /*!*/);--un-backdrop-contrast:var(--un-empty,/*!*/ /*!*/);--un-backdrop-grayscale:var(--un-empty,/*!*/ /*!*/);--un-backdrop-hue-rotate:var(--un-empty,/*!*/ /*!*/);--un-backdrop-invert:var(--un-empty,/*!*/ /*!*/);--un-backdrop-opacity:var(--un-empty,/*!*/ /*!*/);--un-backdrop-saturate:var(--un-empty,/*!*/ /*!*/);--un-backdrop-sepia:var(--un-empty,/*!*/ /*!*/);}@font-face { font-family: 'Fira Code'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/firacode/v21/uU9eCBsR6Z2vfE9aq3bL0fxyUs4tcw4W_D1sFVc.ttf) format('truetype');}@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/firamono/v14/N0bX2SlFPv1weGeLZDtQIQ.ttf) format('truetype');}@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url(https://fonts.gstatic.com/s/firamono/v14/N0bS2SlFPv1weGeLZDtondv3mQ.ttf) format('truetype');}@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/rubik/v26/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-B4i1UA.ttf) format('truetype');}.i-codicon-chrome-maximize{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M3 3v10h10V3H3zm9 9H4V4h8v8z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-chrome-minimize{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M14 8v1H3V8h11z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-chrome-restore{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='currentColor'%3E%3Cpath d='M3 5v9h9V5H3zm8 8H4V6h7v7z'/%3E%3Cpath fill-rule='evenodd' d='M5 5h1V4h7v7h-1v1h2V3H5v2z' clip-rule='evenodd'/%3E%3C/g%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-clear-all{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m10 12.6l.7.7l1.6-1.6l1.6 1.6l.8-.7L13 11l1.7-1.6l-.8-.8l-1.6 1.7l-1.6-1.7l-.7.8l1.6 1.6l-1.6 1.6zM1 4h14V3H1v1zm0 3h14V6H1v1zm8 2.5V9H1v1h8v-.5zM9 13v-1H1v1h8z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-close{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m8 8.707l3.646 3.647l.708-.707L8.707 8l3.647-3.646l-.707-.708L8 7.293L4.354 3.646l-.707.708L7.293 8l-3.646 3.646l.707.708L8 8.707z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-link-external{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='currentColor'%3E%3Cpath d='M1.5 1H6v1H2v12h12v-4h1v4.5l-.5.5h-13l-.5-.5v-13l.5-.5z'/%3E%3Cpath d='M15 1.5V8h-1V2.707L7.243 9.465l-.707-.708L13.293 2H8V1h6.5l.5.5z'/%3E%3C/g%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-menu{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16 5H0V4h16v1zm0 8H0v-1h16v1zm0-4.008H0V8h16v.992z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-radio-tower{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2.998 5.58a5.55 5.55 0 0 1 1.62-3.88l-.71-.7a6.45 6.45 0 0 0 0 9.16l.71-.7a5.55 5.55 0 0 1-1.62-3.88zm1.06 0a4.42 4.42 0 0 0 1.32 3.17l.71-.71a3.27 3.27 0 0 1-.76-1.12a3.45 3.45 0 0 1 0-2.67a3.22 3.22 0 0 1 .76-1.13l-.71-.71a4.46 4.46 0 0 0-1.32 3.17zm7.65 3.21l-.71-.71c.33-.32.59-.704.76-1.13a3.449 3.449 0 0 0 0-2.67a3.22 3.22 0 0 0-.76-1.13l.71-.7a4.468 4.468 0 0 1 0 6.34zM13.068 1l-.71.71a5.43 5.43 0 0 1 0 7.74l.71.71a6.45 6.45 0 0 0 0-9.16zM9.993 5.43a1.5 1.5 0 0 1-.245.98a2 2 0 0 1-.27.23l3.44 7.73l-.92.4l-.77-1.73h-5.54l-.77 1.73l-.92-.4l3.44-7.73a1.52 1.52 0 0 1-.33-1.63a1.55 1.55 0 0 1 .56-.68a1.5 1.5 0 0 1 2.325 1.1zm-1.595-.34a.52.52 0 0 0-.25.14a.52.52 0 0 0-.11.22a.48.48 0 0 0 0 .29c.04.09.102.17.18.23a.54.54 0 0 0 .28.08a.51.51 0 0 0 .5-.5a.54.54 0 0 0-.08-.28a.58.58 0 0 0-.23-.18a.48.48 0 0 0-.29 0zm.23 2.05h-.27l-.87 1.94h2l-.86-1.94zm2.2 4.94l-.89-2h-2.88l-.89 2h4.66z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-terminal{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 24 24' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M3 1.5L1.5 3v18L3 22.5h18l1.5-1.5V3L21 1.5H3zM3 21V3h18v18H3zm5.656-4.01l1.038 1.061l5.26-5.243v-.912l-5.26-5.26l-1.035 1.06l4.59 4.702l-4.593 4.592z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-window{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M14.5 2h-13l-.5.5v11l.5.5h13l.5-.5v-11l-.5-.5zM14 13H2V6h12v7zm0-8H2V3h12v2z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-broadcast{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M128 88a40 40 0 1 0 40 40a40 40 0 0 0-40-40Zm0 64a24 24 0 1 1 24-24a24.1 24.1 0 0 1-24 24Zm-59-48.9a64.5 64.5 0 0 0 0 49.8a65.4 65.4 0 0 0 13.7 20.4a7.9 7.9 0 0 1 0 11.3a8 8 0 0 1-5.6 2.3a8.3 8.3 0 0 1-5.7-2.3a80 80 0 0 1-17.1-25.5a79.9 79.9 0 0 1 0-62.2a80 80 0 0 1 17.1-25.5a8 8 0 0 1 11.3 0a7.9 7.9 0 0 1 0 11.3A65.4 65.4 0 0 0 69 103.1Zm132.7 56a80 80 0 0 1-17.1 25.5a8.3 8.3 0 0 1-5.7 2.3a8 8 0 0 1-5.6-2.3a7.9 7.9 0 0 1 0-11.3a65.4 65.4 0 0 0 13.7-20.4a64.5 64.5 0 0 0 0-49.8a65.4 65.4 0 0 0-13.7-20.4a7.9 7.9 0 0 1 0-11.3a8 8 0 0 1 11.3 0a80 80 0 0 1 17.1 25.5a79.9 79.9 0 0 1 0 62.2ZM54.5 201.5a8.1 8.1 0 0 1 0 11.4a8.3 8.3 0 0 1-5.7 2.3a8.5 8.5 0 0 1-5.7-2.3a121.8 121.8 0 0 1-25.7-38.2a120.7 120.7 0 0 1 0-93.4a121.8 121.8 0 0 1 25.7-38.2a8.1 8.1 0 0 1 11.4 11.4A103.5 103.5 0 0 0 24 128a103.5 103.5 0 0 0 30.5 73.5ZM248 128a120.2 120.2 0 0 1-9.4 46.7a121.8 121.8 0 0 1-25.7 38.2a8.5 8.5 0 0 1-5.7 2.3a8.3 8.3 0 0 1-5.7-2.3a8.1 8.1 0 0 1 0-11.4A103.5 103.5 0 0 0 232 128a103.5 103.5 0 0 0-30.5-73.5a8.1 8.1 0 1 1 11.4-11.4a121.8 121.8 0 0 1 25.7 38.2A120.2 120.2 0 0 1 248 128Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-hand-waving{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m220.2 104l-20-34.7a28.1 28.1 0 0 0-47.3-1.9l-17.3-30a28.1 28.1 0 0 0-38.3-10.3a29.4 29.4 0 0 0-9.9 9.6a27.9 27.9 0 0 0-11.5-6.2a27.2 27.2 0 0 0-21.2 2.8a27.9 27.9 0 0 0-10.3 38.2l3.4 5.8A28.5 28.5 0 0 0 36 81a28.1 28.1 0 0 0-10.2 38.2l42 72.8a88 88 0 1 0 152.4-88Zm-6.7 62.6a71.2 71.2 0 0 1-33.5 43.7A72.1 72.1 0 0 1 81.6 184l-42-72.8a12 12 0 0 1 20.8-12l22 38.1l.6.9v.2l.5.5l.2.2l.7.6h.1l.7.5h.3l.6.3h.2l.9.3h.1l.8.2h2.2l.9-.2h.3l.6-.2h.3l.9-.4a8.1 8.1 0 0 0 2.9-11l-22-38.1l-16-27.7a12 12 0 0 1-1.2-9.1a11.8 11.8 0 0 1 5.6-7.3a12 12 0 0 1 9.1-1.2a12.5 12.5 0 0 1 7.3 5.6l8 14h.1l26 45a7 7 0 0 0 1.5 1.9a8 8 0 0 0 12.3-9.9l-26-45a12 12 0 1 1 20.8-12l30 51.9l6.3 11a48.1 48.1 0 0 0-10.9 61a8 8 0 0 0 13.8-8a32 32 0 0 1 11.7-43.7l.7-.4l.5-.4h.1l.6-.6l.5-.5l.4-.5l.3-.6h.1l.2-.5v-.2a1.9 1.9 0 0 0 .2-.7h.1c0-.2.1-.4.1-.6s0-.2.1-.2v-2.1a6.4 6.4 0 0 0-.2-.7a1.9 1.9 0 0 0-.2-.7v-.2c0-.2-.1-.3-.2-.5l-.3-.7l-10-17.4a12 12 0 0 1 13.5-17.5a11.8 11.8 0 0 1 7.2 5.5l20 34.7a70.9 70.9 0 0 1 7.2 53.8Zm-125.8 78a8.2 8.2 0 0 1-6.6 3.4a8.6 8.6 0 0 1-4.6-1.4A117.9 117.9 0 0 1 41.1 208a8 8 0 1 1 13.8-8a102.6 102.6 0 0 0 30.8 33.4a8.1 8.1 0 0 1 2 11.2ZM168 31a8 8 0 0 1 8-8a60.2 60.2 0 0 1 52 30a7.9 7.9 0 0 1-3 10.9a7.1 7.1 0 0 1-4 1.1a8 8 0 0 1-6.9-4A44 44 0 0 0 176 39a8 8 0 0 1-8-8Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-moon{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M224.3 150.3a8.1 8.1 0 0 0-7.8-5.7l-2.2.4A84 84 0 0 1 111 41.6a5.7 5.7 0 0 0 .3-1.8a7.9 7.9 0 0 0-10.3-8.1a100 100 0 1 0 123.3 123.2a7.2 7.2 0 0 0 0-4.6ZM128 212A84 84 0 0 1 92.8 51.7a99.9 99.9 0 0 0 111.5 111.5A84.4 84.4 0 0 1 128 212Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-sun{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M128 60a68 68 0 1 0 68 68a68.1 68.1 0 0 0-68-68Zm0 120a52 52 0 1 1 52-52a52 52 0 0 1-52 52Zm-8-144V16a8 8 0 0 1 16 0v20a8 8 0 0 1-16 0ZM43.1 54.5a8.1 8.1 0 1 1 11.4-11.4l14.1 14.2a8 8 0 0 1 0 11.3a8.1 8.1 0 0 1-11.3 0ZM36 136H16a8 8 0 0 1 0-16h20a8 8 0 0 1 0 16Zm32.6 51.4a8 8 0 0 1 0 11.3l-14.1 14.2a8.3 8.3 0 0 1-5.7 2.3a8.5 8.5 0 0 1-5.7-2.3a8.1 8.1 0 0 1 0-11.4l14.2-14.1a8 8 0 0 1 11.3 0ZM136 220v20a8 8 0 0 1-16 0v-20a8 8 0 0 1 16 0Zm76.9-18.5a8.1 8.1 0 0 1 0 11.4a8.5 8.5 0 0 1-5.7 2.3a8.3 8.3 0 0 1-5.7-2.3l-14.1-14.2a8 8 0 0 1 11.3-11.3ZM248 128a8 8 0 0 1-8 8h-20a8 8 0 0 1 0-16h20a8 8 0 0 1 8 8Zm-60.6-59.4a8 8 0 0 1 0-11.3l14.1-14.2a8.1 8.1 0 0 1 11.4 11.4l-14.2 14.1a8.1 8.1 0 0 1-11.3 0Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.note{position:relative;display:inline-flex;align-items:center;border-left-width:4px;border-left-style:solid;--un-border-opacity:1;border-color:rgba(53,120,229,var(--un-border-opacity));border-radius:0.25rem;background-color:rgba(53,120,229,0.1);padding:0.5rem;text-decoration:none;}.note-red{position:relative;display:inline-flex;align-items:center;border-left-width:4px;border-left-style:solid;--un-border-opacity:1;border-color:rgba(53,120,229,var(--un-border-opacity));border-radius:0.25rem;background-color:rgba(53,120,229,0.1);background-color:rgba(185,28,28,0.1);padding:0.5rem;text-decoration:none;}.nv{position:relative;display:flex;align-items:center;border-radius:0.25rem;padding:0.5rem;--un-text-opacity:1;color:rgba(194,197,202,var(--un-text-opacity));text-decoration:none;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:125ms;}.nv_selected{position:relative;display:flex;align-items:center;border-left-width:4px;border-left-style:solid;border-radius:0.25rem;--un-bg-opacity:.05;background-color:hsla(0,0%,100%,var(--un-bg-opacity));padding:0.5rem;--un-text-opacity:1;color:rgba(194,197,202,var(--un-text-opacity));color:rgba(53,120,229,var(--un-text-opacity));text-decoration:none;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:125ms;}.input{height:2.5rem;display:flex;align-items:center;border-radius:0.25rem;border-style:none;--un-bg-opacity:1;background-color:rgba(233,236,239,var(--un-bg-opacity));padding:0.5rem;--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));--un-shadow:var(--un-shadow-inset) 0 4px 6px -1px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);outline:2px solid transparent;outline-offset:2px;}.btn{user-select:none;border-radius:0.25rem;border-style:none;--un-bg-opacity:1;background-color:rgba(53,120,229,var(--un-bg-opacity));padding:0.5rem;font-weight:400;--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));color:rgba(255,255,255,var(--un-text-opacity));--un-shadow:var(--un-shadow-inset) 0 4px 6px -1px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);outline:2px solid transparent;outline-offset:2px;}.nv_selected:hover,.nv:hover{border-left-width:4px;border-left-style:solid;--un-bg-opacity:.05;background-color:hsla(0,0%,100%,var(--un-bg-opacity));--un-text-opacity:1;color:rgba(53,120,229,var(--un-text-opacity));}.dark .note{--un-border-opacity:1;border-color:rgba(103,214,237,var(--un-border-opacity));background-color:rgba(103,214,237,0.1);}.dark .note-red{--un-border-opacity:1;border-color:rgba(103,214,237,var(--un-border-opacity));background-color:rgba(103,214,237,0.1);background-color:rgba(185,28,28,0.1);}.btn:hover{--un-bg-opacity:1;background-color:rgba(45,102,195,var(--un-bg-opacity));}.dark .btn{--un-bg-opacity:1;background-color:rgba(103,214,237,var(--un-bg-opacity));font-weight:600;--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));}.dark .btn:hover{--un-bg-opacity:1;background-color:rgba(57,202,232,var(--un-bg-opacity));}.dark .input{--un-bg-opacity:1;background-color:rgba(36,37,38,var(--un-bg-opacity));--un-text-opacity:1;color:rgba(227,227,227,var(--un-text-opacity));}.dark .note-red::after,.note-red::after{--un-bg-opacity:1;background-color:rgba(185,28,28,var(--un-bg-opacity));}.btn:active{--un-bg-opacity:1;background-color:rgba(37,84,160,var(--un-bg-opacity));}.dark .btn:active{--un-bg-opacity:1;background-color:rgba(25,181,213,var(--un-bg-opacity));}.dark .nv_selected,.dark .nv_selected:hover,.dark .nv:hover{--un-text-opacity:1;color:rgba(103,214,237,var(--un-text-opacity));} ::-webkit-scrollbar-thumb { background-color: #3578E5; } .dark ::-webkit-scrollbar-thumb { background-color: #67d6ed; } code { font-size: 0.75rem; font-family: "Fira Code","Fira Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace; border-radius: 0.25rem; background-color: #d6d8da; } .code-block { font-family: "Fira Code","Fira Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace; font-size: 0.875rem; } .dark code { background-color: #282a2e; } .visible{visibility:visible;}.absolute{position:absolute;}.left-2{left:0.5rem;}.top-2{top:0.5rem;}.z-2000{z-index:2000;}.grid{display:grid;}.grid-rows-\[2fr_auto\]{grid-template-rows:2fr auto;}.grid-rows-\[2px_2rem_1fr\]{grid-template-rows:2px 2rem 1fr;}.grid-rows-\[auto_1fr\]{grid-template-rows:auto 1fr;}.my-2{margin-top:0.5rem;margin-bottom:0.5rem;}.mb-2{margin-bottom:0.5rem;}.mr-2{margin-right:0.5rem;}.display-none{display:none;}.children-h-10>*{height:2.5rem;}.children\:h-100\%>*,.h-100\%{height:100%;}.children\:w-12>*{width:3rem;}.h-15rem{height:15rem;}.h-2px{height:2px;}.h-8{height:2rem;}.h-85\%{height:85%;}.h-screen{height:100vh;}.w-8{width:2rem;}.w-screen{width:100vw;}.flex{display:flex;}.children\:inline-flex>*{display:inline-flex;}.flex-1{flex:1 1 0%;}.children-flex-none>*{flex:none;}.children\:grow>*,.grow{flex-grow:1;}.flex-row{flex-direction:row;}.flex-col{flex-direction:column;}.flex-wrap{flex-wrap:wrap;}@keyframes fade-in{from{opacity:0}to{opacity:1}}.animate-fade-in{animation:fade-in 1s linear 1;}.animate-duration-300ms{animation-duration:300ms;}.cursor-ns-resize{cursor:ns-resize;}.cursor-pointer{cursor:pointer;}.select-none{user-select:none;}.children\:items-center>*,.items-center{align-items:center;}.self-center{align-self:center;}.children\:justify-center>*,.justify-center{justify-content:center;}.justify-between{justify-content:space-between;}.gap-1{grid-gap:0.25rem;gap:0.25rem;}.gap-2{grid-gap:0.5rem;gap:0.5rem;}.overflow-hidden{overflow:hidden;}.overflow-y-auto{overflow-y:auto;}.rd-1{border-radius:0.25rem;}.rd-8{border-radius:2rem;}.bg-accent{--un-bg-opacity:1;background-color:rgba(53,120,229,var(--un-bg-opacity));}.bg-black\/20{background-color:rgba(0,0,0,0.2);}.bg-darkPrimaryLighter{--un-bg-opacity:1;background-color:rgba(36,37,38,var(--un-bg-opacity));}.bg-primary{--un-bg-opacity:1;background-color:rgba(255,255,255,var(--un-bg-opacity));}.bg-white\/5{background-color:rgba(255,255,255,0.05);}.dark .dark\:bg-darkAccent{--un-bg-opacity:1;background-color:rgba(103,214,237,var(--un-bg-opacity));}.dark .dark\:bg-darkPrimary{--un-bg-opacity:1;background-color:rgba(27,27,29,var(--un-bg-opacity));}.dark .dark\:hover\:bg-darkHoverOverlay:hover{--un-bg-opacity:.05;background-color:hsla(0,0%,100%,var(--un-bg-opacity));}.hover\:bg-hoverOverlay:hover{--un-bg-opacity:.05;background-color:rgba(0,0,0,var(--un-bg-opacity));}.active\:bg-accentDark:active{--un-bg-opacity:1;background-color:rgba(48,108,206,var(--un-bg-opacity));}.active\:bg-hoverOverlay\/25:active{background-color:rgba(0,0,0,0.25);}.active\:bg-hoverOverlayDarker:active{--un-bg-opacity:.1;background-color:rgba(0,0,0,var(--un-bg-opacity));}.dark .dark\:active\:bg-darkAccentDark:active{--un-bg-opacity:1;background-color:rgba(73,206,233,var(--un-bg-opacity));}.dark .dark\:active\:bg-darkHoverOverlay\/25:active{background-color:hsla(0,0%,100%,0.25);}.dark .dark\:active\:bg-darkHoverOverlayDarker:active{--un-bg-opacity:.1;background-color:hsla(0,0%,100%,var(--un-bg-opacity));}.p-1{padding:0.25rem;}.p-7{padding:1.75rem;}.px{padding-left:1rem;padding-right:1rem;}.px-2{padding-left:0.5rem;padding-right:0.5rem;}.px-5{padding-left:1.25rem;padding-right:1.25rem;}.children-pb-2>*{padding-bottom:0.5rem;}.children-pt8>*{padding-top:2rem;}.pl-2{padding-left:0.5rem;}.all\:font-mono *{font-family:"Fira Code","Fira Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;}.all\:text-xs *{font-size:0.75rem;line-height:1rem;}.text-sm{font-size:0.875rem;line-height:1.25rem;}.font-700{font-weight:700;}.font-semibold{font-weight:600;}.dark .dark\:text-darkAccent{--un-text-opacity:1;color:rgba(103,214,237,var(--un-text-opacity));}.dark .dark\:text-darkPrimaryText,.text-darkPrimaryText{--un-text-opacity:1;color:rgba(227,227,227,var(--un-text-opacity));}.text-accent{--un-text-opacity:1;color:rgba(53,120,229,var(--un-text-opacity));}.text-primaryText{--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));}.transition-colors-250{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:250ms;}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}@media (max-width: 639.9px){.lt-sm\:absolute{position:absolute;}.lt-sm\:z-1999{z-index:1999;}.lt-sm\:h-screen{height:100vh;}.lt-sm\:flex{display:flex;}.lt-sm\:pl-10{padding-left:2.5rem;}.lt-sm\:shadow{--un-shadow:var(--un-shadow-inset) 0 1px 3px 0 var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);}.lt-sm\:shadow-lg{--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);}.lt-sm\:transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}}*:not(h1,h2,h3,h4,h5,h6){margin:0;padding:0}*{box-sizing:border-box;font-family:Rubik,sans-serif}::-webkit-scrollbar{width:.25rem;height:3px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:.25rem}code{padding:.05rem .25rem}code.code-block{padding:.5rem}#sidebar{width:18.75rem}@media screen and (max-width: 640px){#sidebar{--translate-x: -18.75rem;transform:translate(var(--translate-x))}} +*,::before,::after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x:var(--un-empty,/*!*/ /*!*/);--un-pan-y:var(--un-empty,/*!*/ /*!*/);--un-pinch-zoom:var(--un-empty,/*!*/ /*!*/);--un-scroll-snap-strictness:proximity;--un-ordinal:var(--un-empty,/*!*/ /*!*/);--un-slashed-zero:var(--un-empty,/*!*/ /*!*/);--un-numeric-figure:var(--un-empty,/*!*/ /*!*/);--un-numeric-spacing:var(--un-empty,/*!*/ /*!*/);--un-numeric-fraction:var(--un-empty,/*!*/ /*!*/);--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 #0000;--un-ring-shadow:0 0 #0000;--un-shadow-inset:var(--un-empty,/*!*/ /*!*/);--un-shadow:0 0 #0000;--un-ring-inset:var(--un-empty,/*!*/ /*!*/);--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,0.5);--un-blur:var(--un-empty,/*!*/ /*!*/);--un-brightness:var(--un-empty,/*!*/ /*!*/);--un-contrast:var(--un-empty,/*!*/ /*!*/);--un-drop-shadow:var(--un-empty,/*!*/ /*!*/);--un-grayscale:var(--un-empty,/*!*/ /*!*/);--un-hue-rotate:var(--un-empty,/*!*/ /*!*/);--un-invert:var(--un-empty,/*!*/ /*!*/);--un-saturate:var(--un-empty,/*!*/ /*!*/);--un-sepia:var(--un-empty,/*!*/ /*!*/);--un-backdrop-blur:var(--un-empty,/*!*/ /*!*/);--un-backdrop-brightness:var(--un-empty,/*!*/ /*!*/);--un-backdrop-contrast:var(--un-empty,/*!*/ /*!*/);--un-backdrop-grayscale:var(--un-empty,/*!*/ /*!*/);--un-backdrop-hue-rotate:var(--un-empty,/*!*/ /*!*/);--un-backdrop-invert:var(--un-empty,/*!*/ /*!*/);--un-backdrop-opacity:var(--un-empty,/*!*/ /*!*/);--un-backdrop-saturate:var(--un-empty,/*!*/ /*!*/);--un-backdrop-sepia:var(--un-empty,/*!*/ /*!*/);}@font-face { font-family: 'Fira Code'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/firacode/v21/uU9eCBsR6Z2vfE9aq3bL0fxyUs4tcw4W_D1sFVc.ttf) format('truetype');}@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/firamono/v14/N0bX2SlFPv1weGeLZDtQIQ.ttf) format('truetype');}@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url(https://fonts.gstatic.com/s/firamono/v14/N0bS2SlFPv1weGeLZDtondv3mQ.ttf) format('truetype');}@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 400; font-display: swap; src: url(https://fonts.gstatic.com/s/rubik/v26/iJWZBXyIfDnIV5PNhY1KTN7Z-Yh-B4i1UA.ttf) format('truetype');}.i-codicon-clear-all{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m10 12.6l.7.7l1.6-1.6l1.6 1.6l.8-.7L13 11l1.7-1.6l-.8-.8l-1.6 1.7l-1.6-1.7l-.7.8l1.6 1.6l-1.6 1.6zM1 4h14V3H1v1zm0 3h14V6H1v1zm8 2.5V9H1v1h8v-.5zM9 13v-1H1v1h8z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-close{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='m8 8.707l3.646 3.647l.708-.707L8.707 8l3.647-3.646l-.707-.708L8 7.293L4.354 3.646l-.707.708L7.293 8l-3.646 3.646l.707.708L8 8.707z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-link-external{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cg fill='currentColor'%3E%3Cpath d='M1.5 1H6v1H2v12h12v-4h1v4.5l-.5.5h-13l-.5-.5v-13l.5-.5z'/%3E%3Cpath d='M15 1.5V8h-1V2.707L7.243 9.465l-.707-.708L13.293 2H8V1h6.5l.5.5z'/%3E%3C/g%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-menu{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16 5H0V4h16v1zm0 8H0v-1h16v1zm0-4.008H0V8h16v.992z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-codicon-radio-tower{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 16 16' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M2.998 5.58a5.55 5.55 0 0 1 1.62-3.88l-.71-.7a6.45 6.45 0 0 0 0 9.16l.71-.7a5.55 5.55 0 0 1-1.62-3.88zm1.06 0a4.42 4.42 0 0 0 1.32 3.17l.71-.71a3.27 3.27 0 0 1-.76-1.12a3.45 3.45 0 0 1 0-2.67a3.22 3.22 0 0 1 .76-1.13l-.71-.71a4.46 4.46 0 0 0-1.32 3.17zm7.65 3.21l-.71-.71c.33-.32.59-.704.76-1.13a3.449 3.449 0 0 0 0-2.67a3.22 3.22 0 0 0-.76-1.13l.71-.7a4.468 4.468 0 0 1 0 6.34zM13.068 1l-.71.71a5.43 5.43 0 0 1 0 7.74l.71.71a6.45 6.45 0 0 0 0-9.16zM9.993 5.43a1.5 1.5 0 0 1-.245.98a2 2 0 0 1-.27.23l3.44 7.73l-.92.4l-.77-1.73h-5.54l-.77 1.73l-.92-.4l3.44-7.73a1.52 1.52 0 0 1-.33-1.63a1.55 1.55 0 0 1 .56-.68a1.5 1.5 0 0 1 2.325 1.1zm-1.595-.34a.52.52 0 0 0-.25.14a.52.52 0 0 0-.11.22a.48.48 0 0 0 0 .29c.04.09.102.17.18.23a.54.54 0 0 0 .28.08a.51.51 0 0 0 .5-.5a.54.54 0 0 0-.08-.28a.58.58 0 0 0-.23-.18a.48.48 0 0 0-.29 0zm.23 2.05h-.27l-.87 1.94h2l-.86-1.94zm2.2 4.94l-.89-2h-2.88l-.89 2h4.66z' clip-rule='evenodd'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-broadcast{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M128 88a40 40 0 1 0 40 40a40 40 0 0 0-40-40Zm0 64a24 24 0 1 1 24-24a24.1 24.1 0 0 1-24 24Zm-59-48.9a64.5 64.5 0 0 0 0 49.8a65.4 65.4 0 0 0 13.7 20.4a7.9 7.9 0 0 1 0 11.3a8 8 0 0 1-5.6 2.3a8.3 8.3 0 0 1-5.7-2.3a80 80 0 0 1-17.1-25.5a79.9 79.9 0 0 1 0-62.2a80 80 0 0 1 17.1-25.5a8 8 0 0 1 11.3 0a7.9 7.9 0 0 1 0 11.3A65.4 65.4 0 0 0 69 103.1Zm132.7 56a80 80 0 0 1-17.1 25.5a8.3 8.3 0 0 1-5.7 2.3a8 8 0 0 1-5.6-2.3a7.9 7.9 0 0 1 0-11.3a65.4 65.4 0 0 0 13.7-20.4a64.5 64.5 0 0 0 0-49.8a65.4 65.4 0 0 0-13.7-20.4a7.9 7.9 0 0 1 0-11.3a8 8 0 0 1 11.3 0a80 80 0 0 1 17.1 25.5a79.9 79.9 0 0 1 0 62.2ZM54.5 201.5a8.1 8.1 0 0 1 0 11.4a8.3 8.3 0 0 1-5.7 2.3a8.5 8.5 0 0 1-5.7-2.3a121.8 121.8 0 0 1-25.7-38.2a120.7 120.7 0 0 1 0-93.4a121.8 121.8 0 0 1 25.7-38.2a8.1 8.1 0 0 1 11.4 11.4A103.5 103.5 0 0 0 24 128a103.5 103.5 0 0 0 30.5 73.5ZM248 128a120.2 120.2 0 0 1-9.4 46.7a121.8 121.8 0 0 1-25.7 38.2a8.5 8.5 0 0 1-5.7 2.3a8.3 8.3 0 0 1-5.7-2.3a8.1 8.1 0 0 1 0-11.4A103.5 103.5 0 0 0 232 128a103.5 103.5 0 0 0-30.5-73.5a8.1 8.1 0 1 1 11.4-11.4a121.8 121.8 0 0 1 25.7 38.2A120.2 120.2 0 0 1 248 128Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-hand-waving{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m220.2 104l-20-34.7a28.1 28.1 0 0 0-47.3-1.9l-17.3-30a28.1 28.1 0 0 0-38.3-10.3a29.4 29.4 0 0 0-9.9 9.6a27.9 27.9 0 0 0-11.5-6.2a27.2 27.2 0 0 0-21.2 2.8a27.9 27.9 0 0 0-10.3 38.2l3.4 5.8A28.5 28.5 0 0 0 36 81a28.1 28.1 0 0 0-10.2 38.2l42 72.8a88 88 0 1 0 152.4-88Zm-6.7 62.6a71.2 71.2 0 0 1-33.5 43.7A72.1 72.1 0 0 1 81.6 184l-42-72.8a12 12 0 0 1 20.8-12l22 38.1l.6.9v.2l.5.5l.2.2l.7.6h.1l.7.5h.3l.6.3h.2l.9.3h.1l.8.2h2.2l.9-.2h.3l.6-.2h.3l.9-.4a8.1 8.1 0 0 0 2.9-11l-22-38.1l-16-27.7a12 12 0 0 1-1.2-9.1a11.8 11.8 0 0 1 5.6-7.3a12 12 0 0 1 9.1-1.2a12.5 12.5 0 0 1 7.3 5.6l8 14h.1l26 45a7 7 0 0 0 1.5 1.9a8 8 0 0 0 12.3-9.9l-26-45a12 12 0 1 1 20.8-12l30 51.9l6.3 11a48.1 48.1 0 0 0-10.9 61a8 8 0 0 0 13.8-8a32 32 0 0 1 11.7-43.7l.7-.4l.5-.4h.1l.6-.6l.5-.5l.4-.5l.3-.6h.1l.2-.5v-.2a1.9 1.9 0 0 0 .2-.7h.1c0-.2.1-.4.1-.6s0-.2.1-.2v-2.1a6.4 6.4 0 0 0-.2-.7a1.9 1.9 0 0 0-.2-.7v-.2c0-.2-.1-.3-.2-.5l-.3-.7l-10-17.4a12 12 0 0 1 13.5-17.5a11.8 11.8 0 0 1 7.2 5.5l20 34.7a70.9 70.9 0 0 1 7.2 53.8Zm-125.8 78a8.2 8.2 0 0 1-6.6 3.4a8.6 8.6 0 0 1-4.6-1.4A117.9 117.9 0 0 1 41.1 208a8 8 0 1 1 13.8-8a102.6 102.6 0 0 0 30.8 33.4a8.1 8.1 0 0 1 2 11.2ZM168 31a8 8 0 0 1 8-8a60.2 60.2 0 0 1 52 30a7.9 7.9 0 0 1-3 10.9a7.1 7.1 0 0 1-4 1.1a8 8 0 0 1-6.9-4A44 44 0 0 0 176 39a8 8 0 0 1-8-8Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-moon{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M224.3 150.3a8.1 8.1 0 0 0-7.8-5.7l-2.2.4A84 84 0 0 1 111 41.6a5.7 5.7 0 0 0 .3-1.8a7.9 7.9 0 0 0-10.3-8.1a100 100 0 1 0 123.3 123.2a7.2 7.2 0 0 0 0-4.6ZM128 212A84 84 0 0 1 92.8 51.7a99.9 99.9 0 0 0 111.5 111.5A84.4 84.4 0 0 1 128 212Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.i-ph-sun{--un-icon:url("data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 256 256' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M128 60a68 68 0 1 0 68 68a68.1 68.1 0 0 0-68-68Zm0 120a52 52 0 1 1 52-52a52 52 0 0 1-52 52Zm-8-144V16a8 8 0 0 1 16 0v20a8 8 0 0 1-16 0ZM43.1 54.5a8.1 8.1 0 1 1 11.4-11.4l14.1 14.2a8 8 0 0 1 0 11.3a8.1 8.1 0 0 1-11.3 0ZM36 136H16a8 8 0 0 1 0-16h20a8 8 0 0 1 0 16Zm32.6 51.4a8 8 0 0 1 0 11.3l-14.1 14.2a8.3 8.3 0 0 1-5.7 2.3a8.5 8.5 0 0 1-5.7-2.3a8.1 8.1 0 0 1 0-11.4l14.2-14.1a8 8 0 0 1 11.3 0ZM136 220v20a8 8 0 0 1-16 0v-20a8 8 0 0 1 16 0Zm76.9-18.5a8.1 8.1 0 0 1 0 11.4a8.5 8.5 0 0 1-5.7 2.3a8.3 8.3 0 0 1-5.7-2.3l-14.1-14.2a8 8 0 0 1 11.3-11.3ZM248 128a8 8 0 0 1-8 8h-20a8 8 0 0 1 0-16h20a8 8 0 0 1 8 8Zm-60.6-59.4a8 8 0 0 1 0-11.3l14.1-14.2a8.1 8.1 0 0 1 11.4 11.4l-14.2 14.1a8.1 8.1 0 0 1-11.3 0Z'/%3E%3C/svg%3E");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}.note-red{position:relative;display:inline-flex;align-items:center;border-left-width:4px;border-left-style:solid;--un-border-opacity:1;border-color:rgba(53,120,229,var(--un-border-opacity));border-radius:0.25rem;background-color:rgba(53,120,229,0.1);background-color:rgba(185,28,28,0.1);padding:0.5rem;text-decoration:none;}.nv{position:relative;display:flex;align-items:center;border-radius:0.25rem;padding:0.5rem;--un-text-opacity:1;color:rgba(194,197,202,var(--un-text-opacity));text-decoration:none;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:125ms;}.nv_selected{position:relative;display:flex;align-items:center;border-left-width:4px;border-left-style:solid;border-radius:0.25rem;--un-bg-opacity:.05;background-color:hsla(0,0%,100%,var(--un-bg-opacity));padding:0.5rem;--un-text-opacity:1;color:rgba(194,197,202,var(--un-text-opacity));color:rgba(53,120,229,var(--un-text-opacity));text-decoration:none;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:125ms;}.input{height:2.5rem;display:flex;align-items:center;border-radius:0.25rem;border-style:none;--un-bg-opacity:1;background-color:rgba(233,236,239,var(--un-bg-opacity));padding:0.5rem;--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));--un-shadow:var(--un-shadow-inset) 0 4px 6px -1px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);outline:2px solid transparent;outline-offset:2px;}.btn{user-select:none;border-radius:0.25rem;border-style:none;--un-bg-opacity:1;background-color:rgba(53,120,229,var(--un-bg-opacity));padding:0.5rem;font-weight:400;--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));color:rgba(255,255,255,var(--un-text-opacity));--un-shadow:var(--un-shadow-inset) 0 4px 6px -1px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);outline:2px solid transparent;outline-offset:2px;}.nv_selected:hover,.nv:hover{border-left-width:4px;border-left-style:solid;--un-bg-opacity:.05;background-color:hsla(0,0%,100%,var(--un-bg-opacity));--un-text-opacity:1;color:rgba(53,120,229,var(--un-text-opacity));}.dark .note-red{--un-border-opacity:1;border-color:rgba(103,214,237,var(--un-border-opacity));background-color:rgba(103,214,237,0.1);background-color:rgba(185,28,28,0.1);}.btn:hover{--un-bg-opacity:1;background-color:rgba(45,102,195,var(--un-bg-opacity));}.dark .btn{--un-bg-opacity:1;background-color:rgba(103,214,237,var(--un-bg-opacity));font-weight:600;--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));}.dark .btn:hover{--un-bg-opacity:1;background-color:rgba(57,202,232,var(--un-bg-opacity));}.dark .input{--un-bg-opacity:1;background-color:rgba(36,37,38,var(--un-bg-opacity));--un-text-opacity:1;color:rgba(227,227,227,var(--un-text-opacity));}.dark .note-red::after,.note-red::after{--un-bg-opacity:1;background-color:rgba(185,28,28,var(--un-bg-opacity));}.btn:active{--un-bg-opacity:1;background-color:rgba(37,84,160,var(--un-bg-opacity));}.dark .btn:active{--un-bg-opacity:1;background-color:rgba(25,181,213,var(--un-bg-opacity));}.dark .nv_selected,.dark .nv_selected:hover,.dark .nv:hover{--un-text-opacity:1;color:rgba(103,214,237,var(--un-text-opacity));} ::-webkit-scrollbar-thumb { background-color: #3578E5; } .dark ::-webkit-scrollbar-thumb { background-color: #67d6ed; } code { font-size: 0.75rem; font-family: "Fira Code","Fira Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace; border-radius: 0.25rem; background-color: #d6d8da; } .code-block { font-family: "Fira Code","Fira Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace; font-size: 0.875rem; } .dark code { background-color: #282a2e; } .visible{visibility:visible;}.absolute{position:absolute;}.left-2{left:0.5rem;}.top-2{top:0.5rem;}.z-2000{z-index:2000;}.grid{display:grid;}.grid-rows-\[2fr_auto\]{grid-template-rows:2fr auto;}.grid-rows-\[2px_2rem_1fr\]{grid-template-rows:2px 2rem 1fr;}.grid-rows-\[auto_1fr\]{grid-template-rows:auto 1fr;}.mr-2{margin-right:0.5rem;}.display-none{display:none;}.children-h-10>*{height:2.5rem;}.h-15rem{height:15rem;}.h-2px{height:2px;}.h-8{height:2rem;}.h-85\%{height:85%;}.h-screen{height:100vh;}.w-8{width:2rem;}.w-screen{width:100vw;}.flex{display:flex;}.flex-1{flex:1 1 0%;}.children-flex-none>*{flex:none;}.grow{flex-grow:1;}.flex-col{flex-direction:column;}@keyframes fade-in{from{opacity:0}to{opacity:1}}.animate-fade-in{animation:fade-in 1s linear 1;}.animate-duration-300ms{animation-duration:300ms;}.cursor-ns-resize{cursor:ns-resize;}.cursor-pointer{cursor:pointer;}.select-none{user-select:none;}.items-center{align-items:center;}.self-center{align-self:center;}.justify-center{justify-content:center;}.justify-between{justify-content:space-between;}.gap-1{grid-gap:0.25rem;gap:0.25rem;}.gap-2{grid-gap:0.5rem;gap:0.5rem;}.overflow-hidden{overflow:hidden;}.overflow-y-auto{overflow-y:auto;}.rd-1{border-radius:0.25rem;}.rd-8{border-radius:2rem;}.bg-accent{--un-bg-opacity:1;background-color:rgba(53,120,229,var(--un-bg-opacity));}.bg-black\/20{background-color:rgba(0,0,0,0.2);}.bg-darkPrimaryLighter{--un-bg-opacity:1;background-color:rgba(36,37,38,var(--un-bg-opacity));}.bg-primary{--un-bg-opacity:1;background-color:rgba(255,255,255,var(--un-bg-opacity));}.bg-white\/5{background-color:rgba(255,255,255,0.05);}.dark .dark\:bg-darkAccent{--un-bg-opacity:1;background-color:rgba(103,214,237,var(--un-bg-opacity));}.dark .dark\:bg-darkPrimary{--un-bg-opacity:1;background-color:rgba(27,27,29,var(--un-bg-opacity));}.dark .dark\:hover\:bg-darkHoverOverlay:hover{--un-bg-opacity:.05;background-color:hsla(0,0%,100%,var(--un-bg-opacity));}.hover\:bg-hoverOverlay:hover{--un-bg-opacity:.05;background-color:rgba(0,0,0,var(--un-bg-opacity));}.active\:bg-accentDark:active{--un-bg-opacity:1;background-color:rgba(48,108,206,var(--un-bg-opacity));}.active\:bg-hoverOverlay\/25:active{background-color:rgba(0,0,0,0.25);}.dark .dark\:active\:bg-darkAccentDark:active{--un-bg-opacity:1;background-color:rgba(73,206,233,var(--un-bg-opacity));}.dark .dark\:active\:bg-darkHoverOverlay\/25:active{background-color:hsla(0,0%,100%,0.25);}.p-1{padding:0.25rem;}.p-7{padding:1.75rem;}.px{padding-left:1rem;padding-right:1rem;}.px-2{padding-left:0.5rem;padding-right:0.5rem;}.px-5{padding-left:1.25rem;padding-right:1.25rem;}.children-pb-2>*{padding-bottom:0.5rem;}.children-pt8>*{padding-top:2rem;}.all\:font-mono *{font-family:"Fira Code","Fira Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;}.all\:text-xs *{font-size:0.75rem;line-height:1rem;}.font-semibold{font-weight:600;}.dark .dark\:text-darkAccent{--un-text-opacity:1;color:rgba(103,214,237,var(--un-text-opacity));}.dark .dark\:text-darkPrimaryText{--un-text-opacity:1;color:rgba(227,227,227,var(--un-text-opacity));}.text-accent{--un-text-opacity:1;color:rgba(53,120,229,var(--un-text-opacity));}.text-primaryText{--un-text-opacity:1;color:rgba(28,30,33,var(--un-text-opacity));}.transition-colors-250{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:250ms;}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}@media (max-width: 639.9px){.lt-sm\:absolute{position:absolute;}.lt-sm\:z-1999{z-index:1999;}.lt-sm\:h-screen{height:100vh;}.lt-sm\:flex{display:flex;}.lt-sm\:shadow{--un-shadow:var(--un-shadow-inset) 0 1px 3px 0 var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);}.lt-sm\:shadow-lg{--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgba(0,0,0,0.1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgba(0,0,0,0.1));box-shadow:var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow);}.lt-sm\:transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}}*:not(h1,h2,h3,h4,h5,h6){margin:0;padding:0}*{box-sizing:border-box;font-family:Rubik,sans-serif}::-webkit-scrollbar{width:.25rem;height:3px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:.25rem}code{padding:.05rem .25rem}code.code-block{padding:.5rem}#sidebar{width:18.75rem}@media screen and (max-width: 640px){#sidebar{--translate-x: -18.75rem;transform:translate(var(--translate-x))}} diff --git a/examples/api/dist/assets/index.js b/examples/api/dist/assets/index.js index 2a86bf4e6d4..855846251db 100644 --- a/examples/api/dist/assets/index.js +++ b/examples/api/dist/assets/index.js @@ -1,34 +1,9 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))l(s);new MutationObserver(s=>{for(const u of s)if(u.type==="childList")for(const b of u.addedNodes)b.tagName==="LINK"&&b.rel==="modulepreload"&&l(b)}).observe(document,{childList:!0,subtree:!0});function n(s){const u={};return s.integrity&&(u.integrity=s.integrity),s.referrerpolicy&&(u.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?u.credentials="include":s.crossorigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(s){if(s.ep)return;s.ep=!0;const u=n(s);fetch(s.href,u)}})();function V(){}function Dl(e){return e()}function hl(){return Object.create(null)}function Ce(e){e.forEach(Dl)}function Zl(e){return typeof e=="function"}function lt(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let Tn;function $l(e,t){return Tn||(Tn=document.createElement("a")),Tn.href=t,e===Tn.href}function es(e){return Object.keys(e).length===0}function ts(e,...t){if(e==null)return V;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function ns(e,t,n){e.$$.on_destroy.push(ts(t,n))}function i(e,t){e.appendChild(t)}function _(e,t,n){e.insertBefore(t,n||null)}function h(e){e.parentNode.removeChild(e)}function Dn(e,t){for(let n=0;ne.removeEventListener(t,n,l)}function ls(e){return function(t){return t.preventDefault(),e.call(this,t)}}function o(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Y(e){return e===""?null:+e}function ss(e){return Array.from(e.childNodes)}function K(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function q(e,t){e.value=t==null?"":t}function In(e,t){for(let n=0;n{An.delete(e),l&&(n&&e.d(1),l())}),e.o(t)}else l&&l()}function yl(e){e&&e.c()}function fi(e,t,n,l){const{fragment:s,on_mount:u,on_destroy:b,after_update:p}=e.$$;s&&s.m(t,n),l||Dt(()=>{const f=u.map(Dl).filter(Zl);b?b.push(...f):Ce(f),e.$$.on_mount=[]}),p.forEach(Dt)}function mi(e,t){const n=e.$$;n.fragment!==null&&(Ce(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function fs(e,t){e.$$.dirty[0]===-1&&(Tt.push(e),rs(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const m=M.length?M[0]:W;return c.ctx&&s(c.ctx[y],c.ctx[y]=m)&&(!c.skip_bound&&c.bound[y]&&c.bound[y](m),z&&fs(e,y)),W}):[],c.update(),z=!0,Ce(c.before_update),c.fragment=l?l(c.ctx):!1,t.target){if(t.hydrate){const y=ss(t.target);c.fragment&&c.fragment.l(y),y.forEach(h)}else c.fragment&&c.fragment.c();t.intro&&di(e.$$.fragment),fi(e,t.target,t.anchor,t.customElement),Nl()}Pt(f)}class vt{$destroy(){mi(this,1),this.$destroy=V}$on(t,n){const l=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return l.push(n),()=>{const s=l.indexOf(n);s!==-1&&l.splice(s,1)}}$set(t){this.$$set&&!es(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const gt=[];function ms(e,t=V){let n;const l=new Set;function s(p){if(lt(e,p)&&(e=p,n)){const f=!gt.length;for(const c of l)c[1](),gt.push(c,e);if(f){for(let c=0;c{l.delete(c),l.size===0&&(n(),n=null)}}return{set:s,update:u,subscribe:b}}var ps=Object.defineProperty,pi=(e,t)=>{for(var n in t)ps(e,n,{get:t[n],enumerable:!0})},ql=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},vl=(e,t,n)=>(ql(e,t,"read from private field"),n?n.call(e):t.get(e)),hs=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},_s=(e,t,n,l)=>(ql(e,t,"write to private field"),l?l.call(e,n):t.set(e,n),n),bs={};pi(bs,{Channel:()=>ys,convertFileSrc:()=>vs,invoke:()=>Be,transformCallback:()=>It});function gs(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function It(e,t=!1){let n=gs(),l=`_${n}`;return Object.defineProperty(window,l,{value:s=>(t&&Reflect.deleteProperty(window,l),e==null?void 0:e(s)),writable:!1,configurable:!0}),n}var Et,ys=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,hs(this,Et,()=>{}),this.id=It(e=>{vl(this,Et).call(this,e)})}set onmessage(e){_s(this,Et,e)}get onmessage(){return vl(this,Et)}toJSON(){return`__CHANNEL__:${this.id}`}};Et=new WeakMap;async function Be(e,t={}){return new Promise((n,l)=>{let s=It(b=>{n(b),Reflect.deleteProperty(window,`_${u}`)},!0),u=It(b=>{l(b),Reflect.deleteProperty(window,`_${s}`)},!0);window.__TAURI_IPC__({cmd:e,callback:s,error:u,...t})})}function vs(e,t="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${t}.localhost/${n}`:`${t}://localhost/${n}`}var ws={};pi(ws,{TauriEvent:()=>jl,emit:()=>Vl,listen:()=>_i,once:()=>ks});async function Fl(e,t){await Be("plugin:event|unlisten",{event:e,eventId:t})}async function Ul(e,t,n){await Be("plugin:event|emit",{event:e,windowLabel:t,payload:n})}async function hi(e,t,n){return Be("plugin:event|listen",{event:e,windowLabel:t,handler:It(n)}).then(l=>async()=>Fl(e,l))}async function xl(e,t,n){return hi(e,t,l=>{n(l),Fl(e,l.id).catch(()=>{})})}var jl=(e=>(e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_CREATED="tauri://window-created",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_FILE_DROP="tauri://file-drop",e.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",e.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",e.MENU="tauri://menu",e))(jl||{});async function _i(e,t){return hi(e,null,t)}async function ks(e,t){return xl(e,null,t)}async function Vl(e,t){return Ul(e,void 0,t)}var Ms={};pi(Ms,{CloseRequestedEvent:()=>Jl,LogicalPosition:()=>Gl,LogicalSize:()=>Rn,PhysicalPosition:()=>Ye,PhysicalSize:()=>tt,UserAttentionType:()=>bi,WebviewWindow:()=>it,WebviewWindowHandle:()=>Yl,WindowManager:()=>Bl,appWindow:()=>nt,availableMonitors:()=>Cs,currentMonitor:()=>zs,getAll:()=>Xl,getCurrent:()=>On,primaryMonitor:()=>Ws});async function L(e){return Be("tauri",e)}var Rn=class{constructor(e,t){this.type="Logical",this.width=e,this.height=t}},tt=class{constructor(e,t){this.type="Physical",this.width=e,this.height=t}toLogical(e){return new Rn(this.width/e,this.height/e)}},Gl=class{constructor(e,t){this.type="Logical",this.x=e,this.y=t}},Ye=class{constructor(e,t){this.type="Physical",this.x=e,this.y=t}toLogical(e){return new Gl(this.x/e,this.y/e)}},bi=(e=>(e[e.Critical=1]="Critical",e[e.Informational=2]="Informational",e))(bi||{});function On(){return new it(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function Xl(){return window.__TAURI_METADATA__.__windows.map(e=>new it(e.label,{skip:!0}))}var wl=["tauri://created","tauri://error"],Yl=class{constructor(e){this.label=e,this.listeners=Object.create(null)}async listen(e,t){return this._handleTauriEvent(e,t)?Promise.resolve(()=>{let n=this.listeners[e];n.splice(n.indexOf(t),1)}):hi(e,this.label,t)}async once(e,t){return this._handleTauriEvent(e,t)?Promise.resolve(()=>{let n=this.listeners[e];n.splice(n.indexOf(t),1)}):xl(e,this.label,t)}async emit(e,t){if(wl.includes(e)){for(let n of this.listeners[e]||[])n({event:e,id:-1,windowLabel:this.label,payload:t});return Promise.resolve()}return Ul(e,this.label,t)}_handleTauriEvent(e,t){return wl.includes(e)?(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0):!1}},Bl=class extends Yl{async scaleFactor(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})}async innerPosition(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}}).then(({x:e,y:t})=>new Ye(e,t))}async outerPosition(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(({x:e,y:t})=>new Ye(e,t))}async innerSize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(({width:e,height:t})=>new tt(e,t))}async outerSize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(({width:e,height:t})=>new tt(e,t))}async isFullscreen(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})}async isMinimized(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMinimized"}}}})}async isMaximized(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})}async isDecorated(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})}async isResizable(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})}async isVisible(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})}async title(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"title"}}}})}async theme(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"theme"}}}})}async center(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"center"}}}})}async requestUserAttention(e){let t=null;return e&&(e===1?t={type:"Critical"}:t={type:"Informational"}),L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:t}}}})}async setResizable(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:e}}}})}async setTitle(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:e}}}})}async maximize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})}async unmaximize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})}async toggleMaximize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"toggleMaximize"}}}})}async minimize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})}async unminimize(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})}async show(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})}async hide(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})}async close(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})}async setDecorations(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:e}}}})}async setShadow(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setShadow",payload:e}}}})}async setAlwaysOnTop(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:e}}}})}async setContentProtected(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setContentProtected",payload:e}}}})}async setSize(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSize",payload:{type:e.type,data:{width:e.width,height:e.height}}}}}})}async setMinSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setMaxSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaxSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setFullscreen(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:e}}}})}async setFocus(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})}async setIcon(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIcon",payload:{icon:typeof e=="string"?e:Array.from(e)}}}}})}async setSkipTaskbar(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:e}}}})}async setCursorGrab(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorGrab",payload:e}}}})}async setCursorVisible(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorVisible",payload:e}}}})}async setCursorIcon(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorIcon",payload:e}}}})}async setCursorPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setIgnoreCursorEvents(e){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIgnoreCursorEvents",payload:e}}}})}async startDragging(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})}async onResized(e){return this.listen("tauri://resize",t=>{t.payload=Ql(t.payload),e(t)})}async onMoved(e){return this.listen("tauri://move",t=>{t.payload=Kl(t.payload),e(t)})}async onCloseRequested(e){return this.listen("tauri://close-requested",t=>{let n=new Jl(t);Promise.resolve(e(n)).then(()=>{if(!n.isPreventDefault())return this.close()})})}async onFocusChanged(e){let t=await this.listen("tauri://focus",l=>{e({...l,payload:!0})}),n=await this.listen("tauri://blur",l=>{e({...l,payload:!1})});return()=>{t(),n()}}async onScaleChanged(e){return this.listen("tauri://scale-change",e)}async onMenuClicked(e){return this.listen("tauri://menu",e)}async onFileDropEvent(e){let t=await this.listen("tauri://file-drop",s=>{e({...s,payload:{type:"drop",paths:s.payload}})}),n=await this.listen("tauri://file-drop-hover",s=>{e({...s,payload:{type:"hover",paths:s.payload}})}),l=await this.listen("tauri://file-drop-cancelled",s=>{e({...s,payload:{type:"cancel"}})});return()=>{t(),n(),l()}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},Jl=class{constructor(e){this._preventDefault=!1,this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}},it=class extends Bl{constructor(e,t={}){super(e),t!=null&&t.skip||L({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:{label:e,...t}}}}).then(async()=>this.emit("tauri://created")).catch(async n=>this.emit("tauri://error",n))}static getByLabel(e){return Xl().some(t=>t.label===e)?new it(e,{skip:!0}):null}},nt;"__TAURI_METADATA__"in window?nt=new it(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn(`Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label. -Note that this is not an issue if running this frontend on a browser instead of a Tauri window.`),nt=new it("main",{skip:!0}));function gi(e){return e===null?null:{name:e.name,scaleFactor:e.scaleFactor,position:Kl(e.position),size:Ql(e.size)}}function Kl(e){return new Ye(e.x,e.y)}function Ql(e){return new tt(e.width,e.height)}async function zs(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}).then(gi)}async function Ws(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}).then(gi)}async function Cs(){return L({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}).then(e=>e.map(gi))}function Ls(e){let t,n,l,s,u,b,p;return{c(){t=a("p"),t.innerHTML=`This is a demo of Tauri's API capabilities using the @tauri-apps/api package. It's used as the main validation app, serving as the test bed of our +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const u of r)if(u.type==="childList")for(const m of u.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&i(m)}).observe(document,{childList:!0,subtree:!0});function n(r){const u={};return r.integrity&&(u.integrity=r.integrity),r.referrerpolicy&&(u.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?u.credentials="include":r.crossorigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function i(r){if(r.ep)return;r.ep=!0;const u=n(r);fetch(r.href,u)}})();function $(){}function ot(e){return e()}function Ge(){return Object.create(null)}function F(e){e.forEach(ot)}function gt(e){return typeof e=="function"}function me(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let ke;function vt(e,t){return ke||(ke=document.createElement("a")),ke.href=t,e===ke.href}function bt(e){return Object.keys(e).length===0}function yt(e,...t){if(e==null)return $;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function wt(e,t,n){e.$$.on_destroy.push(yt(t,n))}function s(e,t){e.appendChild(t)}function v(e,t,n){e.insertBefore(t,n||null)}function g(e){e.parentNode.removeChild(e)}function Xe(e,t){for(let n=0;ne.removeEventListener(t,n,i)}function d(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Et(e){return Array.from(e.childNodes)}function $t(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}class Lt{constructor(t=!1){this.is_svg=!1,this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,n,i=null){this.e||(this.is_svg?this.e=kt(n.nodeName):this.e=f(n.nodeName),this.t=n,this.c(t)),this.i(i)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.childNodes)}i(t){for(let n=0;n{Le.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}function Ke(e){e&&e.c()}function Me(e,t,n,i){const{fragment:r,on_mount:u,on_destroy:m,after_update:l}=e.$$;r&&r.m(t,n),i||Ie(()=>{const o=u.map(ot).filter(gt);m?m.push(...o):F(o),e.$$.on_mount=[]}),l.forEach(Ie)}function Re(e,t){const n=e.$$;n.fragment!==null&&(F(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Dt(e,t){e.$$.dirty[0]===-1&&(ce.push(e),St(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const O=P.length?P[0]:S;return a.ctx&&r(a.ctx[y],a.ctx[y]=O)&&(!a.skip_bound&&a.bound[y]&&a.bound[y](O),E&&Dt(e,y)),S}):[],a.update(),E=!0,F(a.before_update),a.fragment=i?i(a.ctx):!1,t.target){if(t.hydrate){const y=Et(t.target);a.fragment&&a.fragment.l(y),y.forEach(g)}else a.fragment&&a.fragment.c();t.intro&&Ae(e.$$.fragment),Me(e,t.target,t.anchor,t.customElement),at()}ue(o)}class Oe{$destroy(){Re(this,1),this.$destroy=$}$on(t,n){const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const r=i.indexOf(n);r!==-1&&i.splice(r,1)}}$set(t){this.$$set&&!bt(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const J=[];function Nt(e,t=$){let n;const i=new Set;function r(l){if(me(e,l)&&(e=l,n)){const o=!J.length;for(const a of i)a[1](),J.push(a,e);if(o){for(let a=0;a{i.delete(a),i.size===0&&(n(),n=null)}}return{set:r,update:u,subscribe:m}}function Wt(e){let t,n,i,r,u,m,l;return{c(){t=f("p"),t.innerHTML=`This is a demo of Tauri's API capabilities using the @tauri-apps/api package. It's used as the main validation app, serving as the test bed of our development process. In the future, this app will be used on Tauri's integration - tests.`,n=d(),l=a("br"),s=d(),u=a("br"),b=d(),p=a("br")},m(f,c){_(f,t,c),_(f,n,c),_(f,l,c),_(f,s,c),_(f,u,c),_(f,b,c),_(f,p,c)},p:V,i:V,o:V,d(f){f&&h(t),f&&h(n),f&&h(l),f&&h(s),f&&h(u),f&&h(b),f&&h(p)}}}class Ss extends vt{constructor(t){super(),yt(this,t,null,Ls,lt,{})}}function Ts(e){let t,n,l,s,u,b,p,f,c,z,y,W,M;return{c(){t=a("p"),t.innerHTML=`This binary can be run from the terminal and takes the following arguments: -
  --config <PATH>
-  --theme <light|dark|system>
-  --verbose
- Additionally, it has a update --background subcommand.`,n=d(),l=a("br"),s=d(),u=a("div"),u.textContent="Note that the arguments are only parsed, not implemented.",b=d(),p=a("br"),f=d(),c=a("br"),z=d(),y=a("button"),y.textContent="Get matches",o(u,"class","note"),o(y,"class","btn"),o(y,"id","cli-matches")},m(m,C){_(m,t,C),_(m,n,C),_(m,l,C),_(m,s,C),_(m,u,C),_(m,b,C),_(m,p,C),_(m,f,C),_(m,c,C),_(m,z,C),_(m,y,C),W||(M=T(y,"click",e[0]),W=!0)},p:V,i:V,o:V,d(m){m&&h(t),m&&h(n),m&&h(l),m&&h(s),m&&h(u),m&&h(b),m&&h(p),m&&h(f),m&&h(c),m&&h(z),m&&h(y),W=!1,M()}}}function Es(e,t,n){let{onMessage:l}=t;function s(){Be("plugin:cli|cli_matches").then(l).catch(l)}return e.$$set=u=>{"onMessage"in u&&n(1,l=u.onMessage)},[s,l]}class Ps extends vt{constructor(t){super(),yt(this,t,Es,Ts,lt,{onMessage:1})}}function As(e){let t,n,l,s,u,b,p,f;return{c(){t=a("div"),n=a("button"),n.textContent="Call Log API",l=d(),s=a("button"),s.textContent="Call Request (async) API",u=d(),b=a("button"),b.textContent="Send event to Rust",o(n,"class","btn"),o(n,"id","log"),o(s,"class","btn"),o(s,"id","request"),o(b,"class","btn"),o(b,"id","event")},m(c,z){_(c,t,z),i(t,n),i(t,l),i(t,s),i(t,u),i(t,b),p||(f=[T(n,"click",e[0]),T(s,"click",e[1]),T(b,"click",e[2])],p=!0)},p:V,i:V,o:V,d(c){c&&h(t),p=!1,Ce(f)}}}function Os(e,t,n){let{onMessage:l}=t,s;At(async()=>{s=await _i("rust-event",l)}),Hl(()=>{s&&s()});function u(){Be("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function b(){Be("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(l).catch(l)}function p(){Vl("js-event","this is the payload string")}return e.$$set=f=>{"onMessage"in f&&n(3,l=f.onMessage)},[u,b,p,l]}class Ds extends vt{constructor(t){super(),yt(this,t,Os,As,lt,{onMessage:3})}}function kl(e,t,n){const l=e.slice();return l[65]=t[n],l}function Ml(e,t,n){const l=e.slice();return l[68]=t[n],l}function zl(e){let t,n,l,s,u,b,p=Object.keys(e[1]),f=[];for(let c=0;ce[37].call(l))},m(c,z){_(c,t,z),_(c,n,z),_(c,l,z),i(l,s);for(let y=0;ye[56].call(De)),o(Ve,"class","input"),o(Ve,"type","number"),o(Ge,"class","input"),o(Ge,"type","number"),o(Oe,"class","flex gap-2"),o(Xe,"class","input grow"),o(Xe,"id","title"),o(St,"class","btn"),o(St,"type","submit"),o($e,"class","flex gap-1"),o(Lt,"class","flex flex-col gap-1")},m(r,v){_(r,t,v),_(r,n,v),_(r,l,v),i(l,s),i(l,u),i(l,b),i(l,p),i(l,f),i(l,c),i(l,z),_(r,y,v),_(r,W,v),_(r,M,v),_(r,m,v),i(m,C),i(C,P),i(C,G),G.checked=e[3],i(m,N),i(m,R),i(R,E),i(R,O),O.checked=e[2],i(m,de),i(m,F),i(F,B),i(F,U),U.checked=e[4],i(m,le),i(m,Q),i(Q,fe),i(Q,te),te.checked=e[5],i(m,se),i(m,J),i(J,g),i(J,A),A.checked=e[6],i(m,D),i(m,Z),i(Z,Le),i(Z,$),$.checked=e[7],_(r,me,v),_(r,Ie,v),_(r,he,v),_(r,ee,v),i(ee,ae),i(ae,_e),i(_e,Re),i(_e,oe),q(oe,e[14]),i(ae,be),i(ae,Se),i(Se,Te),i(Se,X),q(X,e[15]),i(ee,ge),i(ee,ie),i(ie,x),i(x,we),i(x,re),q(re,e[8]),i(ie,ke),i(ie,j),i(j,k),i(j,I),q(I,e[9]),i(ee,S),i(ee,ue),i(ue,st),i(st,Rt),i(st,ze),q(ze,e[10]),i(ue,Ht),i(ue,at),i(at,Nt),i(at,We),q(We,e[11]),i(ee,H),i(ee,Ee),i(Ee,Je),i(Je,wt),i(Je,ye),q(ye,e[12]),i(Ee,kt),i(Ee,Ke),i(Ke,Mt),i(Ke,ve),q(ve,e[13]),_(r,ot,v),_(r,rt,v),_(r,ut,v),_(r,pe,v),i(pe,Pe),i(Pe,Me),i(Me,Qe),i(Me,zt),i(Me,Ze),i(Ze,Wt),i(Ze,Hn),i(Me,yi),i(Me,qt),i(qt,vi),i(qt,Nn),i(Pe,wi),i(Pe,He),i(He,Ut),i(He,ki),i(He,xt),i(xt,Mi),i(xt,qn),i(He,zi),i(He,Vt),i(Vt,Wi),i(Vt,Fn),i(pe,Ci),i(pe,dt),i(dt,Ne),i(Ne,Xt),i(Ne,Li),i(Ne,Yt),i(Yt,Si),i(Yt,Un),i(Ne,Ti),i(Ne,Jt),i(Jt,Ei),i(Jt,xn),i(dt,Pi),i(dt,qe),i(qe,Qt),i(qe,Ai),i(qe,Zt),i(Zt,Oi),i(Zt,jn),i(qe,Di),i(qe,en),i(en,Ii),i(en,Vn),i(pe,Ri),i(pe,ft),i(ft,Fe),i(Fe,nn),i(Fe,Hi),i(Fe,ln),i(ln,Ni),i(ln,Gn),i(Fe,qi),i(Fe,an),i(an,Fi),i(an,Xn),i(ft,Ui),i(ft,Ue),i(Ue,rn),i(Ue,xi),i(Ue,un),i(un,ji),i(un,Yn),i(Ue,Vi),i(Ue,dn),i(dn,Gi),i(dn,Bn),i(pe,Xi),i(pe,mt),i(mt,xe),i(xe,mn),i(xe,Yi),i(xe,pn),i(pn,Bi),i(pn,Jn),i(xe,Ji),i(xe,_n),i(_n,Ki),i(_n,Kn),i(mt,Qi),i(mt,je),i(je,gn),i(je,Zi),i(je,yn),i(yn,$i),i(yn,Qn),i(je,el),i(je,wn),i(wn,tl),i(wn,Zn),_(r,$n,v),_(r,ei,v),_(r,ti,v),_(r,Ct,v),_(r,ni,v),_(r,Ae,v),i(Ae,Mn),i(Mn,pt),pt.checked=e[16],i(Mn,nl),i(Ae,il),i(Ae,zn),i(zn,ht),ht.checked=e[17],i(zn,ll),i(Ae,sl),i(Ae,Wn),i(Wn,_t),_t.checked=e[21],i(Wn,al),_(r,ii,v),_(r,Oe,v),i(Oe,Cn),i(Cn,ol),i(Cn,De);for(let ne=0;ne=1,z,y,W,M=c&&zl(e),m=e[1][e[0]]&&Cl(e);return{c(){t=a("div"),n=a("div"),l=a("input"),s=d(),u=a("button"),u.textContent="New window",b=d(),p=a("br"),f=d(),M&&M.c(),z=d(),m&&m.c(),o(l,"class","input grow"),o(l,"type","text"),o(l,"placeholder","New Window label.."),o(u,"class","btn"),o(n,"class","flex gap-1"),o(t,"class","flex flex-col children:grow gap-2")},m(C,P){_(C,t,P),i(t,n),i(n,l),q(l,e[22]),i(n,s),i(n,u),i(t,b),i(t,p),i(t,f),M&&M.m(t,null),i(t,z),m&&m.m(t,null),y||(W=[T(l,"input",e[36]),T(u,"click",e[33])],y=!0)},p(C,P){P[0]&4194304&&l.value!==C[22]&&q(l,C[22]),P[0]&2&&(c=Object.keys(C[1]).length>=1),c?M?M.p(C,P):(M=zl(C),M.c(),M.m(t,z)):M&&(M.d(1),M=null),C[1][C[0]]?m?m.p(C,P):(m=Cl(C),m.c(),m.m(t,null)):m&&(m.d(1),m=null)},i:V,o:V,d(C){C&&h(t),M&&M.d(),m&&m.d(),y=!1,Ce(W)}}}function Rs(e,t,n){let l=nt.label;const s={[nt.label]:nt},u=["default","crosshair","hand","arrow","move","text","wait","help","progress","notAllowed","contextMenu","cell","verticalText","alias","copy","noDrop","grab","grabbing","allScroll","zoomIn","zoomOut","eResize","nResize","neResize","nwResize","sResize","seResize","swResize","wResize","ewResize","nsResize","neswResize","nwseResize","colResize","rowResize"];let{onMessage:b}=t,p,f=!0,c=!1,z=!0,y=!1,W=!0,M=!1,m=null,C=null,P=null,G=null,N=null,R=null,E=null,O=null,de=1,F=new Ye(E,O),B=new Ye(E,O),U=new tt(m,C),le=new tt(m,C),Q,fe,te=!1,se=!0,J=null,g=null,A="default",D=!1,Z="Awesome Tauri Example!";function Le(){s[l].setTitle(Z)}function $(){s[l].hide(),setTimeout(s[l].show,2e3)}function me(){s[l].minimize(),setTimeout(s[l].unminimize,2e3)}function Ie(){if(!p)return;const H=new it(p);n(1,s[p]=H,s),H.once("tauri://error",function(){b("Error creating new webview")})}function he(){s[l].innerSize().then(H=>{n(26,U=H),n(8,m=U.width),n(9,C=U.height)}),s[l].outerSize().then(H=>{n(27,le=H)})}function ee(){s[l].innerPosition().then(H=>{n(24,F=H)}),s[l].outerPosition().then(H=>{n(25,B=H),n(14,E=B.x),n(15,O=B.y)})}async function ae(H){!H||(Q&&Q(),fe&&fe(),fe=await H.listen("tauri://move",ee),Q=await H.listen("tauri://resize",he))}async function _e(){await s[l].minimize(),await s[l].requestUserAttention(bi.Critical),await new Promise(H=>setTimeout(H,3e3)),await s[l].requestUserAttention(null)}function Re(){p=this.value,n(22,p)}function oe(){l=_l(this),n(0,l),n(1,s)}const be=()=>s[l].center();function Se(){c=this.checked,n(3,c)}function Te(){f=this.checked,n(2,f)}function X(){z=this.checked,n(4,z)}function ge(){y=this.checked,n(5,y)}function ie(){W=this.checked,n(6,W)}function x(){M=this.checked,n(7,M)}function we(){E=Y(this.value),n(14,E)}function re(){O=Y(this.value),n(15,O)}function ke(){m=Y(this.value),n(8,m)}function j(){C=Y(this.value),n(9,C)}function k(){P=Y(this.value),n(10,P)}function I(){G=Y(this.value),n(11,G)}function S(){N=Y(this.value),n(12,N)}function ue(){R=Y(this.value),n(13,R)}function st(){te=this.checked,n(16,te)}function Rt(){se=this.checked,n(17,se)}function ze(){D=this.checked,n(21,D)}function Ht(){A=_l(this),n(20,A),n(29,u)}function at(){J=Y(this.value),n(18,J)}function Nt(){g=Y(this.value),n(19,g)}function We(){Z=this.value,n(28,Z)}return e.$$set=H=>{"onMessage"in H&&n(35,b=H.onMessage)},e.$$.update=()=>{var H,Ee,Je,wt,ye,kt,Ke,Mt,ve,ot,rt,ut,pe,Pe,Me,Qe,zt,Ze,Wt;e.$$.dirty[0]&3&&(s[l],ee(),he()),e.$$.dirty[0]&7&&((H=s[l])==null||H.setResizable(f)),e.$$.dirty[0]&11&&(c?(Ee=s[l])==null||Ee.maximize():(Je=s[l])==null||Je.unmaximize()),e.$$.dirty[0]&19&&((wt=s[l])==null||wt.setDecorations(z)),e.$$.dirty[0]&35&&((ye=s[l])==null||ye.setAlwaysOnTop(y)),e.$$.dirty[0]&67&&((kt=s[l])==null||kt.setContentProtected(W)),e.$$.dirty[0]&131&&((Ke=s[l])==null||Ke.setFullscreen(M)),e.$$.dirty[0]&771&&m&&C&&((Mt=s[l])==null||Mt.setSize(new tt(m,C))),e.$$.dirty[0]&3075&&(P&&G?(ve=s[l])==null||ve.setMinSize(new Rn(P,G)):(ot=s[l])==null||ot.setMinSize(null)),e.$$.dirty[0]&12291&&(N>800&&R>400?(rt=s[l])==null||rt.setMaxSize(new Rn(N,R)):(ut=s[l])==null||ut.setMaxSize(null)),e.$$.dirty[0]&49155&&E!==null&&O!==null&&((pe=s[l])==null||pe.setPosition(new Ye(E,O))),e.$$.dirty[0]&3&&((Pe=s[l])==null||Pe.scaleFactor().then(ct=>n(23,de=ct))),e.$$.dirty[0]&3&&ae(s[l]),e.$$.dirty[0]&65539&&((Me=s[l])==null||Me.setCursorGrab(te)),e.$$.dirty[0]&131075&&((Qe=s[l])==null||Qe.setCursorVisible(se)),e.$$.dirty[0]&1048579&&((zt=s[l])==null||zt.setCursorIcon(A)),e.$$.dirty[0]&786435&&J!==null&&g!==null&&((Ze=s[l])==null||Ze.setCursorPosition(new Ye(J,g))),e.$$.dirty[0]&2097155&&((Wt=s[l])==null||Wt.setIgnoreCursorEvents(D))},[l,s,f,c,z,y,W,M,m,C,P,G,N,R,E,O,te,se,J,g,A,D,p,de,F,B,U,le,Z,u,Le,$,me,Ie,_e,b,Re,oe,be,Se,Te,X,ge,ie,x,we,re,ke,j,k,I,S,ue,st,Rt,ze,Ht,at,Nt,We]}class Hs extends vt{constructor(t){super(),yt(this,t,Rs,Is,lt,{onMessage:35},null,[-1,-1,-1])}}function Ns(e){let t;return{c(){t=a("div"),t.innerHTML=`
Not available for Linux
- `,o(t,"class","flex flex-col gap-2")},m(n,l){_(n,t,l)},p:V,i:V,o:V,d(n){n&&h(t)}}}function qs(e,t,n){let{onMessage:l}=t;const s=window.constraints={audio:!0,video:!0};function u(p){const f=document.querySelector("video"),c=p.getVideoTracks();l("Got stream with constraints:",s),l(`Using video device: ${c[0].label}`),window.stream=p,f.srcObject=p}function b(p){if(p.name==="ConstraintNotSatisfiedError"){const f=s.video;l(`The resolution ${f.width.exact}x${f.height.exact} px is not supported by your device.`)}else p.name==="PermissionDeniedError"&&l("Permissions have not been granted to use your camera and microphone, you need to allow the page access to your devices in order for the demo to work.");l(`getUserMedia error: ${p.name}`,p)}return At(async()=>{try{const p=await navigator.mediaDevices.getUserMedia(s);u(p)}catch(p){b(p)}}),Hl(()=>{window.stream.getTracks().forEach(function(p){p.stop()})}),e.$$set=p=>{"onMessage"in p&&n(0,l=p.onMessage)},[l]}class Fs extends vt{constructor(t){super(),yt(this,t,qs,Ns,lt,{onMessage:0})}}function Sl(e,t,n){const l=e.slice();return l[29]=t[n],l}function Tl(e,t,n){const l=e.slice();return l[32]=t[n],l}function Us(e){let t,n,l,s,u,b,p,f,c,z,y,W,M;function m(E,O){return E[3]?js:xs}let C=m(e),P=C(e);function G(E,O){return E[2]?Gs:Vs}let N=G(e),R=N(e);return{c(){t=a("div"),n=a("span"),n.textContent="Tauri API Validation",l=d(),s=a("span"),u=a("span"),P.c(),p=d(),f=a("span"),f.innerHTML='
',c=d(),z=a("span"),R.c(),o(n,"class","lt-sm:pl-10 text-darkPrimaryText"),o(u,"title",b=e[3]?"Switch to Light mode":"Switch to Dark mode"),o(u,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),o(f,"title","Minimize"),o(f,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),o(z,"title",y=e[2]?"Restore":"Maximize"),o(z,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),o(s,"class","h-100% children:h-100% children:w-12 children:inline-flex children:items-center children:justify-center"),o(t,"class","w-screen select-none h-8 pl-2 flex justify-between items-center absolute text-primaryText dark:text-darkPrimaryText"),o(t,"data-tauri-drag-region","")},m(E,O){_(E,t,O),i(t,n),i(t,l),i(t,s),i(s,u),P.m(u,null),i(s,p),i(s,f),i(s,c),i(s,z),R.m(z,null),W||(M=[T(u,"click",e[10]),T(f,"click",e[8]),T(z,"click",e[9])],W=!0)},p(E,O){C!==(C=m(E))&&(P.d(1),P=C(E),P&&(P.c(),P.m(u,null))),O[0]&8&&b!==(b=E[3]?"Switch to Light mode":"Switch to Dark mode")&&o(u,"title",b),N!==(N=G(E))&&(R.d(1),R=N(E),R&&(R.c(),R.m(z,null))),O[0]&4&&y!==(y=E[2]?"Restore":"Maximize")&&o(z,"title",y)},d(E){E&&h(t),P.d(),R.d(),W=!1,Ce(M)}}}function xs(e){let t;return{c(){t=a("div"),o(t,"class","i-ph-moon")},m(n,l){_(n,t,l)},d(n){n&&h(t)}}}function js(e){let t;return{c(){t=a("div"),o(t,"class","i-ph-sun")},m(n,l){_(n,t,l)},d(n){n&&h(t)}}}function Vs(e){let t;return{c(){t=a("div"),o(t,"class","i-codicon-chrome-maximize")},m(n,l){_(n,t,l)},d(n){n&&h(t)}}}function Gs(e){let t;return{c(){t=a("div"),o(t,"class","i-codicon-chrome-restore")},m(n,l){_(n,t,l)},d(n){n&&h(t)}}}function Xs(e){let t;return{c(){t=a("span"),o(t,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(n,l){_(n,t,l)},d(n){n&&h(t)}}}function Ys(e){let t;return{c(){t=a("span"),o(t,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(n,l){_(n,t,l)},d(n){n&&h(t)}}}function Bs(e){let t,n,l,s,u,b,p,f,c;function z(M,m){return M[3]?Ks:Js}let y=z(e),W=y(e);return{c(){t=a("a"),W.c(),n=d(),l=a("br"),s=d(),u=a("div"),b=d(),p=a("br"),o(t,"href","##"),o(t,"class","nv justify-between h-8"),o(u,"class","bg-white/5 h-2px")},m(M,m){_(M,t,m),W.m(t,null),_(M,n,m),_(M,l,m),_(M,s,m),_(M,u,m),_(M,b,m),_(M,p,m),f||(c=T(t,"click",e[10]),f=!0)},p(M,m){y!==(y=z(M))&&(W.d(1),W=y(M),W&&(W.c(),W.m(t,null)))},d(M){M&&h(t),W.d(),M&&h(n),M&&h(l),M&&h(s),M&&h(u),M&&h(b),M&&h(p),f=!1,c()}}}function Js(e){let t,n;return{c(){t=w(`Switch to Dark mode - `),n=a("div"),o(n,"class","i-ph-moon")},m(l,s){_(l,t,s),_(l,n,s)},d(l){l&&h(t),l&&h(n)}}}function Ks(e){let t,n;return{c(){t=w(`Switch to Light mode - `),n=a("div"),o(n,"class","i-ph-sun")},m(l,s){_(l,t,s),_(l,n,s)},d(l){l&&h(t),l&&h(n)}}}function Qs(e){let t,n,l,s,u=e[32].label+"",b,p,f,c;function z(){return e[18](e[32])}return{c(){t=a("a"),n=a("div"),l=d(),s=a("p"),b=w(u),o(n,"class",e[32].icon+" mr-2"),o(t,"href","##"),o(t,"class",p="nv "+(e[1]===e[32]?"nv_selected":""))},m(y,W){_(y,t,W),i(t,n),i(t,l),i(t,s),i(s,b),f||(c=T(t,"click",z),f=!0)},p(y,W){e=y,W[0]&2&&p!==(p="nv "+(e[1]===e[32]?"nv_selected":""))&&o(t,"class",p)},d(y){y&&h(t),f=!1,c()}}}function El(e){let t,n=e[32]&&Qs(e);return{c(){n&&n.c(),t=Il()},m(l,s){n&&n.m(l,s),_(l,t,s)},p(l,s){l[32]&&n.p(l,s)},d(l){n&&n.d(l),l&&h(t)}}}function Pl(e){let t,n=e[29].html+"",l;return{c(){t=new as(!1),l=Il(),t.a=l},m(s,u){t.m(n,s,u),_(s,l,u)},p(s,u){u[0]&32&&n!==(n=s[29].html+"")&&t.p(n)},d(s){s&&h(l),s&&t.d()}}}function Zs(e){let t,n,l,s,u,b,p,f,c,z,y,W,M,m,C,P,G,N,R,E,O,de,F,B,U,le,Q=e[1].label+"",fe,te,se,J,g,A,D,Z,Le,$,me,Ie,he,ee,ae,_e,Re,oe,be=e[16]&&Us(e);function Se(k,I){return k[0]?Ys:Xs}let Te=Se(e),X=Te(e),ge=!e[16]&&Bs(e),ie=e[6],x=[];for(let k=0;k`,y=d(),W=a("a"),W.innerHTML=`GitHub - `,M=d(),m=a("a"),m.innerHTML=`Source - `,C=d(),P=a("br"),G=d(),N=a("div"),R=d(),E=a("br"),O=d(),de=a("div");for(let k=0;k',ee=d(),ae=a("div");for(let k=0;k{mi(S,1)}),ds()}we?(g=new we(re(k)),yl(g.$$.fragment),di(g.$$.fragment,1),fi(g,J,null)):g=null}if(I[0]&32){ke=k[5];let S;for(S=0;S{C(`File drop: ${JSON.stringify(g.payload)}`)});const s=navigator.userAgent.toLowerCase(),u=s.includes("android")||s.includes("iphone"),b=[{label:"Welcome",component:Ss,icon:"i-ph-hand-waving"},{label:"Communication",component:Ds,icon:"i-codicon-radio-tower"},!u&&{label:"CLI",component:Ps,icon:"i-codicon-terminal"},!u&&{label:"Window",component:Hs,icon:"i-codicon-window"},{label:"WebRTC",component:Fs,icon:"i-ph-broadcast"}];let p=b[0];function f(g){n(1,p=g)}let c;At(async()=>{const g=On();n(2,c=await g.isMaximized()),_i("tauri://resize",async()=>{n(2,c=await g.isMaximized())})});function z(){On().minimize()}async function y(){const g=On();await g.isMaximized()?g.unmaximize():g.maximize()}let W;At(()=>{n(3,W=localStorage&&localStorage.getItem("theme")=="dark"),Ol(W)});function M(){n(3,W=!W),Ol(W)}let m=ms([]);ns(e,m,g=>n(5,l=g));function C(g){m.update(A=>[{html:`
[${new Date().toLocaleTimeString()}]: `+(typeof g=="string"?g:JSON.stringify(g,null,1))+"
"},...A])}function P(g){m.update(A=>[{html:`
[${new Date().toLocaleTimeString()}]: `+g+"
"},...A])}function G(){m.update(()=>[])}let N,R,E;function O(g){E=g.clientY;const A=window.getComputedStyle(N);R=parseInt(A.height,10);const D=Le=>{const $=Le.clientY-E,me=R-$;n(4,N.style.height=`${me{document.removeEventListener("mouseup",Z),document.removeEventListener("mousemove",D)};document.addEventListener("mouseup",Z),document.addEventListener("mousemove",D)}const de=navigator.appVersion.includes("Win");let F=!1,B,U,le=!1,Q=0,fe=0;const te=(g,A,D)=>Math.min(Math.max(A,g),D);At(()=>{n(17,B=document.querySelector("#sidebar")),U=document.querySelector("#sidebarToggle"),document.addEventListener("click",g=>{U.contains(g.target)?n(0,F=!F):F&&!B.contains(g.target)&&n(0,F=!1)}),document.addEventListener("touchstart",g=>{if(U.contains(g.target))return;const A=g.touches[0].clientX;(0{if(le){const A=g.touches[0].clientX;fe=A;const D=(A-Q)/10;B.style.setProperty("--translate-x",`-${te(0,F?0-D:18.75-D,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(le){const g=(fe-Q)/10;n(0,F=F?g>-(18.75/2):g>18.75/2)}le=!1})});const se=g=>{f(g),n(0,F=!1)};function J(g){ui[g?"unshift":"push"](()=>{N=g,n(4,N)})}return e.$$.update=()=>{if(e.$$.dirty[0]&1){const g=document.querySelector("#sidebar");g&&$s(g,F)}},[F,p,c,W,N,l,b,f,z,y,M,m,C,P,G,O,de,B,se,J]}class ta extends vt{constructor(t){super(),yt(this,t,ea,Zs,lt,{},null,[-1,-1])}}new ta({target:document.querySelector("#app")}); + tests.`,n=_(),i=f("br"),r=_(),u=f("br"),m=_(),l=f("br")},m(o,a){v(o,t,a),v(o,n,a),v(o,i,a),v(o,r,a),v(o,u,a),v(o,m,a),v(o,l,a)},p:$,i:$,o:$,d(o){o&&g(t),o&&g(n),o&&g(i),o&&g(r),o&&g(u),o&&g(m),o&&g(l)}}}class It extends Oe{constructor(t){super(),Se(this,t,null,Wt,me,{})}}var At=Object.defineProperty,ut=(e,t)=>{for(var n in t)At(e,n,{get:t[n],enumerable:!0})},dt=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Qe=(e,t,n)=>(dt(e,t,"read from private field"),n?n.call(e):t.get(e)),Mt=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Rt=(e,t,n,i)=>(dt(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n),Pt={};ut(Pt,{Channel:()=>jt,convertFileSrc:()=>qt,invoke:()=>K,transformCallback:()=>fe});function Ht(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function fe(e,t=!1){let n=Ht(),i=`_${n}`;return Object.defineProperty(window,i,{value:r=>(t&&Reflect.deleteProperty(window,i),e==null?void 0:e(r)),writable:!1,configurable:!0}),n}var ae,jt=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,Mt(this,ae,()=>{}),this.id=fe(e=>{Qe(this,ae).call(this,e)})}set onmessage(e){Rt(this,ae,e)}get onmessage(){return Qe(this,ae)}toJSON(){return`__CHANNEL__:${this.id}`}};ae=new WeakMap;async function K(e,t={}){return new Promise((n,i)=>{let r=fe(m=>{n(m),Reflect.deleteProperty(window,`_${u}`)},!0),u=fe(m=>{i(m),Reflect.deleteProperty(window,`_${r}`)},!0);window.__TAURI_IPC__({cmd:e,callback:r,error:u,...t})})}function qt(e,t="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${t}.localhost/${n}`:`${t}://localhost/${n}`}var Ut={};ut(Ut,{TauriEvent:()=>ht,emit:()=>_t,listen:()=>pt,once:()=>Vt});async function ft(e,t){await K("plugin:event|unlisten",{event:e,eventId:t})}async function zt(e,t,n){await K("plugin:event|emit",{event:e,windowLabel:t,payload:n})}async function mt(e,t,n){return K("plugin:event|listen",{event:e,windowLabel:t,handler:fe(n)}).then(i=>async()=>ft(e,i))}async function Ft(e,t,n){return mt(e,t,i=>{n(i),ft(e,i.id).catch(()=>{})})}var ht=(e=>(e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_CREATED="tauri://window-created",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_FILE_DROP="tauri://file-drop",e.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",e.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",e.MENU="tauri://menu",e))(ht||{});async function pt(e,t){return mt(e,null,t)}async function Vt(e,t){return Ft(e,null,t)}async function _t(e,t){return zt(e,void 0,t)}function Bt(e){let t,n,i,r,u,m,l,o;return{c(){t=f("div"),n=f("button"),n.textContent="Call Log API",i=_(),r=f("button"),r.textContent="Call Request (async) API",u=_(),m=f("button"),m.textContent="Send event to Rust",d(n,"class","btn"),d(n,"id","log"),d(r,"class","btn"),d(r,"id","request"),d(m,"class","btn"),d(m,"id","event")},m(a,E){v(a,t,E),s(t,n),s(t,i),s(t,r),s(t,u),s(t,m),l||(o=[z(n,"click",e[0]),z(r,"click",e[1]),z(m,"click",e[2])],l=!0)},p:$,i:$,o:$,d(a){a&&g(t),l=!1,F(o)}}}function Gt(e,t,n){let{onMessage:i}=t,r;xe(async()=>{r=await pt("rust-event",i)}),ct(()=>{r&&r()});function u(){K("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function m(){K("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function l(){_t("js-event","this is the payload string")}return e.$$set=o=>{"onMessage"in o&&n(3,i=o.onMessage)},[u,m,l,i]}class Xt extends Oe{constructor(t){super(),Se(this,t,Gt,Bt,me,{onMessage:3})}}function Yt(e){let t;return{c(){t=f("div"),t.innerHTML=`
Not available for Linux
+ `,d(t,"class","flex flex-col gap-2")},m(n,i){v(n,t,i)},p:$,i:$,o:$,d(n){n&&g(t)}}}function Jt(e,t,n){let{onMessage:i}=t;const r=window.constraints={audio:!0,video:!0};function u(l){const o=document.querySelector("video"),a=l.getVideoTracks();i("Got stream with constraints:",r),i(`Using video device: ${a[0].label}`),window.stream=l,o.srcObject=l}function m(l){if(l.name==="ConstraintNotSatisfiedError"){const o=r.video;i(`The resolution ${o.width.exact}x${o.height.exact} px is not supported by your device.`)}else l.name==="PermissionDeniedError"&&i("Permissions have not been granted to use your camera and microphone, you need to allow the page access to your devices in order for the demo to work.");i(`getUserMedia error: ${l.name}`,l)}return xe(async()=>{try{const l=await navigator.mediaDevices.getUserMedia(r);u(l)}catch(l){m(l)}}),ct(()=>{window.stream.getTracks().forEach(function(l){l.stop()})}),e.$$set=l=>{"onMessage"in l&&n(0,i=l.onMessage)},[i]}class Kt extends Oe{constructor(t){super(),Se(this,t,Jt,Yt,me,{onMessage:0})}}function Ze(e,t,n){const i=e.slice();return i[25]=t[n],i}function et(e,t,n){const i=e.slice();return i[28]=t[n],i}function Qt(e){let t;return{c(){t=f("span"),d(t,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(n,i){v(n,t,i)},d(n){n&&g(t)}}}function Zt(e){let t;return{c(){t=f("span"),d(t,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(n,i){v(n,t,i)},d(n){n&&g(t)}}}function en(e){let t,n;return{c(){t=Q(`Switch to Dark mode + `),n=f("div"),d(n,"class","i-ph-moon")},m(i,r){v(i,t,r),v(i,n,r)},d(i){i&&g(t),i&&g(n)}}}function tn(e){let t,n;return{c(){t=Q(`Switch to Light mode + `),n=f("div"),d(n,"class","i-ph-sun")},m(i,r){v(i,t,r),v(i,n,r)},d(i){i&&g(t),i&&g(n)}}}function nn(e){let t,n,i,r,u=e[28].label+"",m,l,o,a;function E(){return e[14](e[28])}return{c(){t=f("a"),n=f("div"),i=_(),r=f("p"),m=Q(u),d(n,"class",e[28].icon+" mr-2"),d(t,"href","##"),d(t,"class",l="nv "+(e[1]===e[28]?"nv_selected":""))},m(y,S){v(y,t,S),s(t,n),s(t,i),s(t,r),s(r,m),o||(a=z(t,"click",E),o=!0)},p(y,S){e=y,S&2&&l!==(l="nv "+(e[1]===e[28]?"nv_selected":""))&&d(t,"class",l)},d(y){y&&g(t),o=!1,a()}}}function tt(e){let t,n=e[28]&&nn(e);return{c(){n&&n.c(),t=st()},m(i,r){n&&n.m(i,r),v(i,t,r)},p(i,r){i[28]&&n.p(i,r)},d(i){n&&n.d(i),i&&g(t)}}}function nt(e){let t,n=e[25].html+"",i;return{c(){t=new Lt(!1),i=st(),t.a=i},m(r,u){t.m(n,r,u),v(r,i,u)},p(r,u){u&16&&n!==(n=r[25].html+"")&&t.p(n)},d(r){r&&g(i),r&&t.d()}}}function rn(e){let t,n,i,r,u,m,l,o,a,E,y,S,P,O,Z,W,he,w,H,C,j,V,ee,te,pe,_e,p,b,D,I,A,ne,q=e[1].label+"",Te,Pe,ge,ie,k,He,N,ve,je,B,be,qe,re,Ue,oe,se,Ce,ze;function Fe(c,T){return c[0]?Zt:Qt}let ye=Fe(e),M=ye(e);function Ve(c,T){return c[2]?tn:en}let we=Ve(e),R=we(e),G=e[5],L=[];for(let c=0;c`,he=_(),w=f("a"),w.innerHTML=`GitHub + `,H=_(),C=f("a"),C.innerHTML=`Source + `,j=_(),V=f("br"),ee=_(),te=f("div"),pe=_(),_e=f("br"),p=_(),b=f("div");for(let c=0;c',Ue=_(),oe=f("div");for(let c=0;c{Re(h,1)}),Ct()}X?(k=new X(Be(c)),Ke(k.$$.fragment),Ae(k.$$.fragment,1),Me(k,ie,null)):k=null}if(T&16){Y=c[4];let h;for(h=0;h{n(2,o=localStorage&&localStorage.getItem("theme")=="dark"),rt(o)});function a(){n(2,o=!o),rt(o)}let E=Nt([]);wt(e,E,p=>n(4,i=p));function y(p){E.update(b=>[{html:`
[${new Date().toLocaleTimeString()}]: `+(typeof p=="string"?p:JSON.stringify(p,null,1))+"
"},...b])}function S(p){E.update(b=>[{html:`
[${new Date().toLocaleTimeString()}]: `+p+"
"},...b])}function P(){E.update(()=>[])}let O,Z,W;function he(p){W=p.clientY;const b=window.getComputedStyle(O);Z=parseInt(b.height,10);const D=A=>{const ne=A.clientY-W,q=Z-ne;n(3,O.style.height=`${q{document.removeEventListener("mouseup",I),document.removeEventListener("mousemove",D)};document.addEventListener("mouseup",I),document.addEventListener("mousemove",D)}let w=!1,H,C,j=!1,V=0,ee=0;const te=(p,b,D)=>Math.min(Math.max(b,p),D);xe(()=>{n(13,H=document.querySelector("#sidebar")),C=document.querySelector("#sidebarToggle"),document.addEventListener("click",p=>{C.contains(p.target)?n(0,w=!w):w&&!H.contains(p.target)&&n(0,w=!1)}),document.addEventListener("touchstart",p=>{if(C.contains(p.target))return;const b=p.touches[0].clientX;(0{if(j){const b=p.touches[0].clientX;ee=b;const D=(b-V)/10;H.style.setProperty("--translate-x",`-${te(0,w?0-D:18.75-D,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(j){const p=(ee-V)/10;n(0,w=w?p>-(18.75/2):p>18.75/2)}j=!1})});const pe=p=>{l(p),n(0,w=!1)};function _e(p){Ne[p?"unshift":"push"](()=>{O=p,n(3,O)})}return e.$$.update=()=>{if(e.$$.dirty&1){const p=document.querySelector("#sidebar");p&&on(p,w)}},[w,m,o,O,i,u,l,a,E,y,S,P,he,H,pe,_e]}class ln extends Oe{constructor(t){super(),Se(this,t,sn,rn,me,{})}}new ln({target:document.querySelector("#app")}); diff --git a/examples/api/src-tauri/src/lib.rs b/examples/api/src-tauri/src/lib.rs index 13b343d6843..e61ed79cad4 100644 --- a/examples/api/src-tauri/src/lib.rs +++ b/examples/api/src-tauri/src/lib.rs @@ -52,11 +52,6 @@ pub fn run() { .content_protected(true); } - #[cfg(target_os = "windows")] - { - window_builder = window_builder.transparent(true).decorations(false); - } - let window = window_builder.build().unwrap(); #[cfg(debug_assertions)] diff --git a/examples/api/src/App.svelte b/examples/api/src/App.svelte index 9ef9655e2e4..ae98905c793 100644 --- a/examples/api/src/App.svelte +++ b/examples/api/src/App.svelte @@ -1,19 +1,11 @@ - -{#if isWindows} -
- Tauri API Validation - - - {#if isDark} -
- {:else} -
- {/if} - - -
- - - {#if isWindowMaximized} -
- {:else} -
- {/if} - - -
-{/if} -
- {#if !isWindows} - - {#if isDark} - Switch to Light mode -
- {:else} - Switch to Dark mode -
- {/if} - -
-
-
- {/if} + + {#if isDark} + Switch to Light mode +
+ {:else} + Switch to Dark mode +
+ {/if} + +
+
+
- import { invoke } from '@tauri-apps/api/tauri' - - export let onMessage - - function cliMatches() { - invoke('plugin:cli|cli_matches').then(onMessage).catch(onMessage) - } - - -

- This binary can be run from the terminal and takes the following arguments: - -

-  --config <PATH>
-  --theme <light|dark|system>
-  --verbose
- - Additionally, it has a update --background subcommand. -

-
-
- Note that the arguments are only parsed, not implemented. -
-
-
- diff --git a/examples/api/src/views/Window.svelte b/examples/api/src/views/Window.svelte deleted file mode 100644 index 8b37eaf0cd1..00000000000 --- a/examples/api/src/views/Window.svelte +++ /dev/null @@ -1,438 +0,0 @@ - - -
-
- - -
-
- {#if Object.keys(windowMap).length >= 1} - Selected window: - - {/if} - {#if windowMap[selectedWindow]} -
-
- - - - -
-
-
- - - - - - -
-
-
-
-
- X - -
-
- Y - -
-
- -
-
- Width - -
-
- Height - -
-
- -
-
- Min width - -
-
- Min height - -
-
- -
-
- Max width - -
-
- Max height - -
-
-
-
-
-
-
-
- Inner Size -
- Width: {innerSize.width} - Height: {innerSize.height} -
-
-
- Outer Size -
- Width: {outerSize.width} - Height: {outerSize.height} -
-
-
-
-
- Inner Logical Size -
- Width: {innerSize.toLogical(scaleFactor).width} - Height: {innerSize.toLogical(scaleFactor).height} -
-
-
- Outer Logical Size -
- Width: {outerSize.toLogical(scaleFactor).width} - Height: {outerSize.toLogical(scaleFactor).height} -
-
-
-
-
- Inner Position -
- x: {innerPosition.x} - y: {innerPosition.y} -
-
-
- Outer Position -
- x: {outerPosition.x} - y: {outerPosition.y} -
-
-
-
-
- Inner Logical Position -
- x: {innerPosition.toLogical(scaleFactor).x} - y: {innerPosition.toLogical(scaleFactor).y} -
-
-
- Outer Logical Position -
- x: {outerPosition.toLogical(scaleFactor).x} - y: {outerPosition.toLogical(scaleFactor).y} -
-
-
-
-

Cursor

-
- - - -
-
- - - -
-
-
-
- - -
-
- {/if} -
diff --git a/tooling/api/docs/js-api.json b/tooling/api/docs/js-api.json index 820c877a976..c841e4475eb 100644 --- a/tooling/api/docs/js-api.json +++ b/tooling/api/docs/js-api.json @@ -1 +1 @@ -{"id":0,"name":"@tauri-apps/api","kind":1,"flags":{},"originalName":"","children":[{"id":1,"name":"event","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"The event system allows you to emit events to the backend and listen to events from it.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.event`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":"."}]},"children":[{"id":3,"name":"TauriEvent","kind":8,"kindString":"Enumeration","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"children":[{"id":16,"name":"MENU","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":33,"character":2}],"type":{"type":"literal","value":"tauri://menu"}},{"id":10,"name":"WINDOW_BLUR","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":27,"character":2}],"type":{"type":"literal","value":"tauri://blur"}},{"id":6,"name":"WINDOW_CLOSE_REQUESTED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":23,"character":2}],"type":{"type":"literal","value":"tauri://close-requested"}},{"id":7,"name":"WINDOW_CREATED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":24,"character":2}],"type":{"type":"literal","value":"tauri://window-created"}},{"id":8,"name":"WINDOW_DESTROYED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":25,"character":2}],"type":{"type":"literal","value":"tauri://destroyed"}},{"id":13,"name":"WINDOW_FILE_DROP","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":30,"character":2}],"type":{"type":"literal","value":"tauri://file-drop"}},{"id":15,"name":"WINDOW_FILE_DROP_CANCELLED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":32,"character":2}],"type":{"type":"literal","value":"tauri://file-drop-cancelled"}},{"id":14,"name":"WINDOW_FILE_DROP_HOVER","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":31,"character":2}],"type":{"type":"literal","value":"tauri://file-drop-hover"}},{"id":9,"name":"WINDOW_FOCUS","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":26,"character":2}],"type":{"type":"literal","value":"tauri://focus"}},{"id":5,"name":"WINDOW_MOVED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":22,"character":2}],"type":{"type":"literal","value":"tauri://move"}},{"id":4,"name":"WINDOW_RESIZED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":21,"character":2}],"type":{"type":"literal","value":"tauri://resize"}},{"id":11,"name":"WINDOW_SCALE_FACTOR_CHANGED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":28,"character":2}],"type":{"type":"literal","value":"tauri://scale-change"}},{"id":12,"name":"WINDOW_THEME_CHANGED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":29,"character":2}],"type":{"type":"literal","value":"tauri://theme-changed"}}],"groups":[{"title":"Enumeration Members","children":[16,10,6,7,8,13,15,14,9,5,4,11,12]}],"sources":[{"fileName":"event.ts","line":20,"character":12}]},{"id":641,"name":"Event","kind":256,"kindString":"Interface","flags":{},"children":[{"id":642,"name":"event","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name"}]},"sources":[{"fileName":"helpers/event.ts","line":11,"character":2}],"type":{"type":"reference","id":2,"name":"EventName"}},{"id":644,"name":"id","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Event identifier used to unlisten"}]},"sources":[{"fileName":"helpers/event.ts","line":15,"character":2}],"type":{"type":"intrinsic","name":"number"}},{"id":645,"name":"payload","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Event payload"}]},"sources":[{"fileName":"helpers/event.ts","line":17,"character":2}],"type":{"type":"reference","id":646,"name":"T"}},{"id":643,"name":"windowLabel","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The label of the window that emitted this event."}]},"sources":[{"fileName":"helpers/event.ts","line":13,"character":2}],"type":{"type":"intrinsic","name":"string"}}],"groups":[{"title":"Properties","children":[642,644,645,643]}],"sources":[{"fileName":"helpers/event.ts","line":9,"character":17}],"typeParameters":[{"id":646,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}]},{"id":647,"name":"EventCallback","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"helpers/event.ts","line":20,"character":12}],"typeParameters":[{"id":651,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"type":{"type":"reflection","declaration":{"id":648,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"helpers/event.ts","line":20,"character":31}],"signatures":[{"id":649,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":650,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":641,"typeArguments":[{"type":"reference","id":651,"name":"T"}],"name":"Event"}}],"type":{"type":"intrinsic","name":"void"}}]}}},{"id":2,"name":"EventName","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"event.ts","line":15,"character":12}],"type":{"type":"union","types":[{"type":"template-literal","head":"","tail":[[{"type":"reference","id":3,"name":"TauriEvent"},""]]},{"type":"intersection","types":[{"type":"intrinsic","name":"string"},{"type":"reference","typeArguments":[{"type":"intrinsic","name":"never"},{"type":"intrinsic","name":"never"}],"name":"Record","qualifiedName":"Record","package":"typescript"}]}]}},{"id":652,"name":"UnlistenFn","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"helpers/event.ts","line":22,"character":12}],"type":{"type":"reflection","declaration":{"id":653,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"helpers/event.ts","line":22,"character":25}],"signatures":[{"id":654,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"intrinsic","name":"void"}}]}}},{"id":27,"name":"emit","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"event.ts","line":107,"character":15}],"signatures":[{"id":28,"name":"emit","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Emits an event to the backend."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { emit } from '@tauri-apps/api/event';\nawait emit('frontend-loaded', { loggedIn: true, token: 'authToken' });\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":29,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"intrinsic","name":"string"}},{"id":30,"name":"payload","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"unknown"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":17,"name":"listen","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"event.ts","line":57,"character":15}],"signatures":[{"id":18,"name":"listen","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to an event from the backend."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { listen } from '@tauri-apps/api/event';\nconst unlisten = await listen('error', (event) => {\n console.log(`Got error in window ${event.windowLabel}, payload: ${event.payload}`);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"typeParameter":[{"id":19,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":20,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"reference","id":2,"name":"EventName"}},{"id":21,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event handler callback."}]},"type":{"type":"reference","id":647,"typeArguments":[{"type":"reference","id":19,"name":"T"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":652,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":22,"name":"once","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"event.ts","line":88,"character":15}],"signatures":[{"id":23,"name":"once","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to an one-off event from the backend."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { once } from '@tauri-apps/api/event';\ninterface LoadedPayload {\n loggedIn: boolean,\n token: string\n}\nconst unlisten = await once('loaded', (event) => {\n console.log(`App is loaded, loggedIn: ${event.payload.loggedIn}, token: ${event.payload.token}`);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"typeParameter":[{"id":24,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":25,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"reference","id":2,"name":"EventName"}},{"id":26,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":647,"typeArguments":[{"type":"reference","id":24,"name":"T"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":652,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Enumerations","children":[3]},{"title":"Interfaces","children":[641]},{"title":"Type Aliases","children":[647,2,652]},{"title":"Functions","children":[27,17,22]}],"sources":[{"fileName":"event.ts","line":12,"character":0}]},{"id":31,"name":"mocks","kind":2,"kindString":"Module","flags":{},"children":[{"id":43,"name":"clearMocks","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"mocks.ts","line":171,"character":16,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/mocks.ts#L171"}],"signatures":[{"id":44,"name":"clearMocks","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Clears mocked functions/data injected by the other functions in this module.\nWhen using a test runner that doesn't provide a fresh window object for each test, calling this function will reset tauri specific properties.\n\n# Example\n\n"},{"kind":"code","text":"```js\nimport { mockWindows, clearMocks } from \"@tauri-apps/api/mocks\"\n\nafterEach(() => {\n clearMocks()\n})\n\ntest(\"mocked windows\", () => {\n mockWindows(\"main\", \"second\", \"third\");\n\n expect(window).toHaveProperty(\"__TAURI_METADATA__\")\n})\n\ntest(\"no mocked windows\", () => {\n expect(window).not.toHaveProperty(\"__TAURI_METADATA__\")\n})\n```"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"intrinsic","name":"void"}}]},{"id":32,"name":"mockIPC","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"mocks.ts","line":65,"character":16,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/mocks.ts#L65"}],"signatures":[{"id":33,"name":"mockIPC","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Intercepts all IPC requests with the given mock handler.\n\nThis function can be used when testing tauri frontend applications or when running the frontend in a Node.js context during static site generation.\n\n# Examples\n\nTesting setup using vitest:\n"},{"kind":"code","text":"```js\nimport { mockIPC, clearMocks } from \"@tauri-apps/api/mocks\"\nimport { invoke } from \"@tauri-apps/api/tauri\"\n\nafterEach(() => {\n clearMocks()\n})\n\ntest(\"mocked command\", () => {\n mockIPC((cmd, args) => {\n switch (cmd) {\n case \"add\":\n return (args.a as number) + (args.b as number);\n default:\n break;\n }\n });\n\n expect(invoke('add', { a: 12, b: 15 })).resolves.toBe(27);\n})\n```"},{"kind":"text","text":"\n\nThe callback function can also return a Promise:\n"},{"kind":"code","text":"```js\nimport { mockIPC, clearMocks } from \"@tauri-apps/api/mocks\"\nimport { invoke } from \"@tauri-apps/api/tauri\"\n\nafterEach(() => {\n clearMocks()\n})\n\ntest(\"mocked command\", () => {\n mockIPC((cmd, args) => {\n if(cmd === \"get_data\") {\n return fetch(\"https://example.com/data.json\")\n .then((response) => response.json())\n }\n });\n\n expect(invoke('get_data')).resolves.toBe({ foo: 'bar' });\n})\n```"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":34,"name":"cb","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":35,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"mocks.ts","line":66,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/mocks.ts#L66"}],"signatures":[{"id":36,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":37,"name":"cmd","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":38,"name":"args","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"},{"type":"intrinsic","name":"unknown"}],"name":"Record","qualifiedName":"Record","package":"typescript"}}],"type":{"type":"intrinsic","name":"any"}}]}}}],"type":{"type":"intrinsic","name":"void"}}]},{"id":39,"name":"mockWindows","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"mocks.ts","line":135,"character":16,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/mocks.ts#L135"}],"signatures":[{"id":40,"name":"mockWindows","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Mocks one or many window labels.\nIn non-tauri context it is required to call this function *before* using the "},{"kind":"code","text":"`@tauri-apps/api/window`"},{"kind":"text","text":" module.\n\nThis function only mocks the *presence* of windows,\nwindow properties (e.g. width and height) can be mocked like regular IPC calls using the "},{"kind":"code","text":"`mockIPC`"},{"kind":"text","text":" function.\n\n# Examples\n\n"},{"kind":"code","text":"```js\nimport { mockWindows } from \"@tauri-apps/api/mocks\";\nimport { getCurrent } from \"@tauri-apps/api/window\";\n\nmockWindows(\"main\", \"second\", \"third\");\n\nconst win = getCurrent();\n\nwin.label // \"main\"\n```"},{"kind":"text","text":"\n\n"},{"kind":"code","text":"```js\nimport { mockWindows } from \"@tauri-apps/api/mocks\";\n\nmockWindows(\"main\", \"second\", \"third\");\n\nmockIPC((cmd, args) => {\n if (cmd === \"tauri\") {\n if (\n args?.__tauriModule === \"Window\" &&\n args?.message?.cmd === \"manage\" &&\n args?.message?.data?.cmd?.type === \"close\"\n ) {\n console.log('closing window!');\n }\n }\n});\n\nconst { getCurrent } = await import(\"@tauri-apps/api/window\");\n\nconst win = getCurrent();\nawait win.close(); // this will cause the mocked IPC handler to log to the console.\n```"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":41,"name":"current","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Label of window this JavaScript context is running in."}]},"type":{"type":"intrinsic","name":"string"}},{"id":42,"name":"additionalWindows","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"comment":{"summary":[{"kind":"text","text":"Label of additional windows the app has."}]},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}}],"type":{"type":"intrinsic","name":"void"}}]}],"groups":[{"title":"Functions","children":[43,32,39]}],"sources":[{"fileName":"mocks.ts","line":5,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/mocks.ts#L5"}]},{"id":45,"name":"path","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"The path module provides utilities for working with file and directory paths.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.path`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":".\n\nThe APIs must be added to ["},{"kind":"code","text":"`tauri.allowlist.path`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#allowlistconfig.path) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":":\n"},{"kind":"code","text":"```json\n{\n \"tauri\": {\n \"allowlist\": {\n \"path\": {\n \"all\": true, // enable all Path APIs\n }\n }\n }\n}\n```"},{"kind":"text","text":"\nIt is recommended to allowlist only the APIs you use for optimal bundle size and security."}]},"children":[{"id":46,"name":"BaseDirectory","kind":8,"kindString":"Enumeration","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"children":[{"id":62,"name":"AppCache","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":48,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L48"}],"type":{"type":"literal","value":16}},{"id":59,"name":"AppConfig","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":45,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L45"}],"type":{"type":"literal","value":13}},{"id":60,"name":"AppData","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":46,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L46"}],"type":{"type":"literal","value":14}},{"id":61,"name":"AppLocalData","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":47,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L47"}],"type":{"type":"literal","value":15}},{"id":63,"name":"AppLog","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":49,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L49"}],"type":{"type":"literal","value":17}},{"id":47,"name":"Audio","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":33,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L33"}],"type":{"type":"literal","value":1}},{"id":48,"name":"Cache","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":34,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L34"}],"type":{"type":"literal","value":2}},{"id":49,"name":"Config","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":35,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L35"}],"type":{"type":"literal","value":3}},{"id":50,"name":"Data","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":36,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L36"}],"type":{"type":"literal","value":4}},{"id":64,"name":"Desktop","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":51,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L51"}],"type":{"type":"literal","value":18}},{"id":52,"name":"Document","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":38,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L38"}],"type":{"type":"literal","value":6}},{"id":53,"name":"Download","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":39,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L39"}],"type":{"type":"literal","value":7}},{"id":65,"name":"Executable","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":52,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L52"}],"type":{"type":"literal","value":19}},{"id":66,"name":"Font","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":53,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L53"}],"type":{"type":"literal","value":20}},{"id":67,"name":"Home","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":54,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L54"}],"type":{"type":"literal","value":21}},{"id":51,"name":"LocalData","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":37,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L37"}],"type":{"type":"literal","value":5}},{"id":54,"name":"Picture","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":40,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L40"}],"type":{"type":"literal","value":8}},{"id":55,"name":"Public","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":41,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L41"}],"type":{"type":"literal","value":9}},{"id":57,"name":"Resource","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":43,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L43"}],"type":{"type":"literal","value":11}},{"id":68,"name":"Runtime","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":55,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L55"}],"type":{"type":"literal","value":22}},{"id":58,"name":"Temp","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":44,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L44"}],"type":{"type":"literal","value":12}},{"id":69,"name":"Template","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":56,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L56"}],"type":{"type":"literal","value":23}},{"id":56,"name":"Video","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":42,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L42"}],"type":{"type":"literal","value":10}}],"groups":[{"title":"Enumeration Members","children":[62,59,60,61,63,47,48,49,50,64,52,53,65,66,67,51,54,55,57,68,58,69,56]}],"sources":[{"fileName":"path.ts","line":32,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L32"}]},{"id":118,"name":"delimiter","kind":32,"kindString":"Variable","flags":{"isConst":true},"comment":{"summary":[{"kind":"text","text":"Provides the platform-specific path segment delimiter:\n- "},{"kind":"code","text":"`;`"},{"kind":"text","text":" on Windows\n- "},{"kind":"code","text":"`:`"},{"kind":"text","text":" on POSIX"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"sources":[{"fileName":"path.ts","line":555,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L555"}],"type":{"type":"union","types":[{"type":"literal","value":";"},{"type":"literal","value":":"}]},"defaultValue":"..."},{"id":117,"name":"sep","kind":32,"kindString":"Variable","flags":{"isConst":true},"comment":{"summary":[{"kind":"text","text":"Provides the platform-specific path segment separator:\n- "},{"kind":"code","text":"`\\` on Windows\n- `"},{"kind":"text","text":"/` on POSIX"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"sources":[{"fileName":"path.ts","line":546,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L546"}],"type":{"type":"union","types":[{"type":"literal","value":"\\"},{"type":"literal","value":"/"}]},"defaultValue":"..."},{"id":76,"name":"appCacheDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":121,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L121"}],"signatures":[{"id":77,"name":"appCacheDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the suggested directory for your app's cache files.\nResolves to "},{"kind":"code","text":"`${cacheDir}/${bundleIdentifier}`"},{"kind":"text","text":", where "},{"kind":"code","text":"`bundleIdentifier`"},{"kind":"text","text":" is the value ["},{"kind":"code","text":"`tauri.bundle.identifier`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#bundleconfig.identifier) is configured in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appCacheDir } from '@tauri-apps/api/path';\nconst appCacheDirPath = await appCacheDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.2.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":70,"name":"appConfigDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":70,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L70"}],"signatures":[{"id":71,"name":"appConfigDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the suggested directory for your app's config files.\nResolves to "},{"kind":"code","text":"`${configDir}/${bundleIdentifier}`"},{"kind":"text","text":", where "},{"kind":"code","text":"`bundleIdentifier`"},{"kind":"text","text":" is the value ["},{"kind":"code","text":"`tauri.bundle.identifier`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#bundleconfig.identifier) is configured in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appConfigDir } from '@tauri-apps/api/path';\nconst appConfigDirPath = await appConfigDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.2.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":72,"name":"appDataDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":87,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L87"}],"signatures":[{"id":73,"name":"appDataDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the suggested directory for your app's data files.\nResolves to "},{"kind":"code","text":"`${dataDir}/${bundleIdentifier}`"},{"kind":"text","text":", where "},{"kind":"code","text":"`bundleIdentifier`"},{"kind":"text","text":" is the value ["},{"kind":"code","text":"`tauri.bundle.identifier`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#bundleconfig.identifier) is configured in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appDataDir } from '@tauri-apps/api/path';\nconst appDataDirPath = await appDataDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.2.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":74,"name":"appLocalDataDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":104,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L104"}],"signatures":[{"id":75,"name":"appLocalDataDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the suggested directory for your app's local data files.\nResolves to "},{"kind":"code","text":"`${localDataDir}/${bundleIdentifier}`"},{"kind":"text","text":", where "},{"kind":"code","text":"`bundleIdentifier`"},{"kind":"text","text":" is the value ["},{"kind":"code","text":"`tauri.bundle.identifier`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#bundleconfig.identifier) is configured in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appLocalDataDir } from '@tauri-apps/api/path';\nconst appLocalDataDirPath = await appLocalDataDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.2.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":78,"name":"appLogDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":533,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L533"}],"signatures":[{"id":79,"name":"appLogDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the suggested directory for your app's log files.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`${configDir}/${bundleIdentifier}/logs`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`${homeDir}/Library/Logs/{bundleIdentifier}`"},{"kind":"text","text":"\n- **Windows:** Resolves to "},{"kind":"code","text":"`${configDir}/${bundleIdentifier}/logs`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appLogDir } from '@tauri-apps/api/path';\nconst appLogDirPath = await appLogDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.2.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":80,"name":"audioDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":143,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L143"}],"signatures":[{"id":81,"name":"audioDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's audio directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_MUSIC_DIR`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Music`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Music}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { audioDir } from '@tauri-apps/api/path';\nconst audioDirPath = await audioDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":134,"name":"basename","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":647,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L647"}],"signatures":[{"id":135,"name":"basename","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the last portion of a "},{"kind":"code","text":"`path`"},{"kind":"text","text":". Trailing directory separators are ignored."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { basename, resolveResource } from '@tauri-apps/api/path';\nconst resourcePath = await resolveResource('app.conf');\nconst base = await basename(resourcePath);\nassert(base === 'app.conf');\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":136,"name":"path","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":137,"name":"ext","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"An optional file extension to be removed from the returned path."}]},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":82,"name":"cacheDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":165,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L165"}],"signatures":[{"id":83,"name":"cacheDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's cache directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_CACHE_HOME`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$HOME/.cache`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Library/Caches`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_LocalAppData}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { cacheDir } from '@tauri-apps/api/path';\nconst cacheDirPath = await cacheDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":84,"name":"configDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":187,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L187"}],"signatures":[{"id":85,"name":"configDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's config directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_CONFIG_HOME`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$HOME/.config`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Library/Application Support`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_RoamingAppData}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { configDir } from '@tauri-apps/api/path';\nconst configDirPath = await configDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":86,"name":"dataDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":209,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L209"}],"signatures":[{"id":87,"name":"dataDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's data directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_DATA_HOME`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$HOME/.local/share`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Library/Application Support`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_RoamingAppData}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { dataDir } from '@tauri-apps/api/path';\nconst dataDirPath = await dataDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":88,"name":"desktopDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":231,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L231"}],"signatures":[{"id":89,"name":"desktopDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's desktop directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_DESKTOP_DIR`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Desktop`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Desktop}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { desktopDir } from '@tauri-apps/api/path';\nconst desktopPath = await desktopDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":128,"name":"dirname","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":613,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L613"}],"signatures":[{"id":129,"name":"dirname","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the directory name of a "},{"kind":"code","text":"`path`"},{"kind":"text","text":". Trailing directory separators are ignored."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { dirname, appDataDir } from '@tauri-apps/api/path';\nconst appDataDirPath = await appDataDir();\nconst dir = await dirname(appDataDirPath);\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":130,"name":"path","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":90,"name":"documentDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":253,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L253"}],"signatures":[{"id":91,"name":"documentDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's document directory."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { documentDir } from '@tauri-apps/api/path';\nconst documentDirPath = await documentDir();\n```"},{"kind":"text","text":"\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_DOCUMENTS_DIR`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Documents`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Documents}`"},{"kind":"text","text":"."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":92,"name":"downloadDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":275,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L275"}],"signatures":[{"id":93,"name":"downloadDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's download directory.\n\n#### Platform-specific\n\n- **Linux**: Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_DOWNLOAD_DIR`"},{"kind":"text","text":".\n- **macOS**: Resolves to "},{"kind":"code","text":"`$HOME/Downloads`"},{"kind":"text","text":".\n- **Windows**: Resolves to "},{"kind":"code","text":"`{FOLDERID_Downloads}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { downloadDir } from '@tauri-apps/api/path';\nconst downloadDirPath = await downloadDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":94,"name":"executableDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":297,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L297"}],"signatures":[{"id":95,"name":"executableDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's executable directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_BIN_HOME/../bin`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$XDG_DATA_HOME/../bin`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$HOME/.local/bin`"},{"kind":"text","text":".\n- **macOS:** Not supported.\n- **Windows:** Not supported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { executableDir } from '@tauri-apps/api/path';\nconst executableDirPath = await executableDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":131,"name":"extname","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":629,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L629"}],"signatures":[{"id":132,"name":"extname","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the extension of the "},{"kind":"code","text":"`path`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { extname, resolveResource } from '@tauri-apps/api/path';\nconst resourcePath = await resolveResource('app.conf');\nconst ext = await extname(resourcePath);\nassert(ext === 'conf');\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":133,"name":"path","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":96,"name":"fontDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":319,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L319"}],"signatures":[{"id":97,"name":"fontDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's font directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_DATA_HOME/fonts`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$HOME/.local/share/fonts`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Library/Fonts`"},{"kind":"text","text":".\n- **Windows:** Not supported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { fontDir } from '@tauri-apps/api/path';\nconst fontDirPath = await fontDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":98,"name":"homeDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":341,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L341"}],"signatures":[{"id":99,"name":"homeDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's home directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$HOME`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Profile}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { homeDir } from '@tauri-apps/api/path';\nconst homeDirPath = await homeDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":138,"name":"isAbsolute","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":661,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L661"}],"signatures":[{"id":139,"name":"isAbsolute","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns whether the path is absolute or not."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { isAbsolute } from '@tauri-apps/api/path';\nassert(await isAbsolute('/home/tauri'));\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":140,"name":"path","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":125,"name":"join","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":598,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L598"}],"signatures":[{"id":126,"name":"join","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Joins all given "},{"kind":"code","text":"`path`"},{"kind":"text","text":" segments together using the platform-specific separator as a delimiter, then normalizes the resulting path."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { join, appDataDir } from '@tauri-apps/api/path';\nconst appDataDirPath = await appDataDir();\nconst path = await join(appDataDirPath, 'users', 'tauri', 'avatar.png');\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":127,"name":"paths","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":100,"name":"localDataDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":363,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L363"}],"signatures":[{"id":101,"name":"localDataDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's local data directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_DATA_HOME`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$HOME/.local/share`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Library/Application Support`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_LocalAppData}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { localDataDir } from '@tauri-apps/api/path';\nconst localDataDirPath = await localDataDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":122,"name":"normalize","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":583,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L583"}],"signatures":[{"id":123,"name":"normalize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Normalizes the given "},{"kind":"code","text":"`path`"},{"kind":"text","text":", resolving "},{"kind":"code","text":"`'..'`"},{"kind":"text","text":" and "},{"kind":"code","text":"`'.'`"},{"kind":"text","text":" segments and resolve symbolic links."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { normalize, appDataDir } from '@tauri-apps/api/path';\nconst appDataDirPath = await appDataDir();\nconst path = await normalize(appDataDirPath, '..', 'users', 'tauri', 'avatar.png');\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":124,"name":"path","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":102,"name":"pictureDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":385,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L385"}],"signatures":[{"id":103,"name":"pictureDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's picture directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_PICTURES_DIR`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Pictures`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Pictures}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { pictureDir } from '@tauri-apps/api/path';\nconst pictureDirPath = await pictureDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":104,"name":"publicDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":407,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L407"}],"signatures":[{"id":105,"name":"publicDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's public directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_PUBLICSHARE_DIR`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Public`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Public}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { publicDir } from '@tauri-apps/api/path';\nconst publicDirPath = await publicDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":119,"name":"resolve","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":568,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L568"}],"signatures":[{"id":120,"name":"resolve","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Resolves a sequence of "},{"kind":"code","text":"`paths`"},{"kind":"text","text":" or "},{"kind":"code","text":"`path`"},{"kind":"text","text":" segments into an absolute path."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { resolve, appDataDir } from '@tauri-apps/api/path';\nconst appDataDirPath = await appDataDir();\nconst path = await resolve(appDataDirPath, '..', 'users', 'tauri', 'avatar.png');\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":121,"name":"paths","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":108,"name":"resolveResource","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":444,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L444"}],"signatures":[{"id":109,"name":"resolveResource","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Resolve the path to a resource file."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { resolveResource } from '@tauri-apps/api/path';\nconst resourcePath = await resolveResource('script.sh');\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The full path to the resource."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":110,"name":"resourcePath","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The path to the resource.\nMust follow the same syntax as defined in "},{"kind":"code","text":"`tauri.conf.json > tauri > bundle > resources`"},{"kind":"text","text":", i.e. keeping subfolders and parent dir components ("},{"kind":"code","text":"`../`"},{"kind":"text","text":")."}]},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":106,"name":"resourceDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":424,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L424"}],"signatures":[{"id":107,"name":"resourceDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the application's resource directory.\nTo resolve a resource path, see the [[resolveResource | "},{"kind":"code","text":"`resolveResource API`"},{"kind":"text","text":"]]."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { resourceDir } from '@tauri-apps/api/path';\nconst resourceDirPath = await resourceDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":111,"name":"runtimeDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":467,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L467"}],"signatures":[{"id":112,"name":"runtimeDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's runtime directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_RUNTIME_DIR`"},{"kind":"text","text":".\n- **macOS:** Not supported.\n- **Windows:** Not supported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { runtimeDir } from '@tauri-apps/api/path';\nconst runtimeDirPath = await runtimeDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":113,"name":"templateDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":489,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L489"}],"signatures":[{"id":114,"name":"templateDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's template directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_TEMPLATES_DIR`"},{"kind":"text","text":".\n- **macOS:** Not supported.\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Templates}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { templateDir } from '@tauri-apps/api/path';\nconst templateDirPath = await templateDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":115,"name":"videoDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":511,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L511"}],"signatures":[{"id":116,"name":"videoDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's video directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_VIDEOS_DIR`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Movies`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Videos}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { videoDir } from '@tauri-apps/api/path';\nconst videoDirPath = await videoDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Enumerations","children":[46]},{"title":"Variables","children":[118,117]},{"title":"Functions","children":[76,70,72,74,78,80,134,82,84,86,88,128,90,92,94,131,96,98,138,125,100,122,102,104,119,108,106,111,113,115]}],"sources":[{"fileName":"path.ts","line":26,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/path.ts#L26"}]},{"id":141,"name":"tauri","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"Invoke your custom commands.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.tauri`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":"."}]},"children":[{"id":150,"name":"Channel","kind":128,"kindString":"Class","flags":{},"children":[{"id":151,"name":"constructor","kind":512,"kindString":"Constructor","flags":{},"sources":[{"fileName":"tauri.ts","line":66,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/tauri.ts#L66"}],"signatures":[{"id":152,"name":"new Channel","kind":16384,"kindString":"Constructor signature","flags":{},"typeParameter":[{"id":153,"name":"T","kind":131072,"kindString":"Type parameter","flags":{},"default":{"type":"intrinsic","name":"unknown"}}],"type":{"type":"reference","id":150,"typeArguments":[{"type":"reference","id":153,"name":"T"}],"name":"Channel"}}]},{"id":156,"name":"#onmessage","kind":1024,"kindString":"Property","flags":{"isPrivate":true},"sources":[{"fileName":"tauri.ts","line":62,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/tauri.ts#L62"}],"type":{"type":"reflection","declaration":{"id":157,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"tauri.ts","line":62,"character":14,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/tauri.ts#L62"}],"signatures":[{"id":158,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":159,"name":"response","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":153,"name":"T"}}],"type":{"type":"intrinsic","name":"void"}}]}},"defaultValue":"..."},{"id":155,"name":"__TAURI_CHANNEL_MARKER__","kind":1024,"kindString":"Property","flags":{"isPrivate":true,"isReadonly":true},"sources":[{"fileName":"tauri.ts","line":61,"character":19,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/tauri.ts#L61"}],"type":{"type":"literal","value":true},"defaultValue":"true"},{"id":154,"name":"id","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"tauri.ts","line":59,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/tauri.ts#L59"}],"type":{"type":"intrinsic","name":"number"}},{"id":160,"name":"onmessage","kind":262144,"kindString":"Accessor","flags":{},"sources":[{"fileName":"tauri.ts","line":72,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/tauri.ts#L72"},{"fileName":"tauri.ts","line":76,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/tauri.ts#L76"}],"getSignature":{"id":161,"name":"onmessage","kind":524288,"kindString":"Get signature","flags":{},"type":{"type":"reflection","declaration":{"id":162,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"tauri.ts","line":76,"character":19,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/tauri.ts#L76"}],"signatures":[{"id":163,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":164,"name":"response","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":153,"name":"T"}}],"type":{"type":"intrinsic","name":"void"}}]}}},"setSignature":{"id":165,"name":"onmessage","kind":1048576,"kindString":"Set signature","flags":{},"parameters":[{"id":166,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":167,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"tauri.ts","line":72,"character":25,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/tauri.ts#L72"}],"signatures":[{"id":168,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":169,"name":"response","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":153,"name":"T"}}],"type":{"type":"intrinsic","name":"void"}}]}}}],"type":{"type":"intrinsic","name":"void"}}},{"id":170,"name":"toJSON","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"tauri.ts","line":80,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/tauri.ts#L80"}],"signatures":[{"id":171,"name":"toJSON","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"intrinsic","name":"string"}}]}],"groups":[{"title":"Constructors","children":[151]},{"title":"Properties","children":[156,155,154]},{"title":"Accessors","children":[160]},{"title":"Methods","children":[170]}],"sources":[{"fileName":"tauri.ts","line":58,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/tauri.ts#L58"}],"typeParameters":[{"id":172,"name":"T","kind":131072,"kindString":"Type parameter","flags":{},"default":{"type":"intrinsic","name":"unknown"}}]},{"id":142,"name":"InvokeArgs","kind":4194304,"kindString":"Type alias","flags":{},"comment":{"summary":[{"kind":"text","text":"Command arguments."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"sources":[{"fileName":"tauri.ts","line":90,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/tauri.ts#L90"}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"},{"type":"intrinsic","name":"unknown"}],"name":"Record","qualifiedName":"Record","package":"typescript"}},{"id":178,"name":"convertFileSrc","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"tauri.ts","line":156,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/tauri.ts#L156"}],"signatures":[{"id":179,"name":"convertFileSrc","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Convert a device file path to an URL that can be loaded by the webview.\nNote that "},{"kind":"code","text":"`asset:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`https://asset.localhost`"},{"kind":"text","text":" must be added to ["},{"kind":"code","text":"`tauri.security.csp`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#securityconfig.csp) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":".\nExample CSP value: "},{"kind":"code","text":"`\"csp\": \"default-src 'self'; img-src 'self' asset: https://asset.localhost\"`"},{"kind":"text","text":" to use the asset protocol on image sources.\n\nAdditionally, "},{"kind":"code","text":"`asset`"},{"kind":"text","text":" must be added to ["},{"kind":"code","text":"`tauri.allowlist.protocol`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#allowlistconfig.protocol)\nin "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" and its access scope must be defined on the "},{"kind":"code","text":"`assetScope`"},{"kind":"text","text":" array on the same "},{"kind":"code","text":"`protocol`"},{"kind":"text","text":" object."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appDataDir, join } from '@tauri-apps/api/path';\nimport { convertFileSrc } from '@tauri-apps/api/tauri';\nconst appDataDirPath = await appDataDir();\nconst filePath = await join(appDataDirPath, 'assets/video.mp4');\nconst assetUrl = convertFileSrc(filePath);\n\nconst video = document.getElementById('my-video');\nconst source = document.createElement('source');\nsource.type = 'video/mp4';\nsource.src = assetUrl;\nvideo.appendChild(source);\nvideo.load();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"the URL that can be used as source on the webview."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":180,"name":"filePath","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The file path."}]},"type":{"type":"intrinsic","name":"string"}},{"id":181,"name":"protocol","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The protocol to use. Defaults to "},{"kind":"code","text":"`asset`"},{"kind":"text","text":". You only need to set this when using a custom protocol."}]},"type":{"type":"intrinsic","name":"string"},"defaultValue":"'asset'"}],"type":{"type":"intrinsic","name":"string"}}]},{"id":173,"name":"invoke","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"tauri.ts","line":106,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/tauri.ts#L106"}],"signatures":[{"id":174,"name":"invoke","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sends a message to the backend."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { invoke } from '@tauri-apps/api/tauri';\nawait invoke('login', { user: 'tauri', password: 'poiwe3h4r5ip3yrhtew9ty' });\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving or rejecting to the backend response."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"typeParameter":[{"id":175,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":176,"name":"cmd","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The command name."}]},"type":{"type":"intrinsic","name":"string"}},{"id":177,"name":"args","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The optional arguments to pass to the command."}]},"type":{"type":"reference","id":142,"name":"InvokeArgs"},"defaultValue":"{}"}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":175,"name":"T"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":143,"name":"transformCallback","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"tauri.ts","line":36,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/tauri.ts#L36"}],"signatures":[{"id":144,"name":"transformCallback","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Transforms a callback function to a string identifier that can be passed to the backend.\nThe backend uses the identifier to "},{"kind":"code","text":"`eval()`"},{"kind":"text","text":" the callback."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"A unique identifier associated with the callback function."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":145,"name":"callback","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reflection","declaration":{"id":146,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"tauri.ts","line":37,"character":13,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/tauri.ts#L37"}],"signatures":[{"id":147,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":148,"name":"response","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"intrinsic","name":"void"}}]}}},{"id":149,"name":"once","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"boolean"},"defaultValue":"false"}],"type":{"type":"intrinsic","name":"number"}}]}],"groups":[{"title":"Classes","children":[150]},{"title":"Type Aliases","children":[142]},{"title":"Functions","children":[178,173,143]}],"sources":[{"fileName":"tauri.ts","line":13,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/tauri.ts#L13"}]},{"id":182,"name":"window","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"Provides APIs to create windows, communicate with other windows and manipulate the current window.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.window`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":".\n\nThe APIs must be added to ["},{"kind":"code","text":"`tauri.allowlist.window`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#allowlistconfig.window) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":":\n"},{"kind":"code","text":"```json\n{\n \"tauri\": {\n \"allowlist\": {\n \"window\": {\n \"all\": true, // enable all window APIs\n \"create\": true, // enable window creation\n \"center\": true,\n \"requestUserAttention\": true,\n \"setResizable\": true,\n \"setTitle\": true,\n \"maximize\": true,\n \"unmaximize\": true,\n \"minimize\": true,\n \"unminimize\": true,\n \"show\": true,\n \"hide\": true,\n \"close\": true,\n \"setDecorations\": true,\n \"setShadow\": true,\n \"setAlwaysOnTop\": true,\n \"setContentProtected\": true,\n \"setSize\": true,\n \"setMinSize\": true,\n \"setMaxSize\": true,\n \"setPosition\": true,\n \"setFullscreen\": true,\n \"setFocus\": true,\n \"setIcon\": true,\n \"setSkipTaskbar\": true,\n \"setCursorGrab\": true,\n \"setCursorVisible\": true,\n \"setCursorIcon\": true,\n \"setCursorPosition\": true,\n \"setIgnoreCursorEvents\": true,\n \"startDragging\": true,\n \"print\": true\n }\n }\n }\n}\n```"},{"kind":"text","text":"\nIt is recommended to allowlist only the APIs you use for optimal bundle size and security.\n\n## Window events\n\nEvents can be listened to using "},{"kind":"code","text":"`appWindow.listen`"},{"kind":"text","text":":\n"},{"kind":"code","text":"```typescript\nimport { appWindow } from \"@tauri-apps/api/window\";\nappWindow.listen(\"my-window-event\", ({ event, payload }) => { });\n```"}]},"children":[{"id":583,"name":"UserAttentionType","kind":8,"kindString":"Enumeration","flags":{},"comment":{"summary":[{"kind":"text","text":"Attention type to request on a window."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":584,"name":"Critical","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"#### Platform-specific\n- **macOS:** Bounces the dock icon until the application is in focus.\n- **Windows:** Flashes both the window and the taskbar button until the application is in focus."}]},"sources":[{"fileName":"window.ts","line":226,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L226"}],"type":{"type":"literal","value":1}},{"id":585,"name":"Informational","kind":16,"kindString":"Enumeration Member","flags":{},"comment":{"summary":[{"kind":"text","text":"#### Platform-specific\n- **macOS:** Bounces the dock icon once.\n- **Windows:** Flashes the taskbar button until the application is in focus."}]},"sources":[{"fileName":"window.ts","line":232,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L232"}],"type":{"type":"literal","value":2}}],"groups":[{"title":"Enumeration Members","children":[584,585]}],"sources":[{"fileName":"window.ts","line":220,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L220"}]},{"id":528,"name":"CloseRequestedEvent","kind":128,"kindString":"Class","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.2"}]}]},"children":[{"id":529,"name":"constructor","kind":512,"kindString":"Constructor","flags":{},"sources":[{"fileName":"window.ts","line":1971,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1971"}],"signatures":[{"id":530,"name":"new CloseRequestedEvent","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":531,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":641,"typeArguments":[{"type":"literal","value":null}],"name":"Event"}}],"type":{"type":"reference","id":528,"name":"CloseRequestedEvent"}}]},{"id":535,"name":"_preventDefault","kind":1024,"kindString":"Property","flags":{"isPrivate":true},"sources":[{"fileName":"window.ts","line":1969,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1969"}],"type":{"type":"intrinsic","name":"boolean"},"defaultValue":"false"},{"id":532,"name":"event","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name"}]},"sources":[{"fileName":"window.ts","line":1964,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1964"}],"type":{"type":"reference","id":2,"name":"EventName"}},{"id":534,"name":"id","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Event identifier used to unlisten"}]},"sources":[{"fileName":"window.ts","line":1968,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1968"}],"type":{"type":"intrinsic","name":"number"}},{"id":533,"name":"windowLabel","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The label of the window that emitted this event."}]},"sources":[{"fileName":"window.ts","line":1966,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1966"}],"type":{"type":"intrinsic","name":"string"}},{"id":538,"name":"isPreventDefault","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1981,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1981"}],"signatures":[{"id":539,"name":"isPreventDefault","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"intrinsic","name":"boolean"}}]},{"id":536,"name":"preventDefault","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1977,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1977"}],"signatures":[{"id":537,"name":"preventDefault","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"intrinsic","name":"void"}}]}],"groups":[{"title":"Constructors","children":[529]},{"title":"Properties","children":[535,532,534,533]},{"title":"Methods","children":[538,536]}],"sources":[{"fileName":"window.ts","line":1962,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1962"}]},{"id":564,"name":"LogicalPosition","kind":128,"kindString":"Class","flags":{},"comment":{"summary":[{"kind":"text","text":"A position represented in logical pixels."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":565,"name":"constructor","kind":512,"kindString":"Constructor","flags":{},"sources":[{"fileName":"window.ts","line":164,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L164"}],"signatures":[{"id":566,"name":"new LogicalPosition","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":567,"name":"x","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}},{"id":568,"name":"y","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"reference","id":564,"name":"LogicalPosition"}}]},{"id":569,"name":"type","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":160,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L160"}],"type":{"type":"intrinsic","name":"string"},"defaultValue":"'Logical'"},{"id":570,"name":"x","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":161,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L161"}],"type":{"type":"intrinsic","name":"number"}},{"id":571,"name":"y","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":162,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L162"}],"type":{"type":"intrinsic","name":"number"}}],"groups":[{"title":"Constructors","children":[565]},{"title":"Properties","children":[569,570,571]}],"sources":[{"fileName":"window.ts","line":159,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L159"}]},{"id":545,"name":"LogicalSize","kind":128,"kindString":"Class","flags":{},"comment":{"summary":[{"kind":"text","text":"A size represented in logical pixels."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":546,"name":"constructor","kind":512,"kindString":"Constructor","flags":{},"sources":[{"fileName":"window.ts","line":118,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L118"}],"signatures":[{"id":547,"name":"new LogicalSize","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":548,"name":"width","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}},{"id":549,"name":"height","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"reference","id":545,"name":"LogicalSize"}}]},{"id":552,"name":"height","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":116,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L116"}],"type":{"type":"intrinsic","name":"number"}},{"id":550,"name":"type","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":114,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L114"}],"type":{"type":"intrinsic","name":"string"},"defaultValue":"'Logical'"},{"id":551,"name":"width","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":115,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L115"}],"type":{"type":"intrinsic","name":"number"}}],"groups":[{"title":"Constructors","children":[546]},{"title":"Properties","children":[552,550,551]}],"sources":[{"fileName":"window.ts","line":113,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L113"}]},{"id":572,"name":"PhysicalPosition","kind":128,"kindString":"Class","flags":{},"comment":{"summary":[{"kind":"text","text":"A position represented in physical pixels."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":573,"name":"constructor","kind":512,"kindString":"Constructor","flags":{},"sources":[{"fileName":"window.ts","line":180,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L180"}],"signatures":[{"id":574,"name":"new PhysicalPosition","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":575,"name":"x","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}},{"id":576,"name":"y","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"reference","id":572,"name":"PhysicalPosition"}}]},{"id":577,"name":"type","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":176,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L176"}],"type":{"type":"intrinsic","name":"string"},"defaultValue":"'Physical'"},{"id":578,"name":"x","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":177,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L177"}],"type":{"type":"intrinsic","name":"number"}},{"id":579,"name":"y","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":178,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L178"}],"type":{"type":"intrinsic","name":"number"}},{"id":580,"name":"toLogical","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":195,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L195"}],"signatures":[{"id":581,"name":"toLogical","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Converts the physical position to a logical one."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst factor = await appWindow.scaleFactor();\nconst position = await appWindow.innerPosition();\nconst logical = position.toLogical(factor);\n```"}]}]},"parameters":[{"id":582,"name":"scaleFactor","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"reference","id":564,"name":"LogicalPosition"}}]}],"groups":[{"title":"Constructors","children":[573]},{"title":"Properties","children":[577,578,579]},{"title":"Methods","children":[580]}],"sources":[{"fileName":"window.ts","line":175,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L175"}]},{"id":553,"name":"PhysicalSize","kind":128,"kindString":"Class","flags":{},"comment":{"summary":[{"kind":"text","text":"A size represented in physical pixels."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":554,"name":"constructor","kind":512,"kindString":"Constructor","flags":{},"sources":[{"fileName":"window.ts","line":134,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L134"}],"signatures":[{"id":555,"name":"new PhysicalSize","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":556,"name":"width","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}},{"id":557,"name":"height","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"reference","id":553,"name":"PhysicalSize"}}]},{"id":560,"name":"height","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":132,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L132"}],"type":{"type":"intrinsic","name":"number"}},{"id":558,"name":"type","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":130,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L130"}],"type":{"type":"intrinsic","name":"string"},"defaultValue":"'Physical'"},{"id":559,"name":"width","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":131,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L131"}],"type":{"type":"intrinsic","name":"number"}},{"id":561,"name":"toLogical","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":149,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L149"}],"signatures":[{"id":562,"name":"toLogical","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Converts the physical size to a logical one."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst factor = await appWindow.scaleFactor();\nconst size = await appWindow.innerSize();\nconst logical = size.toLogical(factor);\n```"}]}]},"parameters":[{"id":563,"name":"scaleFactor","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"reference","id":545,"name":"LogicalSize"}}]}],"groups":[{"title":"Constructors","children":[554]},{"title":"Properties","children":[560,558,559]},{"title":"Methods","children":[561]}],"sources":[{"fileName":"window.ts","line":129,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L129"}]},{"id":185,"name":"WebviewWindow","kind":128,"kindString":"Class","flags":{},"comment":{"summary":[{"kind":"text","text":"Create new webview windows and get a handle to existing ones.\n\nWindows are identified by a *label* a unique identifier that can be used to reference it later.\nIt may only contain alphanumeric characters "},{"kind":"code","text":"`a-zA-Z`"},{"kind":"text","text":" plus the following special characters "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\n// loading embedded asset:\nconst webview = new WebviewWindow('theUniqueLabel', {\n url: 'path/to/page.html'\n});\n// alternatively, load a remote URL:\nconst webview = new WebviewWindow('theUniqueLabel', {\n url: 'https://github.com/tauri-apps/tauri'\n});\n\nwebview.once('tauri://created', function () {\n // webview window successfully created\n});\nwebview.once('tauri://error', function (e) {\n // an error happened creating the webview window\n});\n\n// emit an event to the backend\nawait webview.emit(\"some event\", \"data\");\n// listen to an event from the backend\nconst unlisten = await webview.listen(\"event name\", e => {});\nunlisten();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.2"}]}]},"children":[{"id":189,"name":"constructor","kind":512,"kindString":"Constructor","flags":{},"sources":[{"fileName":"window.ts","line":2039,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2039"}],"signatures":[{"id":190,"name":"new WebviewWindow","kind":16384,"kindString":"Constructor signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Creates a new WebviewWindow."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { WebviewWindow } from '@tauri-apps/api/window';\nconst webview = new WebviewWindow('my-label', {\n url: 'https://github.com/tauri-apps/tauri'\n});\nwebview.once('tauri://created', function () {\n // webview window successfully created\n});\nwebview.once('tauri://error', function (e) {\n // an error happened creating the webview window\n});\n```"},{"kind":"text","text":"\n\n*"}]},{"tag":"@returns","content":[{"kind":"text","text":"The WebviewWindow instance to communicate with the webview."}]}]},"parameters":[{"id":191,"name":"label","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The unique webview window label. Must be alphanumeric: "},{"kind":"code","text":"`a-zA-Z-/:_`"},{"kind":"text","text":"."}]},"type":{"type":"intrinsic","name":"string"}},{"id":192,"name":"options","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":611,"name":"WindowOptions"},"defaultValue":"{}"}],"type":{"type":"reference","id":185,"name":"WebviewWindow"},"overwrites":{"type":"reference","name":"WindowManager.constructor"}}],"overwrites":{"type":"reference","name":"WindowManager.constructor"}},{"id":325,"name":"label","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The window label. It is a unique identifier for the window, can be used to reference it later."}]},"sources":[{"fileName":"window.ts","line":316,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L316"}],"type":{"type":"intrinsic","name":"string"},"inheritedFrom":{"type":"reference","name":"WindowManager.label"}},{"id":326,"name":"listeners","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Local event listeners."}]},"sources":[{"fileName":"window.ts","line":318,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L318"}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"},{"type":"array","elementType":{"type":"reference","id":647,"typeArguments":[{"type":"intrinsic","name":"any"}],"name":"EventCallback"}}],"name":"Record","qualifiedName":"Record","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.listeners"}},{"id":219,"name":"center","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":780,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L780"}],"signatures":[{"id":220,"name":"center","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Centers the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.center();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.center"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.center"}},{"id":244,"name":"close","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1081,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1081"}],"signatures":[{"id":245,"name":"close","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Closes the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.close();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.close"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.close"}},{"id":337,"name":"emit","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":400,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L400"}],"signatures":[{"id":338,"name":"emit","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Emits an event to the backend, tied to the webview window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.emit('window-loaded', { loggedIn: true, token: 'authToken' });\n```"}]}]},"parameters":[{"id":339,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"intrinsic","name":"string"}},{"id":340,"name":"payload","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Event payload."}]},"type":{"type":"intrinsic","name":"unknown"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.emit"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.emit"}},{"id":242,"name":"hide","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1056,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1056"}],"signatures":[{"id":243,"name":"hide","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets the window visibility to false."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.hide();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.hide"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.hide"}},{"id":195,"name":"innerPosition","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":470,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L470"}],"signatures":[{"id":196,"name":"innerPosition","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"The position of the top-left hand corner of the window's client area relative to the top-left hand corner of the desktop."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst position = await appWindow.innerPosition();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The window's inner position."}]}]},"type":{"type":"reference","typeArguments":[{"type":"reference","id":572,"name":"PhysicalPosition"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.innerPosition"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.innerPosition"}},{"id":199,"name":"innerSize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":521,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L521"}],"signatures":[{"id":200,"name":"innerSize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"The physical size of the window's client area.\nThe client area is the content of the window, excluding the title bar and borders."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst size = await appWindow.innerSize();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The window's inner size."}]}]},"type":{"type":"reference","typeArguments":[{"type":"reference","id":553,"name":"PhysicalSize"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.innerSize"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.innerSize"}},{"id":209,"name":"isDecorated","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":647,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L647"}],"signatures":[{"id":210,"name":"isDecorated","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current decorated state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst decorated = await appWindow.isDecorated();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"Whether the window is decorated or not."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.isDecorated"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.isDecorated"}},{"id":203,"name":"isFullscreen","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":572,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L572"}],"signatures":[{"id":204,"name":"isFullscreen","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current fullscreen state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst fullscreen = await appWindow.isFullscreen();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"Whether the window is in fullscreen mode or not."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.isFullscreen"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.isFullscreen"}},{"id":207,"name":"isMaximized","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":622,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L622"}],"signatures":[{"id":208,"name":"isMaximized","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current maximized state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst maximized = await appWindow.isMaximized();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"Whether the window is maximized or not."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.isMaximized"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.isMaximized"}},{"id":205,"name":"isMinimized","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":597,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L597"}],"signatures":[{"id":206,"name":"isMinimized","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current minimized state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst minimized = await appWindow.isMinimized();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.3.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.isMinimized"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.isMinimized"}},{"id":211,"name":"isResizable","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":672,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L672"}],"signatures":[{"id":212,"name":"isResizable","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current resizable state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst resizable = await appWindow.isResizable();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"Whether the window is resizable or not."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.isResizable"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.isResizable"}},{"id":213,"name":"isVisible","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":697,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L697"}],"signatures":[{"id":214,"name":"isVisible","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current visible state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst visible = await appWindow.isVisible();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"Whether the window is visible or not."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.isVisible"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.isVisible"}},{"id":327,"name":"listen","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":345,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L345"}],"signatures":[{"id":328,"name":"listen","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to an event emitted by the backend that is tied to the webview window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst unlisten = await appWindow.listen('state-changed', (event) => {\n console.log(`Got error: ${payload}`);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]}]},"typeParameter":[{"id":329,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":330,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"reference","id":2,"name":"EventName"}},{"id":331,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event handler."}]},"type":{"type":"reference","id":647,"typeArguments":[{"type":"reference","id":329,"name":"T"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":652,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.listen"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.listen"}},{"id":230,"name":"maximize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":906,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L906"}],"signatures":[{"id":231,"name":"maximize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Maximizes the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.maximize();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.maximize"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.maximize"}},{"id":236,"name":"minimize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":981,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L981"}],"signatures":[{"id":237,"name":"minimize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Minimizes the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.minimize();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.minimize"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.minimize"}},{"id":304,"name":"onCloseRequested","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1770,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1770"}],"signatures":[{"id":305,"name":"onCloseRequested","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to window close requested. Emitted when the user requests to closes the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from \"@tauri-apps/api/window\";\nimport { confirm } from '@tauri-apps/api/dialog';\nconst unlisten = await appWindow.onCloseRequested(async (event) => {\n const confirmed = await confirm('Are you sure?');\n if (!confirmed) {\n // user did not confirm closing the window; let's prevent it\n event.preventDefault();\n }\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.2"}]}]},"parameters":[{"id":306,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":307,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"window.ts","line":1771,"character":13,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1771"}],"signatures":[{"id":308,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":309,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":528,"name":"CloseRequestedEvent"}}],"type":{"type":"union","types":[{"type":"intrinsic","name":"void"},{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}]}}]}}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":652,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.onCloseRequested"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.onCloseRequested"}},{"id":319,"name":"onFileDropEvent","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1904,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1904"}],"signatures":[{"id":320,"name":"onFileDropEvent","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to a file drop event.\nThe listener is triggered when the user hovers the selected files on the window,\ndrops the files or cancels the operation."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from \"@tauri-apps/api/window\";\nconst unlisten = await appWindow.onFileDropEvent((event) => {\n if (event.payload.type === 'hover') {\n console.log('User hovering', event.payload.paths);\n } else if (event.payload.type === 'drop') {\n console.log('User dropped', event.payload.paths);\n } else {\n console.log('File drop cancelled');\n }\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.2"}]}]},"parameters":[{"id":321,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":647,"typeArguments":[{"type":"reference","id":602,"name":"FileDropEvent"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":652,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.onFileDropEvent"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.onFileDropEvent"}},{"id":310,"name":"onFocusChanged","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1803,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1803"}],"signatures":[{"id":311,"name":"onFocusChanged","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to window focus change."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from \"@tauri-apps/api/window\";\nconst unlisten = await appWindow.onFocusChanged(({ payload: focused }) => {\n console.log('Focus changed, window is focused? ' + focused);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.2"}]}]},"parameters":[{"id":312,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":647,"typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":652,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.onFocusChanged"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.onFocusChanged"}},{"id":316,"name":"onMenuClicked","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1873,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1873"}],"signatures":[{"id":317,"name":"onMenuClicked","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to the window menu item click. The payload is the item id."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from \"@tauri-apps/api/window\";\nconst unlisten = await appWindow.onMenuClicked(({ payload: menuId }) => {\n console.log('Menu clicked: ' + menuId);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.2"}]}]},"parameters":[{"id":318,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":647,"typeArguments":[{"type":"intrinsic","name":"string"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":652,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.onMenuClicked"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.onMenuClicked"}},{"id":301,"name":"onMoved","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1738,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1738"}],"signatures":[{"id":302,"name":"onMoved","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to window move."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from \"@tauri-apps/api/window\";\nconst unlisten = await appWindow.onMoved(({ payload: position }) => {\n console.log('Window moved', position);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.2"}]}]},"parameters":[{"id":303,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":647,"typeArguments":[{"type":"reference","id":572,"name":"PhysicalPosition"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":652,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.onMoved"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.onMoved"}},{"id":298,"name":"onResized","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1712,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1712"}],"signatures":[{"id":299,"name":"onResized","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to window resize."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from \"@tauri-apps/api/window\";\nconst unlisten = await appWindow.onResized(({ payload: size }) => {\n console.log('Window resized', size);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.2"}]}]},"parameters":[{"id":300,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":647,"typeArguments":[{"type":"reference","id":553,"name":"PhysicalSize"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":652,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.onResized"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.onResized"}},{"id":313,"name":"onScaleChanged","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1845,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1845"}],"signatures":[{"id":314,"name":"onScaleChanged","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to window scale change. Emitted when the window's scale factor has changed.\nThe following user actions can cause DPI changes:\n- Changing the display's resolution.\n- Changing the display's scale factor (e.g. in Control Panel on Windows).\n- Moving the window to a display with a different scale factor."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from \"@tauri-apps/api/window\";\nconst unlisten = await appWindow.onScaleChanged(({ payload }) => {\n console.log('Scale changed', payload.scaleFactor, payload.size);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.2"}]}]},"parameters":[{"id":315,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":647,"typeArguments":[{"type":"reference","id":599,"name":"ScaleFactorChanged"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":652,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.onScaleChanged"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.onScaleChanged"}},{"id":322,"name":"onThemeChanged","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1954,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1954"}],"signatures":[{"id":323,"name":"onThemeChanged","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to the system theme change."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from \"@tauri-apps/api/window\";\nconst unlisten = await appWindow.onThemeChanged(({ payload: theme }) => {\n console.log('New theme: ' + theme);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.2"}]}]},"parameters":[{"id":324,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":647,"typeArguments":[{"type":"reference","id":592,"name":"Theme"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":652,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.onThemeChanged"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.onThemeChanged"}},{"id":332,"name":"once","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":378,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L378"}],"signatures":[{"id":333,"name":"once","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to an one-off event emitted by the backend that is tied to the webview window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst unlisten = await appWindow.once('initialized', (event) => {\n console.log(`Window initialized!`);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]}]},"typeParameter":[{"id":334,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":335,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"intrinsic","name":"string"}},{"id":336,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event handler."}]},"type":{"type":"reference","id":647,"typeArguments":[{"type":"reference","id":334,"name":"T"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":652,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.once"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.once"}},{"id":197,"name":"outerPosition","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":495,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L495"}],"signatures":[{"id":198,"name":"outerPosition","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"The position of the top-left hand corner of the window relative to the top-left hand corner of the desktop."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst position = await appWindow.outerPosition();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The window's outer position."}]}]},"type":{"type":"reference","typeArguments":[{"type":"reference","id":572,"name":"PhysicalPosition"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.outerPosition"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.outerPosition"}},{"id":201,"name":"outerSize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":547,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L547"}],"signatures":[{"id":202,"name":"outerSize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"The physical size of the entire window.\nThese dimensions include the title bar and borders. If you don't want that (and you usually don't), use inner_size instead."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst size = await appWindow.outerSize();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The window's outer size."}]}]},"type":{"type":"reference","typeArguments":[{"type":"reference","id":553,"name":"PhysicalSize"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.outerSize"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.outerSize"}},{"id":221,"name":"requestUserAttention","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":816,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L816"}],"signatures":[{"id":222,"name":"requestUserAttention","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Requests user attention to the window, this has no effect if the application\nis already focused. How requesting for user attention manifests is platform dependent,\nsee "},{"kind":"code","text":"`UserAttentionType`"},{"kind":"text","text":" for details.\n\nProviding "},{"kind":"code","text":"`null`"},{"kind":"text","text":" will unset the request for user attention. Unsetting the request for\nuser attention might not be done automatically by the WM when the window receives input.\n\n#### Platform-specific\n\n- **macOS:** "},{"kind":"code","text":"`null`"},{"kind":"text","text":" has no effect.\n- **Linux:** Urgency levels have the same effect."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.requestUserAttention();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":223,"name":"requestType","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"union","types":[{"type":"literal","value":null},{"type":"reference","id":583,"name":"UserAttentionType"}]}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.requestUserAttention"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.requestUserAttention"}},{"id":193,"name":"scaleFactor","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":445,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L445"}],"signatures":[{"id":194,"name":"scaleFactor","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"The scale factor that can be used to map physical pixels to logical pixels."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst factor = await appWindow.scaleFactor();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The window's monitor scale factor."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"number"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.scaleFactor"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.scaleFactor"}},{"id":252,"name":"setAlwaysOnTop","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1171,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1171"}],"signatures":[{"id":253,"name":"setAlwaysOnTop","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Whether the window should always be on top of other windows."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setAlwaysOnTop(true);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":254,"name":"alwaysOnTop","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Whether the window should always be on top of other windows or not."}]},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setAlwaysOnTop"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setAlwaysOnTop"}},{"id":255,"name":"setContentProtected","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1199,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1199"}],"signatures":[{"id":256,"name":"setContentProtected","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Prevents the window contents from being captured by other apps."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setContentProtected(true);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"1.2.0"}]}]},"parameters":[{"id":257,"name":"protected_","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setContentProtected"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setContentProtected"}},{"id":281,"name":"setCursorGrab","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1519,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1519"}],"signatures":[{"id":282,"name":"setCursorGrab","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Grabs the cursor, preventing it from leaving the window.\n\nThere's no guarantee that the cursor will be hidden. You should\nhide it by yourself if you want so.\n\n#### Platform-specific\n\n- **Linux:** Unsupported.\n- **macOS:** This locks the cursor in a fixed location, which looks visually awkward."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setCursorGrab(true);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":283,"name":"grab","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"code","text":"`true`"},{"kind":"text","text":" to grab the cursor icon, "},{"kind":"code","text":"`false`"},{"kind":"text","text":" to release it."}]},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setCursorGrab"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setCursorGrab"}},{"id":287,"name":"setCursorIcon","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1579,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1579"}],"signatures":[{"id":288,"name":"setCursorIcon","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Modifies the cursor icon of the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setCursorIcon('help');\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":289,"name":"icon","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The new cursor icon."}]},"type":{"type":"reference","id":183,"name":"CursorIcon"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setCursorIcon"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setCursorIcon"}},{"id":290,"name":"setCursorPosition","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1606,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1606"}],"signatures":[{"id":291,"name":"setCursorPosition","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Changes the position of the cursor in window coordinates."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow, LogicalPosition } from '@tauri-apps/api/window';\nawait appWindow.setCursorPosition(new LogicalPosition(600, 300));\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":292,"name":"position","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The new cursor position."}]},"type":{"type":"union","types":[{"type":"reference","id":572,"name":"PhysicalPosition"},{"type":"reference","id":564,"name":"LogicalPosition"}]}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setCursorPosition"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setCursorPosition"}},{"id":284,"name":"setCursorVisible","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1552,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1552"}],"signatures":[{"id":285,"name":"setCursorVisible","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Modifies the cursor's visibility.\n\n#### Platform-specific\n\n- **Windows:** The cursor is only hidden within the confines of the window.\n- **macOS:** The cursor is hidden as long as the window has input focus, even if the cursor is\n outside of the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setCursorVisible(false);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":286,"name":"visible","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"If "},{"kind":"code","text":"`false`"},{"kind":"text","text":", this will hide the cursor. If "},{"kind":"code","text":"`true`"},{"kind":"text","text":", this will show the cursor."}]},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setCursorVisible"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setCursorVisible"}},{"id":246,"name":"setDecorations","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1107,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1107"}],"signatures":[{"id":247,"name":"setDecorations","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Whether the window should have borders and bars."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setDecorations(false);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":248,"name":"decorations","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Whether the window should have borders and bars."}]},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setDecorations"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setDecorations"}},{"id":273,"name":"setFocus","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1417,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1417"}],"signatures":[{"id":274,"name":"setFocus","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Bring the window to front and focus."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setFocus();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setFocus"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setFocus"}},{"id":270,"name":"setFullscreen","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1391,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1391"}],"signatures":[{"id":271,"name":"setFullscreen","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets the window fullscreen state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setFullscreen(true);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":272,"name":"fullscreen","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Whether the window should go to fullscreen or not."}]},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setFullscreen"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setFullscreen"}},{"id":275,"name":"setIcon","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1450,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1450"}],"signatures":[{"id":276,"name":"setIcon","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets the window icon."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setIcon('/tauri/awesome.png');\n```"},{"kind":"text","text":"\n\nNote that you need the "},{"kind":"code","text":"`icon-ico`"},{"kind":"text","text":" or "},{"kind":"code","text":"`icon-png`"},{"kind":"text","text":" Cargo features to use this API.\nTo enable it, change your Cargo.toml file:\n"},{"kind":"code","text":"```toml\n[dependencies]\ntauri = { version = \"...\", features = [\"...\", \"icon-png\"] }\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":277,"name":"icon","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Icon bytes or path to the icon file."}]},"type":{"type":"union","types":[{"type":"intrinsic","name":"string"},{"type":"reference","name":"Uint8Array","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array","qualifiedName":"Uint8Array","package":"typescript"}]}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setIcon"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setIcon"}},{"id":293,"name":"setIgnoreCursorEvents","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1650,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1650"}],"signatures":[{"id":294,"name":"setIgnoreCursorEvents","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Changes the cursor events behavior."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setIgnoreCursorEvents(true);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":295,"name":"ignore","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"code","text":"`true`"},{"kind":"text","text":" to ignore the cursor events; "},{"kind":"code","text":"`false`"},{"kind":"text","text":" to process them as usual."}]},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setIgnoreCursorEvents"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setIgnoreCursorEvents"}},{"id":264,"name":"setMaxSize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1306,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1306"}],"signatures":[{"id":265,"name":"setMaxSize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets the window maximum inner size. If the "},{"kind":"code","text":"`size`"},{"kind":"text","text":" argument is undefined, the constraint is unset."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow, LogicalSize } from '@tauri-apps/api/window';\nawait appWindow.setMaxSize(new LogicalSize(600, 500));\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":266,"name":"size","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The logical or physical inner size, or "},{"kind":"code","text":"`null`"},{"kind":"text","text":" to unset the constraint."}]},"type":{"type":"union","types":[{"type":"intrinsic","name":"undefined"},{"type":"literal","value":null},{"type":"reference","id":553,"name":"PhysicalSize"},{"type":"reference","id":545,"name":"LogicalSize"}]}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setMaxSize"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setMaxSize"}},{"id":261,"name":"setMinSize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1264,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1264"}],"signatures":[{"id":262,"name":"setMinSize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets the window minimum inner size. If the "},{"kind":"code","text":"`size`"},{"kind":"text","text":" argument is not provided, the constraint is unset."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow, PhysicalSize } from '@tauri-apps/api/window';\nawait appWindow.setMinSize(new PhysicalSize(600, 500));\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":263,"name":"size","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The logical or physical inner size, or "},{"kind":"code","text":"`null`"},{"kind":"text","text":" to unset the constraint."}]},"type":{"type":"union","types":[{"type":"intrinsic","name":"undefined"},{"type":"literal","value":null},{"type":"reference","id":553,"name":"PhysicalSize"},{"type":"reference","id":545,"name":"LogicalSize"}]}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setMinSize"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setMinSize"}},{"id":267,"name":"setPosition","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1348,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1348"}],"signatures":[{"id":268,"name":"setPosition","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets the window outer position."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow, LogicalPosition } from '@tauri-apps/api/window';\nawait appWindow.setPosition(new LogicalPosition(600, 500));\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":269,"name":"position","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The new position, in logical or physical pixels."}]},"type":{"type":"union","types":[{"type":"reference","id":572,"name":"PhysicalPosition"},{"type":"reference","id":564,"name":"LogicalPosition"}]}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setPosition"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setPosition"}},{"id":224,"name":"setResizable","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":853,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L853"}],"signatures":[{"id":225,"name":"setResizable","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Updates the window resizable flag."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setResizable(false);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":226,"name":"resizable","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setResizable"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setResizable"}},{"id":249,"name":"setShadow","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1144,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1144"}],"signatures":[{"id":250,"name":"setShadow","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Whether or not the window should have shadow.\n\n#### Platform-specific\n\n- **Windows:**\n - "},{"kind":"code","text":"`false`"},{"kind":"text","text":" has no effect on decorated window, shadows are always ON.\n - "},{"kind":"code","text":"`true`"},{"kind":"text","text":" will make ndecorated window have a 1px white border,\nand on Windows 11, it will have a rounded corners.\n- **Linux:** Unsupported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setShadow(false);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0"}]}]},"parameters":[{"id":251,"name":"enable","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setShadow"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setShadow"}},{"id":258,"name":"setSize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1226,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1226"}],"signatures":[{"id":259,"name":"setSize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Resizes the window with a new inner size."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow, LogicalSize } from '@tauri-apps/api/window';\nawait appWindow.setSize(new LogicalSize(600, 500));\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":260,"name":"size","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The logical or physical inner size."}]},"type":{"type":"union","types":[{"type":"reference","id":553,"name":"PhysicalSize"},{"type":"reference","id":545,"name":"LogicalSize"}]}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setSize"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setSize"}},{"id":278,"name":"setSkipTaskbar","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1484,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1484"}],"signatures":[{"id":279,"name":"setSkipTaskbar","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Whether the window icon should be hidden from the taskbar or not.\n\n#### Platform-specific\n\n- **macOS:** Unsupported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setSkipTaskbar(true);\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":280,"name":"skip","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"true to hide window icon, false to show it."}]},"type":{"type":"intrinsic","name":"boolean"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setSkipTaskbar"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setSkipTaskbar"}},{"id":227,"name":"setTitle","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":880,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L880"}],"signatures":[{"id":228,"name":"setTitle","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets the window title."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.setTitle('Tauri');\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"parameters":[{"id":229,"name":"title","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The new title"}]},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.setTitle"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.setTitle"}},{"id":240,"name":"show","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1031,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1031"}],"signatures":[{"id":241,"name":"show","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sets the window visibility to true."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.show();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.show"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.show"}},{"id":296,"name":"startDragging","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1676,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1676"}],"signatures":[{"id":297,"name":"startDragging","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Starts dragging the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.startDragging();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.startDragging"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.startDragging"}},{"id":217,"name":"theme","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":752,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L752"}],"signatures":[{"id":218,"name":"theme","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current theme.\n\n#### Platform-specific\n\n- **macOS:** Theme was introduced on macOS 10.14. Returns "},{"kind":"code","text":"`light`"},{"kind":"text","text":" on macOS 10.13 and below."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst theme = await appWindow.theme();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The window theme."}]}]},"type":{"type":"reference","typeArguments":[{"type":"union","types":[{"type":"literal","value":null},{"type":"reference","id":592,"name":"Theme"}]}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.theme"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.theme"}},{"id":215,"name":"title","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":722,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L722"}],"signatures":[{"id":216,"name":"title","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the window's current title."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nconst title = await appWindow.title();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.3.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.title"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.title"}},{"id":234,"name":"toggleMaximize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":956,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L956"}],"signatures":[{"id":235,"name":"toggleMaximize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Toggles the window maximized state."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.toggleMaximize();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.toggleMaximize"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.toggleMaximize"}},{"id":232,"name":"unmaximize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":931,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L931"}],"signatures":[{"id":233,"name":"unmaximize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Unmaximizes the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.unmaximize();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.unmaximize"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.unmaximize"}},{"id":238,"name":"unminimize","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"window.ts","line":1006,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L1006"}],"signatures":[{"id":239,"name":"unminimize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Unminimizes the window."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appWindow } from '@tauri-apps/api/window';\nawait appWindow.unminimize();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise indicating the success or failure of the operation."}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"},"inheritedFrom":{"type":"reference","name":"WindowManager.unminimize"}}],"inheritedFrom":{"type":"reference","name":"WindowManager.unminimize"}},{"id":186,"name":"getByLabel","kind":2048,"kindString":"Method","flags":{"isStatic":true},"sources":[{"fileName":"window.ts","line":2071,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2071"}],"signatures":[{"id":187,"name":"getByLabel","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets the WebviewWindow for the webview associated with the given label."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { WebviewWindow } from '@tauri-apps/api/window';\nconst mainWindow = WebviewWindow.getByLabel('main');\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The WebviewWindow instance to communicate with the webview or null if the webview doesn't exist."}]}]},"parameters":[{"id":188,"name":"label","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The webview window label."}]},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"union","types":[{"type":"literal","value":null},{"type":"reference","id":185,"name":"WebviewWindow"}]}}]}],"groups":[{"title":"Constructors","children":[189]},{"title":"Properties","children":[325,326]},{"title":"Methods","children":[219,244,337,242,195,199,209,203,207,205,211,213,327,230,236,304,319,310,316,301,298,313,322,332,197,201,221,193,252,255,281,287,290,284,246,273,270,275,293,264,261,267,224,249,258,278,227,240,296,217,215,234,232,238,186]}],"sources":[{"fileName":"window.ts","line":2019,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2019"}],"extendedTypes":[{"type":"reference","name":"WindowManager"}]},{"id":594,"name":"Monitor","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[{"kind":"text","text":"Allows you to retrieve information about a given monitor."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":595,"name":"name","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Human-readable name of the monitor"}]},"sources":[{"fileName":"window.ts","line":81,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L81"}],"type":{"type":"union","types":[{"type":"literal","value":null},{"type":"intrinsic","name":"string"}]}},{"id":597,"name":"position","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"the Top-left corner position of the monitor relative to the larger full screen area."}]},"sources":[{"fileName":"window.ts","line":85,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L85"}],"type":{"type":"reference","id":572,"name":"PhysicalPosition"}},{"id":598,"name":"scaleFactor","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The scale factor that can be used to map physical pixels to logical pixels."}]},"sources":[{"fileName":"window.ts","line":87,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L87"}],"type":{"type":"intrinsic","name":"number"}},{"id":596,"name":"size","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The monitor's resolution."}]},"sources":[{"fileName":"window.ts","line":83,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L83"}],"type":{"type":"reference","id":553,"name":"PhysicalSize"}}],"groups":[{"title":"Properties","children":[595,597,598,596]}],"sources":[{"fileName":"window.ts","line":79,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L79"}]},{"id":599,"name":"ScaleFactorChanged","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[{"kind":"text","text":"The payload for the "},{"kind":"code","text":"`scaleChange`"},{"kind":"text","text":" event."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.2"}]}]},"children":[{"id":600,"name":"scaleFactor","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The new window scale factor."}]},"sources":[{"fileName":"window.ts","line":97,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L97"}],"type":{"type":"intrinsic","name":"number"}},{"id":601,"name":"size","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The new window size"}]},"sources":[{"fileName":"window.ts","line":99,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L99"}],"type":{"type":"reference","id":553,"name":"PhysicalSize"}}],"groups":[{"title":"Properties","children":[600,601]}],"sources":[{"fileName":"window.ts","line":95,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L95"}]},{"id":611,"name":"WindowOptions","kind":256,"kindString":"Interface","flags":{},"comment":{"summary":[{"kind":"text","text":"Configuration for the window to create."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"children":[{"id":638,"name":"acceptFirstMouse","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether clicking an inactive window also clicks through to the webview on macOS."}]},"sources":[{"fileName":"window.ts","line":2195,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2195"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":630,"name":"alwaysOnTop","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window should always be on top of other windows or not."}]},"sources":[{"fileName":"window.ts","line":2153,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2153"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":613,"name":"center","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Show window in the center of the screen.."}]},"sources":[{"fileName":"window.ts","line":2115,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2115"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":631,"name":"contentProtected","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Prevents the window contents from being captured by other apps."}]},"sources":[{"fileName":"window.ts","line":2155,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2155"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":629,"name":"decorations","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window should have borders and bars or not."}]},"sources":[{"fileName":"window.ts","line":2151,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2151"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":634,"name":"fileDropEnabled","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the file drop is enabled or not on the webview. By default it is enabled.\n\nDisabling it is required to use drag and drop on the frontend on Windows."}]},"sources":[{"fileName":"window.ts","line":2177,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2177"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":625,"name":"focus","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window will be initially focused or not."}]},"sources":[{"fileName":"window.ts","line":2139,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2139"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":624,"name":"fullscreen","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window is in fullscreen mode or not."}]},"sources":[{"fileName":"window.ts","line":2137,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2137"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":617,"name":"height","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The initial height."}]},"sources":[{"fileName":"window.ts","line":2123,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2123"}],"type":{"type":"intrinsic","name":"number"}},{"id":637,"name":"hiddenTitle","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"If "},{"kind":"code","text":"`true`"},{"kind":"text","text":", sets the window title to be hidden on macOS."}]},"sources":[{"fileName":"window.ts","line":2191,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2191"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":621,"name":"maxHeight","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The maximum height. Only applies if "},{"kind":"code","text":"`maxWidth`"},{"kind":"text","text":" is also set."}]},"sources":[{"fileName":"window.ts","line":2131,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2131"}],"type":{"type":"intrinsic","name":"number"}},{"id":620,"name":"maxWidth","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The maximum width. Only applies if "},{"kind":"code","text":"`maxHeight`"},{"kind":"text","text":" is also set."}]},"sources":[{"fileName":"window.ts","line":2129,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2129"}],"type":{"type":"intrinsic","name":"number"}},{"id":627,"name":"maximized","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window should be maximized upon creation or not."}]},"sources":[{"fileName":"window.ts","line":2147,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2147"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":619,"name":"minHeight","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The minimum height. Only applies if "},{"kind":"code","text":"`minWidth`"},{"kind":"text","text":" is also set."}]},"sources":[{"fileName":"window.ts","line":2127,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2127"}],"type":{"type":"intrinsic","name":"number"}},{"id":618,"name":"minWidth","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The minimum width. Only applies if "},{"kind":"code","text":"`minHeight`"},{"kind":"text","text":" is also set."}]},"sources":[{"fileName":"window.ts","line":2125,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2125"}],"type":{"type":"intrinsic","name":"number"}},{"id":622,"name":"resizable","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window is resizable or not."}]},"sources":[{"fileName":"window.ts","line":2133,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2133"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":633,"name":"shadow","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether or not the window has shadow.\n\n#### Platform-specific\n\n- **Windows:**\n - "},{"kind":"code","text":"`false`"},{"kind":"text","text":" has no effect on decorated window, shadows are always ON.\n - "},{"kind":"code","text":"`true`"},{"kind":"text","text":" will make ndecorated window have a 1px white border,\nand on Windows 11, it will have a rounded corners.\n- **Linux:** Unsupported."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"2.0"}]}]},"sources":[{"fileName":"window.ts","line":2171,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2171"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":632,"name":"skipTaskbar","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether or not the window icon should be added to the taskbar."}]},"sources":[{"fileName":"window.ts","line":2157,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2157"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":639,"name":"tabbingIdentifier","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Defines the window [tabbing identifier](https://developer.apple.com/documentation/appkit/nswindow/1644704-tabbingidentifier) on macOS.\n\nWindows with the same tabbing identifier will be grouped together.\nIf the tabbing identifier is not set, automatic tabbing will be disabled."}]},"sources":[{"fileName":"window.ts","line":2202,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2202"}],"type":{"type":"intrinsic","name":"string"}},{"id":635,"name":"theme","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The initial window theme. Defaults to the system theme.\n\nOnly implemented on Windows and macOS 10.14+."}]},"sources":[{"fileName":"window.ts","line":2183,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2183"}],"type":{"type":"reference","id":592,"name":"Theme"}},{"id":623,"name":"title","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Window title."}]},"sources":[{"fileName":"window.ts","line":2135,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2135"}],"type":{"type":"intrinsic","name":"string"}},{"id":636,"name":"titleBarStyle","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The style of the macOS title bar."}]},"sources":[{"fileName":"window.ts","line":2187,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2187"}],"type":{"type":"reference","id":593,"name":"TitleBarStyle"}},{"id":626,"name":"transparent","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window is transparent or not.\nNote that on "},{"kind":"code","text":"`macOS`"},{"kind":"text","text":" this requires the "},{"kind":"code","text":"`macos-private-api`"},{"kind":"text","text":" feature flag, enabled under "},{"kind":"code","text":"`tauri.conf.json > tauri > macOSPrivateApi`"},{"kind":"text","text":".\nWARNING: Using private APIs on "},{"kind":"code","text":"`macOS`"},{"kind":"text","text":" prevents your application from being accepted to the "},{"kind":"code","text":"`App Store`"},{"kind":"text","text":"."}]},"sources":[{"fileName":"window.ts","line":2145,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2145"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":612,"name":"url","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Remote URL or local file path to open.\n\n- URL such as "},{"kind":"code","text":"`https://github.com/tauri-apps`"},{"kind":"text","text":" is opened directly on a Tauri window.\n- data: URL such as "},{"kind":"code","text":"`data:text/html,...`"},{"kind":"text","text":" is only supported with the "},{"kind":"code","text":"`window-data-url`"},{"kind":"text","text":" Cargo feature for the "},{"kind":"code","text":"`tauri`"},{"kind":"text","text":" dependency.\n- local file path or route such as "},{"kind":"code","text":"`/path/to/page.html`"},{"kind":"text","text":" or "},{"kind":"code","text":"`/users`"},{"kind":"text","text":" is appended to the application URL (the devServer URL on development, or "},{"kind":"code","text":"`tauri://localhost/`"},{"kind":"text","text":" and "},{"kind":"code","text":"`https://tauri.localhost/`"},{"kind":"text","text":" on production)."}]},"sources":[{"fileName":"window.ts","line":2113,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2113"}],"type":{"type":"intrinsic","name":"string"}},{"id":640,"name":"userAgent","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The user agent for the webview."}]},"sources":[{"fileName":"window.ts","line":2206,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2206"}],"type":{"type":"intrinsic","name":"string"}},{"id":628,"name":"visible","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether the window should be immediately visible upon creation or not."}]},"sources":[{"fileName":"window.ts","line":2149,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2149"}],"type":{"type":"intrinsic","name":"boolean"}},{"id":616,"name":"width","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The initial width."}]},"sources":[{"fileName":"window.ts","line":2121,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2121"}],"type":{"type":"intrinsic","name":"number"}},{"id":614,"name":"x","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The initial vertical position. Only applies if "},{"kind":"code","text":"`y`"},{"kind":"text","text":" is also set."}]},"sources":[{"fileName":"window.ts","line":2117,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2117"}],"type":{"type":"intrinsic","name":"number"}},{"id":615,"name":"y","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The initial horizontal position. Only applies if "},{"kind":"code","text":"`x`"},{"kind":"text","text":" is also set."}]},"sources":[{"fileName":"window.ts","line":2119,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2119"}],"type":{"type":"intrinsic","name":"number"}}],"groups":[{"title":"Properties","children":[638,630,613,631,629,634,625,624,617,637,621,620,627,619,618,622,633,632,639,635,623,636,626,612,640,628,616,614,615]}],"sources":[{"fileName":"window.ts","line":2105,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2105"}]},{"id":183,"name":"CursorIcon","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"window.ts","line":235,"character":12,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L235"}],"type":{"type":"union","types":[{"type":"literal","value":"default"},{"type":"literal","value":"crosshair"},{"type":"literal","value":"hand"},{"type":"literal","value":"arrow"},{"type":"literal","value":"move"},{"type":"literal","value":"text"},{"type":"literal","value":"wait"},{"type":"literal","value":"help"},{"type":"literal","value":"progress"},{"type":"literal","value":"notAllowed"},{"type":"literal","value":"contextMenu"},{"type":"literal","value":"cell"},{"type":"literal","value":"verticalText"},{"type":"literal","value":"alias"},{"type":"literal","value":"copy"},{"type":"literal","value":"noDrop"},{"type":"literal","value":"grab"},{"type":"literal","value":"grabbing"},{"type":"literal","value":"allScroll"},{"type":"literal","value":"zoomIn"},{"type":"literal","value":"zoomOut"},{"type":"literal","value":"eResize"},{"type":"literal","value":"nResize"},{"type":"literal","value":"neResize"},{"type":"literal","value":"nwResize"},{"type":"literal","value":"sResize"},{"type":"literal","value":"seResize"},{"type":"literal","value":"swResize"},{"type":"literal","value":"wResize"},{"type":"literal","value":"ewResize"},{"type":"literal","value":"nsResize"},{"type":"literal","value":"neswResize"},{"type":"literal","value":"nwseResize"},{"type":"literal","value":"colResize"},{"type":"literal","value":"rowResize"}]}},{"id":602,"name":"FileDropEvent","kind":4194304,"kindString":"Type alias","flags":{},"comment":{"summary":[{"kind":"text","text":"The file drop event types."}]},"sources":[{"fileName":"window.ts","line":103,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L103"}],"type":{"type":"union","types":[{"type":"reflection","declaration":{"id":603,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"children":[{"id":605,"name":"paths","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":104,"character":21,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L104"}],"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}},{"id":604,"name":"type","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":104,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L104"}],"type":{"type":"literal","value":"hover"}}],"groups":[{"title":"Properties","children":[605,604]}],"sources":[{"fileName":"window.ts","line":104,"character":4,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L104"}]}},{"type":"reflection","declaration":{"id":606,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"children":[{"id":608,"name":"paths","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":105,"character":20,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L105"}],"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}},{"id":607,"name":"type","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":105,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L105"}],"type":{"type":"literal","value":"drop"}}],"groups":[{"title":"Properties","children":[608,607]}],"sources":[{"fileName":"window.ts","line":105,"character":4,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L105"}]}},{"type":"reflection","declaration":{"id":609,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"children":[{"id":610,"name":"type","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"window.ts","line":106,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L106"}],"type":{"type":"literal","value":"cancel"}}],"groups":[{"title":"Properties","children":[610]}],"sources":[{"fileName":"window.ts","line":106,"character":4,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L106"}]}}]}},{"id":592,"name":"Theme","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"window.ts","line":71,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L71"}],"type":{"type":"union","types":[{"type":"literal","value":"light"},{"type":"literal","value":"dark"}]}},{"id":593,"name":"TitleBarStyle","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"window.ts","line":72,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L72"}],"type":{"type":"union","types":[{"type":"literal","value":"visible"},{"type":"literal","value":"transparent"},{"type":"literal","value":"overlay"}]}},{"id":544,"name":"appWindow","kind":32,"kindString":"Variable","flags":{},"comment":{"summary":[{"kind":"text","text":"The WebviewWindow for the current window."}]},"sources":[{"fileName":"window.ts","line":2081,"character":4,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2081"}],"type":{"type":"reference","id":185,"name":"WebviewWindow"}},{"id":590,"name":"availableMonitors","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"window.ts","line":2288,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2288"}],"signatures":[{"id":591,"name":"availableMonitors","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the list of all the monitors available on the system."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { availableMonitors } from '@tauri-apps/api/window';\nconst monitors = availableMonitors();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"array","elementType":{"type":"reference","id":594,"name":"Monitor"}}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":586,"name":"currentMonitor","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"window.ts","line":2239,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2239"}],"signatures":[{"id":587,"name":"currentMonitor","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the monitor on which the window currently resides.\nReturns "},{"kind":"code","text":"`null`"},{"kind":"text","text":" if current monitor can't be detected."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { currentMonitor } from '@tauri-apps/api/window';\nconst monitor = currentMonitor();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"union","types":[{"type":"reference","id":594,"name":"Monitor"},{"type":"literal","value":null}]}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":542,"name":"getAll","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"window.ts","line":293,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L293"}],"signatures":[{"id":543,"name":"getAll","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Gets a list of instances of "},{"kind":"code","text":"`WebviewWindow`"},{"kind":"text","text":" for all available webview windows."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"array","elementType":{"type":"reference","id":185,"name":"WebviewWindow"}}}]},{"id":540,"name":"getCurrent","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"window.ts","line":281,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L281"}],"signatures":[{"id":541,"name":"getCurrent","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Get an instance of "},{"kind":"code","text":"`WebviewWindow`"},{"kind":"text","text":" for the current webview window."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","id":185,"name":"WebviewWindow"}}]},{"id":588,"name":"primaryMonitor","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"window.ts","line":2264,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L2264"}],"signatures":[{"id":589,"name":"primaryMonitor","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the primary monitor of the system.\nReturns "},{"kind":"code","text":"`null`"},{"kind":"text","text":" if it can't identify any monitor as a primary one."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { primaryMonitor } from '@tauri-apps/api/window';\nconst monitor = primaryMonitor();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"union","types":[{"type":"reference","id":594,"name":"Monitor"},{"type":"literal","value":null}]}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Enumerations","children":[583]},{"title":"Classes","children":[528,564,545,572,553,185]},{"title":"Interfaces","children":[594,599,611]},{"title":"Type Aliases","children":[183,602,592,593]},{"title":"Variables","children":[544]},{"title":"Functions","children":[590,586,542,540,588]}],"sources":[{"fileName":"window.ts","line":66,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/56a45e899/tooling/api/src/window.ts#L66"}]}],"groups":[{"title":"Modules","children":[1,31,45,141,182]}]} \ No newline at end of file +{"id":0,"name":"@tauri-apps/api","kind":1,"flags":{},"originalName":"","children":[{"id":1,"name":"event","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"The event system allows you to emit events to the backend and listen to events from it.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.event`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":"."}]},"children":[{"id":3,"name":"TauriEvent","kind":8,"kindString":"Enumeration","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"children":[{"id":16,"name":"MENU","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":33,"character":2}],"type":{"type":"literal","value":"tauri://menu"}},{"id":10,"name":"WINDOW_BLUR","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":27,"character":2}],"type":{"type":"literal","value":"tauri://blur"}},{"id":6,"name":"WINDOW_CLOSE_REQUESTED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":23,"character":2}],"type":{"type":"literal","value":"tauri://close-requested"}},{"id":7,"name":"WINDOW_CREATED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":24,"character":2}],"type":{"type":"literal","value":"tauri://window-created"}},{"id":8,"name":"WINDOW_DESTROYED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":25,"character":2}],"type":{"type":"literal","value":"tauri://destroyed"}},{"id":13,"name":"WINDOW_FILE_DROP","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":30,"character":2}],"type":{"type":"literal","value":"tauri://file-drop"}},{"id":15,"name":"WINDOW_FILE_DROP_CANCELLED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":32,"character":2}],"type":{"type":"literal","value":"tauri://file-drop-cancelled"}},{"id":14,"name":"WINDOW_FILE_DROP_HOVER","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":31,"character":2}],"type":{"type":"literal","value":"tauri://file-drop-hover"}},{"id":9,"name":"WINDOW_FOCUS","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":26,"character":2}],"type":{"type":"literal","value":"tauri://focus"}},{"id":5,"name":"WINDOW_MOVED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":22,"character":2}],"type":{"type":"literal","value":"tauri://move"}},{"id":4,"name":"WINDOW_RESIZED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":21,"character":2}],"type":{"type":"literal","value":"tauri://resize"}},{"id":11,"name":"WINDOW_SCALE_FACTOR_CHANGED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":28,"character":2}],"type":{"type":"literal","value":"tauri://scale-change"}},{"id":12,"name":"WINDOW_THEME_CHANGED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":29,"character":2}],"type":{"type":"literal","value":"tauri://theme-changed"}}],"groups":[{"title":"Enumeration Members","children":[16,10,6,7,8,13,15,14,9,5,4,11,12]}],"sources":[{"fileName":"event.ts","line":20,"character":12}]},{"id":182,"name":"Event","kind":256,"kindString":"Interface","flags":{},"children":[{"id":183,"name":"event","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name"}]},"sources":[{"fileName":"helpers/event.ts","line":10,"character":2}],"type":{"type":"reference","id":2,"name":"EventName"}},{"id":185,"name":"id","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Event identifier used to unlisten"}]},"sources":[{"fileName":"helpers/event.ts","line":14,"character":2}],"type":{"type":"intrinsic","name":"number"}},{"id":186,"name":"payload","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Event payload"}]},"sources":[{"fileName":"helpers/event.ts","line":16,"character":2}],"type":{"type":"reference","id":187,"name":"T"}},{"id":184,"name":"windowLabel","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The label of the window that emitted this event."}]},"sources":[{"fileName":"helpers/event.ts","line":12,"character":2}],"type":{"type":"intrinsic","name":"string"}}],"groups":[{"title":"Properties","children":[183,185,186,184]}],"sources":[{"fileName":"helpers/event.ts","line":8,"character":17}],"typeParameters":[{"id":187,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}]},{"id":188,"name":"EventCallback","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"helpers/event.ts","line":19,"character":12}],"typeParameters":[{"id":192,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"type":{"type":"reflection","declaration":{"id":189,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"helpers/event.ts","line":19,"character":31}],"signatures":[{"id":190,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":191,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":182,"typeArguments":[{"type":"reference","id":192,"name":"T"}],"name":"Event"}}],"type":{"type":"intrinsic","name":"void"}}]}}},{"id":2,"name":"EventName","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"event.ts","line":15,"character":12}],"type":{"type":"union","types":[{"type":"template-literal","head":"","tail":[[{"type":"reference","id":3,"name":"TauriEvent"},""]]},{"type":"intersection","types":[{"type":"intrinsic","name":"string"},{"type":"reference","typeArguments":[{"type":"intrinsic","name":"never"},{"type":"intrinsic","name":"never"}],"name":"Record","qualifiedName":"Record","package":"typescript"}]}]}},{"id":193,"name":"UnlistenFn","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"helpers/event.ts","line":21,"character":12}],"type":{"type":"reflection","declaration":{"id":194,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"helpers/event.ts","line":21,"character":25}],"signatures":[{"id":195,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"intrinsic","name":"void"}}]}}},{"id":27,"name":"emit","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"event.ts","line":107,"character":15}],"signatures":[{"id":28,"name":"emit","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Emits an event to the backend."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { emit } from '@tauri-apps/api/event';\nawait emit('frontend-loaded', { loggedIn: true, token: 'authToken' });\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":29,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"intrinsic","name":"string"}},{"id":30,"name":"payload","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"unknown"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":17,"name":"listen","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"event.ts","line":57,"character":15}],"signatures":[{"id":18,"name":"listen","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to an event from the backend."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { listen } from '@tauri-apps/api/event';\nconst unlisten = await listen('error', (event) => {\n console.log(`Got error in window ${event.windowLabel}, payload: ${event.payload}`);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"typeParameter":[{"id":19,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":20,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"reference","id":2,"name":"EventName"}},{"id":21,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event handler callback."}]},"type":{"type":"reference","id":188,"typeArguments":[{"type":"reference","id":19,"name":"T"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":193,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":22,"name":"once","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"event.ts","line":88,"character":15}],"signatures":[{"id":23,"name":"once","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to an one-off event from the backend."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { once } from '@tauri-apps/api/event';\ninterface LoadedPayload {\n loggedIn: boolean,\n token: string\n}\nconst unlisten = await once('loaded', (event) => {\n console.log(`App is loaded, loggedIn: ${event.payload.loggedIn}, token: ${event.payload.token}`);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"typeParameter":[{"id":24,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":25,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"reference","id":2,"name":"EventName"}},{"id":26,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":188,"typeArguments":[{"type":"reference","id":24,"name":"T"}],"name":"EventCallback"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":193,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Enumerations","children":[3]},{"title":"Interfaces","children":[182]},{"title":"Type Aliases","children":[188,2,193]},{"title":"Functions","children":[27,17,22]}],"sources":[{"fileName":"event.ts","line":12,"character":0}]},{"id":31,"name":"mocks","kind":2,"kindString":"Module","flags":{},"children":[{"id":43,"name":"clearMocks","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"mocks.ts","line":186,"character":16}],"signatures":[{"id":44,"name":"clearMocks","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Clears mocked functions/data injected by the other functions in this module.\nWhen using a test runner that doesn't provide a fresh window object for each test, calling this function will reset tauri specific properties.\n\n# Example\n\n"},{"kind":"code","text":"```js\nimport { mockWindows, clearMocks } from \"@tauri-apps/api/mocks\"\n\nafterEach(() => {\n clearMocks()\n})\n\ntest(\"mocked windows\", () => {\n mockWindows(\"main\", \"second\", \"third\");\n\n expect(window).toHaveProperty(\"__TAURI_METADATA__\")\n})\n\ntest(\"no mocked windows\", () => {\n expect(window).not.toHaveProperty(\"__TAURI_METADATA__\")\n})\n```"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"intrinsic","name":"void"}}]},{"id":32,"name":"mockIPC","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"mocks.ts","line":80,"character":16}],"signatures":[{"id":33,"name":"mockIPC","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Intercepts all IPC requests with the given mock handler.\n\nThis function can be used when testing tauri frontend applications or when running the frontend in a Node.js context during static site generation.\n\n# Examples\n\nTesting setup using vitest:\n"},{"kind":"code","text":"```js\nimport { mockIPC, clearMocks } from \"@tauri-apps/api/mocks\"\nimport { invoke } from \"@tauri-apps/api/tauri\"\n\nafterEach(() => {\n clearMocks()\n})\n\ntest(\"mocked command\", () => {\n mockIPC((cmd, args) => {\n switch (cmd) {\n case \"add\":\n return (args.a as number) + (args.b as number);\n default:\n break;\n }\n });\n\n expect(invoke('add', { a: 12, b: 15 })).resolves.toBe(27);\n})\n```"},{"kind":"text","text":"\n\nThe callback function can also return a Promise:\n"},{"kind":"code","text":"```js\nimport { mockIPC, clearMocks } from \"@tauri-apps/api/mocks\"\nimport { invoke } from \"@tauri-apps/api/tauri\"\n\nafterEach(() => {\n clearMocks()\n})\n\ntest(\"mocked command\", () => {\n mockIPC((cmd, args) => {\n if(cmd === \"get_data\") {\n return fetch(\"https://example.com/data.json\")\n .then((response) => response.json())\n }\n });\n\n expect(invoke('get_data')).resolves.toBe({ foo: 'bar' });\n})\n```"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":34,"name":"cb","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":35,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"mocks.ts","line":81,"character":6}],"signatures":[{"id":36,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":37,"name":"cmd","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":38,"name":"args","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"},{"type":"intrinsic","name":"unknown"}],"name":"Record","qualifiedName":"Record","package":"typescript"}}],"type":{"type":"intrinsic","name":"any"}}]}}}],"type":{"type":"intrinsic","name":"void"}}]},{"id":39,"name":"mockWindows","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"mocks.ts","line":150,"character":16}],"signatures":[{"id":40,"name":"mockWindows","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Mocks one or many window labels.\nIn non-tauri context it is required to call this function *before* using the "},{"kind":"code","text":"`@tauri-apps/api/window`"},{"kind":"text","text":" module.\n\nThis function only mocks the *presence* of windows,\nwindow properties (e.g. width and height) can be mocked like regular IPC calls using the "},{"kind":"code","text":"`mockIPC`"},{"kind":"text","text":" function.\n\n# Examples\n\n"},{"kind":"code","text":"```js\nimport { mockWindows } from \"@tauri-apps/api/mocks\";\nimport { getCurrent } from \"@tauri-apps/api/window\";\n\nmockWindows(\"main\", \"second\", \"third\");\n\nconst win = getCurrent();\n\nwin.label // \"main\"\n```"},{"kind":"text","text":"\n\n"},{"kind":"code","text":"```js\nimport { mockWindows } from \"@tauri-apps/api/mocks\";\n\nmockWindows(\"main\", \"second\", \"third\");\n\nmockIPC((cmd, args) => {\n if (cmd === \"tauri\") {\n if (\n args?.__tauriModule === \"Window\" &&\n args?.message?.cmd === \"manage\" &&\n args?.message?.data?.cmd?.type === \"close\"\n ) {\n console.log('closing window!');\n }\n }\n});\n\nconst { getCurrent } = await import(\"@tauri-apps/api/window\");\n\nconst win = getCurrent();\nawait win.close(); // this will cause the mocked IPC handler to log to the console.\n```"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":41,"name":"current","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Label of window this JavaScript context is running in."}]},"type":{"type":"intrinsic","name":"string"}},{"id":42,"name":"additionalWindows","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"comment":{"summary":[{"kind":"text","text":"Label of additional windows the app has."}]},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}}],"type":{"type":"intrinsic","name":"void"}}]}],"groups":[{"title":"Functions","children":[43,32,39]}],"sources":[{"fileName":"mocks.ts","line":6,"character":0}]},{"id":45,"name":"path","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"The path module provides utilities for working with file and directory paths.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.path`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":".\n\nThe APIs must be added to ["},{"kind":"code","text":"`tauri.allowlist.path`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#allowlistconfig.path) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":":\n"},{"kind":"code","text":"```json\n{\n \"tauri\": {\n \"allowlist\": {\n \"path\": {\n \"all\": true, // enable all Path APIs\n }\n }\n }\n}\n```"},{"kind":"text","text":"\nIt is recommended to allowlist only the APIs you use for optimal bundle size and security."}]},"children":[{"id":46,"name":"BaseDirectory","kind":8,"kindString":"Enumeration","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"children":[{"id":62,"name":"AppCache","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":48,"character":2}],"type":{"type":"literal","value":16}},{"id":59,"name":"AppConfig","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":45,"character":2}],"type":{"type":"literal","value":13}},{"id":60,"name":"AppData","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":46,"character":2}],"type":{"type":"literal","value":14}},{"id":61,"name":"AppLocalData","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":47,"character":2}],"type":{"type":"literal","value":15}},{"id":63,"name":"AppLog","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":49,"character":2}],"type":{"type":"literal","value":17}},{"id":47,"name":"Audio","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":33,"character":2}],"type":{"type":"literal","value":1}},{"id":48,"name":"Cache","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":34,"character":2}],"type":{"type":"literal","value":2}},{"id":49,"name":"Config","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":35,"character":2}],"type":{"type":"literal","value":3}},{"id":50,"name":"Data","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":36,"character":2}],"type":{"type":"literal","value":4}},{"id":64,"name":"Desktop","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":51,"character":2}],"type":{"type":"literal","value":18}},{"id":52,"name":"Document","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":38,"character":2}],"type":{"type":"literal","value":6}},{"id":53,"name":"Download","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":39,"character":2}],"type":{"type":"literal","value":7}},{"id":65,"name":"Executable","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":52,"character":2}],"type":{"type":"literal","value":19}},{"id":66,"name":"Font","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":53,"character":2}],"type":{"type":"literal","value":20}},{"id":67,"name":"Home","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":54,"character":2}],"type":{"type":"literal","value":21}},{"id":51,"name":"LocalData","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":37,"character":2}],"type":{"type":"literal","value":5}},{"id":54,"name":"Picture","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":40,"character":2}],"type":{"type":"literal","value":8}},{"id":55,"name":"Public","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":41,"character":2}],"type":{"type":"literal","value":9}},{"id":57,"name":"Resource","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":43,"character":2}],"type":{"type":"literal","value":11}},{"id":68,"name":"Runtime","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":55,"character":2}],"type":{"type":"literal","value":22}},{"id":58,"name":"Temp","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":44,"character":2}],"type":{"type":"literal","value":12}},{"id":69,"name":"Template","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":56,"character":2}],"type":{"type":"literal","value":23}},{"id":56,"name":"Video","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"path.ts","line":42,"character":2}],"type":{"type":"literal","value":10}}],"groups":[{"title":"Enumeration Members","children":[62,59,60,61,63,47,48,49,50,64,52,53,65,66,67,51,54,55,57,68,58,69,56]}],"sources":[{"fileName":"path.ts","line":32,"character":5}]},{"id":118,"name":"delimiter","kind":32,"kindString":"Variable","flags":{"isConst":true},"comment":{"summary":[{"kind":"text","text":"Provides the platform-specific path segment delimiter:\n- "},{"kind":"code","text":"`;`"},{"kind":"text","text":" on Windows\n- "},{"kind":"code","text":"`:`"},{"kind":"text","text":" on POSIX"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"sources":[{"fileName":"path.ts","line":555,"character":6}],"type":{"type":"union","types":[{"type":"literal","value":";"},{"type":"literal","value":":"}]},"defaultValue":"..."},{"id":117,"name":"sep","kind":32,"kindString":"Variable","flags":{"isConst":true},"comment":{"summary":[{"kind":"text","text":"Provides the platform-specific path segment separator:\n- "},{"kind":"code","text":"`\\` on Windows\n- `"},{"kind":"text","text":"/` on POSIX"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"sources":[{"fileName":"path.ts","line":546,"character":6}],"type":{"type":"union","types":[{"type":"literal","value":"\\"},{"type":"literal","value":"/"}]},"defaultValue":"..."},{"id":76,"name":"appCacheDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":121,"character":15}],"signatures":[{"id":77,"name":"appCacheDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the suggested directory for your app's cache files.\nResolves to "},{"kind":"code","text":"`${cacheDir}/${bundleIdentifier}`"},{"kind":"text","text":", where "},{"kind":"code","text":"`bundleIdentifier`"},{"kind":"text","text":" is the value ["},{"kind":"code","text":"`tauri.bundle.identifier`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#bundleconfig.identifier) is configured in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appCacheDir } from '@tauri-apps/api/path';\nconst appCacheDirPath = await appCacheDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.2.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":70,"name":"appConfigDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":70,"character":15}],"signatures":[{"id":71,"name":"appConfigDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the suggested directory for your app's config files.\nResolves to "},{"kind":"code","text":"`${configDir}/${bundleIdentifier}`"},{"kind":"text","text":", where "},{"kind":"code","text":"`bundleIdentifier`"},{"kind":"text","text":" is the value ["},{"kind":"code","text":"`tauri.bundle.identifier`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#bundleconfig.identifier) is configured in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appConfigDir } from '@tauri-apps/api/path';\nconst appConfigDirPath = await appConfigDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.2.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":72,"name":"appDataDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":87,"character":15}],"signatures":[{"id":73,"name":"appDataDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the suggested directory for your app's data files.\nResolves to "},{"kind":"code","text":"`${dataDir}/${bundleIdentifier}`"},{"kind":"text","text":", where "},{"kind":"code","text":"`bundleIdentifier`"},{"kind":"text","text":" is the value ["},{"kind":"code","text":"`tauri.bundle.identifier`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#bundleconfig.identifier) is configured in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appDataDir } from '@tauri-apps/api/path';\nconst appDataDirPath = await appDataDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.2.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":74,"name":"appLocalDataDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":104,"character":15}],"signatures":[{"id":75,"name":"appLocalDataDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the suggested directory for your app's local data files.\nResolves to "},{"kind":"code","text":"`${localDataDir}/${bundleIdentifier}`"},{"kind":"text","text":", where "},{"kind":"code","text":"`bundleIdentifier`"},{"kind":"text","text":" is the value ["},{"kind":"code","text":"`tauri.bundle.identifier`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#bundleconfig.identifier) is configured in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appLocalDataDir } from '@tauri-apps/api/path';\nconst appLocalDataDirPath = await appLocalDataDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.2.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":78,"name":"appLogDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":533,"character":15}],"signatures":[{"id":79,"name":"appLogDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the suggested directory for your app's log files.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`${configDir}/${bundleIdentifier}/logs`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`${homeDir}/Library/Logs/{bundleIdentifier}`"},{"kind":"text","text":"\n- **Windows:** Resolves to "},{"kind":"code","text":"`${configDir}/${bundleIdentifier}/logs`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appLogDir } from '@tauri-apps/api/path';\nconst appLogDirPath = await appLogDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.2.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":80,"name":"audioDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":143,"character":15}],"signatures":[{"id":81,"name":"audioDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's audio directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_MUSIC_DIR`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Music`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Music}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { audioDir } from '@tauri-apps/api/path';\nconst audioDirPath = await audioDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":134,"name":"basename","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":647,"character":15}],"signatures":[{"id":135,"name":"basename","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the last portion of a "},{"kind":"code","text":"`path`"},{"kind":"text","text":". Trailing directory separators are ignored."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { basename, resolveResource } from '@tauri-apps/api/path';\nconst resourcePath = await resolveResource('app.conf');\nconst base = await basename(resourcePath);\nassert(base === 'app.conf');\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":136,"name":"path","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":137,"name":"ext","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"An optional file extension to be removed from the returned path."}]},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":82,"name":"cacheDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":165,"character":15}],"signatures":[{"id":83,"name":"cacheDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's cache directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_CACHE_HOME`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$HOME/.cache`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Library/Caches`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_LocalAppData}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { cacheDir } from '@tauri-apps/api/path';\nconst cacheDirPath = await cacheDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":84,"name":"configDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":187,"character":15}],"signatures":[{"id":85,"name":"configDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's config directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_CONFIG_HOME`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$HOME/.config`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Library/Application Support`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_RoamingAppData}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { configDir } from '@tauri-apps/api/path';\nconst configDirPath = await configDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":86,"name":"dataDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":209,"character":15}],"signatures":[{"id":87,"name":"dataDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's data directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_DATA_HOME`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$HOME/.local/share`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Library/Application Support`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_RoamingAppData}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { dataDir } from '@tauri-apps/api/path';\nconst dataDirPath = await dataDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":88,"name":"desktopDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":231,"character":15}],"signatures":[{"id":89,"name":"desktopDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's desktop directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_DESKTOP_DIR`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Desktop`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Desktop}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { desktopDir } from '@tauri-apps/api/path';\nconst desktopPath = await desktopDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":128,"name":"dirname","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":613,"character":15}],"signatures":[{"id":129,"name":"dirname","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the directory name of a "},{"kind":"code","text":"`path`"},{"kind":"text","text":". Trailing directory separators are ignored."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { dirname, appDataDir } from '@tauri-apps/api/path';\nconst appDataDirPath = await appDataDir();\nconst dir = await dirname(appDataDirPath);\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":130,"name":"path","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":90,"name":"documentDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":253,"character":15}],"signatures":[{"id":91,"name":"documentDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's document directory."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { documentDir } from '@tauri-apps/api/path';\nconst documentDirPath = await documentDir();\n```"},{"kind":"text","text":"\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_DOCUMENTS_DIR`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Documents`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Documents}`"},{"kind":"text","text":"."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":92,"name":"downloadDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":275,"character":15}],"signatures":[{"id":93,"name":"downloadDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's download directory.\n\n#### Platform-specific\n\n- **Linux**: Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_DOWNLOAD_DIR`"},{"kind":"text","text":".\n- **macOS**: Resolves to "},{"kind":"code","text":"`$HOME/Downloads`"},{"kind":"text","text":".\n- **Windows**: Resolves to "},{"kind":"code","text":"`{FOLDERID_Downloads}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { downloadDir } from '@tauri-apps/api/path';\nconst downloadDirPath = await downloadDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":94,"name":"executableDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":297,"character":15}],"signatures":[{"id":95,"name":"executableDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's executable directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_BIN_HOME/../bin`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$XDG_DATA_HOME/../bin`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$HOME/.local/bin`"},{"kind":"text","text":".\n- **macOS:** Not supported.\n- **Windows:** Not supported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { executableDir } from '@tauri-apps/api/path';\nconst executableDirPath = await executableDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":131,"name":"extname","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":629,"character":15}],"signatures":[{"id":132,"name":"extname","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the extension of the "},{"kind":"code","text":"`path`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { extname, resolveResource } from '@tauri-apps/api/path';\nconst resourcePath = await resolveResource('app.conf');\nconst ext = await extname(resourcePath);\nassert(ext === 'conf');\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":133,"name":"path","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":96,"name":"fontDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":319,"character":15}],"signatures":[{"id":97,"name":"fontDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's font directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_DATA_HOME/fonts`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$HOME/.local/share/fonts`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Library/Fonts`"},{"kind":"text","text":".\n- **Windows:** Not supported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { fontDir } from '@tauri-apps/api/path';\nconst fontDirPath = await fontDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":98,"name":"homeDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":341,"character":15}],"signatures":[{"id":99,"name":"homeDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's home directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$HOME`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Profile}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { homeDir } from '@tauri-apps/api/path';\nconst homeDirPath = await homeDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":138,"name":"isAbsolute","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":661,"character":15}],"signatures":[{"id":139,"name":"isAbsolute","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns whether the path is absolute or not."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { isAbsolute } from '@tauri-apps/api/path';\nassert(await isAbsolute('/home/tauri'));\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":140,"name":"path","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"boolean"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":125,"name":"join","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":598,"character":15}],"signatures":[{"id":126,"name":"join","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Joins all given "},{"kind":"code","text":"`path`"},{"kind":"text","text":" segments together using the platform-specific separator as a delimiter, then normalizes the resulting path."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { join, appDataDir } from '@tauri-apps/api/path';\nconst appDataDirPath = await appDataDir();\nconst path = await join(appDataDirPath, 'users', 'tauri', 'avatar.png');\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":127,"name":"paths","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":100,"name":"localDataDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":363,"character":15}],"signatures":[{"id":101,"name":"localDataDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's local data directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_DATA_HOME`"},{"kind":"text","text":" or "},{"kind":"code","text":"`$HOME/.local/share`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Library/Application Support`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_LocalAppData}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { localDataDir } from '@tauri-apps/api/path';\nconst localDataDirPath = await localDataDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":122,"name":"normalize","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":583,"character":15}],"signatures":[{"id":123,"name":"normalize","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Normalizes the given "},{"kind":"code","text":"`path`"},{"kind":"text","text":", resolving "},{"kind":"code","text":"`'..'`"},{"kind":"text","text":" and "},{"kind":"code","text":"`'.'`"},{"kind":"text","text":" segments and resolve symbolic links."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { normalize, appDataDir } from '@tauri-apps/api/path';\nconst appDataDirPath = await appDataDir();\nconst path = await normalize(appDataDirPath, '..', 'users', 'tauri', 'avatar.png');\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":124,"name":"path","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":102,"name":"pictureDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":385,"character":15}],"signatures":[{"id":103,"name":"pictureDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's picture directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_PICTURES_DIR`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Pictures`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Pictures}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { pictureDir } from '@tauri-apps/api/path';\nconst pictureDirPath = await pictureDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":104,"name":"publicDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":407,"character":15}],"signatures":[{"id":105,"name":"publicDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's public directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_PUBLICSHARE_DIR`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Public`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Public}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { publicDir } from '@tauri-apps/api/path';\nconst publicDirPath = await publicDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":119,"name":"resolve","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":568,"character":15}],"signatures":[{"id":120,"name":"resolve","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Resolves a sequence of "},{"kind":"code","text":"`paths`"},{"kind":"text","text":" or "},{"kind":"code","text":"`path`"},{"kind":"text","text":" segments into an absolute path."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { resolve, appDataDir } from '@tauri-apps/api/path';\nconst appDataDirPath = await appDataDir();\nconst path = await resolve(appDataDirPath, '..', 'users', 'tauri', 'avatar.png');\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":121,"name":"paths","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":108,"name":"resolveResource","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":444,"character":15}],"signatures":[{"id":109,"name":"resolveResource","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Resolve the path to a resource file."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { resolveResource } from '@tauri-apps/api/path';\nconst resourcePath = await resolveResource('script.sh');\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"The full path to the resource."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":110,"name":"resourcePath","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The path to the resource.\nMust follow the same syntax as defined in "},{"kind":"code","text":"`tauri.conf.json > tauri > bundle > resources`"},{"kind":"text","text":", i.e. keeping subfolders and parent dir components ("},{"kind":"code","text":"`../`"},{"kind":"text","text":")."}]},"type":{"type":"intrinsic","name":"string"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":106,"name":"resourceDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":424,"character":15}],"signatures":[{"id":107,"name":"resourceDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the application's resource directory.\nTo resolve a resource path, see the [[resolveResource | "},{"kind":"code","text":"`resolveResource API`"},{"kind":"text","text":"]]."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { resourceDir } from '@tauri-apps/api/path';\nconst resourceDirPath = await resourceDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":111,"name":"runtimeDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":467,"character":15}],"signatures":[{"id":112,"name":"runtimeDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's runtime directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to "},{"kind":"code","text":"`$XDG_RUNTIME_DIR`"},{"kind":"text","text":".\n- **macOS:** Not supported.\n- **Windows:** Not supported."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { runtimeDir } from '@tauri-apps/api/path';\nconst runtimeDirPath = await runtimeDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":113,"name":"templateDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":489,"character":15}],"signatures":[{"id":114,"name":"templateDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's template directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_TEMPLATES_DIR`"},{"kind":"text","text":".\n- **macOS:** Not supported.\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Templates}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { templateDir } from '@tauri-apps/api/path';\nconst templateDirPath = await templateDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":115,"name":"videoDir","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"path.ts","line":511,"character":15}],"signatures":[{"id":116,"name":"videoDir","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Returns the path to the user's video directory.\n\n#### Platform-specific\n\n- **Linux:** Resolves to ["},{"kind":"code","text":"`xdg-user-dirs`"},{"kind":"text","text":"](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' "},{"kind":"code","text":"`XDG_VIDEOS_DIR`"},{"kind":"text","text":".\n- **macOS:** Resolves to "},{"kind":"code","text":"`$HOME/Movies`"},{"kind":"text","text":".\n- **Windows:** Resolves to "},{"kind":"code","text":"`{FOLDERID_Videos}`"},{"kind":"text","text":"."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { videoDir } from '@tauri-apps/api/path';\nconst videoDirPath = await videoDir();\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Enumerations","children":[46]},{"title":"Variables","children":[118,117]},{"title":"Functions","children":[76,70,72,74,78,80,134,82,84,86,88,128,90,92,94,131,96,98,138,125,100,122,102,104,119,108,106,111,113,115]}],"sources":[{"fileName":"path.ts","line":26,"character":0}]},{"id":141,"name":"tauri","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"Invoke your custom commands.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.tauri`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":"."}]},"children":[{"id":150,"name":"Channel","kind":128,"kindString":"Class","flags":{},"children":[{"id":151,"name":"constructor","kind":512,"kindString":"Constructor","flags":{},"sources":[{"fileName":"tauri.ts","line":66,"character":2}],"signatures":[{"id":152,"name":"new Channel","kind":16384,"kindString":"Constructor signature","flags":{},"typeParameter":[{"id":153,"name":"T","kind":131072,"kindString":"Type parameter","flags":{},"default":{"type":"intrinsic","name":"unknown"}}],"type":{"type":"reference","id":150,"typeArguments":[{"type":"reference","id":153,"name":"T"}],"name":"Channel"}}]},{"id":156,"name":"#onmessage","kind":1024,"kindString":"Property","flags":{"isPrivate":true},"sources":[{"fileName":"tauri.ts","line":62,"character":2}],"type":{"type":"reflection","declaration":{"id":157,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"tauri.ts","line":62,"character":14}],"signatures":[{"id":158,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":159,"name":"response","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":153,"name":"T"}}],"type":{"type":"intrinsic","name":"void"}}]}},"defaultValue":"..."},{"id":155,"name":"__TAURI_CHANNEL_MARKER__","kind":1024,"kindString":"Property","flags":{"isPrivate":true,"isReadonly":true},"sources":[{"fileName":"tauri.ts","line":61,"character":19}],"type":{"type":"literal","value":true},"defaultValue":"true"},{"id":154,"name":"id","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"tauri.ts","line":59,"character":2}],"type":{"type":"intrinsic","name":"number"}},{"id":160,"name":"onmessage","kind":262144,"kindString":"Accessor","flags":{},"sources":[{"fileName":"tauri.ts","line":72,"character":6},{"fileName":"tauri.ts","line":76,"character":6}],"getSignature":{"id":161,"name":"onmessage","kind":524288,"kindString":"Get signature","flags":{},"type":{"type":"reflection","declaration":{"id":162,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"tauri.ts","line":76,"character":19}],"signatures":[{"id":163,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":164,"name":"response","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":153,"name":"T"}}],"type":{"type":"intrinsic","name":"void"}}]}}},"setSignature":{"id":165,"name":"onmessage","kind":1048576,"kindString":"Set signature","flags":{},"parameters":[{"id":166,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":167,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"tauri.ts","line":72,"character":25}],"signatures":[{"id":168,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":169,"name":"response","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":153,"name":"T"}}],"type":{"type":"intrinsic","name":"void"}}]}}}],"type":{"type":"intrinsic","name":"void"}}},{"id":170,"name":"toJSON","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"tauri.ts","line":80,"character":2}],"signatures":[{"id":171,"name":"toJSON","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"intrinsic","name":"string"}}]}],"groups":[{"title":"Constructors","children":[151]},{"title":"Properties","children":[156,155,154]},{"title":"Accessors","children":[160]},{"title":"Methods","children":[170]}],"sources":[{"fileName":"tauri.ts","line":58,"character":6}],"typeParameters":[{"id":172,"name":"T","kind":131072,"kindString":"Type parameter","flags":{},"default":{"type":"intrinsic","name":"unknown"}}]},{"id":142,"name":"InvokeArgs","kind":4194304,"kindString":"Type alias","flags":{},"comment":{"summary":[{"kind":"text","text":"Command arguments."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"sources":[{"fileName":"tauri.ts","line":90,"character":5}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"},{"type":"intrinsic","name":"unknown"}],"name":"Record","qualifiedName":"Record","package":"typescript"}},{"id":178,"name":"convertFileSrc","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"tauri.ts","line":156,"character":9}],"signatures":[{"id":179,"name":"convertFileSrc","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Convert a device file path to an URL that can be loaded by the webview.\nNote that "},{"kind":"code","text":"`asset:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`https://asset.localhost`"},{"kind":"text","text":" must be added to ["},{"kind":"code","text":"`tauri.security.csp`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#securityconfig.csp) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":".\nExample CSP value: "},{"kind":"code","text":"`\"csp\": \"default-src 'self'; img-src 'self' asset: https://asset.localhost\"`"},{"kind":"text","text":" to use the asset protocol on image sources.\n\nAdditionally, "},{"kind":"code","text":"`asset`"},{"kind":"text","text":" must be added to ["},{"kind":"code","text":"`tauri.allowlist.protocol`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#allowlistconfig.protocol)\nin "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" and its access scope must be defined on the "},{"kind":"code","text":"`assetScope`"},{"kind":"text","text":" array on the same "},{"kind":"code","text":"`protocol`"},{"kind":"text","text":" object."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appDataDir, join } from '@tauri-apps/api/path';\nimport { convertFileSrc } from '@tauri-apps/api/tauri';\nconst appDataDirPath = await appDataDir();\nconst filePath = await join(appDataDirPath, 'assets/video.mp4');\nconst assetUrl = convertFileSrc(filePath);\n\nconst video = document.getElementById('my-video');\nconst source = document.createElement('source');\nsource.type = 'video/mp4';\nsource.src = assetUrl;\nvideo.appendChild(source);\nvideo.load();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"the URL that can be used as source on the webview."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":180,"name":"filePath","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The file path."}]},"type":{"type":"intrinsic","name":"string"}},{"id":181,"name":"protocol","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The protocol to use. Defaults to "},{"kind":"code","text":"`asset`"},{"kind":"text","text":". You only need to set this when using a custom protocol."}]},"type":{"type":"intrinsic","name":"string"},"defaultValue":"'asset'"}],"type":{"type":"intrinsic","name":"string"}}]},{"id":173,"name":"invoke","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"tauri.ts","line":106,"character":15}],"signatures":[{"id":174,"name":"invoke","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sends a message to the backend."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { invoke } from '@tauri-apps/api/tauri';\nawait invoke('login', { user: 'tauri', password: 'poiwe3h4r5ip3yrhtew9ty' });\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving or rejecting to the backend response."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"typeParameter":[{"id":175,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":176,"name":"cmd","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The command name."}]},"type":{"type":"intrinsic","name":"string"}},{"id":177,"name":"args","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The optional arguments to pass to the command."}]},"type":{"type":"reference","id":142,"name":"InvokeArgs"},"defaultValue":"{}"}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":175,"name":"T"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":143,"name":"transformCallback","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"tauri.ts","line":36,"character":9}],"signatures":[{"id":144,"name":"transformCallback","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Transforms a callback function to a string identifier that can be passed to the backend.\nThe backend uses the identifier to "},{"kind":"code","text":"`eval()`"},{"kind":"text","text":" the callback."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"A unique identifier associated with the callback function."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":145,"name":"callback","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reflection","declaration":{"id":146,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"tauri.ts","line":37,"character":13}],"signatures":[{"id":147,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":148,"name":"response","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"intrinsic","name":"void"}}]}}},{"id":149,"name":"once","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"boolean"},"defaultValue":"false"}],"type":{"type":"intrinsic","name":"number"}}]}],"groups":[{"title":"Classes","children":[150]},{"title":"Type Aliases","children":[142]},{"title":"Functions","children":[178,173,143]}],"sources":[{"fileName":"tauri.ts","line":13,"character":0}]}],"groups":[{"title":"Modules","children":[1,31,45,141]}]} \ No newline at end of file diff --git a/tooling/api/src/helpers/event.ts b/tooling/api/src/helpers/event.ts index 0ab79d481b8..39d3f66d2cf 100644 --- a/tooling/api/src/helpers/event.ts +++ b/tooling/api/src/helpers/event.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -import { type WindowLabel } from '../window' import { invoke, transformCallback } from '../tauri' import { type EventName } from '../event' @@ -46,7 +45,7 @@ async function _unlisten(event: string, eventId: number): Promise { */ async function emit( event: string, - windowLabel?: WindowLabel, + windowLabel?: string, payload?: unknown ): Promise { await invoke('plugin:event|emit', { diff --git a/tooling/api/src/helpers/tauri.ts b/tooling/api/src/helpers/tauri.ts deleted file mode 100644 index 2f5e5fc55b9..00000000000 --- a/tooling/api/src/helpers/tauri.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - -/** @ignore */ - -import { invoke } from '../tauri' - -type TauriModule = - | 'App' - | 'Fs' - | 'Path' - | 'Os' - | 'Window' - | 'Shell' - | 'Event' - | 'Internal' - | 'Dialog' - | 'Cli' - | 'Notification' - | 'Http' - | 'GlobalShortcut' - | 'Process' - | 'Clipboard' - -interface TauriCommand { - __tauriModule: TauriModule - [key: string]: unknown -} - -async function invokeTauriCommand(command: TauriCommand): Promise { - return invoke('tauri', command) -} - -export type { TauriModule, TauriCommand } - -export { invokeTauriCommand } diff --git a/tooling/api/src/index.ts b/tooling/api/src/index.ts index 92d0c220eac..113ee68089e 100644 --- a/tooling/api/src/index.ts +++ b/tooling/api/src/index.ts @@ -16,9 +16,8 @@ import * as event from './event' import * as path from './path' import * as tauri from './tauri' -import * as window from './window' /** @ignore */ const invoke = tauri.invoke -export { invoke, event, path, tauri, window } +export { invoke, event, path, tauri } diff --git a/tooling/api/src/mocks.ts b/tooling/api/src/mocks.ts index 1a21e18f76d..56b9ac81ce3 100644 --- a/tooling/api/src/mocks.ts +++ b/tooling/api/src/mocks.ts @@ -2,6 +2,21 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT +/** @ignore */ +declare global { + interface Window { + __TAURI_METADATA__: { + __windows: WindowDef[] + __currentWindow: WindowDef + } + } +} + +/** @ignore */ +interface WindowDef { + label: string +} + interface IPCMessage { cmd: string callback: number diff --git a/tooling/api/src/window.ts b/tooling/api/src/window.ts deleted file mode 100644 index 11cea97d206..00000000000 --- a/tooling/api/src/window.ts +++ /dev/null @@ -1,2327 +0,0 @@ -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - -/** - * Provides APIs to create windows, communicate with other windows and manipulate the current window. - * - * This package is also accessible with `window.__TAURI__.window` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`. - * - * The APIs must be added to [`tauri.allowlist.window`](https://tauri.app/v1/api/config/#allowlistconfig.window) in `tauri.conf.json`: - * ```json - * { - * "tauri": { - * "allowlist": { - * "window": { - * "all": true, // enable all window APIs - * "create": true, // enable window creation - * "center": true, - * "requestUserAttention": true, - * "setResizable": true, - * "setTitle": true, - * "maximize": true, - * "unmaximize": true, - * "minimize": true, - * "unminimize": true, - * "show": true, - * "hide": true, - * "close": true, - * "setDecorations": true, - * "setShadow": true, - * "setAlwaysOnTop": true, - * "setContentProtected": true, - * "setSize": true, - * "setMinSize": true, - * "setMaxSize": true, - * "setPosition": true, - * "setFullscreen": true, - * "setFocus": true, - * "setIcon": true, - * "setSkipTaskbar": true, - * "setCursorGrab": true, - * "setCursorVisible": true, - * "setCursorIcon": true, - * "setCursorPosition": true, - * "setIgnoreCursorEvents": true, - * "startDragging": true, - * "print": true - * } - * } - * } - * } - * ``` - * It is recommended to allowlist only the APIs you use for optimal bundle size and security. - * - * ## Window events - * - * Events can be listened to using `appWindow.listen`: - * ```typescript - * import { appWindow } from "@tauri-apps/api/window"; - * appWindow.listen("my-window-event", ({ event, payload }) => { }); - * ``` - * - * @module - */ - -import { invokeTauriCommand } from './helpers/tauri' -import type { EventName, EventCallback, UnlistenFn } from './event' -import { emit, type Event, listen, once } from './helpers/event' -import { TauriEvent } from './event' - -type Theme = 'light' | 'dark' -type TitleBarStyle = 'visible' | 'transparent' | 'overlay' - -/** - * Allows you to retrieve information about a given monitor. - * - * @since 1.0.0 - */ -interface Monitor { - /** Human-readable name of the monitor */ - name: string | null - /** The monitor's resolution. */ - size: PhysicalSize - /** the Top-left corner position of the monitor relative to the larger full screen area. */ - position: PhysicalPosition - /** The scale factor that can be used to map physical pixels to logical pixels. */ - scaleFactor: number -} - -/** - * The payload for the `scaleChange` event. - * - * @since 1.0.2 - */ -interface ScaleFactorChanged { - /** The new window scale factor. */ - scaleFactor: number - /** The new window size */ - size: PhysicalSize -} - -/** The file drop event types. */ -type FileDropEvent = - | { type: 'hover'; paths: string[] } - | { type: 'drop'; paths: string[] } - | { type: 'cancel' } - -/** - * A size represented in logical pixels. - * - * @since 1.0.0 - */ -class LogicalSize { - type = 'Logical' - width: number - height: number - - constructor(width: number, height: number) { - this.width = width - this.height = height - } -} - -/** - * A size represented in physical pixels. - * - * @since 1.0.0 - */ -class PhysicalSize { - type = 'Physical' - width: number - height: number - - constructor(width: number, height: number) { - this.width = width - this.height = height - } - - /** - * Converts the physical size to a logical one. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * const factor = await appWindow.scaleFactor(); - * const size = await appWindow.innerSize(); - * const logical = size.toLogical(factor); - * ``` - * */ - toLogical(scaleFactor: number): LogicalSize { - return new LogicalSize(this.width / scaleFactor, this.height / scaleFactor) - } -} - -/** - * A position represented in logical pixels. - * - * @since 1.0.0 - */ -class LogicalPosition { - type = 'Logical' - x: number - y: number - - constructor(x: number, y: number) { - this.x = x - this.y = y - } -} - -/** - * A position represented in physical pixels. - * - * @since 1.0.0 - */ -class PhysicalPosition { - type = 'Physical' - x: number - y: number - - constructor(x: number, y: number) { - this.x = x - this.y = y - } - - /** - * Converts the physical position to a logical one. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * const factor = await appWindow.scaleFactor(); - * const position = await appWindow.innerPosition(); - * const logical = position.toLogical(factor); - * ``` - * */ - toLogical(scaleFactor: number): LogicalPosition { - return new LogicalPosition(this.x / scaleFactor, this.y / scaleFactor) - } -} - -/** @ignore */ -interface WindowDef { - label: string -} - -/** @ignore */ -declare global { - interface Window { - __TAURI_METADATA__: { - __windows: WindowDef[] - __currentWindow: WindowDef - } - } -} - -/** - * Attention type to request on a window. - * - * @since 1.0.0 - */ -enum UserAttentionType { - /** - * #### Platform-specific - * - **macOS:** Bounces the dock icon until the application is in focus. - * - **Windows:** Flashes both the window and the taskbar button until the application is in focus. - */ - Critical = 1, - /** - * #### Platform-specific - * - **macOS:** Bounces the dock icon once. - * - **Windows:** Flashes the taskbar button until the application is in focus. - */ - Informational -} - -export type CursorIcon = - | 'default' - | 'crosshair' - | 'hand' - | 'arrow' - | 'move' - | 'text' - | 'wait' - | 'help' - | 'progress' - // something cannot be done - | 'notAllowed' - | 'contextMenu' - | 'cell' - | 'verticalText' - | 'alias' - | 'copy' - | 'noDrop' - // something can be grabbed - | 'grab' - /// something is grabbed - | 'grabbing' - | 'allScroll' - | 'zoomIn' - | 'zoomOut' - // edge is to be moved - | 'eResize' - | 'nResize' - | 'neResize' - | 'nwResize' - | 'sResize' - | 'seResize' - | 'swResize' - | 'wResize' - | 'ewResize' - | 'nsResize' - | 'neswResize' - | 'nwseResize' - | 'colResize' - | 'rowResize' - -/** - * Get an instance of `WebviewWindow` for the current webview window. - * - * @since 1.0.0 - */ -function getCurrent(): WebviewWindow { - return new WebviewWindow(window.__TAURI_METADATA__.__currentWindow.label, { - // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor - skip: true - }) -} - -/** - * Gets a list of instances of `WebviewWindow` for all available webview windows. - * - * @since 1.0.0 - */ -function getAll(): WebviewWindow[] { - return window.__TAURI_METADATA__.__windows.map( - (w) => - new WebviewWindow(w.label, { - // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor - skip: true - }) - ) -} - -/** @ignore */ -// events that are emitted right here instead of by the created webview -const localTauriEvents = ['tauri://created', 'tauri://error'] -/** @ignore */ -export type WindowLabel = string -/** - * A webview window handle allows emitting and listening to events from the backend that are tied to the window. - * - * @ignore - * @since 1.0.0 - */ -class WebviewWindowHandle { - /** The window label. It is a unique identifier for the window, can be used to reference it later. */ - label: WindowLabel - /** Local event listeners. */ - listeners: Record>> - - constructor(label: WindowLabel) { - this.label = label - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment - this.listeners = Object.create(null) - } - - /** - * Listen to an event emitted by the backend that is tied to the webview window. - * - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * const unlisten = await appWindow.listen('state-changed', (event) => { - * console.log(`Got error: ${payload}`); - * }); - * - * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted - * unlisten(); - * ``` - * - * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. - * @param handler Event handler. - * @returns A promise resolving to a function to unlisten to the event. - * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted. - */ - async listen( - event: EventName, - handler: EventCallback - ): Promise { - if (this._handleTauriEvent(event, handler)) { - return Promise.resolve(() => { - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, security/detect-object-injection - const listeners = this.listeners[event] - listeners.splice(listeners.indexOf(handler), 1) - }) - } - return listen(event, this.label, handler) - } - - /** - * Listen to an one-off event emitted by the backend that is tied to the webview window. - * - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * const unlisten = await appWindow.once('initialized', (event) => { - * console.log(`Window initialized!`); - * }); - * - * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted - * unlisten(); - * ``` - * - * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. - * @param handler Event handler. - * @returns A promise resolving to a function to unlisten to the event. - * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted. - */ - async once(event: string, handler: EventCallback): Promise { - if (this._handleTauriEvent(event, handler)) { - return Promise.resolve(() => { - // eslint-disable-next-line security/detect-object-injection - const listeners = this.listeners[event] - listeners.splice(listeners.indexOf(handler), 1) - }) - } - return once(event, this.label, handler) - } - - /** - * Emits an event to the backend, tied to the webview window. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.emit('window-loaded', { loggedIn: true, token: 'authToken' }); - * ``` - * - * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. - * @param payload Event payload. - */ - async emit(event: string, payload?: unknown): Promise { - if (localTauriEvents.includes(event)) { - // eslint-disable-next-line - for (const handler of this.listeners[event] || []) { - handler({ event, id: -1, windowLabel: this.label, payload }) - } - return Promise.resolve() - } - return emit(event, this.label, payload) - } - - /** @ignore */ - _handleTauriEvent(event: string, handler: EventCallback): boolean { - if (localTauriEvents.includes(event)) { - if (!(event in this.listeners)) { - // eslint-disable-next-line - this.listeners[event] = [handler] - } else { - // eslint-disable-next-line - this.listeners[event].push(handler) - } - return true - } - return false - } -} - -/** - * Manage the current window object. - * - * @ignore - * @since 1.0.0 - */ -class WindowManager extends WebviewWindowHandle { - // Getters - /** - * The scale factor that can be used to map physical pixels to logical pixels. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * const factor = await appWindow.scaleFactor(); - * ``` - * - * @returns The window's monitor scale factor. - * */ - async scaleFactor(): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'scaleFactor' - } - } - } - }) - } - - /** - * The position of the top-left hand corner of the window's client area relative to the top-left hand corner of the desktop. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * const position = await appWindow.innerPosition(); - * ``` - * - * @returns The window's inner position. - * */ - async innerPosition(): Promise { - return invokeTauriCommand<{ x: number; y: number }>({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'innerPosition' - } - } - } - }).then(({ x, y }) => new PhysicalPosition(x, y)) - } - - /** - * The position of the top-left hand corner of the window relative to the top-left hand corner of the desktop. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * const position = await appWindow.outerPosition(); - * ``` - * - * @returns The window's outer position. - * */ - async outerPosition(): Promise { - return invokeTauriCommand<{ x: number; y: number }>({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'outerPosition' - } - } - } - }).then(({ x, y }) => new PhysicalPosition(x, y)) - } - - /** - * The physical size of the window's client area. - * The client area is the content of the window, excluding the title bar and borders. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * const size = await appWindow.innerSize(); - * ``` - * - * @returns The window's inner size. - */ - async innerSize(): Promise { - return invokeTauriCommand<{ width: number; height: number }>({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'innerSize' - } - } - } - }).then(({ width, height }) => new PhysicalSize(width, height)) - } - - /** - * The physical size of the entire window. - * These dimensions include the title bar and borders. If you don't want that (and you usually don't), use inner_size instead. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * const size = await appWindow.outerSize(); - * ``` - * - * @returns The window's outer size. - */ - async outerSize(): Promise { - return invokeTauriCommand<{ width: number; height: number }>({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'outerSize' - } - } - } - }).then(({ width, height }) => new PhysicalSize(width, height)) - } - - /** - * Gets the window's current fullscreen state. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * const fullscreen = await appWindow.isFullscreen(); - * ``` - * - * @returns Whether the window is in fullscreen mode or not. - * */ - async isFullscreen(): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'isFullscreen' - } - } - } - }) - } - - /** - * Gets the window's current minimized state. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * const minimized = await appWindow.isMinimized(); - * ``` - * - * @since 1.3.0 - * */ - async isMinimized(): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'isMinimized' - } - } - } - }) - } - - /** - * Gets the window's current maximized state. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * const maximized = await appWindow.isMaximized(); - * ``` - * - * @returns Whether the window is maximized or not. - * */ - async isMaximized(): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'isMaximized' - } - } - } - }) - } - - /** - * Gets the window's current decorated state. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * const decorated = await appWindow.isDecorated(); - * ``` - * - * @returns Whether the window is decorated or not. - * */ - async isDecorated(): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'isDecorated' - } - } - } - }) - } - - /** - * Gets the window's current resizable state. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * const resizable = await appWindow.isResizable(); - * ``` - * - * @returns Whether the window is resizable or not. - * */ - async isResizable(): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'isResizable' - } - } - } - }) - } - - /** - * Gets the window's current visible state. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * const visible = await appWindow.isVisible(); - * ``` - * - * @returns Whether the window is visible or not. - * */ - async isVisible(): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'isVisible' - } - } - } - }) - } - - /** - * Gets the window's current title. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * const title = await appWindow.title(); - * ``` - * - * @since 1.3.0 - * */ - async title(): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'title' - } - } - } - }) - } - - /** - * Gets the window's current theme. - * - * #### Platform-specific - * - * - **macOS:** Theme was introduced on macOS 10.14. Returns `light` on macOS 10.13 and below. - * - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * const theme = await appWindow.theme(); - * ``` - * - * @returns The window theme. - * */ - async theme(): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'theme' - } - } - } - }) - } - - // Setters - - /** - * Centers the window. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.center(); - * ``` - * - * @param resizable - * @returns A promise indicating the success or failure of the operation. - */ - async center(): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'center' - } - } - } - }) - } - - /** - * Requests user attention to the window, this has no effect if the application - * is already focused. How requesting for user attention manifests is platform dependent, - * see `UserAttentionType` for details. - * - * Providing `null` will unset the request for user attention. Unsetting the request for - * user attention might not be done automatically by the WM when the window receives input. - * - * #### Platform-specific - * - * - **macOS:** `null` has no effect. - * - **Linux:** Urgency levels have the same effect. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.requestUserAttention(); - * ``` - * - * @param resizable - * @returns A promise indicating the success or failure of the operation. - */ - async requestUserAttention( - requestType: UserAttentionType | null - ): Promise { - let requestType_ = null - if (requestType) { - if (requestType === UserAttentionType.Critical) { - requestType_ = { type: 'Critical' } - } else { - requestType_ = { type: 'Informational' } - } - } - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'requestUserAttention', - payload: requestType_ - } - } - } - }) - } - - /** - * Updates the window resizable flag. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.setResizable(false); - * ``` - * - * @param resizable - * @returns A promise indicating the success or failure of the operation. - */ - async setResizable(resizable: boolean): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'setResizable', - payload: resizable - } - } - } - }) - } - - /** - * Sets the window title. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.setTitle('Tauri'); - * ``` - * - * @param title The new title - * @returns A promise indicating the success or failure of the operation. - */ - async setTitle(title: string): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'setTitle', - payload: title - } - } - } - }) - } - - /** - * Maximizes the window. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.maximize(); - * ``` - * - * @returns A promise indicating the success or failure of the operation. - */ - async maximize(): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'maximize' - } - } - } - }) - } - - /** - * Unmaximizes the window. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.unmaximize(); - * ``` - * - * @returns A promise indicating the success or failure of the operation. - */ - async unmaximize(): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'unmaximize' - } - } - } - }) - } - - /** - * Toggles the window maximized state. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.toggleMaximize(); - * ``` - * - * @returns A promise indicating the success or failure of the operation. - */ - async toggleMaximize(): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'toggleMaximize' - } - } - } - }) - } - - /** - * Minimizes the window. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.minimize(); - * ``` - * - * @returns A promise indicating the success or failure of the operation. - */ - async minimize(): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'minimize' - } - } - } - }) - } - - /** - * Unminimizes the window. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.unminimize(); - * ``` - * - * @returns A promise indicating the success or failure of the operation. - */ - async unminimize(): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'unminimize' - } - } - } - }) - } - - /** - * Sets the window visibility to true. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.show(); - * ``` - * - * @returns A promise indicating the success or failure of the operation. - */ - async show(): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'show' - } - } - } - }) - } - - /** - * Sets the window visibility to false. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.hide(); - * ``` - * - * @returns A promise indicating the success or failure of the operation. - */ - async hide(): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'hide' - } - } - } - }) - } - - /** - * Closes the window. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.close(); - * ``` - * - * @returns A promise indicating the success or failure of the operation. - */ - async close(): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'close' - } - } - } - }) - } - - /** - * Whether the window should have borders and bars. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.setDecorations(false); - * ``` - * - * @param decorations Whether the window should have borders and bars. - * @returns A promise indicating the success or failure of the operation. - */ - async setDecorations(decorations: boolean): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'setDecorations', - payload: decorations - } - } - } - }) - } - - /** - * Whether or not the window should have shadow. - * - * #### Platform-specific - * - * - **Windows:** - * - `false` has no effect on decorated window, shadows are always ON. - * - `true` will make ndecorated window have a 1px white border, - * and on Windows 11, it will have a rounded corners. - * - **Linux:** Unsupported. - * - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.setShadow(false); - * ``` - * - * @returns A promise indicating the success or failure of the operation. - * - * @since 2.0 - */ - async setShadow(enable: boolean): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'setShadow', - payload: enable - } - } - } - }) - } - - /** - * Whether the window should always be on top of other windows. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.setAlwaysOnTop(true); - * ``` - * - * @param alwaysOnTop Whether the window should always be on top of other windows or not. - * @returns A promise indicating the success or failure of the operation. - */ - async setAlwaysOnTop(alwaysOnTop: boolean): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'setAlwaysOnTop', - payload: alwaysOnTop - } - } - } - }) - } - - /** - * Prevents the window contents from being captured by other apps. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.setContentProtected(true); - * ``` - * - * @returns A promise indicating the success or failure of the operation. - * - * @since 1.2.0 - */ - async setContentProtected(protected_: boolean): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'setContentProtected', - payload: protected_ - } - } - } - }) - } - - /** - * Resizes the window with a new inner size. - * @example - * ```typescript - * import { appWindow, LogicalSize } from '@tauri-apps/api/window'; - * await appWindow.setSize(new LogicalSize(600, 500)); - * ``` - * - * @param size The logical or physical inner size. - * @returns A promise indicating the success or failure of the operation. - */ - async setSize(size: LogicalSize | PhysicalSize): Promise { - if (!size || (size.type !== 'Logical' && size.type !== 'Physical')) { - throw new Error( - 'the `size` argument must be either a LogicalSize or a PhysicalSize instance' - ) - } - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'setSize', - payload: { - type: size.type, - data: { - width: size.width, - height: size.height - } - } - } - } - } - }) - } - - /** - * Sets the window minimum inner size. If the `size` argument is not provided, the constraint is unset. - * @example - * ```typescript - * import { appWindow, PhysicalSize } from '@tauri-apps/api/window'; - * await appWindow.setMinSize(new PhysicalSize(600, 500)); - * ``` - * - * @param size The logical or physical inner size, or `null` to unset the constraint. - * @returns A promise indicating the success or failure of the operation. - */ - async setMinSize( - size: LogicalSize | PhysicalSize | null | undefined - ): Promise { - if (size && size.type !== 'Logical' && size.type !== 'Physical') { - throw new Error( - 'the `size` argument must be either a LogicalSize or a PhysicalSize instance' - ) - } - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'setMinSize', - payload: size - ? { - type: size.type, - data: { - width: size.width, - height: size.height - } - } - : null - } - } - } - }) - } - - /** - * Sets the window maximum inner size. If the `size` argument is undefined, the constraint is unset. - * @example - * ```typescript - * import { appWindow, LogicalSize } from '@tauri-apps/api/window'; - * await appWindow.setMaxSize(new LogicalSize(600, 500)); - * ``` - * - * @param size The logical or physical inner size, or `null` to unset the constraint. - * @returns A promise indicating the success or failure of the operation. - */ - async setMaxSize( - size: LogicalSize | PhysicalSize | null | undefined - ): Promise { - if (size && size.type !== 'Logical' && size.type !== 'Physical') { - throw new Error( - 'the `size` argument must be either a LogicalSize or a PhysicalSize instance' - ) - } - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'setMaxSize', - payload: size - ? { - type: size.type, - data: { - width: size.width, - height: size.height - } - } - : null - } - } - } - }) - } - - /** - * Sets the window outer position. - * @example - * ```typescript - * import { appWindow, LogicalPosition } from '@tauri-apps/api/window'; - * await appWindow.setPosition(new LogicalPosition(600, 500)); - * ``` - * - * @param position The new position, in logical or physical pixels. - * @returns A promise indicating the success or failure of the operation. - */ - async setPosition( - position: LogicalPosition | PhysicalPosition - ): Promise { - if ( - !position || - (position.type !== 'Logical' && position.type !== 'Physical') - ) { - throw new Error( - 'the `position` argument must be either a LogicalPosition or a PhysicalPosition instance' - ) - } - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'setPosition', - payload: { - type: position.type, - data: { - x: position.x, - y: position.y - } - } - } - } - } - }) - } - - /** - * Sets the window fullscreen state. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.setFullscreen(true); - * ``` - * - * @param fullscreen Whether the window should go to fullscreen or not. - * @returns A promise indicating the success or failure of the operation. - */ - async setFullscreen(fullscreen: boolean): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'setFullscreen', - payload: fullscreen - } - } - } - }) - } - - /** - * Bring the window to front and focus. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.setFocus(); - * ``` - * - * @returns A promise indicating the success or failure of the operation. - */ - async setFocus(): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'setFocus' - } - } - } - }) - } - - /** - * Sets the window icon. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.setIcon('/tauri/awesome.png'); - * ``` - * - * Note that you need the `icon-ico` or `icon-png` Cargo features to use this API. - * To enable it, change your Cargo.toml file: - * ```toml - * [dependencies] - * tauri = { version = "...", features = ["...", "icon-png"] } - * ``` - * - * @param icon Icon bytes or path to the icon file. - * @returns A promise indicating the success or failure of the operation. - */ - async setIcon(icon: string | Uint8Array): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'setIcon', - payload: { - // correctly serialize Uint8Arrays - icon: typeof icon === 'string' ? icon : Array.from(icon) - } - } - } - } - }) - } - - /** - * Whether the window icon should be hidden from the taskbar or not. - * - * #### Platform-specific - * - * - **macOS:** Unsupported. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.setSkipTaskbar(true); - * ``` - * - * @param skip true to hide window icon, false to show it. - * @returns A promise indicating the success or failure of the operation. - */ - async setSkipTaskbar(skip: boolean): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'setSkipTaskbar', - payload: skip - } - } - } - }) - } - - /** - * Grabs the cursor, preventing it from leaving the window. - * - * There's no guarantee that the cursor will be hidden. You should - * hide it by yourself if you want so. - * - * #### Platform-specific - * - * - **Linux:** Unsupported. - * - **macOS:** This locks the cursor in a fixed location, which looks visually awkward. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.setCursorGrab(true); - * ``` - * - * @param grab `true` to grab the cursor icon, `false` to release it. - * @returns A promise indicating the success or failure of the operation. - */ - async setCursorGrab(grab: boolean): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'setCursorGrab', - payload: grab - } - } - } - }) - } - - /** - * Modifies the cursor's visibility. - * - * #### Platform-specific - * - * - **Windows:** The cursor is only hidden within the confines of the window. - * - **macOS:** The cursor is hidden as long as the window has input focus, even if the cursor is - * outside of the window. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.setCursorVisible(false); - * ``` - * - * @param visible If `false`, this will hide the cursor. If `true`, this will show the cursor. - * @returns A promise indicating the success or failure of the operation. - */ - async setCursorVisible(visible: boolean): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'setCursorVisible', - payload: visible - } - } - } - }) - } - - /** - * Modifies the cursor icon of the window. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.setCursorIcon('help'); - * ``` - * - * @param icon The new cursor icon. - * @returns A promise indicating the success or failure of the operation. - */ - async setCursorIcon(icon: CursorIcon): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'setCursorIcon', - payload: icon - } - } - } - }) - } - - /** - * Changes the position of the cursor in window coordinates. - * @example - * ```typescript - * import { appWindow, LogicalPosition } from '@tauri-apps/api/window'; - * await appWindow.setCursorPosition(new LogicalPosition(600, 300)); - * ``` - * - * @param position The new cursor position. - * @returns A promise indicating the success or failure of the operation. - */ - async setCursorPosition( - position: LogicalPosition | PhysicalPosition - ): Promise { - if ( - !position || - (position.type !== 'Logical' && position.type !== 'Physical') - ) { - throw new Error( - 'the `position` argument must be either a LogicalPosition or a PhysicalPosition instance' - ) - } - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'setCursorPosition', - payload: { - type: position.type, - data: { - x: position.x, - y: position.y - } - } - } - } - } - }) - } - - /** - * Changes the cursor events behavior. - * - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.setIgnoreCursorEvents(true); - * ``` - * - * @param ignore `true` to ignore the cursor events; `false` to process them as usual. - * @returns A promise indicating the success or failure of the operation. - */ - async setIgnoreCursorEvents(ignore: boolean): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'setIgnoreCursorEvents', - payload: ignore - } - } - } - }) - } - - /** - * Starts dragging the window. - * @example - * ```typescript - * import { appWindow } from '@tauri-apps/api/window'; - * await appWindow.startDragging(); - * ``` - * - * @return A promise indicating the success or failure of the operation. - */ - async startDragging(): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - label: this.label, - cmd: { - type: 'startDragging' - } - } - } - }) - } - - // Listeners - - /** - * Listen to window resize. - * - * @example - * ```typescript - * import { appWindow } from "@tauri-apps/api/window"; - * const unlisten = await appWindow.onResized(({ payload: size }) => { - * console.log('Window resized', size); - * }); - * - * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted - * unlisten(); - * ``` - * - * @returns A promise resolving to a function to unlisten to the event. - * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted. - * - * @since 1.0.2 - */ - async onResized(handler: EventCallback): Promise { - return this.listen(TauriEvent.WINDOW_RESIZED, (e) => { - e.payload = mapPhysicalSize(e.payload) - handler(e) - }) - } - - /** - * Listen to window move. - * - * @example - * ```typescript - * import { appWindow } from "@tauri-apps/api/window"; - * const unlisten = await appWindow.onMoved(({ payload: position }) => { - * console.log('Window moved', position); - * }); - * - * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted - * unlisten(); - * ``` - * - * @returns A promise resolving to a function to unlisten to the event. - * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted. - * - * @since 1.0.2 - */ - async onMoved(handler: EventCallback): Promise { - return this.listen(TauriEvent.WINDOW_MOVED, (e) => { - e.payload = mapPhysicalPosition(e.payload) - handler(e) - }) - } - - /** - * Listen to window close requested. Emitted when the user requests to closes the window. - * - * @example - * ```typescript - * import { appWindow } from "@tauri-apps/api/window"; - * import { confirm } from '@tauri-apps/api/dialog'; - * const unlisten = await appWindow.onCloseRequested(async (event) => { - * const confirmed = await confirm('Are you sure?'); - * if (!confirmed) { - * // user did not confirm closing the window; let's prevent it - * event.preventDefault(); - * } - * }); - * - * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted - * unlisten(); - * ``` - * - * @returns A promise resolving to a function to unlisten to the event. - * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted. - * - * @since 1.0.2 - */ - /* eslint-disable @typescript-eslint/promise-function-async */ - async onCloseRequested( - handler: (event: CloseRequestedEvent) => void | Promise - ): Promise { - return this.listen(TauriEvent.WINDOW_CLOSE_REQUESTED, (event) => { - const evt = new CloseRequestedEvent(event) - void Promise.resolve(handler(evt)).then(() => { - if (!evt.isPreventDefault()) { - return this.close() - } - }) - }) - } - /* eslint-enable */ - - /** - * Listen to window focus change. - * - * @example - * ```typescript - * import { appWindow } from "@tauri-apps/api/window"; - * const unlisten = await appWindow.onFocusChanged(({ payload: focused }) => { - * console.log('Focus changed, window is focused? ' + focused); - * }); - * - * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted - * unlisten(); - * ``` - * - * @returns A promise resolving to a function to unlisten to the event. - * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted. - * - * @since 1.0.2 - */ - async onFocusChanged(handler: EventCallback): Promise { - const unlistenFocus = await this.listen( - TauriEvent.WINDOW_FOCUS, - (event) => { - handler({ ...event, payload: true }) - } - ) - const unlistenBlur = await this.listen( - TauriEvent.WINDOW_BLUR, - (event) => { - handler({ ...event, payload: false }) - } - ) - return () => { - unlistenFocus() - unlistenBlur() - } - } - - /** - * Listen to window scale change. Emitted when the window's scale factor has changed. - * The following user actions can cause DPI changes: - * - Changing the display's resolution. - * - Changing the display's scale factor (e.g. in Control Panel on Windows). - * - Moving the window to a display with a different scale factor. - * - * @example - * ```typescript - * import { appWindow } from "@tauri-apps/api/window"; - * const unlisten = await appWindow.onScaleChanged(({ payload }) => { - * console.log('Scale changed', payload.scaleFactor, payload.size); - * }); - * - * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted - * unlisten(); - * ``` - * - * @returns A promise resolving to a function to unlisten to the event. - * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted. - * - * @since 1.0.2 - */ - async onScaleChanged( - handler: EventCallback - ): Promise { - return this.listen( - TauriEvent.WINDOW_SCALE_FACTOR_CHANGED, - handler - ) - } - - /** - * Listen to the window menu item click. The payload is the item id. - * - * @example - * ```typescript - * import { appWindow } from "@tauri-apps/api/window"; - * const unlisten = await appWindow.onMenuClicked(({ payload: menuId }) => { - * console.log('Menu clicked: ' + menuId); - * }); - * - * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted - * unlisten(); - * ``` - * - * @returns A promise resolving to a function to unlisten to the event. - * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted. - * - * @since 1.0.2 - */ - async onMenuClicked(handler: EventCallback): Promise { - return this.listen(TauriEvent.MENU, handler) - } - - /** - * Listen to a file drop event. - * The listener is triggered when the user hovers the selected files on the window, - * drops the files or cancels the operation. - * - * @example - * ```typescript - * import { appWindow } from "@tauri-apps/api/window"; - * const unlisten = await appWindow.onFileDropEvent((event) => { - * if (event.payload.type === 'hover') { - * console.log('User hovering', event.payload.paths); - * } else if (event.payload.type === 'drop') { - * console.log('User dropped', event.payload.paths); - * } else { - * console.log('File drop cancelled'); - * } - * }); - * - * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted - * unlisten(); - * ``` - * - * @returns A promise resolving to a function to unlisten to the event. - * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted. - * - * @since 1.0.2 - */ - async onFileDropEvent( - handler: EventCallback - ): Promise { - const unlistenFileDrop = await this.listen( - TauriEvent.WINDOW_FILE_DROP, - (event) => { - handler({ ...event, payload: { type: 'drop', paths: event.payload } }) - } - ) - - const unlistenFileHover = await this.listen( - TauriEvent.WINDOW_FILE_DROP_HOVER, - (event) => { - handler({ ...event, payload: { type: 'hover', paths: event.payload } }) - } - ) - - const unlistenCancel = await this.listen( - TauriEvent.WINDOW_FILE_DROP_CANCELLED, - (event) => { - handler({ ...event, payload: { type: 'cancel' } }) - } - ) - - return () => { - unlistenFileDrop() - unlistenFileHover() - unlistenCancel() - } - } - - /** - * Listen to the system theme change. - * - * @example - * ```typescript - * import { appWindow } from "@tauri-apps/api/window"; - * const unlisten = await appWindow.onThemeChanged(({ payload: theme }) => { - * console.log('New theme: ' + theme); - * }); - * - * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted - * unlisten(); - * ``` - * - * @returns A promise resolving to a function to unlisten to the event. - * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted. - * - * @since 1.0.2 - */ - async onThemeChanged(handler: EventCallback): Promise { - return this.listen(TauriEvent.WINDOW_THEME_CHANGED, handler) - } -} - -/** - * @since 1.0.2 - */ -class CloseRequestedEvent { - /** Event name */ - event: EventName - /** The label of the window that emitted this event. */ - windowLabel: string - /** Event identifier used to unlisten */ - id: number - private _preventDefault = false - - constructor(event: Event) { - this.event = event.event - this.windowLabel = event.windowLabel - this.id = event.id - } - - preventDefault(): void { - this._preventDefault = true - } - - isPreventDefault(): boolean { - return this._preventDefault - } -} - -/** - * Create new webview windows and get a handle to existing ones. - * - * Windows are identified by a *label* a unique identifier that can be used to reference it later. - * It may only contain alphanumeric characters `a-zA-Z` plus the following special characters `-`, `/`, `:` and `_`. - * - * @example - * ```typescript - * // loading embedded asset: - * const webview = new WebviewWindow('theUniqueLabel', { - * url: 'path/to/page.html' - * }); - * // alternatively, load a remote URL: - * const webview = new WebviewWindow('theUniqueLabel', { - * url: 'https://github.com/tauri-apps/tauri' - * }); - * - * webview.once('tauri://created', function () { - * // webview window successfully created - * }); - * webview.once('tauri://error', function (e) { - * // an error happened creating the webview window - * }); - * - * // emit an event to the backend - * await webview.emit("some event", "data"); - * // listen to an event from the backend - * const unlisten = await webview.listen("event name", e => {}); - * unlisten(); - * ``` - * - * @since 1.0.2 - */ -class WebviewWindow extends WindowManager { - /** - * Creates a new WebviewWindow. - * @example - * ```typescript - * import { WebviewWindow } from '@tauri-apps/api/window'; - * const webview = new WebviewWindow('my-label', { - * url: 'https://github.com/tauri-apps/tauri' - * }); - * webview.once('tauri://created', function () { - * // webview window successfully created - * }); - * webview.once('tauri://error', function (e) { - * // an error happened creating the webview window - * }); - * ``` - * - * * @param label The unique webview window label. Must be alphanumeric: `a-zA-Z-/:_`. - * @returns The WebviewWindow instance to communicate with the webview. - */ - constructor(label: WindowLabel, options: WindowOptions = {}) { - super(label) - // @ts-expect-error `skip` is not a public API so it is not defined in WindowOptions - if (!options?.skip) { - invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'createWebview', - data: { - options: { - label, - ...options - } - } - } - }) - .then(async () => this.emit('tauri://created')) - .catch(async (e: string) => this.emit('tauri://error', e)) - } - } - - /** - * Gets the WebviewWindow for the webview associated with the given label. - * @example - * ```typescript - * import { WebviewWindow } from '@tauri-apps/api/window'; - * const mainWindow = WebviewWindow.getByLabel('main'); - * ``` - * - * @param label The webview window label. - * @returns The WebviewWindow instance to communicate with the webview or null if the webview doesn't exist. - */ - static getByLabel(label: string): WebviewWindow | null { - if (getAll().some((w) => w.label === label)) { - // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor - return new WebviewWindow(label, { skip: true }) - } - return null - } -} - -/** The WebviewWindow for the current window. */ -let appWindow: WebviewWindow -if ('__TAURI_METADATA__' in window) { - appWindow = new WebviewWindow( - window.__TAURI_METADATA__.__currentWindow.label, - { - // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor - skip: true - } - ) -} else { - console.warn( - `Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label.\nNote that this is not an issue if running this frontend on a browser instead of a Tauri window.` - ) - appWindow = new WebviewWindow('main', { - // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor - skip: true - }) -} - -/** - * Configuration for the window to create. - * - * @since 1.0.0 - */ -interface WindowOptions { - /** - * Remote URL or local file path to open. - * - * - URL such as `https://github.com/tauri-apps` is opened directly on a Tauri window. - * - data: URL such as `data:text/html,...` is only supported with the `window-data-url` Cargo feature for the `tauri` dependency. - * - local file path or route such as `/path/to/page.html` or `/users` is appended to the application URL (the devServer URL on development, or `tauri://localhost/` and `https://tauri.localhost/` on production). - */ - url?: string - /** Show window in the center of the screen.. */ - center?: boolean - /** The initial vertical position. Only applies if `y` is also set. */ - x?: number - /** The initial horizontal position. Only applies if `x` is also set. */ - y?: number - /** The initial width. */ - width?: number - /** The initial height. */ - height?: number - /** The minimum width. Only applies if `minHeight` is also set. */ - minWidth?: number - /** The minimum height. Only applies if `minWidth` is also set. */ - minHeight?: number - /** The maximum width. Only applies if `maxHeight` is also set. */ - maxWidth?: number - /** The maximum height. Only applies if `maxWidth` is also set. */ - maxHeight?: number - /** Whether the window is resizable or not. */ - resizable?: boolean - /** Window title. */ - title?: string - /** Whether the window is in fullscreen mode or not. */ - fullscreen?: boolean - /** Whether the window will be initially focused or not. */ - focus?: boolean - /** - * Whether the window is transparent or not. - * Note that on `macOS` this requires the `macos-private-api` feature flag, enabled under `tauri.conf.json > tauri > macOSPrivateApi`. - * WARNING: Using private APIs on `macOS` prevents your application from being accepted to the `App Store`. - */ - transparent?: boolean - /** Whether the window should be maximized upon creation or not. */ - maximized?: boolean - /** Whether the window should be immediately visible upon creation or not. */ - visible?: boolean - /** Whether the window should have borders and bars or not. */ - decorations?: boolean - /** Whether the window should always be on top of other windows or not. */ - alwaysOnTop?: boolean - /** Prevents the window contents from being captured by other apps. */ - contentProtected?: boolean - /** Whether or not the window icon should be added to the taskbar. */ - skipTaskbar?: boolean - /** - * Whether or not the window has shadow. - * - * #### Platform-specific - * - * - **Windows:** - * - `false` has no effect on decorated window, shadows are always ON. - * - `true` will make ndecorated window have a 1px white border, - * and on Windows 11, it will have a rounded corners. - * - **Linux:** Unsupported. - * - * @since 2.0 - */ - shadow?: boolean - /** - * Whether the file drop is enabled or not on the webview. By default it is enabled. - * - * Disabling it is required to use drag and drop on the frontend on Windows. - */ - fileDropEnabled?: boolean - /** - * The initial window theme. Defaults to the system theme. - * - * Only implemented on Windows and macOS 10.14+. - */ - theme?: Theme - /** - * The style of the macOS title bar. - */ - titleBarStyle?: TitleBarStyle - /** - * If `true`, sets the window title to be hidden on macOS. - */ - hiddenTitle?: boolean - /** - * Whether clicking an inactive window also clicks through to the webview on macOS. - */ - acceptFirstMouse?: boolean - /** - * Defines the window [tabbing identifier](https://developer.apple.com/documentation/appkit/nswindow/1644704-tabbingidentifier) on macOS. - * - * Windows with the same tabbing identifier will be grouped together. - * If the tabbing identifier is not set, automatic tabbing will be disabled. - */ - tabbingIdentifier?: string - /** - * The user agent for the webview. - */ - userAgent?: string -} - -function mapMonitor(m: Monitor | null): Monitor | null { - return m === null - ? null - : { - name: m.name, - scaleFactor: m.scaleFactor, - position: mapPhysicalPosition(m.position), - size: mapPhysicalSize(m.size) - } -} - -function mapPhysicalPosition(m: PhysicalPosition): PhysicalPosition { - return new PhysicalPosition(m.x, m.y) -} - -function mapPhysicalSize(m: PhysicalSize): PhysicalSize { - return new PhysicalSize(m.width, m.height) -} - -/** - * Returns the monitor on which the window currently resides. - * Returns `null` if current monitor can't be detected. - * @example - * ```typescript - * import { currentMonitor } from '@tauri-apps/api/window'; - * const monitor = currentMonitor(); - * ``` - * - * @since 1.0.0 - */ -async function currentMonitor(): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - cmd: { - type: 'currentMonitor' - } - } - } - }).then(mapMonitor) -} - -/** - * Returns the primary monitor of the system. - * Returns `null` if it can't identify any monitor as a primary one. - * @example - * ```typescript - * import { primaryMonitor } from '@tauri-apps/api/window'; - * const monitor = primaryMonitor(); - * ``` - * - * @since 1.0.0 - */ -async function primaryMonitor(): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - cmd: { - type: 'primaryMonitor' - } - } - } - }).then(mapMonitor) -} - -/** - * Returns the list of all the monitors available on the system. - * @example - * ```typescript - * import { availableMonitors } from '@tauri-apps/api/window'; - * const monitors = availableMonitors(); - * ``` - * - * @since 1.0.0 - */ -async function availableMonitors(): Promise { - return invokeTauriCommand({ - __tauriModule: 'Window', - message: { - cmd: 'manage', - data: { - cmd: { - type: 'availableMonitors' - } - } - } - }).then((ms) => ms.map(mapMonitor) as Monitor[]) -} - -export { - WebviewWindow, - WebviewWindowHandle, - WindowManager, - CloseRequestedEvent, - getCurrent, - getAll, - appWindow, - LogicalSize, - PhysicalSize, - LogicalPosition, - PhysicalPosition, - UserAttentionType, - currentMonitor, - primaryMonitor, - availableMonitors -} - -export type { - Theme, - TitleBarStyle, - Monitor, - ScaleFactorChanged, - FileDropEvent, - WindowOptions -} diff --git a/tooling/cli/schema.json b/tooling/cli/schema.json index 45358778519..b3b219fc71a 100644 --- a/tooling/cli/schema.json +++ b/tooling/cli/schema.json @@ -2508,11 +2508,6 @@ "items": { "type": "string" } - }, - "enableTauriAPI": { - "description": "Enables access to the Tauri API.", - "default": false, - "type": "boolean" } }, "additionalProperties": false