@tauri-apps/api
Advanced tools
| /** | ||
| * Application metadata and related APIs. | ||
| * | ||
| * @module | ||
| */ | ||
| /** | ||
| * Gets the application version. | ||
| * @example | ||
| * ```typescript | ||
| * import { getVersion } from '@tauri-apps/api/app'; | ||
| * const appVersion = await getVersion(); | ||
| * ``` | ||
| * | ||
| * @since 1.0.0 | ||
| */ | ||
| declare function getVersion(): Promise<string>; | ||
| /** | ||
| * Gets the application name. | ||
| * @example | ||
| * ```typescript | ||
| * import { getName } from '@tauri-apps/api/app'; | ||
| * const appName = await getName(); | ||
| * ``` | ||
| * | ||
| * @since 1.0.0 | ||
| */ | ||
| declare function getName(): Promise<string>; | ||
| /** | ||
| * Gets the Tauri version. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { getTauriVersion } from '@tauri-apps/api/app'; | ||
| * const tauriVersion = await getTauriVersion(); | ||
| * ``` | ||
| * | ||
| * @since 1.0.0 | ||
| */ | ||
| declare function getTauriVersion(): Promise<string>; | ||
| /** | ||
| * Shows the application on macOS. This function does not automatically focus any specific app window. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { show } from '@tauri-apps/api/app'; | ||
| * await show(); | ||
| * ``` | ||
| * | ||
| * @since 1.2.0 | ||
| */ | ||
| declare function show(): Promise<void>; | ||
| /** | ||
| * Hides the application on macOS. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { hide } from '@tauri-apps/api/app'; | ||
| * await hide(); | ||
| * ``` | ||
| * | ||
| * @since 1.2.0 | ||
| */ | ||
| declare function hide(): Promise<void>; | ||
| declare const app_getName: typeof getName; | ||
| declare const app_getVersion: typeof getVersion; | ||
| declare const app_getTauriVersion: typeof getTauriVersion; | ||
| declare const app_show: typeof show; | ||
| declare const app_hide: typeof hide; | ||
| declare namespace app { | ||
| export { | ||
| app_getName as getName, | ||
| app_getVersion as getVersion, | ||
| app_getTauriVersion as getTauriVersion, | ||
| app_show as show, | ||
| app_hide as hide, | ||
| }; | ||
| } | ||
| export { app as a, getVersion as b, getTauriVersion as c, getName as g, hide as h, show as s }; |
+1
| "use strict";var t=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var p=(e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})},c=(e,n,r,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of u(n))!g.call(e,s)&&s!==r&&t(e,s,{get:()=>n[s],enumerable:!(o=a(n,s))||o.enumerable});return e};var d=e=>c(t({},"__esModule",{value:!0}),e);var T={};p(T,{getName:()=>l,getTauriVersion:()=>v,getVersion:()=>_,hide:()=>h,show:()=>m});module.exports=d(T);async function i(e,n={},r){return window.__TAURI_INTERNALS__.invoke(e,n,r)}async function _(){return i("plugin:app|version")}async function l(){return i("plugin:app|name")}async function v(){return i("plugin:app|tauri_version")}async function m(){return i("plugin:app|app_show")}async function h(){return i("plugin:app|app_hide")} |
| export { g as getName, c as getTauriVersion, b as getVersion, h as hide, s as show } from './app-d81a8ac4.js'; |
+1
| export { g as getName, c as getTauriVersion, b as getVersion, h as hide, s as show } from './app-d81a8ac4.js'; |
+1
| import{a,b,c,d,e}from"./chunk-KXWJIJYO.js";import"./chunk-CTAYYLOC.js";import"./chunk-NDS2DDJC.js";export{b as getName,c as getTauriVersion,a as getVersion,e as hide,d as show}; |
| import{a as s}from"./chunk-NDS2DDJC.js";var b={};s(b,{LogicalPosition:()=>h,LogicalSize:()=>r,PhysicalPosition:()=>i,PhysicalSize:()=>u});var r=class{constructor(t,e){this.type="Logical";this.width=t,this.height=e}},u=class{constructor(t,e){this.type="Physical";this.width=t,this.height=e}toLogical(t){return new r(this.width/t,this.height/t)}},h=class{constructor(t,e){this.type="Logical";this.x=t,this.y=e}},i=class{constructor(t,e){this.type="Physical";this.x=t,this.y=e}toLogical(t){return new h(this.x/t,this.y/t)}};export{r as a,u as b,h as c,i as d,b as e}; |
| import{a as m,b as r,c as w,d as u}from"./chunk-24ATAN64.js";import{b as y,c as p,d as g}from"./chunk-AFSYT2WA.js";import{e as i}from"./chunk-CTAYYLOC.js";import{a as k}from"./chunk-NDS2DDJC.js";var T={};k(T,{CloseRequestedEvent:()=>d,Effect:()=>S,EffectState:()=>C,LogicalPosition:()=>w,LogicalSize:()=>m,PhysicalPosition:()=>u,PhysicalSize:()=>r,ProgressBarStatus:()=>_,UserAttentionType:()=>v,Window:()=>c,availableMonitors:()=>x,currentMonitor:()=>D,getAll:()=>b,getCurrent:()=>z,primaryMonitor:()=>L});var v=(n=>(n[n.Critical=1]="Critical",n[n.Informational=2]="Informational",n))(v||{}),d=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}},_=(o=>(o.None="none",o.Normal="normal",o.Indeterminate="indeterminate",o.Paused="paused",o.Error="error",o))(_||{});function z(){return new c(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}function b(){return window.__TAURI_INTERNALS__.metadata.windows.map(a=>new c(a.label,{skip:!0}))}var P=["tauri://created","tauri://error"],c=class a{constructor(e,n={}){this.label=e,this.listeners=Object.create(null),n?.skip||i("plugin:window|create",{options:{...n,label:e}}).then(async()=>this.emit("tauri://created")).catch(async t=>this.emit("tauri://error",t))}static getByLabel(e){return b().some(n=>n.label===e)?new a(e,{skip:!0}):null}static getCurrent(){return z()}static getAll(){return b()}static async getFocusedWindow(){for(let e of b())if(await e.isFocused())return e;return null}async listen(e,n){return this._handleTauriEvent(e,n)?Promise.resolve(()=>{let t=this.listeners[e];t.splice(t.indexOf(n),1)}):y(e,n,{target:this.label})}async once(e,n){return this._handleTauriEvent(e,n)?Promise.resolve(()=>{let t=this.listeners[e];t.splice(t.indexOf(n),1)}):p(e,n,{target:this.label})}async emit(e,n){if(P.includes(e)){for(let t of this.listeners[e]||[])t({event:e,id:-1,windowLabel:this.label,payload:n});return Promise.resolve()}return g(e,n,{target:this.label})}_handleTauriEvent(e,n){return P.includes(e)?(e in this.listeners?this.listeners[e].push(n):this.listeners[e]=[n],!0):!1}async scaleFactor(){return i("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return i("plugin:window|inner_position",{label:this.label}).then(({x:e,y:n})=>new u(e,n))}async outerPosition(){return i("plugin:window|outer_position",{label:this.label}).then(({x:e,y:n})=>new u(e,n))}async innerSize(){return i("plugin:window|inner_size",{label:this.label}).then(({width:e,height:n})=>new r(e,n))}async outerSize(){return i("plugin:window|outer_size",{label:this.label}).then(({width:e,height:n})=>new r(e,n))}async isFullscreen(){return i("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return i("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return i("plugin:window|is_maximized",{label:this.label})}async isFocused(){return i("plugin:window|is_focused",{label:this.label})}async isDecorated(){return i("plugin:window|is_decorated",{label:this.label})}async isResizable(){return i("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return i("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return i("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return i("plugin:window|is_closable",{label:this.label})}async isVisible(){return i("plugin:window|is_visible",{label:this.label})}async title(){return i("plugin:window|title",{label:this.label})}async theme(){return i("plugin:window|theme",{label:this.label})}async center(){return i("plugin:window|center",{label:this.label})}async requestUserAttention(e){let n=null;return e&&(e===1?n={type:"Critical"}:n={type:"Informational"}),i("plugin:window|request_user_attention",{label:this.label,value:n})}async setResizable(e){return i("plugin:window|set_resizable",{label:this.label,value:e})}async setMaximizable(e){return i("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return i("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return i("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return i("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return i("plugin:window|maximize",{label:this.label})}async unmaximize(){return i("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return i("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return i("plugin:window|minimize",{label:this.label})}async unminimize(){return i("plugin:window|unminimize",{label:this.label})}async show(){return i("plugin:window|show",{label:this.label})}async hide(){return i("plugin:window|hide",{label:this.label})}async close(){return i("plugin:window|close",{label:this.label})}async setDecorations(e){return i("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return i("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return i("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return i("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return i("plugin:window|set_always_on_top",{label:this.label,value:e})}async setAlwaysOnBottom(e){return i("plugin:window|set_always_on_bottom",{label:this.label,value:e})}async setContentProtected(e){return i("plugin:window|set_content_protected",{label:this.label,value: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("plugin:window|set_size",{label:this.label,value:{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("plugin:window|set_min_size",{label:this.label,value: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("plugin:window|set_max_size",{label:this.label,value: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("plugin:window|set_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setFullscreen(e){return i("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return i("plugin:window|set_focus",{label:this.label})}async setIcon(e){return i("plugin:window|set_icon",{label:this.label,value:typeof e=="string"?e:Array.from(e)})}async setSkipTaskbar(e){return i("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return i("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return i("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return i("plugin:window|set_cursor_icon",{label:this.label,value: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("plugin:window|set_cursor_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setIgnoreCursorEvents(e){return i("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return i("plugin:window|start_dragging",{label:this.label})}async setProgressBar(e){return i("plugin:window|set_progress_bar",{label:this.label,value:e})}async onResized(e){return this.listen("tauri://resize",n=>{n.payload=W(n.payload),e(n)})}async onMoved(e){return this.listen("tauri://move",n=>{n.payload=F(n.payload),e(n)})}async onCloseRequested(e){return this.listen("tauri://close-requested",n=>{let t=new d(n);Promise.resolve(e(t)).then(()=>{if(!t.isPreventDefault())return this.close()})})}async onFocusChanged(e){let n=await this.listen("tauri://focus",s=>{e({...s,payload:!0})}),t=await this.listen("tauri://blur",s=>{e({...s,payload:!1})});return()=>{n(),t()}}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",o=>{e({...o,payload:{type:"drop",paths:o.payload}})}),t=await this.listen("tauri://file-drop-hover",o=>{e({...o,payload:{type:"hover",paths:o.payload}})}),s=await this.listen("tauri://file-drop-cancelled",o=>{e({...o,payload:{type:"cancel"}})});return()=>{n(),t(),s()}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},S=(l=>(l.AppearanceBased="appearanceBased",l.Light="light",l.Dark="dark",l.MediumLight="mediumLight",l.UltraDark="ultraDark",l.Titlebar="titlebar",l.Selection="selection",l.Menu="menu",l.Popover="popover",l.Sidebar="sidebar",l.HeaderView="headerView",l.Sheet="sheet",l.WindowBackground="windowBackground",l.HudWindow="hudWindow",l.FullScreenUI="fullScreenUI",l.Tooltip="tooltip",l.ContentBackground="contentBackground",l.UnderWindowBackground="underWindowBackground",l.UnderPageBackground="underPageBackground",l.Mica="mica",l.Blur="blur",l.Acrylic="acrylic",l.Tabbed="tabbed",l.TabbedDark="tabbedDark",l.TabbedLight="tabbedLight",l))(S||{}),C=(t=>(t.FollowsWindowActiveState="followsWindowActiveState",t.Active="active",t.Inactive="inactive",t))(C||{});function h(a){return a===null?null:{name:a.name,scaleFactor:a.scaleFactor,position:F(a.position),size:W(a.size)}}function F(a){return new u(a.x,a.y)}function W(a){return new r(a.width,a.height)}async function D(){return i("plugin:window|current_monitor").then(h)}async function L(){return i("plugin:window|primary_monitor").then(h)}async function x(){return i("plugin:window|available_monitors").then(a=>a.map(h))}export{v as a,d as b,_ as c,z as d,b as e,c as f,S as g,C as h,D as i,L as j,x as k,T as l}; |
| import{a as o,e as a}from"./chunk-CTAYYLOC.js";import{a as O}from"./chunk-NDS2DDJC.js";var E={};O(E,{TauriEvent:()=>l,emit:()=>D,listen:()=>c,once:()=>W});var l=(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))(l||{});async function s(n,t){await a("plugin:event|unlisten",{event:n,eventId:t})}async function c(n,t,i){return a("plugin:event|listen",{event:n,windowLabel:i?.target,handler:o(t)}).then(r=>async()=>s(n,r))}async function W(n,t,i){return c(n,r=>{t(r),s(n,r.id).catch(()=>{})},i)}async function D(n,t,i){await a("plugin:event|emit",{event:n,windowLabel:i?.target,payload:t})}export{l as a,c as b,W as c,D as d,E as e}; |
| import{a as d,b as a,c as g,d as c}from"./chunk-NDS2DDJC.js";var T={};d(T,{Channel:()=>i,PluginListener:()=>o,addPluginListener:()=>l,convertFileSrc:()=>v,invoke:()=>u,transformCallback:()=>_});function _(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}var r,i=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0;g(this,r,()=>{});this.id=_(n=>{a(this,r).call(this,n)})}set onmessage(n){c(this,r,n)}get onmessage(){return a(this,r)}toJSON(){return`__CHANNEL__:${this.id}`}};r=new WeakMap;var o=class{constructor(n,s,t){this.plugin=n,this.event=s,this.channelId=t}async unregister(){return u(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function l(e,n,s){let t=new i;return t.onmessage=s,u(`plugin:${e}|register_listener`,{event:n,handler:t}).then(()=>new o(e,n,t.id))}async function u(e,n={},s){return window.__TAURI_INTERNALS__.invoke(e,n,s)}function v(e,n="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(e,n)}export{_ as a,i as b,o as c,l as d,u as e,v as f,T as g}; |
| import{e as n}from"./chunk-CTAYYLOC.js";import{a as i}from"./chunk-NDS2DDJC.js";var t={};i(t,{getName:()=>e,getTauriVersion:()=>o,getVersion:()=>r,hide:()=>s,show:()=>p});async function r(){return n("plugin:app|version")}async function e(){return n("plugin:app|name")}async function o(){return n("plugin:app|tauri_version")}async function p(){return n("plugin:app|app_show")}async function s(){return n("plugin:app|app_hide")}export{r as a,e as b,o as c,p as d,s as e,t as f}; |
| var f=Object.defineProperty;var g=(a,b)=>{for(var c in b)f(a,c,{get:b[c],enumerable:!0})};var e=(a,b,c)=>{if(!b.has(a))throw TypeError("Cannot "+c)};var h=(a,b,c)=>(e(a,b,"read from private field"),c?c.call(a):b.get(a)),i=(a,b,c)=>{if(b.has(a))throw TypeError("Cannot add the same private member more than once");b instanceof WeakSet?b.add(a):b.set(a,c)},j=(a,b,c,d)=>(e(a,b,"write to private field"),d?d.call(a,c):b.set(a,c),c);export{g as a,h as b,i as c,j as d}; |
| import{e as n}from"./chunk-CTAYYLOC.js";import{a as o}from"./chunk-NDS2DDJC.js";var U={};o(U,{BaseDirectory:()=>t,appCacheDir:()=>p,appConfigDir:()=>s,appDataDir:()=>u,appLocalDataDir:()=>c,appLogDir:()=>w,audioDir:()=>a,basename:()=>H,cacheDir:()=>l,configDir:()=>g,dataDir:()=>d,delimiter:()=>E,desktopDir:()=>m,dirname:()=>z,documentDir:()=>y,downloadDir:()=>h,executableDir:()=>f,extname:()=>F,fontDir:()=>P,homeDir:()=>_,isAbsolute:()=>S,join:()=>j,localDataDir:()=>v,normalize:()=>N,pictureDir:()=>A,publicDir:()=>D,resolve:()=>I,resolveResource:()=>C,resourceDir:()=>b,runtimeDir:()=>L,sep:()=>k,tempDir:()=>x,templateDir:()=>R,videoDir:()=>T});var t=(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))(t||{});async function s(){return n("plugin:path|resolve_directory",{directory:13})}async function u(){return n("plugin:path|resolve_directory",{directory:14})}async function c(){return n("plugin:path|resolve_directory",{directory:15})}async function p(){return n("plugin:path|resolve_directory",{directory:16})}async function a(){return n("plugin:path|resolve_directory",{directory:1})}async function l(){return n("plugin:path|resolve_directory",{directory:2})}async function g(){return n("plugin:path|resolve_directory",{directory:3})}async function d(){return n("plugin:path|resolve_directory",{directory:4})}async function m(){return n("plugin:path|resolve_directory",{directory:18})}async function y(){return n("plugin:path|resolve_directory",{directory:6})}async function h(){return n("plugin:path|resolve_directory",{directory:7})}async function f(){return n("plugin:path|resolve_directory",{directory:19})}async function P(){return n("plugin:path|resolve_directory",{directory:20})}async function _(){return n("plugin:path|resolve_directory",{directory:21})}async function v(){return n("plugin:path|resolve_directory",{directory:5})}async function A(){return n("plugin:path|resolve_directory",{directory:8})}async function D(){return n("plugin:path|resolve_directory",{directory:9})}async function b(){return n("plugin:path|resolve_directory",{directory:11})}async function C(i){return n("plugin:path|resolve_directory",{directory:11,path:i})}async function L(){return n("plugin:path|resolve_directory",{directory:22})}async function R(){return n("plugin:path|resolve_directory",{directory:23})}async function T(){return n("plugin:path|resolve_directory",{directory:10})}async function w(){return n("plugin:path|resolve_directory",{directory:17})}async function x(i){return n("plugin:path|resolve_directory",{directory:12})}function k(){return window.__TAURI_INTERNALS__.plugins.path.sep}function E(){return window.__TAURI_INTERNALS__.plugins.path.delimiter}async function I(...i){return n("plugin:path|resolve",{paths:i})}async function N(i){return n("plugin:path|normalize",{path:i})}async function j(...i){return n("plugin:path|join",{paths:i})}async function z(i){return n("plugin:path|dirname",{path:i})}async function F(i){return n("plugin:path|extname",{path:i})}async function H(i,e){return n("plugin:path|basename",{path:i,ext:e})}async function S(i){return n("plugin:path|isAbsolute",{path:i})}export{t as a,s as b,u as c,c as d,p as e,a as f,l as g,g as h,d as i,m as j,y as k,h as l,f as m,P as n,_ as o,v as p,A as q,D as r,b as s,C as t,L as u,R as v,T as w,w as x,x as y,k as z,E as A,I as B,N as C,j as D,z as E,F,H as G,S as H,U as I}; |
| /** | ||
| * A size represented in logical pixels. | ||
| * | ||
| * @since 2.0.0 | ||
| */ | ||
| declare class LogicalSize { | ||
| type: string; | ||
| width: number; | ||
| height: number; | ||
| constructor(width: number, height: number); | ||
| } | ||
| /** | ||
| * A size represented in physical pixels. | ||
| * | ||
| * @since 2.0.0 | ||
| */ | ||
| declare class PhysicalSize { | ||
| type: string; | ||
| width: number; | ||
| height: number; | ||
| constructor(width: number, height: number); | ||
| /** | ||
| * Converts the physical size to a logical one. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * const appWindow = getCurrent(); | ||
| * const factor = await appWindow.scaleFactor(); | ||
| * const size = await appWindow.innerSize(); | ||
| * const logical = size.toLogical(factor); | ||
| * ``` | ||
| * */ | ||
| toLogical(scaleFactor: number): LogicalSize; | ||
| } | ||
| /** | ||
| * A position represented in logical pixels. | ||
| * | ||
| * @since 2.0.0 | ||
| */ | ||
| declare class LogicalPosition { | ||
| type: string; | ||
| x: number; | ||
| y: number; | ||
| constructor(x: number, y: number); | ||
| } | ||
| /** | ||
| * A position represented in physical pixels. | ||
| * | ||
| * @since 2.0.0 | ||
| */ | ||
| declare class PhysicalPosition { | ||
| type: string; | ||
| x: number; | ||
| y: number; | ||
| constructor(x: number, y: number); | ||
| /** | ||
| * Converts the physical position to a logical one. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * const appWindow = getCurrent(); | ||
| * const factor = await appWindow.scaleFactor(); | ||
| * const position = await appWindow.innerPosition(); | ||
| * const logical = position.toLogical(factor); | ||
| * ``` | ||
| * */ | ||
| toLogical(scaleFactor: number): LogicalPosition; | ||
| } | ||
| type dpi_LogicalPosition = LogicalPosition; | ||
| declare const dpi_LogicalPosition: typeof LogicalPosition; | ||
| type dpi_LogicalSize = LogicalSize; | ||
| declare const dpi_LogicalSize: typeof LogicalSize; | ||
| type dpi_PhysicalPosition = PhysicalPosition; | ||
| declare const dpi_PhysicalPosition: typeof PhysicalPosition; | ||
| type dpi_PhysicalSize = PhysicalSize; | ||
| declare const dpi_PhysicalSize: typeof PhysicalSize; | ||
| declare namespace dpi { | ||
| export { | ||
| dpi_LogicalPosition as LogicalPosition, | ||
| dpi_LogicalSize as LogicalSize, | ||
| dpi_PhysicalPosition as PhysicalPosition, | ||
| dpi_PhysicalSize as PhysicalSize, | ||
| }; | ||
| } | ||
| export { LogicalSize as L, PhysicalSize as P, PhysicalPosition as a, LogicalPosition as b, dpi as d }; |
+1
| "use strict";var i=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var y=(r,t)=>{for(var e in t)i(r,e,{get:t[e],enumerable:!0})},w=(r,t,e,m)=>{if(t&&typeof t=="object"||typeof t=="function")for(let h of o(t))!g.call(r,h)&&h!==e&&i(r,h,{get:()=>t[h],enumerable:!(m=c(t,h))||m.enumerable});return r};var l=r=>w(i({},"__esModule",{value:!0}),r);var x={};y(x,{LogicalPosition:()=>u,LogicalSize:()=>n,PhysicalPosition:()=>b,PhysicalSize:()=>s});module.exports=l(x);var n=class{constructor(t,e){this.type="Logical";this.width=t,this.height=e}},s=class{constructor(t,e){this.type="Physical";this.width=t,this.height=e}toLogical(t){return new n(this.width/t,this.height/t)}},u=class{constructor(t,e){this.type="Logical";this.x=t,this.y=e}},b=class{constructor(t,e){this.type="Physical";this.x=t,this.y=e}toLogical(t){return new u(this.x/t,this.y/t)}}; |
| export { b as LogicalPosition, L as LogicalSize, a as PhysicalPosition, P as PhysicalSize } from './dpi-1b9c86cc.js'; |
+1
| export { b as LogicalPosition, L as LogicalSize, a as PhysicalPosition, P as PhysicalSize } from './dpi-1b9c86cc.js'; |
+1
| import{a,b,c,d}from"./chunk-24ATAN64.js";import"./chunk-NDS2DDJC.js";export{c as LogicalPosition,a as LogicalSize,d as PhysicalPosition,b as PhysicalSize}; |
| interface Event<T> { | ||
| /** Event name */ | ||
| event: EventName; | ||
| /** The label of the window that emitted this event. */ | ||
| windowLabel: string; | ||
| /** Event identifier used to unlisten */ | ||
| id: number; | ||
| /** Event payload */ | ||
| payload: T; | ||
| } | ||
| type EventCallback<T> = (event: Event<T>) => void; | ||
| type UnlistenFn = () => void; | ||
| type EventName = `${TauriEvent}` | (string & Record<never, never>); | ||
| interface Options { | ||
| /** | ||
| * Label of the window the function targets. | ||
| * | ||
| * When listening to events and using this value, | ||
| * only events triggered by the window with the given label are received. | ||
| * | ||
| * When emitting events, only the window with the given label will receive it. | ||
| */ | ||
| target?: string; | ||
| } | ||
| /** | ||
| * @since 1.1.0 | ||
| */ | ||
| declare enum TauriEvent { | ||
| WINDOW_RESIZED = "tauri://resize", | ||
| WINDOW_MOVED = "tauri://move", | ||
| WINDOW_CLOSE_REQUESTED = "tauri://close-requested", | ||
| WINDOW_CREATED = "tauri://window-created", | ||
| WINDOW_DESTROYED = "tauri://destroyed", | ||
| WINDOW_FOCUS = "tauri://focus", | ||
| WINDOW_BLUR = "tauri://blur", | ||
| WINDOW_SCALE_FACTOR_CHANGED = "tauri://scale-change", | ||
| WINDOW_THEME_CHANGED = "tauri://theme-changed", | ||
| WINDOW_FILE_DROP = "tauri://file-drop", | ||
| WINDOW_FILE_DROP_HOVER = "tauri://file-drop-hover", | ||
| WINDOW_FILE_DROP_CANCELLED = "tauri://file-drop-cancelled", | ||
| MENU = "tauri://menu" | ||
| } | ||
| /** | ||
| * Listen to an event. The event can be either global or window-specific. | ||
| * See {@link Event.windowLabel} to check the event source. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { listen } from '@tauri-apps/api/event'; | ||
| * const unlisten = await listen<string>('error', (event) => { | ||
| * console.log(`Got error in window ${event.windowLabel}, payload: ${event.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 callback. | ||
| * @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.0 | ||
| */ | ||
| declare function listen<T>(event: EventName, handler: EventCallback<T>, options?: Options): Promise<UnlistenFn>; | ||
| /** | ||
| * Listen to an one-off event. See {@link listen} for more information. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { once } from '@tauri-apps/api/event'; | ||
| * interface LoadedPayload { | ||
| * loggedIn: boolean, | ||
| * token: string | ||
| * } | ||
| * const unlisten = await once<LoadedPayload>('loaded', (event) => { | ||
| * console.log(`App is loaded, loggedIn: ${event.payload.loggedIn}, token: ${event.payload.token}`); | ||
| * }); | ||
| * | ||
| * // 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 `_`. | ||
| * @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.0 | ||
| */ | ||
| declare function once<T>(event: EventName, handler: EventCallback<T>, options?: Options): Promise<UnlistenFn>; | ||
| /** | ||
| * Emits an event to the backend and all Tauri windows. | ||
| * @example | ||
| * ```typescript | ||
| * import { emit } from '@tauri-apps/api/event'; | ||
| * await emit('frontend-loaded', { loggedIn: true, token: 'authToken' }); | ||
| * ``` | ||
| * | ||
| * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. | ||
| * | ||
| * @since 1.0.0 | ||
| */ | ||
| declare function emit(event: string, payload?: unknown, options?: Options): Promise<void>; | ||
| type event_Event<T> = Event<T>; | ||
| type event_EventCallback<T> = EventCallback<T>; | ||
| type event_UnlistenFn = UnlistenFn; | ||
| type event_EventName = EventName; | ||
| type event_Options = Options; | ||
| declare const event_listen: typeof listen; | ||
| declare const event_once: typeof once; | ||
| declare const event_emit: typeof emit; | ||
| type event_TauriEvent = TauriEvent; | ||
| declare const event_TauriEvent: typeof TauriEvent; | ||
| declare namespace event { | ||
| export { | ||
| event_Event as Event, | ||
| event_EventCallback as EventCallback, | ||
| event_UnlistenFn as UnlistenFn, | ||
| event_EventName as EventName, | ||
| event_Options as Options, | ||
| event_listen as listen, | ||
| event_once as once, | ||
| event_emit as emit, | ||
| event_TauriEvent as TauriEvent, | ||
| }; | ||
| } | ||
| export { EventName as E, Options as O, TauriEvent as T, UnlistenFn as U, Event as a, EventCallback as b, emit as c, event as e, listen as l, once as o }; |
| export { a as Event, b as EventCallback, E as EventName, O as Options, T as TauriEvent, U as UnlistenFn, c as emit, l as listen, o as once } from './event-bdc5d2c8.js'; |
| "use strict"; |
| import { i as invoke, t as transformCallback, c as convertFileSrc } from './primitives-742a88b2.js'; | ||
| // Copyright 2019-2023 Tauri Programme within The Commons Conservancy | ||
| /** @ignore */ | ||
| declare global { | ||
| interface Window { | ||
| __TAURI_INTERNALS__: { | ||
| invoke: typeof invoke | ||
| transformCallback: typeof transformCallback | ||
| convertFileSrc: typeof convertFileSrc | ||
| ipc: (message: { | ||
| cmd: string | ||
| callback: number | ||
| error: number | ||
| payload: unknown | ||
| options?: InvokeOptions | ||
| }) => void | ||
| metadata: { | ||
| windows: WindowDef[] | ||
| currentWindow: WindowDef | ||
| } | ||
| plugins: { | ||
| path: { | ||
| sep: string | ||
| delimiter: string | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| /** @ignore */ | ||
| interface WindowDef { | ||
| label: string | ||
| } |
| import { i as invoke, t as transformCallback, c as convertFileSrc } from './primitives-742a88b2.js'; | ||
| // Copyright 2019-2023 Tauri Programme within The Commons Conservancy | ||
| /** @ignore */ | ||
| declare global { | ||
| interface Window { | ||
| __TAURI_INTERNALS__: { | ||
| invoke: typeof invoke | ||
| transformCallback: typeof transformCallback | ||
| convertFileSrc: typeof convertFileSrc | ||
| ipc: (message: { | ||
| cmd: string | ||
| callback: number | ||
| error: number | ||
| payload: unknown | ||
| options?: InvokeOptions | ||
| }) => void | ||
| metadata: { | ||
| windows: WindowDef[] | ||
| currentWindow: WindowDef | ||
| } | ||
| plugins: { | ||
| path: { | ||
| sep: string | ||
| delimiter: string | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| /** @ignore */ | ||
| interface WindowDef { | ||
| label: string | ||
| } |
| export { a as app } from './app-d81a8ac4.js'; | ||
| export { e as event } from './event-bdc5d2c8.js'; | ||
| export { p as primitives } from './primitives-742a88b2.js'; | ||
| export { w as window } from './window-e99b5597.js'; | ||
| export { p as path } from './path-9694881f.js'; | ||
| export { d as dpi } from './dpi-1b9c86cc.js'; |
+124
| /** | ||
| * Intercepts all IPC requests with the given mock handler. | ||
| * | ||
| * This function can be used when testing tauri frontend applications or when running the frontend in a Node.js context during static site generation. | ||
| * | ||
| * # Examples | ||
| * | ||
| * Testing setup using vitest: | ||
| * ```js | ||
| * import { mockIPC, clearMocks } from "@tauri-apps/api/mocks" | ||
| * import { invoke } from "@tauri-apps/api/primitives" | ||
| * | ||
| * afterEach(() => { | ||
| * clearMocks() | ||
| * }) | ||
| * | ||
| * test("mocked command", () => { | ||
| * mockIPC((cmd, payload) => { | ||
| * switch (cmd) { | ||
| * case "add": | ||
| * return (payload.a as number) + (payload.b as number); | ||
| * default: | ||
| * break; | ||
| * } | ||
| * }); | ||
| * | ||
| * expect(invoke('add', { a: 12, b: 15 })).resolves.toBe(27); | ||
| * }) | ||
| * ``` | ||
| * | ||
| * The callback function can also return a Promise: | ||
| * ```js | ||
| * import { mockIPC, clearMocks } from "@tauri-apps/api/mocks" | ||
| * import { invoke } from "@tauri-apps/api/primitives" | ||
| * | ||
| * afterEach(() => { | ||
| * clearMocks() | ||
| * }) | ||
| * | ||
| * test("mocked command", () => { | ||
| * mockIPC((cmd, payload) => { | ||
| * if(cmd === "get_data") { | ||
| * return fetch("https://example.com/data.json") | ||
| * .then((response) => response.json()) | ||
| * } | ||
| * }); | ||
| * | ||
| * expect(invoke('get_data')).resolves.toBe({ foo: 'bar' }); | ||
| * }) | ||
| * ``` | ||
| * | ||
| * @since 1.0.0 | ||
| */ | ||
| declare function mockIPC(cb: (cmd: string, payload: Record<string, unknown>) => unknown): void; | ||
| /** | ||
| * Mocks one or many window labels. | ||
| * In non-tauri context it is required to call this function *before* using the `@tauri-apps/api/window` module. | ||
| * | ||
| * This function only mocks the *presence* of windows, | ||
| * window properties (e.g. width and height) can be mocked like regular IPC calls using the `mockIPC` function. | ||
| * | ||
| * # Examples | ||
| * | ||
| * ```js | ||
| * import { mockWindows } from "@tauri-apps/api/mocks"; | ||
| * import { getCurrent } from "@tauri-apps/api/window"; | ||
| * | ||
| * mockWindows("main", "second", "third"); | ||
| * | ||
| * const win = getCurrent(); | ||
| * | ||
| * win.label // "main" | ||
| * ``` | ||
| * | ||
| * ```js | ||
| * import { mockWindows } from "@tauri-apps/api/mocks"; | ||
| * | ||
| * mockWindows("main", "second", "third"); | ||
| * | ||
| * mockIPC((cmd, args) => { | ||
| * if (cmd === "plugin:event|emit") { | ||
| * console.log('emit event', args?.event, args?.payload); | ||
| * } | ||
| * }); | ||
| * | ||
| * const { emit } = await import("@tauri-apps/api/event"); | ||
| * await emit('loaded'); // this will cause the mocked IPC handler to log to the console. | ||
| * ``` | ||
| * | ||
| * @param current Label of window this JavaScript context is running in. | ||
| * @param additionalWindows Label of additional windows the app has. | ||
| * | ||
| * @since 1.0.0 | ||
| */ | ||
| declare function mockWindows(current: string, ...additionalWindows: string[]): void; | ||
| /** | ||
| * Clears mocked functions/data injected by the other functions in this module. | ||
| * When using a test runner that doesn't provide a fresh window object for each test, calling this function will reset tauri specific properties. | ||
| * | ||
| * # Example | ||
| * | ||
| * ```js | ||
| * import { mockWindows, clearMocks } from "@tauri-apps/api/mocks" | ||
| * | ||
| * afterEach(() => { | ||
| * clearMocks() | ||
| * }) | ||
| * | ||
| * test("mocked windows", () => { | ||
| * mockWindows("main", "second", "third"); | ||
| * | ||
| * expect(window.__TAURI_INTERNALS__).toHaveProperty("metadata") | ||
| * }) | ||
| * | ||
| * test("no mocked windows", () => { | ||
| * expect(window.__TAURI_INTERNALS__).not.toHaveProperty("metadata") | ||
| * }) | ||
| * ``` | ||
| * | ||
| * @since 1.0.0 | ||
| */ | ||
| declare function clearMocks(): void; | ||
| export { clearMocks, mockIPC, mockWindows }; |
| export { B as BaseDirectory, d as appCacheDir, a as appConfigDir, b as appDataDir, c as appLocalDataDir, e as appLogDir, f as audioDir, G as basename, g as cacheDir, h as configDir, i as dataDir, z as delimiter, j as desktopDir, E as dirname, k as documentDir, l as downloadDir, m as executableDir, F as extname, n as fontDir, o as homeDir, H as isAbsolute, D as join, q as localDataDir, C as normalize, r as pictureDir, s as publicDir, A as resolve, u as resolveResource, t as resourceDir, v as runtimeDir, y as sep, I as tempDir, w as templateDir, x as videoDir } from './path-9694881f.js'; |
| /** | ||
| * Invoke your custom commands. | ||
| * | ||
| * This package is also accessible with `window.__TAURI__.tauri` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`. | ||
| * @module | ||
| */ | ||
| /** | ||
| * Transforms a callback function to a string identifier that can be passed to the backend. | ||
| * The backend uses the identifier to `eval()` the callback. | ||
| * | ||
| * @return A unique identifier associated with the callback function. | ||
| * | ||
| * @since 1.0.0 | ||
| */ | ||
| declare function transformCallback<T = unknown>(callback?: (response: T) => void, once?: boolean): number; | ||
| declare class Channel<T = unknown> { | ||
| #private; | ||
| id: number; | ||
| private readonly __TAURI_CHANNEL_MARKER__; | ||
| constructor(); | ||
| set onmessage(handler: (response: T) => void); | ||
| get onmessage(): (response: T) => void; | ||
| toJSON(): string; | ||
| } | ||
| declare class PluginListener { | ||
| plugin: string; | ||
| event: string; | ||
| channelId: number; | ||
| constructor(plugin: string, event: string, channelId: number); | ||
| unregister(): Promise<void>; | ||
| } | ||
| /** | ||
| * Adds a listener to a plugin event. | ||
| * | ||
| * @returns The listener object to stop listening to the events. | ||
| * | ||
| * @since 2.0.0 | ||
| */ | ||
| declare function addPluginListener<T>(plugin: string, event: string, cb: (payload: T) => void): Promise<PluginListener>; | ||
| /** | ||
| * Command arguments. | ||
| * | ||
| * @since 1.0.0 | ||
| */ | ||
| type InvokeArgs = Record<string, unknown> | number[] | ArrayBuffer | Uint8Array; | ||
| /** | ||
| * @since 2.0.0 | ||
| */ | ||
| interface InvokeOptions { | ||
| headers: Headers | Record<string, string>; | ||
| } | ||
| /** | ||
| * Sends a message to the backend. | ||
| * @example | ||
| * ```typescript | ||
| * import { invoke } from '@tauri-apps/api/primitives'; | ||
| * await invoke('login', { user: 'tauri', password: 'poiwe3h4r5ip3yrhtew9ty' }); | ||
| * ``` | ||
| * | ||
| * @param cmd The command name. | ||
| * @param args The optional arguments to pass to the command. | ||
| * @param options The request options. | ||
| * @return A promise resolving or rejecting to the backend response. | ||
| * | ||
| * @since 1.0.0 | ||
| */ | ||
| declare function invoke<T>(cmd: string, args?: InvokeArgs, options?: InvokeOptions): Promise<T>; | ||
| /** | ||
| * Convert a device file path to an URL that can be loaded by the webview. | ||
| * Note that `asset:` and `http://asset.localhost` must be added to [`tauri.security.csp`](https://tauri.app/v1/api/config/#securityconfig.csp) in `tauri.conf.json`. | ||
| * Example CSP value: `"csp": "default-src 'self' ipc: http://ipc.localhost; img-src 'self' asset: http://asset.localhost"` to use the asset protocol on image sources. | ||
| * | ||
| * Additionally, `asset` must be added to [`tauri.allowlist.protocol`](https://tauri.app/v1/api/config/#allowlistconfig.protocol) | ||
| * in `tauri.conf.json` and its access scope must be defined on the `assetScope` array on the same `protocol` object. | ||
| * | ||
| * @param filePath The file path. | ||
| * @param protocol The protocol to use. Defaults to `asset`. You only need to set this when using a custom protocol. | ||
| * @example | ||
| * ```typescript | ||
| * import { appDataDir, join } from '@tauri-apps/api/path'; | ||
| * import { convertFileSrc } from '@tauri-apps/api/primitives'; | ||
| * const appDataDirPath = await appDataDir(); | ||
| * const filePath = await join(appDataDirPath, 'assets/video.mp4'); | ||
| * const assetUrl = convertFileSrc(filePath); | ||
| * | ||
| * const video = document.getElementById('my-video'); | ||
| * const source = document.createElement('source'); | ||
| * source.type = 'video/mp4'; | ||
| * source.src = assetUrl; | ||
| * video.appendChild(source); | ||
| * video.load(); | ||
| * ``` | ||
| * | ||
| * @return the URL that can be used as source on the webview. | ||
| * | ||
| * @since 1.0.0 | ||
| */ | ||
| declare function convertFileSrc(filePath: string, protocol?: string): string; | ||
| type primitives_InvokeArgs = InvokeArgs; | ||
| type primitives_InvokeOptions = InvokeOptions; | ||
| declare const primitives_transformCallback: typeof transformCallback; | ||
| type primitives_Channel<T = unknown> = Channel<T>; | ||
| declare const primitives_Channel: typeof Channel; | ||
| type primitives_PluginListener = PluginListener; | ||
| declare const primitives_PluginListener: typeof PluginListener; | ||
| declare const primitives_addPluginListener: typeof addPluginListener; | ||
| declare const primitives_invoke: typeof invoke; | ||
| declare const primitives_convertFileSrc: typeof convertFileSrc; | ||
| declare namespace primitives { | ||
| export { | ||
| primitives_InvokeArgs as InvokeArgs, | ||
| primitives_InvokeOptions as InvokeOptions, | ||
| primitives_transformCallback as transformCallback, | ||
| primitives_Channel as Channel, | ||
| primitives_PluginListener as PluginListener, | ||
| primitives_addPluginListener as addPluginListener, | ||
| primitives_invoke as invoke, | ||
| primitives_convertFileSrc as convertFileSrc, | ||
| }; | ||
| } | ||
| export { Channel as C, InvokeArgs as I, PluginListener as P, InvokeOptions as a, addPluginListener as b, convertFileSrc as c, invoke as i, primitives as p, transformCallback as t }; |
| "use strict";var u=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var I=(e,n)=>{for(var r in n)u(e,r,{get:n[r],enumerable:!0})},m=(e,n,r,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of h(n))!p.call(e,i)&&i!==r&&u(e,i,{get:()=>n[i],enumerable:!(s=T(n,i))||s.enumerable});return e};var A=e=>m(u({},"__esModule",{value:!0}),e);var _=(e,n,r)=>{if(!n.has(e))throw TypeError("Cannot "+r)};var g=(e,n,r)=>(_(e,n,"read from private field"),r?r.call(e):n.get(e)),d=(e,n,r)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,r)},l=(e,n,r,s)=>(_(e,n,"write to private field"),s?s.call(e,r):n.set(e,r),r);var N={};I(N,{Channel:()=>o,PluginListener:()=>a,addPluginListener:()=>k,convertFileSrc:()=>w,invoke:()=>c,transformCallback:()=>v});module.exports=A(N);function v(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}var t,o=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0;d(this,t,()=>{});this.id=v(n=>{g(this,t).call(this,n)})}set onmessage(n){l(this,t,n)}get onmessage(){return g(this,t)}toJSON(){return`__CHANNEL__:${this.id}`}};t=new WeakMap;var a=class{constructor(n,r,s){this.plugin=n,this.event=r,this.channelId=s}async unregister(){return c(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function k(e,n,r){let s=new o;return s.onmessage=r,c(`plugin:${e}|register_listener`,{event:n,handler:s}).then(()=>new a(e,n,s.id))}async function c(e,n={},r){return window.__TAURI_INTERNALS__.invoke(e,n,r)}function w(e,n="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(e,n)} |
| export { C as Channel, I as InvokeArgs, a as InvokeOptions, P as PluginListener, b as addPluginListener, c as convertFileSrc, i as invoke, t as transformCallback } from './primitives-742a88b2.js'; |
| export { C as Channel, I as InvokeArgs, a as InvokeOptions, P as PluginListener, b as addPluginListener, c as convertFileSrc, i as invoke, t as transformCallback } from './primitives-742a88b2.js'; |
| import{a,b,c,d,e,f}from"./chunk-CTAYYLOC.js";import"./chunk-NDS2DDJC.js";export{b as Channel,c as PluginListener,d as addPluginListener,f as convertFileSrc,e as invoke,a as transformCallback}; |
+1534
| import { P as PhysicalSize, a as PhysicalPosition, L as LogicalSize, b as LogicalPosition } from './dpi-1b9c86cc.js'; | ||
| import { E as EventName, a as Event, b as EventCallback, U as UnlistenFn } from './event-bdc5d2c8.js'; | ||
| /** | ||
| * Provides APIs to create windows, communicate with other windows and manipulate the current window. | ||
| * | ||
| * ## Window events | ||
| * | ||
| * Events can be listened to using {@link Window.listen}: | ||
| * ```typescript | ||
| * import { getCurrent } from "@tauri-apps/api/window"; | ||
| * getCurrent().listen("my-window-event", ({ event, payload }) => { }); | ||
| * ``` | ||
| * | ||
| * @module | ||
| */ | ||
| /** | ||
| * 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; | ||
| } | ||
| type Theme = 'light' | 'dark'; | ||
| type TitleBarStyle = 'visible' | 'transparent' | 'overlay'; | ||
| /** | ||
| * 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'; | ||
| }; | ||
| /** | ||
| * Attention type to request on a window. | ||
| * | ||
| * @since 1.0.0 | ||
| */ | ||
| declare 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 = 2 | ||
| } | ||
| declare 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; | ||
| constructor(event: Event<null>); | ||
| preventDefault(): void; | ||
| isPreventDefault(): boolean; | ||
| } | ||
| type CursorIcon = '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'; | ||
| declare enum ProgressBarStatus { | ||
| /** | ||
| * Hide progress bar. | ||
| */ | ||
| None = "none", | ||
| /** | ||
| * Normal state. | ||
| */ | ||
| Normal = "normal", | ||
| /** | ||
| * Indeterminate state. **Treated as Normal on Linux and macOS** | ||
| */ | ||
| Indeterminate = "indeterminate", | ||
| /** | ||
| * Paused state. **Treated as Normal on Linux** | ||
| */ | ||
| Paused = "paused", | ||
| /** | ||
| * Error state. **Treated as Normal on linux** | ||
| */ | ||
| Error = "error" | ||
| } | ||
| interface ProgressBarState { | ||
| /** | ||
| * The progress bar status. | ||
| */ | ||
| status?: ProgressBarStatus; | ||
| /** | ||
| * The progress bar progress. This can be a value ranging from `0` to `100` | ||
| */ | ||
| progress?: number; | ||
| /** | ||
| * The identifier for your app to communicate with the Unity desktop window manager **Linux Only** | ||
| */ | ||
| unityUri?: string; | ||
| } | ||
| /** | ||
| * Get an instance of `Window` for the current window. | ||
| * | ||
| * @since 1.0.0 | ||
| */ | ||
| declare function getCurrent(): Window; | ||
| /** | ||
| * Gets a list of instances of `Window` for all available windows. | ||
| * | ||
| * @since 1.0.0 | ||
| */ | ||
| declare function getAll(): Window[]; | ||
| /** @ignore */ | ||
| type WindowLabel = string; | ||
| /** | ||
| * Create new webview window or get a handle to an existing one. | ||
| * | ||
| * 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 appWindow = new Window('theUniqueLabel', { | ||
| * url: 'path/to/page.html' | ||
| * }); | ||
| * // alternatively, load a remote URL: | ||
| * const appWindow = new Window('theUniqueLabel', { | ||
| * url: 'https://github.com/tauri-apps/tauri' | ||
| * }); | ||
| * | ||
| * appWindow.once('tauri://created', function () { | ||
| * // window successfully created | ||
| * }); | ||
| * appWindow.once('tauri://error', function (e) { | ||
| * // an error happened creating the window | ||
| * }); | ||
| * | ||
| * // emit an event to the backend | ||
| * await appWindow.emit("some event", "data"); | ||
| * // listen to an event from the backend | ||
| * const unlisten = await appWindow.listen("event name", e => {}); | ||
| * unlisten(); | ||
| * ``` | ||
| * | ||
| * @since 2.0.0 | ||
| */ | ||
| declare class Window { | ||
| /** 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<string, Array<EventCallback<any>>>; | ||
| /** | ||
| * Creates a new Window. | ||
| * @example | ||
| * ```typescript | ||
| * import { Window } from '@tauri-apps/api/window'; | ||
| * const appWindow = new Window('my-label', { | ||
| * url: 'https://github.com/tauri-apps/tauri' | ||
| * }); | ||
| * appWindow.once('tauri://created', function () { | ||
| * // window successfully created | ||
| * }); | ||
| * appWindow.once('tauri://error', function (e) { | ||
| * // an error happened creating the window | ||
| * }); | ||
| * ``` | ||
| * | ||
| * @param label The unique webview window label. Must be alphanumeric: `a-zA-Z-/:_`. | ||
| * @returns The {@link Window} instance to communicate with the webview. | ||
| */ | ||
| constructor(label: WindowLabel, options?: WindowOptions); | ||
| /** | ||
| * Gets the Window for the webview associated with the given label. | ||
| * @example | ||
| * ```typescript | ||
| * import { Window } from '@tauri-apps/api/window'; | ||
| * const mainWindow = Window.getByLabel('main'); | ||
| * ``` | ||
| * | ||
| * @param label The webview window label. | ||
| * @returns The Window instance to communicate with the webview or null if the webview doesn't exist. | ||
| */ | ||
| static getByLabel(label: string): Window | null; | ||
| /** | ||
| * Get an instance of `Window` for the current window. | ||
| */ | ||
| static getCurrent(): Window; | ||
| /** | ||
| * Gets a list of instances of `Window` for all available windows. | ||
| */ | ||
| static getAll(): Window[]; | ||
| /** | ||
| * Gets the focused window. | ||
| * @example | ||
| * ```typescript | ||
| * import { Window } from '@tauri-apps/api/window'; | ||
| * const focusedWindow = Window.getFocusedWindow(); | ||
| * ``` | ||
| * | ||
| * @returns The Window instance to communicate with the webview or `undefined` if there is not any focused window. | ||
| */ | ||
| static getFocusedWindow(): Promise<Window | null>; | ||
| /** | ||
| * Listen to an event emitted by the backend that is tied to the webview window. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * const unlisten = await getCurrent().listen<string>('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. | ||
| */ | ||
| listen<T>(event: EventName, handler: EventCallback<T>): Promise<UnlistenFn>; | ||
| /** | ||
| * Listen to an one-off event emitted by the backend that is tied to the webview window. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * const unlisten = await getCurrent().once<null>('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. | ||
| */ | ||
| once<T>(event: string, handler: EventCallback<T>): Promise<UnlistenFn>; | ||
| /** | ||
| * Emits an event to the backend, tied to the webview window. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().emit('window-loaded', { loggedIn: true, token: 'authToken' }); | ||
| * ``` | ||
| * | ||
| * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. | ||
| * @param payload Event payload. | ||
| */ | ||
| emit(event: string, payload?: unknown): Promise<void>; | ||
| /** @ignore */ | ||
| _handleTauriEvent<T>(event: string, handler: EventCallback<T>): boolean; | ||
| /** | ||
| * The scale factor that can be used to map physical pixels to logical pixels. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * const factor = await getCurrent().scaleFactor(); | ||
| * ``` | ||
| * | ||
| * @returns The window's monitor scale factor. | ||
| */ | ||
| scaleFactor(): Promise<number>; | ||
| /** | ||
| * 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 { getCurrent } from '@tauri-apps/api/window'; | ||
| * const position = await getCurrent().innerPosition(); | ||
| * ``` | ||
| * | ||
| * @returns The window's inner position. | ||
| */ | ||
| innerPosition(): Promise<PhysicalPosition>; | ||
| /** | ||
| * The position of the top-left hand corner of the window relative to the top-left hand corner of the desktop. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * const position = await getCurrent().outerPosition(); | ||
| * ``` | ||
| * | ||
| * @returns The window's outer position. | ||
| */ | ||
| outerPosition(): Promise<PhysicalPosition>; | ||
| /** | ||
| * 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 { getCurrent } from '@tauri-apps/api/window'; | ||
| * const size = await getCurrent().innerSize(); | ||
| * ``` | ||
| * | ||
| * @returns The window's inner size. | ||
| */ | ||
| innerSize(): Promise<PhysicalSize>; | ||
| /** | ||
| * 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 { getCurrent } from '@tauri-apps/api/window'; | ||
| * const size = await getCurrent().outerSize(); | ||
| * ``` | ||
| * | ||
| * @returns The window's outer size. | ||
| */ | ||
| outerSize(): Promise<PhysicalSize>; | ||
| /** | ||
| * Gets the window's current fullscreen state. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * const fullscreen = await getCurrent().isFullscreen(); | ||
| * ``` | ||
| * | ||
| * @returns Whether the window is in fullscreen mode or not. | ||
| */ | ||
| isFullscreen(): Promise<boolean>; | ||
| /** | ||
| * Gets the window's current minimized state. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * const minimized = await getCurrent().isMinimized(); | ||
| * ``` | ||
| */ | ||
| isMinimized(): Promise<boolean>; | ||
| /** | ||
| * Gets the window's current maximized state. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * const maximized = await getCurrent().isMaximized(); | ||
| * ``` | ||
| * | ||
| * @returns Whether the window is maximized or not. | ||
| */ | ||
| isMaximized(): Promise<boolean>; | ||
| /** | ||
| * Gets the window's current focus state. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * const focused = await getCurrent().isFocused(); | ||
| * ``` | ||
| * | ||
| * @returns Whether the window is focused or not. | ||
| */ | ||
| isFocused(): Promise<boolean>; | ||
| /** | ||
| * Gets the window's current decorated state. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * const decorated = await getCurrent().isDecorated(); | ||
| * ``` | ||
| * | ||
| * @returns Whether the window is decorated or not. | ||
| */ | ||
| isDecorated(): Promise<boolean>; | ||
| /** | ||
| * Gets the window's current resizable state. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * const resizable = await getCurrent().isResizable(); | ||
| * ``` | ||
| * | ||
| * @returns Whether the window is resizable or not. | ||
| */ | ||
| isResizable(): Promise<boolean>; | ||
| /** | ||
| * Gets the window’s native maximize button state. | ||
| * | ||
| * #### Platform-specific | ||
| * | ||
| * - **Linux / iOS / Android:** Unsupported. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * const maximizable = await getCurrent().isMaximizable(); | ||
| * ``` | ||
| * | ||
| * @returns Whether the window's native maximize button is enabled or not. | ||
| */ | ||
| isMaximizable(): Promise<boolean>; | ||
| /** | ||
| * Gets the window’s native minimize button state. | ||
| * | ||
| * #### Platform-specific | ||
| * | ||
| * - **Linux / iOS / Android:** Unsupported. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * const minimizable = await getCurrent().isMinimizable(); | ||
| * ``` | ||
| * | ||
| * @returns Whether the window's native minimize button is enabled or not. | ||
| */ | ||
| isMinimizable(): Promise<boolean>; | ||
| /** | ||
| * Gets the window’s native close button state. | ||
| * | ||
| * #### Platform-specific | ||
| * | ||
| * - **iOS / Android:** Unsupported. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * const closable = await getCurrent().isClosable(); | ||
| * ``` | ||
| * | ||
| * @returns Whether the window's native close button is enabled or not. | ||
| */ | ||
| isClosable(): Promise<boolean>; | ||
| /** | ||
| * Gets the window's current visible state. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * const visible = await getCurrent().isVisible(); | ||
| * ``` | ||
| * | ||
| * @returns Whether the window is visible or not. | ||
| */ | ||
| isVisible(): Promise<boolean>; | ||
| /** | ||
| * Gets the window's current title. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * const title = await getCurrent().title(); | ||
| * ``` | ||
| */ | ||
| title(): Promise<string>; | ||
| /** | ||
| * 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 { getCurrent } from '@tauri-apps/api/window'; | ||
| * const theme = await getCurrent().theme(); | ||
| * ``` | ||
| * | ||
| * @returns The window theme. | ||
| */ | ||
| theme(): Promise<Theme | null>; | ||
| /** | ||
| * Centers the window. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().center(); | ||
| * ``` | ||
| * | ||
| * @returns A promise indicating the success or failure of the operation. | ||
| */ | ||
| center(): Promise<void>; | ||
| /** | ||
| * 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 { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().requestUserAttention(); | ||
| * ``` | ||
| * | ||
| * @returns A promise indicating the success or failure of the operation. | ||
| */ | ||
| requestUserAttention(requestType: UserAttentionType | null): Promise<void>; | ||
| /** | ||
| * Updates the window resizable flag. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().setResizable(false); | ||
| * ``` | ||
| * | ||
| * @returns A promise indicating the success or failure of the operation. | ||
| */ | ||
| setResizable(resizable: boolean): Promise<void>; | ||
| /** | ||
| * Sets whether the window's native maximize button is enabled or not. | ||
| * If resizable is set to false, this setting is ignored. | ||
| * | ||
| * #### Platform-specific | ||
| * | ||
| * - **macOS:** Disables the "zoom" button in the window titlebar, which is also used to enter fullscreen mode. | ||
| * - **Linux / iOS / Android:** Unsupported. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().setMaximizable(false); | ||
| * ``` | ||
| * | ||
| * @returns A promise indicating the success or failure of the operation. | ||
| */ | ||
| setMaximizable(maximizable: boolean): Promise<void>; | ||
| /** | ||
| * Sets whether the window's native minimize button is enabled or not. | ||
| * | ||
| * #### Platform-specific | ||
| * | ||
| * - **Linux / iOS / Android:** Unsupported. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().setMinimizable(false); | ||
| * ``` | ||
| * | ||
| * @returns A promise indicating the success or failure of the operation. | ||
| */ | ||
| setMinimizable(minimizable: boolean): Promise<void>; | ||
| /** | ||
| * Sets whether the window's native close button is enabled or not. | ||
| * | ||
| * #### Platform-specific | ||
| * | ||
| * - **Linux:** GTK+ will do its best to convince the window manager not to show a close button. Depending on the system, this function may not have any effect when called on a window that is already visible | ||
| * - **iOS / Android:** Unsupported. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().setClosable(false); | ||
| * ``` | ||
| * | ||
| * @returns A promise indicating the success or failure of the operation. | ||
| */ | ||
| setClosable(closable: boolean): Promise<void>; | ||
| /** | ||
| * Sets the window title. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().setTitle('Tauri'); | ||
| * ``` | ||
| * | ||
| * @param title The new title | ||
| * @returns A promise indicating the success or failure of the operation. | ||
| */ | ||
| setTitle(title: string): Promise<void>; | ||
| /** | ||
| * Maximizes the window. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().maximize(); | ||
| * ``` | ||
| * | ||
| * @returns A promise indicating the success or failure of the operation. | ||
| */ | ||
| maximize(): Promise<void>; | ||
| /** | ||
| * Unmaximizes the window. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().unmaximize(); | ||
| * ``` | ||
| * | ||
| * @returns A promise indicating the success or failure of the operation. | ||
| */ | ||
| unmaximize(): Promise<void>; | ||
| /** | ||
| * Toggles the window maximized state. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().toggleMaximize(); | ||
| * ``` | ||
| * | ||
| * @returns A promise indicating the success or failure of the operation. | ||
| */ | ||
| toggleMaximize(): Promise<void>; | ||
| /** | ||
| * Minimizes the window. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().minimize(); | ||
| * ``` | ||
| * | ||
| * @returns A promise indicating the success or failure of the operation. | ||
| */ | ||
| minimize(): Promise<void>; | ||
| /** | ||
| * Unminimizes the window. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().unminimize(); | ||
| * ``` | ||
| * | ||
| * @returns A promise indicating the success or failure of the operation. | ||
| */ | ||
| unminimize(): Promise<void>; | ||
| /** | ||
| * Sets the window visibility to true. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().show(); | ||
| * ``` | ||
| * | ||
| * @returns A promise indicating the success or failure of the operation. | ||
| */ | ||
| show(): Promise<void>; | ||
| /** | ||
| * Sets the window visibility to false. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().hide(); | ||
| * ``` | ||
| * | ||
| * @returns A promise indicating the success or failure of the operation. | ||
| */ | ||
| hide(): Promise<void>; | ||
| /** | ||
| * Closes the window. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().close(); | ||
| * ``` | ||
| * | ||
| * @returns A promise indicating the success or failure of the operation. | ||
| */ | ||
| close(): Promise<void>; | ||
| /** | ||
| * Whether the window should have borders and bars. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().setDecorations(false); | ||
| * ``` | ||
| * | ||
| * @param decorations Whether the window should have borders and bars. | ||
| * @returns A promise indicating the success or failure of the operation. | ||
| */ | ||
| setDecorations(decorations: boolean): Promise<void>; | ||
| /** | ||
| * 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 { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().setShadow(false); | ||
| * ``` | ||
| * | ||
| * @returns A promise indicating the success or failure of the operation. | ||
| */ | ||
| setShadow(enable: boolean): Promise<void>; | ||
| /** | ||
| * Set window effects. | ||
| */ | ||
| setEffects(effects: Effects): Promise<void>; | ||
| /** | ||
| * Clear any applied effects if possible. | ||
| */ | ||
| clearEffects(): Promise<void>; | ||
| /** | ||
| * Whether the window should always be on top of other windows. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().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. | ||
| */ | ||
| setAlwaysOnTop(alwaysOnTop: boolean): Promise<void>; | ||
| /** | ||
| * Whether the window should always be below other windows. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().setAlwaysOnBottom(true); | ||
| * ``` | ||
| * | ||
| * @param alwaysOnBottom Whether the window should always be below other windows or not. | ||
| * @returns A promise indicating the success or failure of the operation. | ||
| */ | ||
| setAlwaysOnBottom(alwaysOnBottom: boolean): Promise<void>; | ||
| /** | ||
| * Prevents the window contents from being captured by other apps. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().setContentProtected(true); | ||
| * ``` | ||
| * | ||
| * @returns A promise indicating the success or failure of the operation. | ||
| */ | ||
| setContentProtected(protected_: boolean): Promise<void>; | ||
| /** | ||
| * Resizes the window with a new inner size. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent, LogicalSize } from '@tauri-apps/api/window'; | ||
| * await getCurrent().setSize(new LogicalSize(600, 500)); | ||
| * ``` | ||
| * | ||
| * @param size The logical or physical inner size. | ||
| * @returns A promise indicating the success or failure of the operation. | ||
| */ | ||
| setSize(size: LogicalSize | PhysicalSize): Promise<void>; | ||
| /** | ||
| * Sets the window minimum inner size. If the `size` argument is not provided, the constraint is unset. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent, PhysicalSize } from '@tauri-apps/api/window'; | ||
| * await getCurrent().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. | ||
| */ | ||
| setMinSize(size: LogicalSize | PhysicalSize | null | undefined): Promise<void>; | ||
| /** | ||
| * Sets the window maximum inner size. If the `size` argument is undefined, the constraint is unset. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent, LogicalSize } from '@tauri-apps/api/window'; | ||
| * await getCurrent().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. | ||
| */ | ||
| setMaxSize(size: LogicalSize | PhysicalSize | null | undefined): Promise<void>; | ||
| /** | ||
| * Sets the window outer position. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent, LogicalPosition } from '@tauri-apps/api/window'; | ||
| * await getCurrent().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. | ||
| */ | ||
| setPosition(position: LogicalPosition | PhysicalPosition): Promise<void>; | ||
| /** | ||
| * Sets the window fullscreen state. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().setFullscreen(true); | ||
| * ``` | ||
| * | ||
| * @param fullscreen Whether the window should go to fullscreen or not. | ||
| * @returns A promise indicating the success or failure of the operation. | ||
| */ | ||
| setFullscreen(fullscreen: boolean): Promise<void>; | ||
| /** | ||
| * Bring the window to front and focus. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().setFocus(); | ||
| * ``` | ||
| * | ||
| * @returns A promise indicating the success or failure of the operation. | ||
| */ | ||
| setFocus(): Promise<void>; | ||
| /** | ||
| * Sets the window icon. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().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. | ||
| */ | ||
| setIcon(icon: string | Uint8Array): Promise<void>; | ||
| /** | ||
| * Whether the window icon should be hidden from the taskbar or not. | ||
| * | ||
| * #### Platform-specific | ||
| * | ||
| * - **macOS:** Unsupported. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().setSkipTaskbar(true); | ||
| * ``` | ||
| * | ||
| * @param skip true to hide window icon, false to show it. | ||
| * @returns A promise indicating the success or failure of the operation. | ||
| */ | ||
| setSkipTaskbar(skip: boolean): Promise<void>; | ||
| /** | ||
| * 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 { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().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. | ||
| */ | ||
| setCursorGrab(grab: boolean): Promise<void>; | ||
| /** | ||
| * 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 { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().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. | ||
| */ | ||
| setCursorVisible(visible: boolean): Promise<void>; | ||
| /** | ||
| * Modifies the cursor icon of the window. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().setCursorIcon('help'); | ||
| * ``` | ||
| * | ||
| * @param icon The new cursor icon. | ||
| * @returns A promise indicating the success or failure of the operation. | ||
| */ | ||
| setCursorIcon(icon: CursorIcon): Promise<void>; | ||
| /** | ||
| * Changes the position of the cursor in window coordinates. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent, LogicalPosition } from '@tauri-apps/api/window'; | ||
| * await getCurrent().setCursorPosition(new LogicalPosition(600, 300)); | ||
| * ``` | ||
| * | ||
| * @param position The new cursor position. | ||
| * @returns A promise indicating the success or failure of the operation. | ||
| */ | ||
| setCursorPosition(position: LogicalPosition | PhysicalPosition): Promise<void>; | ||
| /** | ||
| * Changes the cursor events behavior. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().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. | ||
| */ | ||
| setIgnoreCursorEvents(ignore: boolean): Promise<void>; | ||
| /** | ||
| * Starts dragging the window. | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from '@tauri-apps/api/window'; | ||
| * await getCurrent().startDragging(); | ||
| * ``` | ||
| * | ||
| * @return A promise indicating the success or failure of the operation. | ||
| */ | ||
| startDragging(): Promise<void>; | ||
| /** | ||
| * Sets the taskbar progress state. | ||
| * | ||
| * #### Platform-specific | ||
| * | ||
| * - **Linux / macOS**: Progress bar is app-wide and not specific to this window. | ||
| * - **Linux**: Only supported desktop environments with `libunity` (e.g. GNOME). | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent, ProgressBarStatus } from '@tauri-apps/api/window'; | ||
| * await getCurrent().setProgressBar({ | ||
| * status: ProgressBarStatus.Normal, | ||
| * progress: 50, | ||
| * }); | ||
| * ``` | ||
| * | ||
| * @return A promise indicating the success or failure of the operation. | ||
| */ | ||
| setProgressBar(state: ProgressBarState): Promise<void>; | ||
| /** | ||
| * Listen to window resize. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from "@tauri-apps/api/window"; | ||
| * const unlisten = await getCurrent().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. | ||
| */ | ||
| onResized(handler: EventCallback<PhysicalSize>): Promise<UnlistenFn>; | ||
| /** | ||
| * Listen to window move. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from "@tauri-apps/api/window"; | ||
| * const unlisten = await getCurrent().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. | ||
| */ | ||
| onMoved(handler: EventCallback<PhysicalPosition>): Promise<UnlistenFn>; | ||
| /** | ||
| * Listen to window close requested. Emitted when the user requests to closes the window. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from "@tauri-apps/api/window"; | ||
| * import { confirm } from '@tauri-apps/api/dialog'; | ||
| * const unlisten = await getCurrent().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. | ||
| */ | ||
| onCloseRequested(handler: (event: CloseRequestedEvent) => void | Promise<void>): Promise<UnlistenFn>; | ||
| /** | ||
| * Listen to window focus change. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from "@tauri-apps/api/window"; | ||
| * const unlisten = await getCurrent().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. | ||
| */ | ||
| onFocusChanged(handler: EventCallback<boolean>): Promise<UnlistenFn>; | ||
| /** | ||
| * 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 { getCurrent } from "@tauri-apps/api/window"; | ||
| * const unlisten = await getCurrent().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. | ||
| */ | ||
| onScaleChanged(handler: EventCallback<ScaleFactorChanged>): Promise<UnlistenFn>; | ||
| /** | ||
| * Listen to the window menu item click. The payload is the item id. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from "@tauri-apps/api/window"; | ||
| * const unlisten = await getCurrent().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. | ||
| */ | ||
| onMenuClicked(handler: EventCallback<string>): Promise<UnlistenFn>; | ||
| /** | ||
| * 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 { getCurrent } from "@tauri-apps/api/window"; | ||
| * const unlisten = await getCurrent().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. | ||
| */ | ||
| onFileDropEvent(handler: EventCallback<FileDropEvent>): Promise<UnlistenFn>; | ||
| /** | ||
| * Listen to the system theme change. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { getCurrent } from "@tauri-apps/api/window"; | ||
| * const unlisten = await getCurrent().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. | ||
| */ | ||
| onThemeChanged(handler: EventCallback<Theme>): Promise<UnlistenFn>; | ||
| } | ||
| /** | ||
| * an array RGBA colors. Each value has minimum of 0 and maximum of 255. | ||
| * | ||
| * @since 2.0.0 | ||
| */ | ||
| type Color = [number, number, number, number]; | ||
| /** | ||
| * Platform-specific window effects | ||
| * | ||
| * @since 2.0.0 | ||
| */ | ||
| declare enum Effect { | ||
| /** | ||
| * A default material appropriate for the view's effectiveAppearance. **macOS 10.14-** | ||
| * | ||
| * @deprecated since macOS 10.14. You should instead choose an appropriate semantic material. | ||
| */ | ||
| AppearanceBased = "appearanceBased", | ||
| /** | ||
| * **macOS 10.14-** | ||
| * | ||
| * @deprecated since macOS 10.14. Use a semantic material instead. | ||
| */ | ||
| Light = "light", | ||
| /** | ||
| * **macOS 10.14-** | ||
| * | ||
| * @deprecated since macOS 10.14. Use a semantic material instead. | ||
| */ | ||
| Dark = "dark", | ||
| /** | ||
| * **macOS 10.14-** | ||
| * | ||
| * @deprecated since macOS 10.14. Use a semantic material instead. | ||
| */ | ||
| MediumLight = "mediumLight", | ||
| /** | ||
| * **macOS 10.14-** | ||
| * | ||
| * @deprecated since macOS 10.14. Use a semantic material instead. | ||
| */ | ||
| UltraDark = "ultraDark", | ||
| /** | ||
| * **macOS 10.10+** | ||
| */ | ||
| Titlebar = "titlebar", | ||
| /** | ||
| * **macOS 10.10+** | ||
| */ | ||
| Selection = "selection", | ||
| /** | ||
| * **macOS 10.11+** | ||
| */ | ||
| Menu = "menu", | ||
| /** | ||
| * **macOS 10.11+** | ||
| */ | ||
| Popover = "popover", | ||
| /** | ||
| * **macOS 10.11+** | ||
| */ | ||
| Sidebar = "sidebar", | ||
| /** | ||
| * **macOS 10.14+** | ||
| */ | ||
| HeaderView = "headerView", | ||
| /** | ||
| * **macOS 10.14+** | ||
| */ | ||
| Sheet = "sheet", | ||
| /** | ||
| * **macOS 10.14+** | ||
| */ | ||
| WindowBackground = "windowBackground", | ||
| /** | ||
| * **macOS 10.14+** | ||
| */ | ||
| HudWindow = "hudWindow", | ||
| /** | ||
| * **macOS 10.14+** | ||
| */ | ||
| FullScreenUI = "fullScreenUI", | ||
| /** | ||
| * **macOS 10.14+** | ||
| */ | ||
| Tooltip = "tooltip", | ||
| /** | ||
| * **macOS 10.14+** | ||
| */ | ||
| ContentBackground = "contentBackground", | ||
| /** | ||
| * **macOS 10.14+** | ||
| */ | ||
| UnderWindowBackground = "underWindowBackground", | ||
| /** | ||
| * **macOS 10.14+** | ||
| */ | ||
| UnderPageBackground = "underPageBackground", | ||
| /** | ||
| * **Windows 11 Only** | ||
| */ | ||
| Mica = "mica", | ||
| /** | ||
| * **Windows 7/10/11(22H1) Only** | ||
| * | ||
| * ## Notes | ||
| * | ||
| * This effect has bad performance when resizing/dragging the window on Windows 11 build 22621. | ||
| */ | ||
| Blur = "blur", | ||
| /** | ||
| * **Windows 10/11** | ||
| * | ||
| * ## Notes | ||
| * | ||
| * This effect has bad performance when resizing/dragging the window on Windows 10 v1903+ and Windows 11 build 22000. | ||
| */ | ||
| Acrylic = "acrylic", | ||
| /** | ||
| * Tabbed effect that matches the system dark perefence **Windows 11 Only** | ||
| */ | ||
| Tabbed = "tabbed", | ||
| /** | ||
| * Tabbed effect with dark mode but only if dark mode is enabled on the system **Windows 11 Only** | ||
| */ | ||
| TabbedDark = "tabbedDark", | ||
| /** | ||
| * Tabbed effect with light mode **Windows 11 Only** | ||
| */ | ||
| TabbedLight = "tabbedLight" | ||
| } | ||
| /** | ||
| * Window effect state **macOS only** | ||
| * | ||
| * @see https://developer.apple.com/documentation/appkit/nsvisualeffectview/state | ||
| * | ||
| * @since 2.0.0 | ||
| */ | ||
| declare enum EffectState { | ||
| /** | ||
| * Make window effect state follow the window's active state **macOS only** | ||
| */ | ||
| FollowsWindowActiveState = "followsWindowActiveState", | ||
| /** | ||
| * Make window effect state always active **macOS only** | ||
| */ | ||
| Active = "active", | ||
| /** | ||
| * Make window effect state always inactive **macOS only** | ||
| */ | ||
| Inactive = "inactive" | ||
| } | ||
| /** The window effects configuration object | ||
| * | ||
| * @since 2.0.0 | ||
| */ | ||
| interface Effects { | ||
| /** | ||
| * List of Window effects to apply to the Window. | ||
| * Conflicting effects will apply the first one and ignore the rest. | ||
| */ | ||
| effects: Effect[]; | ||
| /** | ||
| * Window effect state **macOS Only** | ||
| */ | ||
| state?: EffectState; | ||
| /** | ||
| * Window effect corner radius **macOS Only** | ||
| */ | ||
| radius?: number; | ||
| /** | ||
| * Window effect color. Affects {@link Effect.Blur} and {@link Effect.Acrylic} only | ||
| * on Windows 10 v1903+. Doesn't have any effect on Windows 7 or Windows 11. | ||
| */ | ||
| color?: Color; | ||
| } | ||
| /** | ||
| * 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,<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; | ||
| /** Whether the window should always be below other windows. */ | ||
| alwaysOnBottom?: 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.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; | ||
| /** | ||
| * Whether or not the webview should be launched in incognito mode. | ||
| * | ||
| * #### Platform-specific | ||
| * | ||
| * - **Android:** Unsupported. | ||
| */ | ||
| incognito?: boolean; | ||
| /** | ||
| * Whether the window's native maximize button is enabled or not. Defaults to `true`. | ||
| */ | ||
| maximizable?: boolean; | ||
| /** | ||
| * Whether the window's native minimize button is enabled or not. Defaults to `true`. | ||
| */ | ||
| minimizable?: boolean; | ||
| /** | ||
| * Whether the window's native close button is enabled or not. Defaults to `true`. | ||
| */ | ||
| closable?: boolean; | ||
| } | ||
| /** | ||
| * 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 | ||
| */ | ||
| declare function currentMonitor(): Promise<Monitor | null>; | ||
| /** | ||
| * 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 | ||
| */ | ||
| declare function primaryMonitor(): Promise<Monitor | null>; | ||
| /** | ||
| * 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 | ||
| */ | ||
| declare function availableMonitors(): Promise<Monitor[]>; | ||
| type window_Window = Window; | ||
| declare const window_Window: typeof Window; | ||
| type window_CloseRequestedEvent = CloseRequestedEvent; | ||
| declare const window_CloseRequestedEvent: typeof CloseRequestedEvent; | ||
| declare const window_getCurrent: typeof getCurrent; | ||
| declare const window_getAll: typeof getAll; | ||
| declare const window_LogicalSize: typeof LogicalSize; | ||
| declare const window_PhysicalSize: typeof PhysicalSize; | ||
| declare const window_LogicalPosition: typeof LogicalPosition; | ||
| declare const window_PhysicalPosition: typeof PhysicalPosition; | ||
| type window_UserAttentionType = UserAttentionType; | ||
| declare const window_UserAttentionType: typeof UserAttentionType; | ||
| type window_Effect = Effect; | ||
| declare const window_Effect: typeof Effect; | ||
| type window_EffectState = EffectState; | ||
| declare const window_EffectState: typeof EffectState; | ||
| declare const window_currentMonitor: typeof currentMonitor; | ||
| declare const window_primaryMonitor: typeof primaryMonitor; | ||
| declare const window_availableMonitors: typeof availableMonitors; | ||
| type window_Effects = Effects; | ||
| type window_Theme = Theme; | ||
| type window_TitleBarStyle = TitleBarStyle; | ||
| type window_ScaleFactorChanged = ScaleFactorChanged; | ||
| type window_FileDropEvent = FileDropEvent; | ||
| type window_WindowOptions = WindowOptions; | ||
| type window_Color = Color; | ||
| type window_Monitor = Monitor; | ||
| type window_CursorIcon = CursorIcon; | ||
| type window_ProgressBarStatus = ProgressBarStatus; | ||
| declare const window_ProgressBarStatus: typeof ProgressBarStatus; | ||
| type window_ProgressBarState = ProgressBarState; | ||
| type window_WindowLabel = WindowLabel; | ||
| declare namespace window { | ||
| export { | ||
| window_Window as Window, | ||
| window_CloseRequestedEvent as CloseRequestedEvent, | ||
| window_getCurrent as getCurrent, | ||
| window_getAll as getAll, | ||
| window_LogicalSize as LogicalSize, | ||
| window_PhysicalSize as PhysicalSize, | ||
| window_LogicalPosition as LogicalPosition, | ||
| window_PhysicalPosition as PhysicalPosition, | ||
| window_UserAttentionType as UserAttentionType, | ||
| window_Effect as Effect, | ||
| window_EffectState as EffectState, | ||
| window_currentMonitor as currentMonitor, | ||
| window_primaryMonitor as primaryMonitor, | ||
| window_availableMonitors as availableMonitors, | ||
| window_Effects as Effects, | ||
| window_Theme as Theme, | ||
| window_TitleBarStyle as TitleBarStyle, | ||
| window_ScaleFactorChanged as ScaleFactorChanged, | ||
| window_FileDropEvent as FileDropEvent, | ||
| window_WindowOptions as WindowOptions, | ||
| window_Color as Color, | ||
| window_Monitor as Monitor, | ||
| window_CursorIcon as CursorIcon, | ||
| window_ProgressBarStatus as ProgressBarStatus, | ||
| window_ProgressBarState as ProgressBarState, | ||
| window_WindowLabel as WindowLabel, | ||
| }; | ||
| } | ||
| export { CloseRequestedEvent as C, Effect as E, FileDropEvent as F, Monitor as M, ProgressBarStatus as P, ScaleFactorChanged as S, Theme as T, UserAttentionType as U, Window as W, getAll as a, EffectState as b, currentMonitor as c, availableMonitors as d, Effects as e, TitleBarStyle as f, getCurrent as g, WindowOptions as h, Color as i, CursorIcon as j, ProgressBarState as k, WindowLabel as l, primaryMonitor as p, window as w }; |
| "use strict";var w=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var N=(t,e)=>{for(var i in e)w(t,i,{get:e[i],enumerable:!0})},R=(t,e,i,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of O(e))!T.call(t,s)&&s!==i&&w(t,s,{get:()=>e[s],enumerable:!(l=k(e,s))||l.enumerable});return t};var f=t=>R(w({},"__esModule",{value:!0}),t);var M={};N(M,{CloseRequestedEvent:()=>m,Effect:()=>D,EffectState:()=>E,LogicalPosition:()=>b,LogicalSize:()=>c,PhysicalPosition:()=>u,PhysicalSize:()=>a,ProgressBarStatus:()=>W,UserAttentionType:()=>C,Window:()=>d,availableMonitors:()=>A,currentMonitor:()=>F,getAll:()=>h,getCurrent:()=>I,primaryMonitor:()=>x});module.exports=f(M);var c=class{constructor(e,i){this.type="Logical";this.width=e,this.height=i}},a=class{constructor(e,i){this.type="Physical";this.width=e,this.height=i}toLogical(e){return new c(this.width/e,this.height/e)}},b=class{constructor(e,i){this.type="Logical";this.x=e,this.y=i}},u=class{constructor(e,i){this.type="Physical";this.x=e,this.y=i}toLogical(e){return new b(this.x/e,this.y/e)}};function y(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}async function n(t,e={},i){return window.__TAURI_INTERNALS__.invoke(t,e,i)}async function P(t,e){await n("plugin:event|unlisten",{event:t,eventId:e})}async function g(t,e,i){return n("plugin:event|listen",{event:t,windowLabel:i?.target,handler:y(e)}).then(l=>async()=>P(t,l))}async function v(t,e,i){return g(t,l=>{e(l),P(t,l.id).catch(()=>{})},i)}async function _(t,e,i){await n("plugin:event|emit",{event:t,windowLabel:i?.target,payload:e})}var C=(i=>(i[i.Critical=1]="Critical",i[i.Informational=2]="Informational",i))(C||{}),m=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}},W=(o=>(o.None="none",o.Normal="normal",o.Indeterminate="indeterminate",o.Paused="paused",o.Error="error",o))(W||{});function I(){return new d(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}function h(){return window.__TAURI_INTERNALS__.metadata.windows.map(t=>new d(t.label,{skip:!0}))}var z=["tauri://created","tauri://error"],d=class t{constructor(e,i={}){this.label=e,this.listeners=Object.create(null),i?.skip||n("plugin:window|create",{options:{...i,label:e}}).then(async()=>this.emit("tauri://created")).catch(async l=>this.emit("tauri://error",l))}static getByLabel(e){return h().some(i=>i.label===e)?new t(e,{skip:!0}):null}static getCurrent(){return I()}static getAll(){return h()}static async getFocusedWindow(){for(let e of h())if(await e.isFocused())return e;return null}async listen(e,i){return this._handleTauriEvent(e,i)?Promise.resolve(()=>{let l=this.listeners[e];l.splice(l.indexOf(i),1)}):g(e,i,{target:this.label})}async once(e,i){return this._handleTauriEvent(e,i)?Promise.resolve(()=>{let l=this.listeners[e];l.splice(l.indexOf(i),1)}):v(e,i,{target:this.label})}async emit(e,i){if(z.includes(e)){for(let l of this.listeners[e]||[])l({event:e,id:-1,windowLabel:this.label,payload:i});return Promise.resolve()}return _(e,i,{target:this.label})}_handleTauriEvent(e,i){return z.includes(e)?(e in this.listeners?this.listeners[e].push(i):this.listeners[e]=[i],!0):!1}async scaleFactor(){return n("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return n("plugin:window|inner_position",{label:this.label}).then(({x:e,y:i})=>new u(e,i))}async outerPosition(){return n("plugin:window|outer_position",{label:this.label}).then(({x:e,y:i})=>new u(e,i))}async innerSize(){return n("plugin:window|inner_size",{label:this.label}).then(({width:e,height:i})=>new a(e,i))}async outerSize(){return n("plugin:window|outer_size",{label:this.label}).then(({width:e,height:i})=>new a(e,i))}async isFullscreen(){return n("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return n("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return n("plugin:window|is_maximized",{label:this.label})}async isFocused(){return n("plugin:window|is_focused",{label:this.label})}async isDecorated(){return n("plugin:window|is_decorated",{label:this.label})}async isResizable(){return n("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return n("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return n("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return n("plugin:window|is_closable",{label:this.label})}async isVisible(){return n("plugin:window|is_visible",{label:this.label})}async title(){return n("plugin:window|title",{label:this.label})}async theme(){return n("plugin:window|theme",{label:this.label})}async center(){return n("plugin:window|center",{label:this.label})}async requestUserAttention(e){let i=null;return e&&(e===1?i={type:"Critical"}:i={type:"Informational"}),n("plugin:window|request_user_attention",{label:this.label,value:i})}async setResizable(e){return n("plugin:window|set_resizable",{label:this.label,value:e})}async setMaximizable(e){return n("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return n("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return n("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return n("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return n("plugin:window|maximize",{label:this.label})}async unmaximize(){return n("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return n("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return n("plugin:window|minimize",{label:this.label})}async unminimize(){return n("plugin:window|unminimize",{label:this.label})}async show(){return n("plugin:window|show",{label:this.label})}async hide(){return n("plugin:window|hide",{label:this.label})}async close(){return n("plugin:window|close",{label:this.label})}async setDecorations(e){return n("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return n("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return n("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return n("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return n("plugin:window|set_always_on_top",{label:this.label,value:e})}async setAlwaysOnBottom(e){return n("plugin:window|set_always_on_bottom",{label:this.label,value:e})}async setContentProtected(e){return n("plugin:window|set_content_protected",{label:this.label,value: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 n("plugin:window|set_size",{label:this.label,value:{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 n("plugin:window|set_min_size",{label:this.label,value: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 n("plugin:window|set_max_size",{label:this.label,value: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 n("plugin:window|set_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setFullscreen(e){return n("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return n("plugin:window|set_focus",{label:this.label})}async setIcon(e){return n("plugin:window|set_icon",{label:this.label,value:typeof e=="string"?e:Array.from(e)})}async setSkipTaskbar(e){return n("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return n("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return n("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return n("plugin:window|set_cursor_icon",{label:this.label,value: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 n("plugin:window|set_cursor_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setIgnoreCursorEvents(e){return n("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return n("plugin:window|start_dragging",{label:this.label})}async setProgressBar(e){return n("plugin:window|set_progress_bar",{label:this.label,value:e})}async onResized(e){return this.listen("tauri://resize",i=>{i.payload=S(i.payload),e(i)})}async onMoved(e){return this.listen("tauri://move",i=>{i.payload=L(i.payload),e(i)})}async onCloseRequested(e){return this.listen("tauri://close-requested",i=>{let l=new m(i);Promise.resolve(e(l)).then(()=>{if(!l.isPreventDefault())return this.close()})})}async onFocusChanged(e){let i=await this.listen("tauri://focus",s=>{e({...s,payload:!0})}),l=await this.listen("tauri://blur",s=>{e({...s,payload:!1})});return()=>{i(),l()}}async onScaleChanged(e){return this.listen("tauri://scale-change",e)}async onMenuClicked(e){return this.listen("tauri://menu",e)}async onFileDropEvent(e){let i=await this.listen("tauri://file-drop",o=>{e({...o,payload:{type:"drop",paths:o.payload}})}),l=await this.listen("tauri://file-drop-hover",o=>{e({...o,payload:{type:"hover",paths:o.payload}})}),s=await this.listen("tauri://file-drop-cancelled",o=>{e({...o,payload:{type:"cancel"}})});return()=>{i(),l(),s()}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},D=(r=>(r.AppearanceBased="appearanceBased",r.Light="light",r.Dark="dark",r.MediumLight="mediumLight",r.UltraDark="ultraDark",r.Titlebar="titlebar",r.Selection="selection",r.Menu="menu",r.Popover="popover",r.Sidebar="sidebar",r.HeaderView="headerView",r.Sheet="sheet",r.WindowBackground="windowBackground",r.HudWindow="hudWindow",r.FullScreenUI="fullScreenUI",r.Tooltip="tooltip",r.ContentBackground="contentBackground",r.UnderWindowBackground="underWindowBackground",r.UnderPageBackground="underPageBackground",r.Mica="mica",r.Blur="blur",r.Acrylic="acrylic",r.Tabbed="tabbed",r.TabbedDark="tabbedDark",r.TabbedLight="tabbedLight",r))(D||{}),E=(l=>(l.FollowsWindowActiveState="followsWindowActiveState",l.Active="active",l.Inactive="inactive",l))(E||{});function p(t){return t===null?null:{name:t.name,scaleFactor:t.scaleFactor,position:L(t.position),size:S(t.size)}}function L(t){return new u(t.x,t.y)}function S(t){return new a(t.width,t.height)}async function F(){return n("plugin:window|current_monitor").then(p)}async function x(){return n("plugin:window|primary_monitor").then(p)}async function A(){return n("plugin:window|available_monitors").then(t=>t.map(p))} |
| export { b as LogicalPosition, L as LogicalSize, a as PhysicalPosition, P as PhysicalSize } from './dpi-1b9c86cc.js'; | ||
| import './event-bdc5d2c8.js'; | ||
| export { C as CloseRequestedEvent, i as Color, j as CursorIcon, E as Effect, b as EffectState, e as Effects, F as FileDropEvent, M as Monitor, k as ProgressBarState, P as ProgressBarStatus, S as ScaleFactorChanged, T as Theme, f as TitleBarStyle, U as UserAttentionType, W as Window, l as WindowLabel, h as WindowOptions, d as availableMonitors, c as currentMonitor, a as getAll, g as getCurrent, p as primaryMonitor } from './window-e99b5597.js'; |
| export { b as LogicalPosition, L as LogicalSize, a as PhysicalPosition, P as PhysicalSize } from './dpi-1b9c86cc.js'; | ||
| import './event-bdc5d2c8.js'; | ||
| export { C as CloseRequestedEvent, i as Color, j as CursorIcon, E as Effect, b as EffectState, e as Effects, F as FileDropEvent, M as Monitor, k as ProgressBarState, P as ProgressBarStatus, S as ScaleFactorChanged, T as Theme, f as TitleBarStyle, U as UserAttentionType, W as Window, l as WindowLabel, h as WindowOptions, d as availableMonitors, c as currentMonitor, a as getAll, g as getCurrent, p as primaryMonitor } from './window-e99b5597.js'; |
| import{a as e,b as f,c as g,d as h,e as i,f as j,g as k,h as l,i as m,j as n,k as o}from"./chunk-5MN3W4J2.js";import{a,b,c,d}from"./chunk-24ATAN64.js";import"./chunk-AFSYT2WA.js";import"./chunk-CTAYYLOC.js";import"./chunk-NDS2DDJC.js";export{f as CloseRequestedEvent,k as Effect,l as EffectState,c as LogicalPosition,a as LogicalSize,d as PhysicalPosition,b as PhysicalSize,g as ProgressBarStatus,e as UserAttentionType,j as Window,o as availableMonitors,m as currentMonitor,i as getAll,h as getCurrent,n as primaryMonitor}; |
+18
-0
| # Changelog | ||
| ## \[2.0.0-alpha.9] | ||
| ### New Features | ||
| - [`c1ec0f15`](https://www.github.com/tauri-apps/tauri/commit/c1ec0f155118527361dd5645d920becbc8afd569)([#7933](https://www.github.com/tauri-apps/tauri/pull/7933)) Added `setAlwaysOnBottom` function on `Window` and the `alwaysOnBottom` option when creating a window. | ||
| - [`fb10b879`](https://www.github.com/tauri-apps/tauri/commit/fb10b87970a43320ef4d14564f45e7579b774eaf)([#8039](https://www.github.com/tauri-apps/tauri/pull/8039)) Add the `app` module back. | ||
| - [`ed32257d`](https://www.github.com/tauri-apps/tauri/commit/ed32257d044f90b5eb15053efd1667125def2d2b)([#7794](https://www.github.com/tauri-apps/tauri/pull/7794)) On Windows, add `Effect.Tabbed`,`Effect.TabbedDark` and `Effect.TabbedLight` effects. | ||
| - [`c9a9246c`](https://www.github.com/tauri-apps/tauri/commit/c9a9246c37bdf190661355c8ee406dac6c427344)([#8007](https://www.github.com/tauri-apps/tauri/pull/8007)) Add the `window` module back. | ||
| - [`c085adda`](https://www.github.com/tauri-apps/tauri/commit/c085addab58ba851398373c6fd13f9cb026d71e8)([#8009](https://www.github.com/tauri-apps/tauri/pull/8009)) Added the `setProgressBar` API on the `Window` class. | ||
| ### What's Changed | ||
| - [`5c0eeb40`](https://www.github.com/tauri-apps/tauri/commit/5c0eeb40c1003583290ff3aebfa02e2b5f5b9c41)([#7638](https://www.github.com/tauri-apps/tauri/pull/7638)) Updated minimum Node.js version to 18. | ||
| ### Breaking Changes | ||
| - [`a63e71f9`](https://www.github.com/tauri-apps/tauri/commit/a63e71f9799e9bbc82521d2f17b5238fbf690e89)([#7942](https://www.github.com/tauri-apps/tauri/pull/7942)) Changed `tauri` module to `primitives` and removed the undocumented `invoke` export from the root module. | ||
| ## \[2.0.0-alpha.8] | ||
@@ -4,0 +22,0 @@ |
+1
-1
@@ -1,1 +0,1 @@ | ||
| "use strict";var d=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var h=(n,e)=>{for(var t in e)d(n,t,{get:e[t],enumerable:!0})},W=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of E(e))!N.call(n,s)&&s!==t&&d(n,s,{get:()=>e[s],enumerable:!(r=y(e,s))||r.enumerable});return n};var b=n=>W(d({},"__esModule",{value:!0}),n);var p=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)};var u=(n,e,t)=>(p(n,e,"read from private field"),t?t.call(n):e.get(n)),m=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},v=(n,e,t,r)=>(p(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t);var k={};h(k,{TauriEvent:()=>I,emit:()=>A,listen:()=>O,once:()=>D});module.exports=b(k);function R(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function a(n,e=!1){let t=R(),r=`_${t}`;return Object.defineProperty(window,r,{value:s=>(e&&Reflect.deleteProperty(window,r),n?.(s)),writable:!1,configurable:!0}),t}var o,w=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0;m(this,o,()=>{});this.id=a(e=>{u(this,o).call(this,e)})}set onmessage(e){v(this,o,e)}get onmessage(){return u(this,o)}toJSON(){return`__CHANNEL__:${this.id}`}};o=new WeakMap;async function l(n,e={},t){return new Promise((r,s)=>{let _=a(c=>{r(c),Reflect.deleteProperty(window,`_${g}`)},!0),g=a(c=>{s(c),Reflect.deleteProperty(window,`_${_}`)},!0);window.__TAURI_IPC__({cmd:n,callback:_,error:g,payload:e,options:t})})}var I=(i=>(i.WINDOW_RESIZED="tauri://resize",i.WINDOW_MOVED="tauri://move",i.WINDOW_CLOSE_REQUESTED="tauri://close-requested",i.WINDOW_CREATED="tauri://window-created",i.WINDOW_DESTROYED="tauri://destroyed",i.WINDOW_FOCUS="tauri://focus",i.WINDOW_BLUR="tauri://blur",i.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",i.WINDOW_THEME_CHANGED="tauri://theme-changed",i.WINDOW_FILE_DROP="tauri://file-drop",i.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",i.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",i.MENU="tauri://menu",i))(I||{});async function f(n,e){await l("plugin:event|unlisten",{event:n,eventId:e})}async function O(n,e,t){return l("plugin:event|listen",{event:n,windowLabel:t?.target,handler:a(e)}).then(r=>async()=>f(n,r))}async function D(n,e,t){return O(n,r=>{e(r),f(n,r.id).catch(()=>{})},t)}async function A(n,e,t){await l("plugin:event|emit",{event:n,windowLabel:t?.target,payload:e})} | ||
| "use strict";var a=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var p=(n,e)=>{for(var r in e)a(n,r,{get:e[r],enumerable:!0})},I=(n,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of g(e))!m.call(n,s)&&s!==r&&a(n,s,{get:()=>e[s],enumerable:!(i=d(e,s))||i.enumerable});return n};var v=n=>I(a({},"__esModule",{value:!0}),n);var E={};p(E,{TauriEvent:()=>c,emit:()=>O,listen:()=>_,once:()=>N});module.exports=v(E);function l(n,e=!1){return window.__TAURI_INTERNALS__.transformCallback(n,e)}async function o(n,e={},r){return window.__TAURI_INTERNALS__.invoke(n,e,r)}var c=(t=>(t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_CREATED="tauri://window-created",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_FILE_DROP="tauri://file-drop",t.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",t.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",t.MENU="tauri://menu",t))(c||{});async function u(n,e){await o("plugin:event|unlisten",{event:n,eventId:e})}async function _(n,e,r){return o("plugin:event|listen",{event:n,windowLabel:r?.target,handler:l(e)}).then(i=>async()=>u(n,i))}async function N(n,e,r){return _(n,i=>{e(i),u(n,i.id).catch(()=>{})},r)}async function O(n,e,r){await o("plugin:event|emit",{event:n,windowLabel:r?.target,payload:e})} |
+1
-1
@@ -1,1 +0,1 @@ | ||
| export { E as Event, a as EventCallback, b as EventName, O as Options, T as TauriEvent, U as UnlistenFn, c as emit, l as listen, o as once } from './event-506df71d.js'; | ||
| export { a as Event, b as EventCallback, E as EventName, O as Options, T as TauriEvent, U as UnlistenFn, c as emit, l as listen, o as once } from './event-bdc5d2c8.js'; |
+1
-1
@@ -1,1 +0,1 @@ | ||
| import{a,b,c,d}from"./chunk-4EPV3FVZ.js";import"./chunk-VMGITBBQ.js";import"./chunk-WVIOQTRJ.js";export{a as TauriEvent,d as emit,b as listen,c as once}; | ||
| import{a,b,c,d}from"./chunk-AFSYT2WA.js";import"./chunk-CTAYYLOC.js";import"./chunk-NDS2DDJC.js";export{a as TauriEvent,d as emit,b as listen,c as once}; |
+1
-1
@@ -1,1 +0,1 @@ | ||
| "use strict";var m=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var p=(n,r)=>{for(var i in r)m(n,i,{get:r[i],enumerable:!0})},W=(n,r,i,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of E(r))!N.call(n,a)&&a!==i&&m(n,a,{get:()=>r[a],enumerable:!(o=C(r,a))||o.enumerable});return n};var k=n=>W(m({},"__esModule",{value:!0}),n);var D=(n,r,i)=>{if(!r.has(n))throw TypeError("Cannot "+i)};var _=(n,r,i)=>(D(n,r,"read from private field"),i?i.call(n):r.get(n)),w=(n,r,i)=>{if(r.has(n))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(n):r.set(n,i)},A=(n,r,i,o)=>(D(n,r,"write to private field"),o?o.call(n,i):r.set(n,i),i);var vn={};p(vn,{event:()=>f,invoke:()=>hn,path:()=>h,tauri:()=>y});module.exports=k(vn);var f={};p(f,{TauriEvent:()=>b,emit:()=>x,listen:()=>R,once:()=>F});var y={};p(y,{Channel:()=>l,PluginListener:()=>g,addPluginListener:()=>L,convertFileSrc:()=>U,invoke:()=>t,transformCallback:()=>u});function T(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function u(n,r=!1){let i=T(),o=`_${i}`;return Object.defineProperty(window,o,{value:a=>(r&&Reflect.deleteProperty(window,o),n?.(a)),writable:!1,configurable:!0}),i}var c,l=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0;w(this,c,()=>{});this.id=u(r=>{_(this,c).call(this,r)})}set onmessage(r){A(this,c,r)}get onmessage(){return _(this,c)}toJSON(){return`__CHANNEL__:${this.id}`}};c=new WeakMap;var g=class{constructor(r,i,o){this.plugin=r,this.event=i,this.channelId=o}async unregister(){return t(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function L(n,r,i){let o=new l;return o.onmessage=i,t(`plugin:${n}|register_listener`,{event:r,handler:o}).then(()=>new g(n,r,o.id))}async function t(n,r={},i){return new Promise((o,a)=>{let v=u(d=>{o(d),Reflect.deleteProperty(window,`_${P}`)},!0),P=u(d=>{a(d),Reflect.deleteProperty(window,`_${v}`)},!0);window.__TAURI_IPC__({cmd:n,callback:v,error:P,payload:r,options:i})})}function U(n,r="asset"){return window.__TAURI__.convertFileSrc(n,r)}var b=(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))(b||{});async function I(n,r){await t("plugin:event|unlisten",{event:n,eventId:r})}async function R(n,r,i){return t("plugin:event|listen",{event:n,windowLabel:i?.target,handler:u(r)}).then(o=>async()=>I(n,o))}async function F(n,r,i){return R(n,o=>{r(o),I(n,o.id).catch(()=>{})},i)}async function x(n,r,i){await t("plugin:event|emit",{event:n,windowLabel:i?.target,payload:r})}var h={};p(h,{BaseDirectory:()=>O,appCacheDir:()=>V,appConfigDir:()=>S,appDataDir:()=>H,appLocalDataDir:()=>$,appLogDir:()=>an,audioDir:()=>M,basename:()=>yn,cacheDir:()=>j,configDir:()=>z,dataDir:()=>G,delimiter:()=>pn,desktopDir:()=>q,dirname:()=>mn,documentDir:()=>J,downloadDir:()=>K,executableDir:()=>Q,extname:()=>_n,fontDir:()=>Y,homeDir:()=>Z,isAbsolute:()=>fn,join:()=>dn,localDataDir:()=>X,normalize:()=>gn,pictureDir:()=>B,publicDir:()=>nn,resolve:()=>ln,resolveResource:()=>en,resourceDir:()=>rn,runtimeDir:()=>tn,sep:()=>un,tempDir:()=>cn,templateDir:()=>on,videoDir:()=>sn});var O=(e=>(e[e.Audio=1]="Audio",e[e.Cache=2]="Cache",e[e.Config=3]="Config",e[e.Data=4]="Data",e[e.LocalData=5]="LocalData",e[e.Document=6]="Document",e[e.Download=7]="Download",e[e.Picture=8]="Picture",e[e.Public=9]="Public",e[e.Video=10]="Video",e[e.Resource=11]="Resource",e[e.Temp=12]="Temp",e[e.AppConfig=13]="AppConfig",e[e.AppData=14]="AppData",e[e.AppLocalData=15]="AppLocalData",e[e.AppCache=16]="AppCache",e[e.AppLog=17]="AppLog",e[e.Desktop=18]="Desktop",e[e.Executable=19]="Executable",e[e.Font=20]="Font",e[e.Home=21]="Home",e[e.Runtime=22]="Runtime",e[e.Template=23]="Template",e))(O||{});async function S(){return t("plugin:path|resolve_directory",{directory:13})}async function H(){return t("plugin:path|resolve_directory",{directory:14})}async function $(){return t("plugin:path|resolve_directory",{directory:15})}async function V(){return t("plugin:path|resolve_directory",{directory:16})}async function M(){return t("plugin:path|resolve_directory",{directory:1})}async function j(){return t("plugin:path|resolve_directory",{directory:2})}async function z(){return t("plugin:path|resolve_directory",{directory:3})}async function G(){return t("plugin:path|resolve_directory",{directory:4})}async function q(){return t("plugin:path|resolve_directory",{directory:18})}async function J(){return t("plugin:path|resolve_directory",{directory:6})}async function K(){return t("plugin:path|resolve_directory",{directory:7})}async function Q(){return t("plugin:path|resolve_directory",{directory:19})}async function Y(){return t("plugin:path|resolve_directory",{directory:20})}async function Z(){return t("plugin:path|resolve_directory",{directory:21})}async function X(){return t("plugin:path|resolve_directory",{directory:5})}async function B(){return t("plugin:path|resolve_directory",{directory:8})}async function nn(){return t("plugin:path|resolve_directory",{directory:9})}async function rn(){return t("plugin:path|resolve_directory",{directory:11})}async function en(n){return t("plugin:path|resolve_directory",{directory:11,path:n})}async function tn(){return t("plugin:path|resolve_directory",{directory:22})}async function on(){return t("plugin:path|resolve_directory",{directory:23})}async function sn(){return t("plugin:path|resolve_directory",{directory:10})}async function an(){return t("plugin:path|resolve_directory",{directory:17})}async function cn(n){return t("plugin:path|resolve_directory",{directory:12})}function un(){return window.__TAURI__.path.__sep}function pn(){return window.__TAURI__.path.__delimiter}async function ln(...n){return t("plugin:path|resolve",{paths:n})}async function gn(n){return t("plugin:path|normalize",{path:n})}async function dn(...n){return t("plugin:path|join",{paths:n})}async function mn(n){return t("plugin:path|dirname",{path:n})}async function _n(n){return t("plugin:path|extname",{path:n})}async function yn(n,r){return t("plugin:path|basename",{path:n,ext:r})}async function fn(n){return t("plugin:path|isAbsolute",{path:n})}var hn=t; | ||
| "use strict";var D=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var J=Object.getOwnPropertyNames;var K=Object.prototype.hasOwnProperty;var p=(t,e)=>{for(var n in e)D(t,n,{get:e[n],enumerable:!0})},Y=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of J(e))!K.call(t,u)&&u!==n&&D(t,u,{get:()=>e[u],enumerable:!(o=Z(e,u))||o.enumerable});return t};var X=t=>Y(D({},"__esModule",{value:!0}),t);var N=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var C=(t,e,n)=>(N(t,e,"read from private field"),n?n.call(t):e.get(t)),O=(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)},x=(t,e,n,o)=>(N(t,e,"write to private field"),o?o.call(t,n):e.set(t,n),n);var Ve={};p(Ve,{app:()=>L,dpi:()=>k,event:()=>W,path:()=>A,primitives:()=>z,window:()=>S});module.exports=X(Ve);var L={};p(L,{getName:()=>ne,getTauriVersion:()=>te,getVersion:()=>ie,hide:()=>oe,show:()=>re});var z={};p(z,{Channel:()=>y,PluginListener:()=>w,addPluginListener:()=>B,convertFileSrc:()=>ee,invoke:()=>i,transformCallback:()=>P});function P(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}var m,y=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0;O(this,m,()=>{});this.id=P(e=>{C(this,m).call(this,e)})}set onmessage(e){x(this,m,e)}get onmessage(){return C(this,m)}toJSON(){return`__CHANNEL__:${this.id}`}};m=new WeakMap;var w=class{constructor(e,n,o){this.plugin=e,this.event=n,this.channelId=o}async unregister(){return i(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function B(t,e,n){let o=new y;return o.onmessage=n,i(`plugin:${t}|register_listener`,{event:e,handler:o}).then(()=>new w(t,e,o.id))}async function i(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}function ee(t,e="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(t,e)}async function ie(){return i("plugin:app|version")}async function ne(){return i("plugin:app|name")}async function te(){return i("plugin:app|tauri_version")}async function re(){return i("plugin:app|app_show")}async function oe(){return i("plugin:app|app_hide")}var W={};p(W,{TauriEvent:()=>I,emit:()=>E,listen:()=>v,once:()=>T});var I=(a=>(a.WINDOW_RESIZED="tauri://resize",a.WINDOW_MOVED="tauri://move",a.WINDOW_CLOSE_REQUESTED="tauri://close-requested",a.WINDOW_CREATED="tauri://window-created",a.WINDOW_DESTROYED="tauri://destroyed",a.WINDOW_FOCUS="tauri://focus",a.WINDOW_BLUR="tauri://blur",a.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",a.WINDOW_THEME_CHANGED="tauri://theme-changed",a.WINDOW_FILE_DROP="tauri://file-drop",a.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",a.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",a.MENU="tauri://menu",a))(I||{});async function F(t,e){await i("plugin:event|unlisten",{event:t,eventId:e})}async function v(t,e,n){return i("plugin:event|listen",{event:t,windowLabel:n?.target,handler:P(e)}).then(o=>async()=>F(t,o))}async function T(t,e,n){return v(t,o=>{e(o),F(t,o.id).catch(()=>{})},n)}async function E(t,e,n){await i("plugin:event|emit",{event:t,windowLabel:n?.target,payload:e})}var S={};p(S,{CloseRequestedEvent:()=>f,Effect:()=>G,EffectState:()=>q,LogicalPosition:()=>b,LogicalSize:()=>h,PhysicalPosition:()=>d,PhysicalSize:()=>c,ProgressBarStatus:()=>H,UserAttentionType:()=>M,Window:()=>g,availableMonitors:()=>ae,currentMonitor:()=>se,getAll:()=>_,getCurrent:()=>V,primaryMonitor:()=>le});var k={};p(k,{LogicalPosition:()=>b,LogicalSize:()=>h,PhysicalPosition:()=>d,PhysicalSize:()=>c});var h=class{constructor(e,n){this.type="Logical";this.width=e,this.height=n}},c=class{constructor(e,n){this.type="Physical";this.width=e,this.height=n}toLogical(e){return new h(this.width/e,this.height/e)}},b=class{constructor(e,n){this.type="Logical";this.x=e,this.y=n}},d=class{constructor(e,n){this.type="Physical";this.x=e,this.y=n}toLogical(e){return new b(this.x/e,this.y/e)}};var M=(n=>(n[n.Critical=1]="Critical",n[n.Informational=2]="Informational",n))(M||{}),f=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}},H=(l=>(l.None="none",l.Normal="normal",l.Indeterminate="indeterminate",l.Paused="paused",l.Error="error",l))(H||{});function V(){return new g(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}function _(){return window.__TAURI_INTERNALS__.metadata.windows.map(t=>new g(t.label,{skip:!0}))}var U=["tauri://created","tauri://error"],g=class t{constructor(e,n={}){this.label=e,this.listeners=Object.create(null),n?.skip||i("plugin:window|create",{options:{...n,label:e}}).then(async()=>this.emit("tauri://created")).catch(async o=>this.emit("tauri://error",o))}static getByLabel(e){return _().some(n=>n.label===e)?new t(e,{skip:!0}):null}static getCurrent(){return V()}static getAll(){return _()}static async getFocusedWindow(){for(let e of _())if(await e.isFocused())return e;return null}async listen(e,n){return this._handleTauriEvent(e,n)?Promise.resolve(()=>{let o=this.listeners[e];o.splice(o.indexOf(n),1)}):v(e,n,{target:this.label})}async once(e,n){return this._handleTauriEvent(e,n)?Promise.resolve(()=>{let o=this.listeners[e];o.splice(o.indexOf(n),1)}):T(e,n,{target:this.label})}async emit(e,n){if(U.includes(e)){for(let o of this.listeners[e]||[])o({event:e,id:-1,windowLabel:this.label,payload:n});return Promise.resolve()}return E(e,n,{target:this.label})}_handleTauriEvent(e,n){return U.includes(e)?(e in this.listeners?this.listeners[e].push(n):this.listeners[e]=[n],!0):!1}async scaleFactor(){return i("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return i("plugin:window|inner_position",{label:this.label}).then(({x:e,y:n})=>new d(e,n))}async outerPosition(){return i("plugin:window|outer_position",{label:this.label}).then(({x:e,y:n})=>new d(e,n))}async innerSize(){return i("plugin:window|inner_size",{label:this.label}).then(({width:e,height:n})=>new c(e,n))}async outerSize(){return i("plugin:window|outer_size",{label:this.label}).then(({width:e,height:n})=>new c(e,n))}async isFullscreen(){return i("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return i("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return i("plugin:window|is_maximized",{label:this.label})}async isFocused(){return i("plugin:window|is_focused",{label:this.label})}async isDecorated(){return i("plugin:window|is_decorated",{label:this.label})}async isResizable(){return i("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return i("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return i("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return i("plugin:window|is_closable",{label:this.label})}async isVisible(){return i("plugin:window|is_visible",{label:this.label})}async title(){return i("plugin:window|title",{label:this.label})}async theme(){return i("plugin:window|theme",{label:this.label})}async center(){return i("plugin:window|center",{label:this.label})}async requestUserAttention(e){let n=null;return e&&(e===1?n={type:"Critical"}:n={type:"Informational"}),i("plugin:window|request_user_attention",{label:this.label,value:n})}async setResizable(e){return i("plugin:window|set_resizable",{label:this.label,value:e})}async setMaximizable(e){return i("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return i("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return i("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return i("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return i("plugin:window|maximize",{label:this.label})}async unmaximize(){return i("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return i("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return i("plugin:window|minimize",{label:this.label})}async unminimize(){return i("plugin:window|unminimize",{label:this.label})}async show(){return i("plugin:window|show",{label:this.label})}async hide(){return i("plugin:window|hide",{label:this.label})}async close(){return i("plugin:window|close",{label:this.label})}async setDecorations(e){return i("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return i("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return i("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return i("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return i("plugin:window|set_always_on_top",{label:this.label,value:e})}async setAlwaysOnBottom(e){return i("plugin:window|set_always_on_bottom",{label:this.label,value:e})}async setContentProtected(e){return i("plugin:window|set_content_protected",{label:this.label,value: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("plugin:window|set_size",{label:this.label,value:{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("plugin:window|set_min_size",{label:this.label,value: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("plugin:window|set_max_size",{label:this.label,value: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("plugin:window|set_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setFullscreen(e){return i("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return i("plugin:window|set_focus",{label:this.label})}async setIcon(e){return i("plugin:window|set_icon",{label:this.label,value:typeof e=="string"?e:Array.from(e)})}async setSkipTaskbar(e){return i("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return i("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return i("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return i("plugin:window|set_cursor_icon",{label:this.label,value: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("plugin:window|set_cursor_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setIgnoreCursorEvents(e){return i("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return i("plugin:window|start_dragging",{label:this.label})}async setProgressBar(e){return i("plugin:window|set_progress_bar",{label:this.label,value:e})}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=$(n.payload),e(n)})}async onCloseRequested(e){return this.listen("tauri://close-requested",n=>{let o=new f(n);Promise.resolve(e(o)).then(()=>{if(!o.isPreventDefault())return this.close()})})}async onFocusChanged(e){let n=await this.listen("tauri://focus",u=>{e({...u,payload:!0})}),o=await this.listen("tauri://blur",u=>{e({...u,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",l=>{e({...l,payload:{type:"drop",paths:l.payload}})}),o=await this.listen("tauri://file-drop-hover",l=>{e({...l,payload:{type:"hover",paths:l.payload}})}),u=await this.listen("tauri://file-drop-cancelled",l=>{e({...l,payload:{type:"cancel"}})});return()=>{n(),o(),u()}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},G=(s=>(s.AppearanceBased="appearanceBased",s.Light="light",s.Dark="dark",s.MediumLight="mediumLight",s.UltraDark="ultraDark",s.Titlebar="titlebar",s.Selection="selection",s.Menu="menu",s.Popover="popover",s.Sidebar="sidebar",s.HeaderView="headerView",s.Sheet="sheet",s.WindowBackground="windowBackground",s.HudWindow="hudWindow",s.FullScreenUI="fullScreenUI",s.Tooltip="tooltip",s.ContentBackground="contentBackground",s.UnderWindowBackground="underWindowBackground",s.UnderPageBackground="underPageBackground",s.Mica="mica",s.Blur="blur",s.Acrylic="acrylic",s.Tabbed="tabbed",s.TabbedDark="tabbedDark",s.TabbedLight="tabbedLight",s))(G||{}),q=(o=>(o.FollowsWindowActiveState="followsWindowActiveState",o.Active="active",o.Inactive="inactive",o))(q||{});function R(t){return t===null?null:{name:t.name,scaleFactor:t.scaleFactor,position:$(t.position),size:j(t.size)}}function $(t){return new d(t.x,t.y)}function j(t){return new c(t.width,t.height)}async function se(){return i("plugin:window|current_monitor").then(R)}async function le(){return i("plugin:window|primary_monitor").then(R)}async function ae(){return i("plugin:window|available_monitors").then(t=>t.map(R))}var A={};p(A,{BaseDirectory:()=>Q,appCacheDir:()=>pe,appConfigDir:()=>ue,appDataDir:()=>ce,appLocalDataDir:()=>de,appLogDir:()=>ke,audioDir:()=>me,basename:()=>Me,cacheDir:()=>he,configDir:()=>be,dataDir:()=>ge,delimiter:()=>Ae,desktopDir:()=>ye,dirname:()=>Fe,documentDir:()=>we,downloadDir:()=>Pe,executableDir:()=>ve,extname:()=>Ue,fontDir:()=>_e,homeDir:()=>fe,isAbsolute:()=>He,join:()=>xe,localDataDir:()=>De,normalize:()=>Oe,pictureDir:()=>Ce,publicDir:()=>ze,resolve:()=>Ne,resolveResource:()=>Ie,resourceDir:()=>Le,runtimeDir:()=>Te,sep:()=>Se,tempDir:()=>Re,templateDir:()=>Ee,videoDir:()=>We});var Q=(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))(Q||{});async function ue(){return i("plugin:path|resolve_directory",{directory:13})}async function ce(){return i("plugin:path|resolve_directory",{directory:14})}async function de(){return i("plugin:path|resolve_directory",{directory:15})}async function pe(){return i("plugin:path|resolve_directory",{directory:16})}async function me(){return i("plugin:path|resolve_directory",{directory:1})}async function he(){return i("plugin:path|resolve_directory",{directory:2})}async function be(){return i("plugin:path|resolve_directory",{directory:3})}async function ge(){return i("plugin:path|resolve_directory",{directory:4})}async function ye(){return i("plugin:path|resolve_directory",{directory:18})}async function we(){return i("plugin:path|resolve_directory",{directory:6})}async function Pe(){return i("plugin:path|resolve_directory",{directory:7})}async function ve(){return i("plugin:path|resolve_directory",{directory:19})}async function _e(){return i("plugin:path|resolve_directory",{directory:20})}async function fe(){return i("plugin:path|resolve_directory",{directory:21})}async function De(){return i("plugin:path|resolve_directory",{directory:5})}async function Ce(){return i("plugin:path|resolve_directory",{directory:8})}async function ze(){return i("plugin:path|resolve_directory",{directory:9})}async function Le(){return i("plugin:path|resolve_directory",{directory:11})}async function Ie(t){return i("plugin:path|resolve_directory",{directory:11,path:t})}async function Te(){return i("plugin:path|resolve_directory",{directory:22})}async function Ee(){return i("plugin:path|resolve_directory",{directory:23})}async function We(){return i("plugin:path|resolve_directory",{directory:10})}async function ke(){return i("plugin:path|resolve_directory",{directory:17})}async function Re(t){return i("plugin:path|resolve_directory",{directory:12})}function Se(){return window.__TAURI_INTERNALS__.plugins.path.sep}function Ae(){return window.__TAURI_INTERNALS__.plugins.path.delimiter}async function Ne(...t){return i("plugin:path|resolve",{paths:t})}async function Oe(t){return i("plugin:path|normalize",{path:t})}async function xe(...t){return i("plugin:path|join",{paths:t})}async function Fe(t){return i("plugin:path|dirname",{path:t})}async function Ue(t){return i("plugin:path|extname",{path:t})}async function Me(t,e){return i("plugin:path|basename",{path:t,ext:e})}async function He(t){return i("plugin:path|isAbsolute",{path:t})} |
+5
-19
@@ -1,20 +0,6 @@ | ||
| export { e as event } from './event-506df71d.js'; | ||
| import { i as invoke$1 } from './tauri-29554428.js'; | ||
| export { t as tauri } from './tauri-29554428.js'; | ||
| export { a as app } from './app-d81a8ac4.js'; | ||
| export { e as event } from './event-bdc5d2c8.js'; | ||
| export { p as primitives } from './primitives-742a88b2.js'; | ||
| export { w as window } from './window-e99b5597.js'; | ||
| export { p as path } from './path-9694881f.js'; | ||
| /** | ||
| * The Tauri API allows you to interface with the backend layer. | ||
| * | ||
| * This module exposes all other modules as an object where the key is the module name, and the value is the module exports. | ||
| * @example | ||
| * ```typescript | ||
| * import { app, dialog, event, fs, globalShortcut } from '@tauri-apps/api' | ||
| * ``` | ||
| * @module | ||
| */ | ||
| /** @ignore */ | ||
| declare const invoke: typeof invoke$1; | ||
| export { invoke }; | ||
| export { d as dpi } from './dpi-1b9c86cc.js'; |
+1
-1
@@ -1,1 +0,1 @@ | ||
| import{e as t}from"./chunk-4EPV3FVZ.js";import{I as i}from"./chunk-EWD5IYKL.js";import{e as o,g as r}from"./chunk-VMGITBBQ.js";import"./chunk-WVIOQTRJ.js";var a=o;export{t as event,a as invoke,i as path,r as tauri}; | ||
| import{l as i}from"./chunk-5MN3W4J2.js";import{f as r}from"./chunk-KXWJIJYO.js";import{e as m}from"./chunk-24ATAN64.js";import{e as p}from"./chunk-AFSYT2WA.js";import{I as t}from"./chunk-UPUVCPZK.js";import{g as o}from"./chunk-CTAYYLOC.js";import"./chunk-NDS2DDJC.js";export{r as app,m as dpi,p as event,t as path,o as primitives,i as window}; |
+1
-1
@@ -1,1 +0,1 @@ | ||
| "use strict";var r=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var t=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var c=(e,n)=>{for(var _ in n)r(e,_,{get:n[_],enumerable:!0})},s=(e,n,_,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of t(n))!a.call(e,o)&&o!==_&&r(e,o,{get:()=>n[o],enumerable:!(i=d(n,o))||i.enumerable});return e};var A=e=>s(r({},"__esModule",{value:!0}),e);var I={};c(I,{clearMocks:()=>g,mockIPC:()=>l,mockWindows:()=>T});module.exports=A(I);function l(e){window.__TAURI_IPC__=async({cmd:n,callback:_,error:i,payload:o})=>{try{window[`_${_}`](await e(n,o))}catch(w){window[`_${i}`](w)}}}function T(e,...n){window.__TAURI_METADATA__={__windows:[e,...n].map(_=>({label:_})),__currentWindow:{label:e}}}function g(){delete window.__TAURI_IPC__,delete window.__TAURI_METADATA__} | ||
| "use strict";var _=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var c=(o,n)=>{for(var e in n)_(o,e,{get:n[e],enumerable:!0})},s=(o,n,e,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of r(n))!w.call(o,i)&&i!==e&&_(o,i,{get:()=>n[i],enumerable:!(t=d(n,i))||t.enumerable});return o};var I=o=>s(_({},"__esModule",{value:!0}),o);var k={};c(k,{clearMocks:()=>g,mockIPC:()=>m,mockWindows:()=>R});module.exports=I(k);function m(o){window.__TAURI_INTERNALS__.ipc=async({cmd:n,callback:e,error:t,payload:i})=>{try{window[`_${e}`](await o(n,i))}catch(a){window[`_${t}`](a)}}}function R(o,...n){window.__TAURI_INTERNALS__.metadata={windows:[o,...n].map(e=>({label:e})),currentWindow:{label:o}}}function g(){delete window.__TAURI_INTERNALS__.ipc,delete window.__TAURI_INTERNALS__.metadata} |
+5
-18
@@ -1,14 +0,1 @@ | ||
| /** @ignore */ | ||
| declare global { | ||
| interface Window { | ||
| __TAURI_METADATA__: { | ||
| __windows: WindowDef[]; | ||
| __currentWindow: WindowDef; | ||
| }; | ||
| } | ||
| } | ||
| /** @ignore */ | ||
| interface WindowDef { | ||
| label: string; | ||
| } | ||
| /** | ||
@@ -24,3 +11,3 @@ * Intercepts all IPC requests with the given mock handler. | ||
| * import { mockIPC, clearMocks } from "@tauri-apps/api/mocks" | ||
| * import { invoke } from "@tauri-apps/api/tauri" | ||
| * import { invoke } from "@tauri-apps/api/primitives" | ||
| * | ||
@@ -48,3 +35,3 @@ * afterEach(() => { | ||
| * import { mockIPC, clearMocks } from "@tauri-apps/api/mocks" | ||
| * import { invoke } from "@tauri-apps/api/tauri" | ||
| * import { invoke } from "@tauri-apps/api/primitives" | ||
| * | ||
@@ -69,3 +56,3 @@ * afterEach(() => { | ||
| */ | ||
| declare function mockIPC(cb: (cmd: string, payload: Record<string, unknown>) => any | Promise<any>): void; | ||
| declare function mockIPC(cb: (cmd: string, payload: Record<string, unknown>) => unknown): void; | ||
| /** | ||
@@ -128,7 +115,7 @@ * Mocks one or many window labels. | ||
| * | ||
| * expect(window).toHaveProperty("__TAURI_METADATA__") | ||
| * expect(window.__TAURI_INTERNALS__).toHaveProperty("metadata") | ||
| * }) | ||
| * | ||
| * test("no mocked windows", () => { | ||
| * expect(window).not.toHaveProperty("__TAURI_METADATA__") | ||
| * expect(window.__TAURI_INTERNALS__).not.toHaveProperty("metadata") | ||
| * }) | ||
@@ -135,0 +122,0 @@ * ``` |
+1
-1
@@ -1,1 +0,1 @@ | ||
| import"./chunk-WVIOQTRJ.js";function w(n){window.__TAURI_IPC__=async({cmd:e,callback:_,error:o,payload:i})=>{try{window[`_${_}`](await n(e,i))}catch(r){window[`_${o}`](r)}}}function d(n,...e){window.__TAURI_METADATA__={__windows:[n,...e].map(_=>({label:_})),__currentWindow:{label:n}}}function t(){delete window.__TAURI_IPC__,delete window.__TAURI_METADATA__}export{t as clearMocks,w as mockIPC,d as mockWindows}; | ||
| import"./chunk-NDS2DDJC.js";function a(n){window.__TAURI_INTERNALS__.ipc=async({cmd:o,callback:e,error:i,payload:t})=>{try{window[`_${e}`](await n(o,t))}catch(_){window[`_${i}`](_)}}}function d(n,...o){window.__TAURI_INTERNALS__.metadata={windows:[n,...o].map(e=>({label:e})),currentWindow:{label:n}}}function r(){delete window.__TAURI_INTERNALS__.ipc,delete window.__TAURI_INTERNALS__.metadata}export{r as clearMocks,a as mockIPC,d as mockWindows}; |
+21
-5
| { | ||
| "name": "@tauri-apps/api", | ||
| "version": "2.0.0-alpha.8", | ||
| "version": "2.0.0-alpha.9", | ||
| "description": "Tauri API definitions", | ||
@@ -11,2 +11,10 @@ "type": "module", | ||
| "exports": { | ||
| "./app": { | ||
| "import": "./app.js", | ||
| "require": "./app.cjs" | ||
| }, | ||
| "./dpi": { | ||
| "import": "./dpi.js", | ||
| "require": "./dpi.cjs" | ||
| }, | ||
| "./event": { | ||
@@ -16,2 +24,6 @@ "import": "./event.js", | ||
| }, | ||
| "./global.d": { | ||
| "import": "./global.d.js", | ||
| "require": "./global.d.cjs" | ||
| }, | ||
| ".": { | ||
@@ -29,6 +41,10 @@ "import": "./index.js", | ||
| }, | ||
| "./tauri": { | ||
| "import": "./tauri.js", | ||
| "require": "./tauri.cjs" | ||
| "./primitives": { | ||
| "import": "./primitives.js", | ||
| "require": "./primitives.cjs" | ||
| }, | ||
| "./window": { | ||
| "import": "./window.js", | ||
| "require": "./window.cjs" | ||
| }, | ||
| "./package.json": "./package.json" | ||
@@ -62,3 +78,3 @@ }, | ||
| "engines": { | ||
| "node": ">= 14.6.0", | ||
| "node": ">= 18", | ||
| "npm": ">= 6.6.0", | ||
@@ -65,0 +81,0 @@ "yarn": ">= 1.19.1" |
+1
-1
@@ -1,1 +0,1 @@ | ||
| "use strict";var a=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var w=(n,e)=>{for(var i in e)a(n,i,{get:e[i],enumerable:!0})},b=(n,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of P(e))!A.call(n,s)&&s!==i&&a(n,s,{get:()=>e[s],enumerable:!(o=v(e,s))||o.enumerable});return n};var T=n=>b(a({},"__esModule",{value:!0}),n);var m=(n,e,i)=>{if(!e.has(n))throw TypeError("Cannot "+i)};var p=(n,e,i)=>(m(n,e,"read from private field"),i?i.call(n):e.get(n)),y=(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)},_=(n,e,i,o)=>(m(n,e,"write to private field"),o?o.call(n,i):e.set(n,i),i);var or={};w(or,{BaseDirectory:()=>h,appCacheDir:()=>C,appConfigDir:()=>I,appDataDir:()=>D,appLocalDataDir:()=>k,appLogDir:()=>G,audioDir:()=>L,basename:()=>tr,cacheDir:()=>U,configDir:()=>x,dataDir:()=>$,delimiter:()=>Y,desktopDir:()=>E,dirname:()=>nr,documentDir:()=>F,downloadDir:()=>H,executableDir:()=>N,extname:()=>er,fontDir:()=>O,homeDir:()=>S,isAbsolute:()=>ir,join:()=>rr,localDataDir:()=>j,normalize:()=>B,pictureDir:()=>V,publicDir:()=>z,resolve:()=>Z,resolveResource:()=>K,resourceDir:()=>J,runtimeDir:()=>M,sep:()=>X,tempDir:()=>Q,templateDir:()=>W,videoDir:()=>q});module.exports=T(or);function R(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function l(n,e=!1){let i=R(),o=`_${i}`;return Object.defineProperty(window,o,{value:s=>(e&&Reflect.deleteProperty(window,o),n?.(s)),writable:!1,configurable:!0}),i}var c,f=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0;y(this,c,()=>{});this.id=l(e=>{p(this,c).call(this,e)})}set onmessage(e){_(this,c,e)}get onmessage(){return p(this,c)}toJSON(){return`__CHANNEL__:${this.id}`}};c=new WeakMap;async function t(n,e={},i){return new Promise((o,s)=>{let g=l(u=>{o(u),Reflect.deleteProperty(window,`_${d}`)},!0),d=l(u=>{s(u),Reflect.deleteProperty(window,`_${g}`)},!0);window.__TAURI_IPC__({cmd:n,callback:g,error:d,payload:e,options:i})})}var h=(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))(h||{});async function I(){return t("plugin:path|resolve_directory",{directory:13})}async function D(){return t("plugin:path|resolve_directory",{directory:14})}async function k(){return t("plugin:path|resolve_directory",{directory:15})}async function C(){return t("plugin:path|resolve_directory",{directory:16})}async function L(){return t("plugin:path|resolve_directory",{directory:1})}async function U(){return t("plugin:path|resolve_directory",{directory:2})}async function x(){return t("plugin:path|resolve_directory",{directory:3})}async function $(){return t("plugin:path|resolve_directory",{directory:4})}async function E(){return t("plugin:path|resolve_directory",{directory:18})}async function F(){return t("plugin:path|resolve_directory",{directory:6})}async function H(){return t("plugin:path|resolve_directory",{directory:7})}async function N(){return t("plugin:path|resolve_directory",{directory:19})}async function O(){return t("plugin:path|resolve_directory",{directory:20})}async function S(){return t("plugin:path|resolve_directory",{directory:21})}async function j(){return t("plugin:path|resolve_directory",{directory:5})}async function V(){return t("plugin:path|resolve_directory",{directory:8})}async function z(){return t("plugin:path|resolve_directory",{directory:9})}async function J(){return t("plugin:path|resolve_directory",{directory:11})}async function K(n){return t("plugin:path|resolve_directory",{directory:11,path:n})}async function M(){return t("plugin:path|resolve_directory",{directory:22})}async function W(){return t("plugin:path|resolve_directory",{directory:23})}async function q(){return t("plugin:path|resolve_directory",{directory:10})}async function G(){return t("plugin:path|resolve_directory",{directory:17})}async function Q(n){return t("plugin:path|resolve_directory",{directory:12})}function X(){return window.__TAURI__.path.__sep}function Y(){return window.__TAURI__.path.__delimiter}async function Z(...n){return t("plugin:path|resolve",{paths:n})}async function B(n){return t("plugin:path|normalize",{path:n})}async function rr(...n){return t("plugin:path|join",{paths:n})}async function nr(n){return t("plugin:path|dirname",{path:n})}async function er(n){return t("plugin:path|extname",{path:n})}async function tr(n,e){return t("plugin:path|basename",{path:n,ext:e})}async function ir(n){return t("plugin:path|isAbsolute",{path:n})} | ||
| "use strict";var s=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var l=(i,e)=>{for(var t in e)s(i,t,{get:e[t],enumerable:!0})},d=(i,e,t,u)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of p(e))!g.call(i,o)&&o!==t&&s(i,o,{get:()=>e[o],enumerable:!(u=a(e,o))||u.enumerable});return i};var m=i=>d(s({},"__esModule",{value:!0}),i);var Q={};l(Q,{BaseDirectory:()=>c,appCacheDir:()=>f,appConfigDir:()=>y,appDataDir:()=>_,appLocalDataDir:()=>h,appLogDir:()=>F,audioDir:()=>v,basename:()=>q,cacheDir:()=>P,configDir:()=>A,dataDir:()=>T,delimiter:()=>j,desktopDir:()=>I,dirname:()=>K,documentDir:()=>R,downloadDir:()=>b,executableDir:()=>w,extname:()=>M,fontDir:()=>D,homeDir:()=>k,isAbsolute:()=>G,join:()=>J,localDataDir:()=>L,normalize:()=>V,pictureDir:()=>N,publicDir:()=>C,resolve:()=>z,resolveResource:()=>x,resourceDir:()=>E,runtimeDir:()=>S,sep:()=>$,tempDir:()=>O,templateDir:()=>U,videoDir:()=>H});module.exports=m(Q);async function n(i,e={},t){return window.__TAURI_INTERNALS__.invoke(i,e,t)}var c=(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))(c||{});async function y(){return n("plugin:path|resolve_directory",{directory:13})}async function _(){return n("plugin:path|resolve_directory",{directory:14})}async function h(){return n("plugin:path|resolve_directory",{directory:15})}async function f(){return n("plugin:path|resolve_directory",{directory:16})}async function v(){return n("plugin:path|resolve_directory",{directory:1})}async function P(){return n("plugin:path|resolve_directory",{directory:2})}async function A(){return n("plugin:path|resolve_directory",{directory:3})}async function T(){return n("plugin:path|resolve_directory",{directory:4})}async function I(){return n("plugin:path|resolve_directory",{directory:18})}async function R(){return n("plugin:path|resolve_directory",{directory:6})}async function b(){return n("plugin:path|resolve_directory",{directory:7})}async function w(){return n("plugin:path|resolve_directory",{directory:19})}async function D(){return n("plugin:path|resolve_directory",{directory:20})}async function k(){return n("plugin:path|resolve_directory",{directory:21})}async function L(){return n("plugin:path|resolve_directory",{directory:5})}async function N(){return n("plugin:path|resolve_directory",{directory:8})}async function C(){return n("plugin:path|resolve_directory",{directory:9})}async function E(){return n("plugin:path|resolve_directory",{directory:11})}async function x(i){return n("plugin:path|resolve_directory",{directory:11,path:i})}async function S(){return n("plugin:path|resolve_directory",{directory:22})}async function U(){return n("plugin:path|resolve_directory",{directory:23})}async function H(){return n("plugin:path|resolve_directory",{directory:10})}async function F(){return n("plugin:path|resolve_directory",{directory:17})}async function O(i){return n("plugin:path|resolve_directory",{directory:12})}function $(){return window.__TAURI_INTERNALS__.plugins.path.sep}function j(){return window.__TAURI_INTERNALS__.plugins.path.delimiter}async function z(...i){return n("plugin:path|resolve",{paths:i})}async function V(i){return n("plugin:path|normalize",{path:i})}async function J(...i){return n("plugin:path|join",{paths:i})}async function K(i){return n("plugin:path|dirname",{path:i})}async function M(i){return n("plugin:path|extname",{path:i})}async function q(i,e){return n("plugin:path|basename",{path:i,ext:e})}async function G(i){return n("plugin:path|isAbsolute",{path:i})} |
+1
-1
@@ -1,1 +0,1 @@ | ||
| import{A,B,C,D,E,F,G,H,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-EWD5IYKL.js";import"./chunk-VMGITBBQ.js";import"./chunk-WVIOQTRJ.js";export{a as BaseDirectory,e as appCacheDir,b as appConfigDir,c as appDataDir,d as appLocalDataDir,x as appLogDir,f as audioDir,G as basename,g as cacheDir,h as configDir,i as dataDir,A as delimiter,j as desktopDir,E as dirname,k as documentDir,l as downloadDir,m as executableDir,F as extname,n as fontDir,o as homeDir,H as isAbsolute,D as join,p as localDataDir,C as normalize,q as pictureDir,r as publicDir,B as resolve,t as resolveResource,s as resourceDir,u as runtimeDir,z as sep,y as tempDir,v as templateDir,w as videoDir}; | ||
| import{A,B,C,D,E,F,G,H,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-UPUVCPZK.js";import"./chunk-CTAYYLOC.js";import"./chunk-NDS2DDJC.js";export{a as BaseDirectory,e as appCacheDir,b as appConfigDir,c as appDataDir,d as appLocalDataDir,x as appLogDir,f as audioDir,G as basename,g as cacheDir,h as configDir,i as dataDir,A as delimiter,j as desktopDir,E as dirname,k as documentDir,l as downloadDir,m as executableDir,F as extname,n as fontDir,o as homeDir,H as isAbsolute,D as join,p as localDataDir,C as normalize,q as pictureDir,r as publicDir,B as resolve,t as resolveResource,s as resourceDir,u as runtimeDir,z as sep,y as tempDir,v as templateDir,w as videoDir}; |
| import{a as o,e as a}from"./chunk-VMGITBBQ.js";import{a as O}from"./chunk-WVIOQTRJ.js";var E={};O(E,{TauriEvent:()=>l,emit:()=>D,listen:()=>c,once:()=>W});var l=(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))(l||{});async function s(n,t){await a("plugin:event|unlisten",{event:n,eventId:t})}async function c(n,t,i){return a("plugin:event|listen",{event:n,windowLabel:i?.target,handler:o(t)}).then(r=>async()=>s(n,r))}async function W(n,t,i){return c(n,r=>{t(r),s(n,r.id).catch(()=>{})},i)}async function D(n,t,i){await a("plugin:event|emit",{event:n,windowLabel:i?.target,payload:t})}export{l as a,c as b,W as c,D as d,E as e}; |
| import{e as n}from"./chunk-VMGITBBQ.js";import{a as o}from"./chunk-WVIOQTRJ.js";var q={};o(q,{BaseDirectory:()=>t,appCacheDir:()=>p,appConfigDir:()=>s,appDataDir:()=>u,appLocalDataDir:()=>c,appLogDir:()=>x,audioDir:()=>a,basename:()=>U,cacheDir:()=>l,configDir:()=>g,dataDir:()=>d,delimiter:()=>j,desktopDir:()=>m,dirname:()=>H,documentDir:()=>y,downloadDir:()=>h,executableDir:()=>f,extname:()=>I,fontDir:()=>_,homeDir:()=>P,isAbsolute:()=>V,join:()=>F,localDataDir:()=>v,normalize:()=>E,pictureDir:()=>D,publicDir:()=>A,resolve:()=>z,resolveResource:()=>C,resourceDir:()=>b,runtimeDir:()=>L,sep:()=>k,tempDir:()=>T,templateDir:()=>R,videoDir:()=>w});var t=(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))(t||{});async function s(){return n("plugin:path|resolve_directory",{directory:13})}async function u(){return n("plugin:path|resolve_directory",{directory:14})}async function c(){return n("plugin:path|resolve_directory",{directory:15})}async function p(){return n("plugin:path|resolve_directory",{directory:16})}async function a(){return n("plugin:path|resolve_directory",{directory:1})}async function l(){return n("plugin:path|resolve_directory",{directory:2})}async function g(){return n("plugin:path|resolve_directory",{directory:3})}async function d(){return n("plugin:path|resolve_directory",{directory:4})}async function m(){return n("plugin:path|resolve_directory",{directory:18})}async function y(){return n("plugin:path|resolve_directory",{directory:6})}async function h(){return n("plugin:path|resolve_directory",{directory:7})}async function f(){return n("plugin:path|resolve_directory",{directory:19})}async function _(){return n("plugin:path|resolve_directory",{directory:20})}async function P(){return n("plugin:path|resolve_directory",{directory:21})}async function v(){return n("plugin:path|resolve_directory",{directory:5})}async function D(){return n("plugin:path|resolve_directory",{directory:8})}async function A(){return n("plugin:path|resolve_directory",{directory:9})}async function b(){return n("plugin:path|resolve_directory",{directory:11})}async function C(i){return n("plugin:path|resolve_directory",{directory:11,path:i})}async function L(){return n("plugin:path|resolve_directory",{directory:22})}async function R(){return n("plugin:path|resolve_directory",{directory:23})}async function w(){return n("plugin:path|resolve_directory",{directory:10})}async function x(){return n("plugin:path|resolve_directory",{directory:17})}async function T(i){return n("plugin:path|resolve_directory",{directory:12})}function k(){return window.__TAURI__.path.__sep}function j(){return window.__TAURI__.path.__delimiter}async function z(...i){return n("plugin:path|resolve",{paths:i})}async function E(i){return n("plugin:path|normalize",{path:i})}async function F(...i){return n("plugin:path|join",{paths:i})}async function H(i){return n("plugin:path|dirname",{path:i})}async function I(i){return n("plugin:path|extname",{path:i})}async function U(i,e){return n("plugin:path|basename",{path:i,ext:e})}async function V(i){return n("plugin:path|isAbsolute",{path:i})}export{t as a,s as b,u as c,c as d,p as e,a as f,l as g,g as h,d as i,m as j,y as k,h as l,f as m,_ as n,P as o,v as p,D as q,A as r,b as s,C as t,L as u,R as v,w,x,T as y,k as z,j as A,z as B,E as C,F as D,H as E,I as F,U as G,V as H,q as I}; |
| import{a as w,b as l,c as p,d as v}from"./chunk-WVIOQTRJ.js";var h={};w(h,{Channel:()=>o,PluginListener:()=>a,addPluginListener:()=>m,convertFileSrc:()=>y,invoke:()=>u,transformCallback:()=>s});function f(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s(n,e=!1){let t=f(),r=`_${t}`;return Object.defineProperty(window,r,{value:c=>(e&&Reflect.deleteProperty(window,r),n?.(c)),writable:!1,configurable:!0}),t}var i,o=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0;p(this,i,()=>{});this.id=s(e=>{l(this,i).call(this,e)})}set onmessage(e){v(this,i,e)}get onmessage(){return l(this,i)}toJSON(){return`__CHANNEL__:${this.id}`}};i=new WeakMap;var a=class{constructor(e,t,r){this.plugin=e,this.event=t,this.channelId=r}async unregister(){return u(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function m(n,e,t){let r=new o;return r.onmessage=t,u(`plugin:${n}|register_listener`,{event:e,handler:r}).then(()=>new a(n,e,r.id))}async function u(n,e={},t){return new Promise((r,c)=>{let g=s(d=>{r(d),Reflect.deleteProperty(window,`_${_}`)},!0),_=s(d=>{c(d),Reflect.deleteProperty(window,`_${g}`)},!0);window.__TAURI_IPC__({cmd:n,callback:g,error:_,payload:e,options:t})})}function y(n,e="asset"){return window.__TAURI__.convertFileSrc(n,e)}export{s as a,o as b,a as c,m as d,u as e,y as f,h as g}; |
| var f=Object.defineProperty;var g=(a,b)=>{for(var c in b)f(a,c,{get:b[c],enumerable:!0})};var e=(a,b,c)=>{if(!b.has(a))throw TypeError("Cannot "+c)};var h=(a,b,c)=>(e(a,b,"read from private field"),c?c.call(a):b.get(a)),i=(a,b,c)=>{if(b.has(a))throw TypeError("Cannot add the same private member more than once");b instanceof WeakSet?b.add(a):b.set(a,c)},j=(a,b,c,d)=>(e(a,b,"write to private field"),d?d.call(a,c):b.set(a,c),c);export{g as a,h as b,i as c,j as d}; |
| interface Event<T> { | ||
| /** Event name */ | ||
| event: EventName; | ||
| /** The label of the window that emitted this event. */ | ||
| windowLabel: string; | ||
| /** Event identifier used to unlisten */ | ||
| id: number; | ||
| /** Event payload */ | ||
| payload: T; | ||
| } | ||
| type EventCallback<T> = (event: Event<T>) => void; | ||
| type UnlistenFn = () => void; | ||
| type EventName = `${TauriEvent}` | (string & Record<never, never>); | ||
| interface Options { | ||
| /** | ||
| * Label of the window the function targets. | ||
| * | ||
| * When listening to events and using this value, | ||
| * only events triggered by the window with the given label are received. | ||
| * | ||
| * When emitting events, only the window with the given label will receive it. | ||
| */ | ||
| target?: string; | ||
| } | ||
| /** | ||
| * @since 1.1.0 | ||
| */ | ||
| declare enum TauriEvent { | ||
| WINDOW_RESIZED = "tauri://resize", | ||
| WINDOW_MOVED = "tauri://move", | ||
| WINDOW_CLOSE_REQUESTED = "tauri://close-requested", | ||
| WINDOW_CREATED = "tauri://window-created", | ||
| WINDOW_DESTROYED = "tauri://destroyed", | ||
| WINDOW_FOCUS = "tauri://focus", | ||
| WINDOW_BLUR = "tauri://blur", | ||
| WINDOW_SCALE_FACTOR_CHANGED = "tauri://scale-change", | ||
| WINDOW_THEME_CHANGED = "tauri://theme-changed", | ||
| WINDOW_FILE_DROP = "tauri://file-drop", | ||
| WINDOW_FILE_DROP_HOVER = "tauri://file-drop-hover", | ||
| WINDOW_FILE_DROP_CANCELLED = "tauri://file-drop-cancelled", | ||
| MENU = "tauri://menu" | ||
| } | ||
| /** | ||
| * Listen to an event. The event can be either global or window-specific. | ||
| * See {@link Event.windowLabel} to check the event source. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { listen } from '@tauri-apps/api/event'; | ||
| * const unlisten = await listen<string>('error', (event) => { | ||
| * console.log(`Got error in window ${event.windowLabel}, payload: ${event.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 callback. | ||
| * @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.0 | ||
| */ | ||
| declare function listen<T>(event: EventName, handler: EventCallback<T>, options?: Options): Promise<UnlistenFn>; | ||
| /** | ||
| * Listen to an one-off event. See {@link listen} for more information. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { once } from '@tauri-apps/api/event'; | ||
| * interface LoadedPayload { | ||
| * loggedIn: boolean, | ||
| * token: string | ||
| * } | ||
| * const unlisten = await once<LoadedPayload>('loaded', (event) => { | ||
| * console.log(`App is loaded, loggedIn: ${event.payload.loggedIn}, token: ${event.payload.token}`); | ||
| * }); | ||
| * | ||
| * // 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 `_`. | ||
| * @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.0 | ||
| */ | ||
| declare function once<T>(event: EventName, handler: EventCallback<T>, options?: Options): Promise<UnlistenFn>; | ||
| /** | ||
| * Emits an event to the backend and all Tauri windows. | ||
| * @example | ||
| * ```typescript | ||
| * import { emit } from '@tauri-apps/api/event'; | ||
| * await emit('frontend-loaded', { loggedIn: true, token: 'authToken' }); | ||
| * ``` | ||
| * | ||
| * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. | ||
| * | ||
| * @since 1.0.0 | ||
| */ | ||
| declare function emit(event: string, payload?: unknown, options?: Options): Promise<void>; | ||
| type event_Event<T> = Event<T>; | ||
| type event_EventCallback<T> = EventCallback<T>; | ||
| type event_UnlistenFn = UnlistenFn; | ||
| type event_EventName = EventName; | ||
| type event_Options = Options; | ||
| declare const event_listen: typeof listen; | ||
| declare const event_once: typeof once; | ||
| declare const event_emit: typeof emit; | ||
| type event_TauriEvent = TauriEvent; | ||
| declare const event_TauriEvent: typeof TauriEvent; | ||
| declare namespace event { | ||
| export { | ||
| event_Event as Event, | ||
| event_EventCallback as EventCallback, | ||
| event_UnlistenFn as UnlistenFn, | ||
| event_EventName as EventName, | ||
| event_Options as Options, | ||
| event_listen as listen, | ||
| event_once as once, | ||
| event_emit as emit, | ||
| event_TauriEvent as TauriEvent, | ||
| }; | ||
| } | ||
| export { Event as E, Options as O, TauriEvent as T, UnlistenFn as U, EventCallback as a, EventName as b, emit as c, event as e, listen as l, once as o }; |
| /** | ||
| * Invoke your custom commands. | ||
| * | ||
| * This package is also accessible with `window.__TAURI__.tauri` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`. | ||
| * @module | ||
| */ | ||
| /** @ignore */ | ||
| declare global { | ||
| interface Window { | ||
| __TAURI__: { | ||
| path: { | ||
| __sep: string; | ||
| __delimiter: string; | ||
| }; | ||
| convertFileSrc: (src: string, protocol: string) => string; | ||
| }; | ||
| __TAURI_IPC__: (message: any) => void; | ||
| } | ||
| } | ||
| /** | ||
| * Transforms a callback function to a string identifier that can be passed to the backend. | ||
| * The backend uses the identifier to `eval()` the callback. | ||
| * | ||
| * @return A unique identifier associated with the callback function. | ||
| * | ||
| * @since 1.0.0 | ||
| */ | ||
| declare function transformCallback(callback?: (response: any) => void, once?: boolean): number; | ||
| declare class Channel<T = unknown> { | ||
| #private; | ||
| id: number; | ||
| private readonly __TAURI_CHANNEL_MARKER__; | ||
| constructor(); | ||
| set onmessage(handler: (response: T) => void); | ||
| get onmessage(): (response: T) => void; | ||
| toJSON(): string; | ||
| } | ||
| declare class PluginListener { | ||
| plugin: string; | ||
| event: string; | ||
| channelId: number; | ||
| constructor(plugin: string, event: string, channelId: number); | ||
| unregister(): Promise<void>; | ||
| } | ||
| /** | ||
| * Adds a listener to a plugin event. | ||
| * | ||
| * @returns The listener object to stop listening to the events. | ||
| * | ||
| * @since 2.0.0 | ||
| */ | ||
| declare function addPluginListener<T>(plugin: string, event: string, cb: (payload: T) => void): Promise<PluginListener>; | ||
| /** | ||
| * Command arguments. | ||
| * | ||
| * @since 1.0.0 | ||
| */ | ||
| type InvokeArgs = Record<string, unknown> | number[] | ArrayBuffer | Uint8Array; | ||
| /** | ||
| * @since 2.0.0 | ||
| */ | ||
| interface InvokeOptions { | ||
| headers: Headers | Record<string, string>; | ||
| } | ||
| /** | ||
| * Sends a message to the backend. | ||
| * @example | ||
| * ```typescript | ||
| * import { invoke } from '@tauri-apps/api/tauri'; | ||
| * await invoke('login', { user: 'tauri', password: 'poiwe3h4r5ip3yrhtew9ty' }); | ||
| * ``` | ||
| * | ||
| * @param cmd The command name. | ||
| * @param args The optional arguments to pass to the command. | ||
| * @param options The request options. | ||
| * @return A promise resolving or rejecting to the backend response. | ||
| * | ||
| * @since 1.0.0 | ||
| */ | ||
| declare function invoke<T>(cmd: string, args?: InvokeArgs, options?: InvokeOptions): Promise<T>; | ||
| /** | ||
| * Convert a device file path to an URL that can be loaded by the webview. | ||
| * Note that `asset:` and `http://asset.localhost` must be added to [`tauri.security.csp`](https://tauri.app/v1/api/config/#securityconfig.csp) in `tauri.conf.json`. | ||
| * Example CSP value: `"csp": "default-src 'self' ipc: http://ipc.localhost; img-src 'self' asset: http://asset.localhost"` to use the asset protocol on image sources. | ||
| * | ||
| * Additionally, `asset` must be added to [`tauri.allowlist.protocol`](https://tauri.app/v1/api/config/#allowlistconfig.protocol) | ||
| * in `tauri.conf.json` and its access scope must be defined on the `assetScope` array on the same `protocol` object. | ||
| * | ||
| * @param filePath The file path. | ||
| * @param protocol The protocol to use. Defaults to `asset`. You only need to set this when using a custom protocol. | ||
| * @example | ||
| * ```typescript | ||
| * import { appDataDir, join } from '@tauri-apps/api/path'; | ||
| * import { convertFileSrc } from '@tauri-apps/api/tauri'; | ||
| * const appDataDirPath = await appDataDir(); | ||
| * const filePath = await join(appDataDirPath, 'assets/video.mp4'); | ||
| * const assetUrl = convertFileSrc(filePath); | ||
| * | ||
| * const video = document.getElementById('my-video'); | ||
| * const source = document.createElement('source'); | ||
| * source.type = 'video/mp4'; | ||
| * source.src = assetUrl; | ||
| * video.appendChild(source); | ||
| * video.load(); | ||
| * ``` | ||
| * | ||
| * @return the URL that can be used as source on the webview. | ||
| * | ||
| * @since 1.0.0 | ||
| */ | ||
| declare function convertFileSrc(filePath: string, protocol?: string): string; | ||
| type tauri_InvokeArgs = InvokeArgs; | ||
| type tauri_InvokeOptions = InvokeOptions; | ||
| declare const tauri_transformCallback: typeof transformCallback; | ||
| type tauri_Channel<T = unknown> = Channel<T>; | ||
| declare const tauri_Channel: typeof Channel; | ||
| type tauri_PluginListener = PluginListener; | ||
| declare const tauri_PluginListener: typeof PluginListener; | ||
| declare const tauri_addPluginListener: typeof addPluginListener; | ||
| declare const tauri_invoke: typeof invoke; | ||
| declare const tauri_convertFileSrc: typeof convertFileSrc; | ||
| declare namespace tauri { | ||
| export { | ||
| tauri_InvokeArgs as InvokeArgs, | ||
| tauri_InvokeOptions as InvokeOptions, | ||
| tauri_transformCallback as transformCallback, | ||
| tauri_Channel as Channel, | ||
| tauri_PluginListener as PluginListener, | ||
| tauri_addPluginListener as addPluginListener, | ||
| tauri_invoke as invoke, | ||
| tauri_convertFileSrc as convertFileSrc, | ||
| }; | ||
| } | ||
| export { Channel as C, InvokeArgs as I, PluginListener as P, InvokeOptions as a, transformCallback as b, addPluginListener as c, convertFileSrc as d, invoke as i, tauri as t }; |
| "use strict";var l=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var I=(n,e)=>{for(var r in e)l(n,r,{get:e[r],enumerable:!0})},T=(n,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of y(e))!h.call(n,i)&&i!==r&&l(n,i,{get:()=>e[i],enumerable:!(t=m(e,i))||t.enumerable});return n};var A=n=>T(l({},"__esModule",{value:!0}),n);var v=(n,e,r)=>{if(!e.has(n))throw TypeError("Cannot "+r)};var u=(n,e,r)=>(v(n,e,"read from private field"),r?r.call(n):e.get(n)),w=(n,e,r)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,r)},f=(n,e,r,t)=>(v(n,e,"write to private field"),t?t.call(n,r):e.set(n,r),r);var P={};I(P,{Channel:()=>a,PluginListener:()=>c,addPluginListener:()=>b,convertFileSrc:()=>k,invoke:()=>g,transformCallback:()=>o});module.exports=A(P);function R(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function o(n,e=!1){let r=R(),t=`_${r}`;return Object.defineProperty(window,t,{value:i=>(e&&Reflect.deleteProperty(window,t),n?.(i)),writable:!1,configurable:!0}),r}var s,a=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0;w(this,s,()=>{});this.id=o(e=>{u(this,s).call(this,e)})}set onmessage(e){f(this,s,e)}get onmessage(){return u(this,s)}toJSON(){return`__CHANNEL__:${this.id}`}};s=new WeakMap;var c=class{constructor(e,r,t){this.plugin=e,this.event=r,this.channelId=t}async unregister(){return g(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function b(n,e,r){let t=new a;return t.onmessage=r,g(`plugin:${n}|register_listener`,{event:e,handler:t}).then(()=>new c(n,e,t.id))}async function g(n,e={},r){return new Promise((t,i)=>{let _=o(d=>{t(d),Reflect.deleteProperty(window,`_${p}`)},!0),p=o(d=>{i(d),Reflect.deleteProperty(window,`_${_}`)},!0);window.__TAURI_IPC__({cmd:n,callback:_,error:p,payload:e,options:r})})}function k(n,e="asset"){return window.__TAURI__.convertFileSrc(n,e)} |
| export { C as Channel, I as InvokeArgs, a as InvokeOptions, P as PluginListener, c as addPluginListener, d as convertFileSrc, i as invoke, b as transformCallback } from './tauri-29554428.js'; |
-1
| import{a,b,c,d,e,f}from"./chunk-VMGITBBQ.js";import"./chunk-WVIOQTRJ.js";export{b as Channel,c as PluginListener,d as addPluginListener,f as convertFileSrc,e as invoke,a as transformCallback}; |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 4 instances in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 2 instances in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
226789
77.5%54
100%2931
165.73%21
61.54%4
300%4
100%