@stacksjs/desktop 0.63.0 → 0.63.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -2616
- package/dist/index.js.map +2 -2
- package/package.json +1 -10
package/dist/index.js
CHANGED
|
@@ -1,2619 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __export = (target, all) => {
|
|
4
|
-
for (var name in all)
|
|
5
|
-
__defProp(target, name, {
|
|
6
|
-
get: all[name],
|
|
7
|
-
enumerable: true,
|
|
8
|
-
configurable: true,
|
|
9
|
-
set: (newValue) => all[name] = () => newValue
|
|
10
|
-
});
|
|
11
|
-
};
|
|
2
|
+
var q9=Object.defineProperty;var O=(J,K)=>{for(var X in K)q9(J,X,{get:K[X],enumerable:!0,configurable:!0,set:(V)=>K[X]=()=>V})};var g={};O(g,{open:()=>b,EventEmitter:()=>U,Command:()=>f,Child:()=>E});var P={};O(P,{transformCallback:()=>q,invoke:()=>z,convertFileSrc:()=>S9});function M9(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function q(J,K=!1){const X=M9(),V=`_${X}`;return Object.defineProperty(window,V,{value:(Z)=>{if(K)Reflect.deleteProperty(window,V);return J===null||J===void 0?void 0:J(Z)},writable:!1,configurable:!0}),X}async function z(J,K={}){return new Promise((X,V)=>{const Z=q((G)=>{X(G),Reflect.deleteProperty(window,`_${Y}`)},!0),Y=q((G)=>{V(G),Reflect.deleteProperty(window,`_${Z}`)},!0);window.__TAURI_IPC__({cmd:J,callback:Z,error:Y,...K})})}function S9(J,K="asset"){return window.__TAURI__.convertFileSrc(J,K)}async function Q(J){return z("tauri",J)}async function b(J,K){return Q({__tauriModule:"Shell",message:{cmd:"open",path:J,with:K}})}class U{constructor(){this.eventListeners=Object.create(null)}addListener(J,K){return this.on(J,K)}removeListener(J,K){return this.off(J,K)}on(J,K){if(J in this.eventListeners)this.eventListeners[J].push(K);else this.eventListeners[J]=[K];return this}once(J,K){const X=(...V)=>{this.removeListener(J,X),K(...V)};return this.addListener(J,X)}off(J,K){if(J in this.eventListeners)this.eventListeners[J]=this.eventListeners[J].filter((X)=>X!==K);return this}removeAllListeners(J){if(J)delete this.eventListeners[J];else this.eventListeners=Object.create(null);return this}emit(J,...K){if(J in this.eventListeners){const X=this.eventListeners[J];for(let V of X)V(...K);return!0}return!1}listenerCount(J){if(J in this.eventListeners)return this.eventListeners[J].length;return 0}prependListener(J,K){if(J in this.eventListeners)this.eventListeners[J].unshift(K);else this.eventListeners[J]=[K];return this}prependOnceListener(J,K){const X=(...V)=>{this.removeListener(J,X),K(...V)};return this.prependListener(J,X)}}class E{constructor(J){this.pid=J}async write(J){return Q({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:typeof J==="string"?J:Array.from(J)}})}async kill(){return Q({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}})}}class f extends U{constructor(J,K=[],X){super();this.stdout=new U,this.stderr=new U,this.program=J,this.args=typeof K==="string"?[K]:K,this.options=X!==null&&X!==void 0?X:{}}static sidecar(J,K=[],X){const V=new f(J,K,X);return V.options.sidecar=!0,V}async spawn(){const J=this.program,K=this.args,X=this.options;if(typeof K==="object")Object.freeze(K);return Q({__tauriModule:"Shell",message:{cmd:"execute",program:J,args:K,options:X,onEventFn:q((Z)=>{switch(Z.event){case"Error":this.emit("error",Z.payload);break;case"Terminated":this.emit("close",Z.payload);break;case"Stdout":this.stdout.emit("data",Z.payload);break;case"Stderr":this.stderr.emit("data",Z.payload);break}})}}).then((Z)=>new E(Z))}async execute(){const J=this.program,K=this.args,X=this.options;if(typeof K==="object")Object.freeze(K);return Q({__tauriModule:"Shell",message:{cmd:"executeAndReturn",program:J,args:K,options:X}})}}var w={};O(w,{show:()=>A9,hide:()=>j9,getVersion:()=>U9,getTauriVersion:()=>L9,getName:()=>F9});async function U9(){return Q({__tauriModule:"App",message:{cmd:"getAppVersion"}})}async function F9(){return Q({__tauriModule:"App",message:{cmd:"getAppName"}})}async function L9(){return Q({__tauriModule:"App",message:{cmd:"getTauriVersion"}})}async function A9(){return Q({__tauriModule:"App",message:{cmd:"show"}})}async function j9(){return Q({__tauriModule:"App",message:{cmd:"hide"}})}var B={};O(B,{writeText:()=>N9,readText:()=>x9});async function N9(J){return Q({__tauriModule:"Clipboard",message:{cmd:"writeText",data:J}})}async function x9(){return Q({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}})}var C={};O(C,{save:()=>R9,open:()=>W9,message:()=>_9,confirm:()=>P9,ask:()=>z9});async function W9(J={}){if(typeof J==="object")Object.freeze(J);return Q({__tauriModule:"Dialog",message:{cmd:"openDialog",options:J}})}async function R9(J={}){if(typeof J==="object")Object.freeze(J);return Q({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:J}})}async function _9(J,K){var X,V;const Z=typeof K==="string"?{title:K}:K;return Q({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:J.toString(),title:(X=Z===null||Z===void 0?void 0:Z.title)===null||X===void 0?void 0:X.toString(),type:Z===null||Z===void 0?void 0:Z.type,buttonLabel:(V=Z===null||Z===void 0?void 0:Z.okLabel)===null||V===void 0?void 0:V.toString()}})}async function z9(J,K){var X,V,Z,Y,G;const H=typeof K==="string"?{title:K}:K;return Q({__tauriModule:"Dialog",message:{cmd:"askDialog",message:J.toString(),title:(X=H===null||H===void 0?void 0:H.title)===null||X===void 0?void 0:X.toString(),type:H===null||H===void 0?void 0:H.type,buttonLabels:[(Z=(V=H===null||H===void 0?void 0:H.okLabel)===null||V===void 0?void 0:V.toString())!==null&&Z!==void 0?Z:"Yes",(G=(Y=H===null||H===void 0?void 0:H.cancelLabel)===null||Y===void 0?void 0:Y.toString())!==null&&G!==void 0?G:"No"]}})}async function P9(J,K){var X,V,Z,Y,G;const H=typeof K==="string"?{title:K}:K;return Q({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:J.toString(),title:(X=H===null||H===void 0?void 0:H.title)===null||X===void 0?void 0:X.toString(),type:H===null||H===void 0?void 0:H.type,buttonLabels:[(Z=(V=H===null||H===void 0?void 0:H.okLabel)===null||V===void 0?void 0:V.toString())!==null&&Z!==void 0?Z:"Ok",(G=(Y=H===null||H===void 0?void 0:H.cancelLabel)===null||Y===void 0?void 0:Y.toString())!==null&&G!==void 0?G:"Cancel"]}})}var T={};O(T,{once:()=>D,listen:()=>k,emit:()=>R,TauriEvent:()=>I});async function V9(J,K){return Q({__tauriModule:"Event",message:{cmd:"unlisten",event:J,eventId:K}})}async function x(J,K,X){await Q({__tauriModule:"Event",message:{cmd:"emit",event:J,windowLabel:K,payload:X}})}async function F(J,K,X){return Q({__tauriModule:"Event",message:{cmd:"listen",event:J,windowLabel:K,handler:q(X)}}).then((V)=>{return async()=>V9(J,V)})}async function W(J,K,X){return F(J,K,(V)=>{X(V),V9(J,V.id).catch(()=>{})})}async function k(J,K){return F(J,null,K)}async function D(J,K){return W(J,null,K)}async function R(J,K){return x(J,void 0,K)}var I;(function(J){J.WINDOW_RESIZED="tauri://resize",J.WINDOW_MOVED="tauri://move",J.WINDOW_CLOSE_REQUESTED="tauri://close-requested",J.WINDOW_CREATED="tauri://window-created",J.WINDOW_DESTROYED="tauri://destroyed",J.WINDOW_FOCUS="tauri://focus",J.WINDOW_BLUR="tauri://blur",J.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",J.WINDOW_THEME_CHANGED="tauri://theme-changed",J.WINDOW_FILE_DROP="tauri://file-drop",J.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",J.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",J.MENU="tauri://menu",J.CHECK_UPDATE="tauri://update",J.UPDATE_AVAILABLE="tauri://update-available",J.INSTALL_UPDATE="tauri://update-install",J.STATUS_UPDATE="tauri://update-status",J.DOWNLOAD_PROGRESS="tauri://update-download-progress"})(I||(I={}));var y={};O(y,{writeTextFile:()=>b9,writeFile:()=>b9,writeBinaryFile:()=>g9,renameFile:()=>T9,removeFile:()=>D9,removeDir:()=>C9,readTextFile:()=>E9,readDir:()=>w9,readBinaryFile:()=>f9,exists:()=>y9,createDir:()=>B9,copyFile:()=>k9,Dir:()=>$,BaseDirectory:()=>$});async function E9(J,K={}){return Q({__tauriModule:"Fs",message:{cmd:"readTextFile",path:J,options:K}})}async function f9(J,K={}){const X=await Q({__tauriModule:"Fs",message:{cmd:"readFile",path:J,options:K}});return Uint8Array.from(X)}async function b9(J,K,X){if(typeof X==="object")Object.freeze(X);if(typeof J==="object")Object.freeze(J);const V={path:"",contents:""};let Z=X;if(typeof J==="string")V.path=J;else V.path=J.path,V.contents=J.contents;if(typeof K==="string")V.contents=K!==null&&K!==void 0?K:"";else Z=K;return Q({__tauriModule:"Fs",message:{cmd:"writeFile",path:V.path,contents:Array.from(new TextEncoder().encode(V.contents)),options:Z}})}async function g9(J,K,X){if(typeof X==="object")Object.freeze(X);if(typeof J==="object")Object.freeze(J);const V={path:"",contents:[]};let Z=X;if(typeof J==="string")V.path=J;else V.path=J.path,V.contents=J.contents;if(K&&"dir"in K)Z=K;else if(typeof J==="string")V.contents=K!==null&&K!==void 0?K:[];return Q({__tauriModule:"Fs",message:{cmd:"writeFile",path:V.path,contents:Array.from(V.contents instanceof ArrayBuffer?new Uint8Array(V.contents):V.contents),options:Z}})}async function w9(J,K={}){return Q({__tauriModule:"Fs",message:{cmd:"readDir",path:J,options:K}})}async function B9(J,K={}){return Q({__tauriModule:"Fs",message:{cmd:"createDir",path:J,options:K}})}async function C9(J,K={}){return Q({__tauriModule:"Fs",message:{cmd:"removeDir",path:J,options:K}})}async function k9(J,K,X={}){return Q({__tauriModule:"Fs",message:{cmd:"copyFile",source:J,destination:K,options:X}})}async function D9(J,K={}){return Q({__tauriModule:"Fs",message:{cmd:"removeFile",path:J,options:K}})}async function T9(J,K,X={}){return Q({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:J,newPath:K,options:X}})}async function y9(J,K={}){return Q({__tauriModule:"Fs",message:{cmd:"exists",path:J,options:K}})}var $;(function(J){J[J.Audio=1]="Audio",J[J.Cache=2]="Cache",J[J.Config=3]="Config",J[J.Data=4]="Data",J[J.LocalData=5]="LocalData",J[J.Desktop=6]="Desktop",J[J.Document=7]="Document",J[J.Download=8]="Download",J[J.Executable=9]="Executable",J[J.Font=10]="Font",J[J.Home=11]="Home",J[J.Picture=12]="Picture",J[J.Public=13]="Public",J[J.Runtime=14]="Runtime",J[J.Template=15]="Template",J[J.Video=16]="Video",J[J.Resource=17]="Resource",J[J.App=18]="App",J[J.Log=19]="Log",J[J.Temp=20]="Temp",J[J.AppConfig=21]="AppConfig",J[J.AppData=22]="AppData",J[J.AppLocalData=23]="AppLocalData",J[J.AppCache=24]="AppCache",J[J.AppLog=25]="AppLog"})($||($={}));var h={};O(h,{unregisterAll:()=>c9,unregister:()=>d9,registerAll:()=>u9,register:()=>h9,isRegistered:()=>v9});async function h9(J,K){return Q({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:J,handler:q(K)}})}async function u9(J,K){return Q({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:J,handler:q(K)}})}async function v9(J){return Q({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:J}})}async function d9(J){return Q({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:J}})}async function c9(){return Q({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})}var c={};O(c,{getClient:()=>Y9,fetch:()=>l9,ResponseType:()=>L,Response:()=>v,Client:()=>d,Body:()=>S});async function m9(J){const K={},X=async(V,Z)=>{if(Z!==null){let Y;if(typeof Z==="string")Y=Z;else if(Z instanceof Uint8Array||Array.isArray(Z))Y=Array.from(Z);else if(Z instanceof File)Y={file:Array.from(new Uint8Array(await Z.arrayBuffer())),mime:Z.type,fileName:Z.name};else if(typeof Z.file==="string")Y={file:Z.file,mime:Z.mime,fileName:Z.fileName};else Y={file:Array.from(Z.file),mime:Z.mime,fileName:Z.fileName};K[String(V)]=Y}};if(J instanceof FormData)for(let[V,Z]of J)await X(V,Z);else for(let[V,Z]of Object.entries(J))await X(V,Z);return K}async function Y9(J){return Q({__tauriModule:"Http",message:{cmd:"createClient",options:J}}).then((K)=>new d(K))}async function l9(J,K){var X;if(u===null)u=await Y9();return u.request({url:J,method:(X=K===null||K===void 0?void 0:K.method)!==null&&X!==void 0?X:"GET",...K})}var L;(function(J){J[J.JSON=1]="JSON",J[J.Text=2]="Text",J[J.Binary=3]="Binary"})(L||(L={}));class S{constructor(J,K){this.type=J,this.payload=K}static form(J){return new S("Form",J)}static json(J){return new S("Json",J)}static text(J){return new S("Text",J)}static bytes(J){return new S("Bytes",Array.from(J instanceof ArrayBuffer?new Uint8Array(J):J))}}class v{constructor(J){this.url=J.url,this.status=J.status,this.ok=this.status>=200&&this.status<300,this.headers=J.headers,this.rawHeaders=J.rawHeaders,this.data=J.data}}class d{constructor(J){this.id=J}async drop(){return Q({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})}async request(J){var K;const X=!J.responseType||J.responseType===L.JSON;if(X)J.responseType=L.Text;if(((K=J.body)===null||K===void 0?void 0:K.type)==="Form")J.body.payload=await m9(J.body.payload);return Q({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:J}}).then((V)=>{const Z=new v(V);if(X){try{Z.data=JSON.parse(Z.data)}catch(Y){if(Z.ok&&Z.data==="")Z.data={};else if(Z.ok)throw Error(`Failed to parse response \`${Z.data}\` as JSON: ${Y};
|
|
3
|
+
try setting the \`responseType\` option to \`ResponseType.Text\` or \`ResponseType.Binary\` if the API does not return a JSON response.`)}return Z}return Z})}async get(J,K){return this.request({method:"GET",url:J,...K})}async post(J,K,X){return this.request({method:"POST",url:J,body:K,...X})}async put(J,K,X){return this.request({method:"PUT",url:J,body:K,...X})}async patch(J,K){return this.request({method:"PATCH",url:J,...K})}async delete(J,K){return this.request({method:"DELETE",url:J,...K})}}var u=null;var m={};O(m,{mockWindows:()=>s9,mockIPC:()=>p9,mockConvertFileSrc:()=>r9,clearMocks:()=>n9});function p9(J){window.__TAURI_IPC__=async({cmd:K,callback:X,error:V,...Z})=>{try{window[`_${X}`](await J(K,Z))}catch(Y){window[`_${V}`](Y)}}}function s9(J,...K){window.__TAURI_METADATA__={__windows:[J,...K].map((X)=>({label:X})),__currentWindow:{label:J}}}function r9(J,K="https"){var X;window.__TAURI__=(X=window.__TAURI__)!==null&&X!==void 0?X:{},window.__TAURI__.convertFileSrc=function(V,Z="asset"){const Y=encodeURIComponent(V);return J==="windows"?`${K}://${Z}.localhost/${Y}`:`${Z}://localhost/${Y}`}}function n9(){var J;if((J=window.__TAURI__)===null||J===void 0?void 0:J.convertFileSrc)delete window.__TAURI__.convertFileSrc;if(window.__TAURI_IPC__)delete window.__TAURI_IPC__;if(window.__TAURI_METADATA__)delete window.__TAURI_METADATA__}var l={};O(l,{sendNotification:()=>i9,requestPermission:()=>a9,isPermissionGranted:()=>o9});async function o9(){if(window.Notification.permission!=="default")return Promise.resolve(window.Notification.permission==="granted");return Q({__tauriModule:"Notification",message:{cmd:"isNotificationPermissionGranted"}})}async function a9(){return window.Notification.requestPermission()}function i9(J){if(typeof J==="string")new window.Notification(J);else new window.Notification(J.title,J)}var p={};O(p,{version:()=>JJ,type:()=>KJ,tempdir:()=>XJ,platform:()=>e9,locale:()=>ZJ,arch:()=>QJ,EOL:()=>t9});function A(){return navigator.appVersion.includes("Win")}async function e9(){return Q({__tauriModule:"Os",message:{cmd:"platform"}})}async function JJ(){return Q({__tauriModule:"Os",message:{cmd:"version"}})}async function KJ(){return Q({__tauriModule:"Os",message:{cmd:"osType"}})}async function QJ(){return Q({__tauriModule:"Os",message:{cmd:"arch"}})}async function XJ(){return Q({__tauriModule:"Os",message:{cmd:"tempdir"}})}async function ZJ(){return Q({__tauriModule:"Os",message:{cmd:"locale"}})}var t9=A()?"\r\n":"\n";var s={};O(s,{videoDir:()=>PJ,templateDir:()=>zJ,sep:()=>fJ,runtimeDir:()=>_J,resourceDir:()=>WJ,resolveResource:()=>RJ,resolve:()=>gJ,publicDir:()=>xJ,pictureDir:()=>NJ,normalize:()=>wJ,logDir:()=>EJ,localDataDir:()=>jJ,join:()=>BJ,isAbsolute:()=>TJ,homeDir:()=>AJ,fontDir:()=>LJ,extname:()=>kJ,executableDir:()=>FJ,downloadDir:()=>UJ,documentDir:()=>SJ,dirname:()=>CJ,desktopDir:()=>MJ,delimiter:()=>bJ,dataDir:()=>qJ,configDir:()=>OJ,cacheDir:()=>IJ,basename:()=>DJ,audioDir:()=>HJ,appLogDir:()=>$9,appLocalDataDir:()=>GJ,appDir:()=>VJ,appDataDir:()=>YJ,appConfigDir:()=>G9,appCacheDir:()=>$J,BaseDirectory:()=>$});async function VJ(){return G9()}async function G9(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.AppConfig}})}async function YJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.AppData}})}async function GJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.AppLocalData}})}async function $J(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.AppCache}})}async function HJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Audio}})}async function IJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Cache}})}async function OJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Config}})}async function qJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Data}})}async function MJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Desktop}})}async function SJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Document}})}async function UJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Download}})}async function FJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Executable}})}async function LJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Font}})}async function AJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Home}})}async function jJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.LocalData}})}async function NJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Picture}})}async function xJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Public}})}async function WJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Resource}})}async function RJ(J){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:J,directory:$.Resource}})}async function _J(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Runtime}})}async function zJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Template}})}async function PJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Video}})}async function EJ(){return $9()}async function $9(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.AppLog}})}async function gJ(...J){return Q({__tauriModule:"Path",message:{cmd:"resolve",paths:J}})}async function wJ(J){return Q({__tauriModule:"Path",message:{cmd:"normalize",path:J}})}async function BJ(...J){return Q({__tauriModule:"Path",message:{cmd:"join",paths:J}})}async function CJ(J){return Q({__tauriModule:"Path",message:{cmd:"dirname",path:J}})}async function kJ(J){return Q({__tauriModule:"Path",message:{cmd:"extname",path:J}})}async function DJ(J,K){return Q({__tauriModule:"Path",message:{cmd:"basename",path:J,ext:K}})}async function TJ(J){return Q({__tauriModule:"Path",message:{cmd:"isAbsolute",path:J}})}var fJ=A()?"\\":"/",bJ=A()?";":":";var r={};O(r,{relaunch:()=>hJ,exit:()=>yJ});async function yJ(J=0){return Q({__tauriModule:"Process",message:{cmd:"exit",exitCode:J}})}async function hJ(){return Q({__tauriModule:"Process",message:{cmd:"relaunch"}})}var o={};O(o,{onUpdaterEvent:()=>n,installUpdate:()=>uJ,checkUpdate:()=>vJ});async function n(J){return k(I.STATUS_UPDATE,(K)=>{J(K===null||K===void 0?void 0:K.payload)})}async function uJ(){let J;function K(){if(J)J();J=void 0}return new Promise((X,V)=>{function Z(Y){if(Y.error){K(),V(Y.error);return}if(Y.status==="DONE")K(),X()}n(Z).then((Y)=>{J=Y}).catch((Y)=>{throw K(),Y}),R(I.INSTALL_UPDATE).catch((Y)=>{throw K(),Y})})}async function vJ(){let J;function K(){if(J)J();J=void 0}return new Promise((X,V)=>{function Z(G){K(),X({manifest:G,shouldUpdate:!0})}function Y(G){if(G.error){K(),V(G.error);return}if(G.status==="UPTODATE")K(),X({shouldUpdate:!1})}D(I.UPDATE_AVAILABLE,(G)=>{Z(G===null||G===void 0?void 0:G.payload)}).catch((G)=>{throw K(),G}),n(Y).then((G)=>{J=G}).catch((G)=>{throw K(),G}),R(I.CHECK_UPDATE).catch((G)=>{throw K(),G})})}var Z9={};O(Z9,{primaryMonitor:()=>mJ,getCurrent:()=>dJ,getAll:()=>a,currentMonitor:()=>cJ,availableMonitors:()=>lJ,appWindow:()=>i,WindowManager:()=>K9,WebviewWindowHandle:()=>J9,WebviewWindow:()=>M,UserAttentionType:()=>_,PhysicalSize:()=>j,PhysicalPosition:()=>N,LogicalSize:()=>t,LogicalPosition:()=>e,CloseRequestedEvent:()=>Q9});function dJ(){return new M(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function a(){return window.__TAURI_METADATA__.__windows.map((J)=>new M(J.label,{skip:!0}))}function X9(J){return J===null?null:{name:J.name,scaleFactor:J.scaleFactor,position:I9(J.position),size:O9(J.size)}}function I9(J){return new N(J.x,J.y)}function O9(J){return new j(J.width,J.height)}async function cJ(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}).then(X9)}async function mJ(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}).then(X9)}async function lJ(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}).then((J)=>J.map(X9))}class t{constructor(J,K){this.type="Logical",this.width=J,this.height=K}}class j{constructor(J,K){this.type="Physical",this.width=J,this.height=K}toLogical(J){return new t(this.width/J,this.height/J)}}class e{constructor(J,K){this.type="Logical",this.x=J,this.y=K}}class N{constructor(J,K){this.type="Physical",this.x=J,this.y=K}toLogical(J){return new e(this.x/J,this.y/J)}}var _;(function(J){J[J.Critical=1]="Critical",J[J.Informational=2]="Informational"})(_||(_={}));var H9=["tauri://created","tauri://error"];class J9{constructor(J){this.label=J,this.listeners=Object.create(null)}async listen(J,K){if(this._handleTauriEvent(J,K))return Promise.resolve(()=>{const X=this.listeners[J];X.splice(X.indexOf(K),1)});return F(J,this.label,K)}async once(J,K){if(this._handleTauriEvent(J,K))return Promise.resolve(()=>{const X=this.listeners[J];X.splice(X.indexOf(K),1)});return W(J,this.label,K)}async emit(J,K){if(H9.includes(J)){for(let X of this.listeners[J]||[])X({event:J,id:-1,windowLabel:this.label,payload:K});return Promise.resolve()}return x(J,this.label,K)}_handleTauriEvent(J,K){if(H9.includes(J)){if(!(J in this.listeners))this.listeners[J]=[K];else this.listeners[J].push(K);return!0}return!1}}class K9 extends J9{async scaleFactor(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})}async innerPosition(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}}).then(({x:J,y:K})=>new N(J,K))}async outerPosition(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(({x:J,y:K})=>new N(J,K))}async innerSize(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(({width:J,height:K})=>new j(J,K))}async outerSize(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(({width:J,height:K})=>new j(J,K))}async isFullscreen(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})}async isMinimized(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMinimized"}}}})}async isMaximized(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})}async isFocused(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFocused"}}}})}async isDecorated(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})}async isResizable(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})}async isMaximizable(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximizable"}}}})}async isMinimizable(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMinimizable"}}}})}async isClosable(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isClosable"}}}})}async isVisible(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})}async title(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"title"}}}})}async theme(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"theme"}}}})}async center(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"center"}}}})}async requestUserAttention(J){let K=null;if(J)if(J===_.Critical)K={type:"Critical"};else K={type:"Informational"};return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:K}}}})}async setResizable(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:J}}}})}async setMaximizable(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaximizable",payload:J}}}})}async setMinimizable(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinimizable",payload:J}}}})}async setClosable(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setClosable",payload:J}}}})}async setTitle(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:J}}}})}async maximize(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})}async unmaximize(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})}async toggleMaximize(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"toggleMaximize"}}}})}async minimize(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})}async unminimize(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})}async show(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})}async hide(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})}async close(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})}async setDecorations(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:J}}}})}async setAlwaysOnTop(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:J}}}})}async setContentProtected(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setContentProtected",payload:J}}}})}async setSize(J){if(!J||J.type!=="Logical"&&J.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSize",payload:{type:J.type,data:{width:J.width,height:J.height}}}}}})}async setMinSize(J){if(J&&J.type!=="Logical"&&J.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinSize",payload:J?{type:J.type,data:{width:J.width,height:J.height}}:null}}}})}async setMaxSize(J){if(J&&J.type!=="Logical"&&J.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaxSize",payload:J?{type:J.type,data:{width:J.width,height:J.height}}:null}}}})}async setPosition(J){if(!J||J.type!=="Logical"&&J.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setPosition",payload:{type:J.type,data:{x:J.x,y:J.y}}}}}})}async setFullscreen(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:J}}}})}async setFocus(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})}async setIcon(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIcon",payload:{icon:typeof J==="string"?J:Array.from(J)}}}}})}async setSkipTaskbar(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:J}}}})}async setCursorGrab(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorGrab",payload:J}}}})}async setCursorVisible(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorVisible",payload:J}}}})}async setCursorIcon(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorIcon",payload:J}}}})}async setCursorPosition(J){if(!J||J.type!=="Logical"&&J.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorPosition",payload:{type:J.type,data:{x:J.x,y:J.y}}}}}})}async setIgnoreCursorEvents(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIgnoreCursorEvents",payload:J}}}})}async startDragging(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})}async onResized(J){return this.listen(I.WINDOW_RESIZED,(K)=>{K.payload=O9(K.payload),J(K)})}async onMoved(J){return this.listen(I.WINDOW_MOVED,(K)=>{K.payload=I9(K.payload),J(K)})}async onCloseRequested(J){return this.listen(I.WINDOW_CLOSE_REQUESTED,(K)=>{const X=new Q9(K);Promise.resolve(J(X)).then(()=>{if(!X.isPreventDefault())return this.close()})})}async onFocusChanged(J){const K=await this.listen(I.WINDOW_FOCUS,(V)=>{J({...V,payload:!0})}),X=await this.listen(I.WINDOW_BLUR,(V)=>{J({...V,payload:!1})});return()=>{K(),X()}}async onScaleChanged(J){return this.listen(I.WINDOW_SCALE_FACTOR_CHANGED,J)}async onMenuClicked(J){return this.listen(I.MENU,J)}async onFileDropEvent(J){const K=await this.listen(I.WINDOW_FILE_DROP,(Z)=>{J({...Z,payload:{type:"drop",paths:Z.payload}})}),X=await this.listen(I.WINDOW_FILE_DROP_HOVER,(Z)=>{J({...Z,payload:{type:"hover",paths:Z.payload}})}),V=await this.listen(I.WINDOW_FILE_DROP_CANCELLED,(Z)=>{J({...Z,payload:{type:"cancel"}})});return()=>{K(),X(),V()}}async onThemeChanged(J){return this.listen(I.WINDOW_THEME_CHANGED,J)}}class Q9{constructor(J){this._preventDefault=!1,this.event=J.event,this.windowLabel=J.windowLabel,this.id=J.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}class M extends K9{constructor(J,K={}){super(J);if(!(K===null||K===void 0?void 0:K.skip))Q({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:{label:J,...K}}}}).then(async()=>this.emit("tauri://created")).catch(async(X)=>this.emit("tauri://error",X))}static getByLabel(J){if(a().some((K)=>K.label===J))return new M(J,{skip:!0});return null}static async getFocusedWindow(){for(let J of a())if(await J.isFocused())return J;return null}}var i;if("__TAURI_METADATA__"in window)i=new M(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0});else console.warn('Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label.\nNote that this is not an issue if running this frontend on a browser instead of a Tauri window.'),i=new M("main",{skip:!0});async function RK(J){await b(J)}var jK="testing this";var WK={app:w,event:T,clipboard:B,dialog:C,fs:y,globalShortcut:h,http:c,mocks:m,notification:l,os:p,path:s,process:r,shell:g,tauri:P,updater:o,window:Z9};export{jK as testingThis,RK as openShell,WK as desktop};
|
|
12
4
|
|
|
13
|
-
|
|
14
|
-
var exports_shell = {};
|
|
15
|
-
__export(exports_shell, {
|
|
16
|
-
open: () => open,
|
|
17
|
-
EventEmitter: () => EventEmitter,
|
|
18
|
-
Command: () => Command,
|
|
19
|
-
Child: () => Child
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
// ../../../../node_modules/@tauri-apps/api/tauri.js
|
|
23
|
-
var exports_tauri = {};
|
|
24
|
-
__export(exports_tauri, {
|
|
25
|
-
transformCallback: () => transformCallback,
|
|
26
|
-
invoke: () => invoke,
|
|
27
|
-
convertFileSrc: () => convertFileSrc
|
|
28
|
-
});
|
|
29
|
-
function uid() {
|
|
30
|
-
return window.crypto.getRandomValues(new Uint32Array(1))[0];
|
|
31
|
-
}
|
|
32
|
-
function transformCallback(callback, once = false) {
|
|
33
|
-
const identifier = uid();
|
|
34
|
-
const prop = `_${identifier}`;
|
|
35
|
-
Object.defineProperty(window, prop, {
|
|
36
|
-
value: (result) => {
|
|
37
|
-
if (once) {
|
|
38
|
-
Reflect.deleteProperty(window, prop);
|
|
39
|
-
}
|
|
40
|
-
return callback === null || callback === undefined ? undefined : callback(result);
|
|
41
|
-
},
|
|
42
|
-
writable: false,
|
|
43
|
-
configurable: true
|
|
44
|
-
});
|
|
45
|
-
return identifier;
|
|
46
|
-
}
|
|
47
|
-
async function invoke(cmd, args = {}) {
|
|
48
|
-
return new Promise((resolve, reject) => {
|
|
49
|
-
const callback = transformCallback((e) => {
|
|
50
|
-
resolve(e);
|
|
51
|
-
Reflect.deleteProperty(window, `_${error}`);
|
|
52
|
-
}, true);
|
|
53
|
-
const error = transformCallback((e) => {
|
|
54
|
-
reject(e);
|
|
55
|
-
Reflect.deleteProperty(window, `_${callback}`);
|
|
56
|
-
}, true);
|
|
57
|
-
window.__TAURI_IPC__({
|
|
58
|
-
cmd,
|
|
59
|
-
callback,
|
|
60
|
-
error,
|
|
61
|
-
...args
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
function convertFileSrc(filePath, protocol = "asset") {
|
|
66
|
-
return window.__TAURI__.convertFileSrc(filePath, protocol);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// ../../../../node_modules/@tauri-apps/api/helpers/tauri.js
|
|
70
|
-
async function invokeTauriCommand(command) {
|
|
71
|
-
return invoke("tauri", command);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// ../../../../node_modules/@tauri-apps/api/shell.js
|
|
75
|
-
async function open(path, openWith) {
|
|
76
|
-
return invokeTauriCommand({
|
|
77
|
-
__tauriModule: "Shell",
|
|
78
|
-
message: {
|
|
79
|
-
cmd: "open",
|
|
80
|
-
path,
|
|
81
|
-
with: openWith
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
class EventEmitter {
|
|
87
|
-
constructor() {
|
|
88
|
-
this.eventListeners = Object.create(null);
|
|
89
|
-
}
|
|
90
|
-
addListener(eventName, listener) {
|
|
91
|
-
return this.on(eventName, listener);
|
|
92
|
-
}
|
|
93
|
-
removeListener(eventName, listener) {
|
|
94
|
-
return this.off(eventName, listener);
|
|
95
|
-
}
|
|
96
|
-
on(eventName, listener) {
|
|
97
|
-
if (eventName in this.eventListeners) {
|
|
98
|
-
this.eventListeners[eventName].push(listener);
|
|
99
|
-
} else {
|
|
100
|
-
this.eventListeners[eventName] = [listener];
|
|
101
|
-
}
|
|
102
|
-
return this;
|
|
103
|
-
}
|
|
104
|
-
once(eventName, listener) {
|
|
105
|
-
const wrapper = (...args) => {
|
|
106
|
-
this.removeListener(eventName, wrapper);
|
|
107
|
-
listener(...args);
|
|
108
|
-
};
|
|
109
|
-
return this.addListener(eventName, wrapper);
|
|
110
|
-
}
|
|
111
|
-
off(eventName, listener) {
|
|
112
|
-
if (eventName in this.eventListeners) {
|
|
113
|
-
this.eventListeners[eventName] = this.eventListeners[eventName].filter((l) => l !== listener);
|
|
114
|
-
}
|
|
115
|
-
return this;
|
|
116
|
-
}
|
|
117
|
-
removeAllListeners(event) {
|
|
118
|
-
if (event) {
|
|
119
|
-
delete this.eventListeners[event];
|
|
120
|
-
} else {
|
|
121
|
-
this.eventListeners = Object.create(null);
|
|
122
|
-
}
|
|
123
|
-
return this;
|
|
124
|
-
}
|
|
125
|
-
emit(eventName, ...args) {
|
|
126
|
-
if (eventName in this.eventListeners) {
|
|
127
|
-
const listeners = this.eventListeners[eventName];
|
|
128
|
-
for (const listener of listeners)
|
|
129
|
-
listener(...args);
|
|
130
|
-
return true;
|
|
131
|
-
}
|
|
132
|
-
return false;
|
|
133
|
-
}
|
|
134
|
-
listenerCount(eventName) {
|
|
135
|
-
if (eventName in this.eventListeners)
|
|
136
|
-
return this.eventListeners[eventName].length;
|
|
137
|
-
return 0;
|
|
138
|
-
}
|
|
139
|
-
prependListener(eventName, listener) {
|
|
140
|
-
if (eventName in this.eventListeners) {
|
|
141
|
-
this.eventListeners[eventName].unshift(listener);
|
|
142
|
-
} else {
|
|
143
|
-
this.eventListeners[eventName] = [listener];
|
|
144
|
-
}
|
|
145
|
-
return this;
|
|
146
|
-
}
|
|
147
|
-
prependOnceListener(eventName, listener) {
|
|
148
|
-
const wrapper = (...args) => {
|
|
149
|
-
this.removeListener(eventName, wrapper);
|
|
150
|
-
listener(...args);
|
|
151
|
-
};
|
|
152
|
-
return this.prependListener(eventName, wrapper);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
class Child {
|
|
157
|
-
constructor(pid) {
|
|
158
|
-
this.pid = pid;
|
|
159
|
-
}
|
|
160
|
-
async write(data) {
|
|
161
|
-
return invokeTauriCommand({
|
|
162
|
-
__tauriModule: "Shell",
|
|
163
|
-
message: {
|
|
164
|
-
cmd: "stdinWrite",
|
|
165
|
-
pid: this.pid,
|
|
166
|
-
buffer: typeof data === "string" ? data : Array.from(data)
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
async kill() {
|
|
171
|
-
return invokeTauriCommand({
|
|
172
|
-
__tauriModule: "Shell",
|
|
173
|
-
message: {
|
|
174
|
-
cmd: "killChild",
|
|
175
|
-
pid: this.pid
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
class Command extends EventEmitter {
|
|
182
|
-
constructor(program, args = [], options) {
|
|
183
|
-
super();
|
|
184
|
-
this.stdout = new EventEmitter;
|
|
185
|
-
this.stderr = new EventEmitter;
|
|
186
|
-
this.program = program;
|
|
187
|
-
this.args = typeof args === "string" ? [args] : args;
|
|
188
|
-
this.options = options !== null && options !== undefined ? options : {};
|
|
189
|
-
}
|
|
190
|
-
static sidecar(program, args = [], options) {
|
|
191
|
-
const instance = new Command(program, args, options);
|
|
192
|
-
instance.options.sidecar = true;
|
|
193
|
-
return instance;
|
|
194
|
-
}
|
|
195
|
-
async spawn() {
|
|
196
|
-
const program = this.program;
|
|
197
|
-
const args = this.args;
|
|
198
|
-
const options = this.options;
|
|
199
|
-
if (typeof args === "object") {
|
|
200
|
-
Object.freeze(args);
|
|
201
|
-
}
|
|
202
|
-
const onEvent = (event) => {
|
|
203
|
-
switch (event.event) {
|
|
204
|
-
case "Error":
|
|
205
|
-
this.emit("error", event.payload);
|
|
206
|
-
break;
|
|
207
|
-
case "Terminated":
|
|
208
|
-
this.emit("close", event.payload);
|
|
209
|
-
break;
|
|
210
|
-
case "Stdout":
|
|
211
|
-
this.stdout.emit("data", event.payload);
|
|
212
|
-
break;
|
|
213
|
-
case "Stderr":
|
|
214
|
-
this.stderr.emit("data", event.payload);
|
|
215
|
-
break;
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
return invokeTauriCommand({
|
|
219
|
-
__tauriModule: "Shell",
|
|
220
|
-
message: {
|
|
221
|
-
cmd: "execute",
|
|
222
|
-
program,
|
|
223
|
-
args,
|
|
224
|
-
options,
|
|
225
|
-
onEventFn: transformCallback(onEvent)
|
|
226
|
-
}
|
|
227
|
-
}).then((pid) => new Child(pid));
|
|
228
|
-
}
|
|
229
|
-
async execute() {
|
|
230
|
-
const program = this.program;
|
|
231
|
-
const args = this.args;
|
|
232
|
-
const options = this.options;
|
|
233
|
-
if (typeof args === "object") {
|
|
234
|
-
Object.freeze(args);
|
|
235
|
-
}
|
|
236
|
-
return invokeTauriCommand({
|
|
237
|
-
__tauriModule: "Shell",
|
|
238
|
-
message: {
|
|
239
|
-
cmd: "executeAndReturn",
|
|
240
|
-
program,
|
|
241
|
-
args,
|
|
242
|
-
options
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
// ../../../../node_modules/@tauri-apps/api/app.js
|
|
249
|
-
var exports_app = {};
|
|
250
|
-
__export(exports_app, {
|
|
251
|
-
show: () => show,
|
|
252
|
-
hide: () => hide,
|
|
253
|
-
getVersion: () => getVersion,
|
|
254
|
-
getTauriVersion: () => getTauriVersion,
|
|
255
|
-
getName: () => getName
|
|
256
|
-
});
|
|
257
|
-
async function getVersion() {
|
|
258
|
-
return invokeTauriCommand({
|
|
259
|
-
__tauriModule: "App",
|
|
260
|
-
message: {
|
|
261
|
-
cmd: "getAppVersion"
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
async function getName() {
|
|
266
|
-
return invokeTauriCommand({
|
|
267
|
-
__tauriModule: "App",
|
|
268
|
-
message: {
|
|
269
|
-
cmd: "getAppName"
|
|
270
|
-
}
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
async function getTauriVersion() {
|
|
274
|
-
return invokeTauriCommand({
|
|
275
|
-
__tauriModule: "App",
|
|
276
|
-
message: {
|
|
277
|
-
cmd: "getTauriVersion"
|
|
278
|
-
}
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
async function show() {
|
|
282
|
-
return invokeTauriCommand({
|
|
283
|
-
__tauriModule: "App",
|
|
284
|
-
message: {
|
|
285
|
-
cmd: "show"
|
|
286
|
-
}
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
async function hide() {
|
|
290
|
-
return invokeTauriCommand({
|
|
291
|
-
__tauriModule: "App",
|
|
292
|
-
message: {
|
|
293
|
-
cmd: "hide"
|
|
294
|
-
}
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
// ../../../../node_modules/@tauri-apps/api/clipboard.js
|
|
299
|
-
var exports_clipboard = {};
|
|
300
|
-
__export(exports_clipboard, {
|
|
301
|
-
writeText: () => writeText,
|
|
302
|
-
readText: () => readText
|
|
303
|
-
});
|
|
304
|
-
async function writeText(text) {
|
|
305
|
-
return invokeTauriCommand({
|
|
306
|
-
__tauriModule: "Clipboard",
|
|
307
|
-
message: {
|
|
308
|
-
cmd: "writeText",
|
|
309
|
-
data: text
|
|
310
|
-
}
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
async function readText() {
|
|
314
|
-
return invokeTauriCommand({
|
|
315
|
-
__tauriModule: "Clipboard",
|
|
316
|
-
message: {
|
|
317
|
-
cmd: "readText",
|
|
318
|
-
data: null
|
|
319
|
-
}
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
// ../../../../node_modules/@tauri-apps/api/dialog.js
|
|
324
|
-
var exports_dialog = {};
|
|
325
|
-
__export(exports_dialog, {
|
|
326
|
-
save: () => save,
|
|
327
|
-
open: () => open2,
|
|
328
|
-
message: () => message,
|
|
329
|
-
confirm: () => confirm,
|
|
330
|
-
ask: () => ask
|
|
331
|
-
});
|
|
332
|
-
async function open2(options = {}) {
|
|
333
|
-
if (typeof options === "object") {
|
|
334
|
-
Object.freeze(options);
|
|
335
|
-
}
|
|
336
|
-
return invokeTauriCommand({
|
|
337
|
-
__tauriModule: "Dialog",
|
|
338
|
-
message: {
|
|
339
|
-
cmd: "openDialog",
|
|
340
|
-
options
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
|
-
}
|
|
344
|
-
async function save(options = {}) {
|
|
345
|
-
if (typeof options === "object") {
|
|
346
|
-
Object.freeze(options);
|
|
347
|
-
}
|
|
348
|
-
return invokeTauriCommand({
|
|
349
|
-
__tauriModule: "Dialog",
|
|
350
|
-
message: {
|
|
351
|
-
cmd: "saveDialog",
|
|
352
|
-
options
|
|
353
|
-
}
|
|
354
|
-
});
|
|
355
|
-
}
|
|
356
|
-
async function message(message2, options) {
|
|
357
|
-
var _a, _b;
|
|
358
|
-
const opts = typeof options === "string" ? { title: options } : options;
|
|
359
|
-
return invokeTauriCommand({
|
|
360
|
-
__tauriModule: "Dialog",
|
|
361
|
-
message: {
|
|
362
|
-
cmd: "messageDialog",
|
|
363
|
-
message: message2.toString(),
|
|
364
|
-
title: (_a = opts === null || opts === undefined ? undefined : opts.title) === null || _a === undefined ? undefined : _a.toString(),
|
|
365
|
-
type: opts === null || opts === undefined ? undefined : opts.type,
|
|
366
|
-
buttonLabel: (_b = opts === null || opts === undefined ? undefined : opts.okLabel) === null || _b === undefined ? undefined : _b.toString()
|
|
367
|
-
}
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
async function ask(message2, options) {
|
|
371
|
-
var _a, _b, _c, _d, _e;
|
|
372
|
-
const opts = typeof options === "string" ? { title: options } : options;
|
|
373
|
-
return invokeTauriCommand({
|
|
374
|
-
__tauriModule: "Dialog",
|
|
375
|
-
message: {
|
|
376
|
-
cmd: "askDialog",
|
|
377
|
-
message: message2.toString(),
|
|
378
|
-
title: (_a = opts === null || opts === undefined ? undefined : opts.title) === null || _a === undefined ? undefined : _a.toString(),
|
|
379
|
-
type: opts === null || opts === undefined ? undefined : opts.type,
|
|
380
|
-
buttonLabels: [
|
|
381
|
-
(_c = (_b = opts === null || opts === undefined ? undefined : opts.okLabel) === null || _b === undefined ? undefined : _b.toString()) !== null && _c !== undefined ? _c : "Yes",
|
|
382
|
-
(_e = (_d = opts === null || opts === undefined ? undefined : opts.cancelLabel) === null || _d === undefined ? undefined : _d.toString()) !== null && _e !== undefined ? _e : "No"
|
|
383
|
-
]
|
|
384
|
-
}
|
|
385
|
-
});
|
|
386
|
-
}
|
|
387
|
-
async function confirm(message2, options) {
|
|
388
|
-
var _a, _b, _c, _d, _e;
|
|
389
|
-
const opts = typeof options === "string" ? { title: options } : options;
|
|
390
|
-
return invokeTauriCommand({
|
|
391
|
-
__tauriModule: "Dialog",
|
|
392
|
-
message: {
|
|
393
|
-
cmd: "confirmDialog",
|
|
394
|
-
message: message2.toString(),
|
|
395
|
-
title: (_a = opts === null || opts === undefined ? undefined : opts.title) === null || _a === undefined ? undefined : _a.toString(),
|
|
396
|
-
type: opts === null || opts === undefined ? undefined : opts.type,
|
|
397
|
-
buttonLabels: [
|
|
398
|
-
(_c = (_b = opts === null || opts === undefined ? undefined : opts.okLabel) === null || _b === undefined ? undefined : _b.toString()) !== null && _c !== undefined ? _c : "Ok",
|
|
399
|
-
(_e = (_d = opts === null || opts === undefined ? undefined : opts.cancelLabel) === null || _d === undefined ? undefined : _d.toString()) !== null && _e !== undefined ? _e : "Cancel"
|
|
400
|
-
]
|
|
401
|
-
}
|
|
402
|
-
});
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
// ../../../../node_modules/@tauri-apps/api/event.js
|
|
406
|
-
var exports_event = {};
|
|
407
|
-
__export(exports_event, {
|
|
408
|
-
once: () => once2,
|
|
409
|
-
listen: () => listen2,
|
|
410
|
-
emit: () => emit2,
|
|
411
|
-
TauriEvent: () => TauriEvent
|
|
412
|
-
});
|
|
413
|
-
|
|
414
|
-
// ../../../../node_modules/@tauri-apps/api/helpers/event.js
|
|
415
|
-
async function _unlisten(event, eventId) {
|
|
416
|
-
return invokeTauriCommand({
|
|
417
|
-
__tauriModule: "Event",
|
|
418
|
-
message: {
|
|
419
|
-
cmd: "unlisten",
|
|
420
|
-
event,
|
|
421
|
-
eventId
|
|
422
|
-
}
|
|
423
|
-
});
|
|
424
|
-
}
|
|
425
|
-
async function emit(event, windowLabel, payload) {
|
|
426
|
-
await invokeTauriCommand({
|
|
427
|
-
__tauriModule: "Event",
|
|
428
|
-
message: {
|
|
429
|
-
cmd: "emit",
|
|
430
|
-
event,
|
|
431
|
-
windowLabel,
|
|
432
|
-
payload
|
|
433
|
-
}
|
|
434
|
-
});
|
|
435
|
-
}
|
|
436
|
-
async function listen(event, windowLabel, handler) {
|
|
437
|
-
return invokeTauriCommand({
|
|
438
|
-
__tauriModule: "Event",
|
|
439
|
-
message: {
|
|
440
|
-
cmd: "listen",
|
|
441
|
-
event,
|
|
442
|
-
windowLabel,
|
|
443
|
-
handler: transformCallback(handler)
|
|
444
|
-
}
|
|
445
|
-
}).then((eventId) => {
|
|
446
|
-
return async () => _unlisten(event, eventId);
|
|
447
|
-
});
|
|
448
|
-
}
|
|
449
|
-
async function once(event, windowLabel, handler) {
|
|
450
|
-
return listen(event, windowLabel, (eventData) => {
|
|
451
|
-
handler(eventData);
|
|
452
|
-
_unlisten(event, eventData.id).catch(() => {
|
|
453
|
-
});
|
|
454
|
-
});
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
// ../../../../node_modules/@tauri-apps/api/event.js
|
|
458
|
-
async function listen2(event2, handler) {
|
|
459
|
-
return listen(event2, null, handler);
|
|
460
|
-
}
|
|
461
|
-
async function once2(event2, handler) {
|
|
462
|
-
return once(event2, null, handler);
|
|
463
|
-
}
|
|
464
|
-
async function emit2(event2, payload) {
|
|
465
|
-
return emit(event2, undefined, payload);
|
|
466
|
-
}
|
|
467
|
-
var TauriEvent;
|
|
468
|
-
(function(TauriEvent2) {
|
|
469
|
-
TauriEvent2["WINDOW_RESIZED"] = "tauri://resize";
|
|
470
|
-
TauriEvent2["WINDOW_MOVED"] = "tauri://move";
|
|
471
|
-
TauriEvent2["WINDOW_CLOSE_REQUESTED"] = "tauri://close-requested";
|
|
472
|
-
TauriEvent2["WINDOW_CREATED"] = "tauri://window-created";
|
|
473
|
-
TauriEvent2["WINDOW_DESTROYED"] = "tauri://destroyed";
|
|
474
|
-
TauriEvent2["WINDOW_FOCUS"] = "tauri://focus";
|
|
475
|
-
TauriEvent2["WINDOW_BLUR"] = "tauri://blur";
|
|
476
|
-
TauriEvent2["WINDOW_SCALE_FACTOR_CHANGED"] = "tauri://scale-change";
|
|
477
|
-
TauriEvent2["WINDOW_THEME_CHANGED"] = "tauri://theme-changed";
|
|
478
|
-
TauriEvent2["WINDOW_FILE_DROP"] = "tauri://file-drop";
|
|
479
|
-
TauriEvent2["WINDOW_FILE_DROP_HOVER"] = "tauri://file-drop-hover";
|
|
480
|
-
TauriEvent2["WINDOW_FILE_DROP_CANCELLED"] = "tauri://file-drop-cancelled";
|
|
481
|
-
TauriEvent2["MENU"] = "tauri://menu";
|
|
482
|
-
TauriEvent2["CHECK_UPDATE"] = "tauri://update";
|
|
483
|
-
TauriEvent2["UPDATE_AVAILABLE"] = "tauri://update-available";
|
|
484
|
-
TauriEvent2["INSTALL_UPDATE"] = "tauri://update-install";
|
|
485
|
-
TauriEvent2["STATUS_UPDATE"] = "tauri://update-status";
|
|
486
|
-
TauriEvent2["DOWNLOAD_PROGRESS"] = "tauri://update-download-progress";
|
|
487
|
-
})(TauriEvent || (TauriEvent = {}));
|
|
488
|
-
|
|
489
|
-
// ../../../../node_modules/@tauri-apps/api/fs.js
|
|
490
|
-
var exports_fs = {};
|
|
491
|
-
__export(exports_fs, {
|
|
492
|
-
writeTextFile: () => writeTextFile,
|
|
493
|
-
writeFile: () => writeTextFile,
|
|
494
|
-
writeBinaryFile: () => writeBinaryFile,
|
|
495
|
-
renameFile: () => renameFile,
|
|
496
|
-
removeFile: () => removeFile,
|
|
497
|
-
removeDir: () => removeDir,
|
|
498
|
-
readTextFile: () => readTextFile,
|
|
499
|
-
readDir: () => readDir,
|
|
500
|
-
readBinaryFile: () => readBinaryFile,
|
|
501
|
-
exists: () => exists,
|
|
502
|
-
createDir: () => createDir,
|
|
503
|
-
copyFile: () => copyFile,
|
|
504
|
-
Dir: () => BaseDirectory,
|
|
505
|
-
BaseDirectory: () => BaseDirectory
|
|
506
|
-
});
|
|
507
|
-
async function readTextFile(filePath, options = {}) {
|
|
508
|
-
return invokeTauriCommand({
|
|
509
|
-
__tauriModule: "Fs",
|
|
510
|
-
message: {
|
|
511
|
-
cmd: "readTextFile",
|
|
512
|
-
path: filePath,
|
|
513
|
-
options
|
|
514
|
-
}
|
|
515
|
-
});
|
|
516
|
-
}
|
|
517
|
-
async function readBinaryFile(filePath, options = {}) {
|
|
518
|
-
const arr = await invokeTauriCommand({
|
|
519
|
-
__tauriModule: "Fs",
|
|
520
|
-
message: {
|
|
521
|
-
cmd: "readFile",
|
|
522
|
-
path: filePath,
|
|
523
|
-
options
|
|
524
|
-
}
|
|
525
|
-
});
|
|
526
|
-
return Uint8Array.from(arr);
|
|
527
|
-
}
|
|
528
|
-
async function writeTextFile(path, contents, options) {
|
|
529
|
-
if (typeof options === "object") {
|
|
530
|
-
Object.freeze(options);
|
|
531
|
-
}
|
|
532
|
-
if (typeof path === "object") {
|
|
533
|
-
Object.freeze(path);
|
|
534
|
-
}
|
|
535
|
-
const file = { path: "", contents: "" };
|
|
536
|
-
let fileOptions = options;
|
|
537
|
-
if (typeof path === "string") {
|
|
538
|
-
file.path = path;
|
|
539
|
-
} else {
|
|
540
|
-
file.path = path.path;
|
|
541
|
-
file.contents = path.contents;
|
|
542
|
-
}
|
|
543
|
-
if (typeof contents === "string") {
|
|
544
|
-
file.contents = contents !== null && contents !== undefined ? contents : "";
|
|
545
|
-
} else {
|
|
546
|
-
fileOptions = contents;
|
|
547
|
-
}
|
|
548
|
-
return invokeTauriCommand({
|
|
549
|
-
__tauriModule: "Fs",
|
|
550
|
-
message: {
|
|
551
|
-
cmd: "writeFile",
|
|
552
|
-
path: file.path,
|
|
553
|
-
contents: Array.from(new TextEncoder().encode(file.contents)),
|
|
554
|
-
options: fileOptions
|
|
555
|
-
}
|
|
556
|
-
});
|
|
557
|
-
}
|
|
558
|
-
async function writeBinaryFile(path, contents, options) {
|
|
559
|
-
if (typeof options === "object") {
|
|
560
|
-
Object.freeze(options);
|
|
561
|
-
}
|
|
562
|
-
if (typeof path === "object") {
|
|
563
|
-
Object.freeze(path);
|
|
564
|
-
}
|
|
565
|
-
const file = { path: "", contents: [] };
|
|
566
|
-
let fileOptions = options;
|
|
567
|
-
if (typeof path === "string") {
|
|
568
|
-
file.path = path;
|
|
569
|
-
} else {
|
|
570
|
-
file.path = path.path;
|
|
571
|
-
file.contents = path.contents;
|
|
572
|
-
}
|
|
573
|
-
if (contents && "dir" in contents) {
|
|
574
|
-
fileOptions = contents;
|
|
575
|
-
} else if (typeof path === "string") {
|
|
576
|
-
file.contents = contents !== null && contents !== undefined ? contents : [];
|
|
577
|
-
}
|
|
578
|
-
return invokeTauriCommand({
|
|
579
|
-
__tauriModule: "Fs",
|
|
580
|
-
message: {
|
|
581
|
-
cmd: "writeFile",
|
|
582
|
-
path: file.path,
|
|
583
|
-
contents: Array.from(file.contents instanceof ArrayBuffer ? new Uint8Array(file.contents) : file.contents),
|
|
584
|
-
options: fileOptions
|
|
585
|
-
}
|
|
586
|
-
});
|
|
587
|
-
}
|
|
588
|
-
async function readDir(dir, options = {}) {
|
|
589
|
-
return invokeTauriCommand({
|
|
590
|
-
__tauriModule: "Fs",
|
|
591
|
-
message: {
|
|
592
|
-
cmd: "readDir",
|
|
593
|
-
path: dir,
|
|
594
|
-
options
|
|
595
|
-
}
|
|
596
|
-
});
|
|
597
|
-
}
|
|
598
|
-
async function createDir(dir, options = {}) {
|
|
599
|
-
return invokeTauriCommand({
|
|
600
|
-
__tauriModule: "Fs",
|
|
601
|
-
message: {
|
|
602
|
-
cmd: "createDir",
|
|
603
|
-
path: dir,
|
|
604
|
-
options
|
|
605
|
-
}
|
|
606
|
-
});
|
|
607
|
-
}
|
|
608
|
-
async function removeDir(dir, options = {}) {
|
|
609
|
-
return invokeTauriCommand({
|
|
610
|
-
__tauriModule: "Fs",
|
|
611
|
-
message: {
|
|
612
|
-
cmd: "removeDir",
|
|
613
|
-
path: dir,
|
|
614
|
-
options
|
|
615
|
-
}
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
async function copyFile(source, destination, options = {}) {
|
|
619
|
-
return invokeTauriCommand({
|
|
620
|
-
__tauriModule: "Fs",
|
|
621
|
-
message: {
|
|
622
|
-
cmd: "copyFile",
|
|
623
|
-
source,
|
|
624
|
-
destination,
|
|
625
|
-
options
|
|
626
|
-
}
|
|
627
|
-
});
|
|
628
|
-
}
|
|
629
|
-
async function removeFile(file, options = {}) {
|
|
630
|
-
return invokeTauriCommand({
|
|
631
|
-
__tauriModule: "Fs",
|
|
632
|
-
message: {
|
|
633
|
-
cmd: "removeFile",
|
|
634
|
-
path: file,
|
|
635
|
-
options
|
|
636
|
-
}
|
|
637
|
-
});
|
|
638
|
-
}
|
|
639
|
-
async function renameFile(oldPath, newPath, options = {}) {
|
|
640
|
-
return invokeTauriCommand({
|
|
641
|
-
__tauriModule: "Fs",
|
|
642
|
-
message: {
|
|
643
|
-
cmd: "renameFile",
|
|
644
|
-
oldPath,
|
|
645
|
-
newPath,
|
|
646
|
-
options
|
|
647
|
-
}
|
|
648
|
-
});
|
|
649
|
-
}
|
|
650
|
-
async function exists(path, options = {}) {
|
|
651
|
-
return invokeTauriCommand({
|
|
652
|
-
__tauriModule: "Fs",
|
|
653
|
-
message: {
|
|
654
|
-
cmd: "exists",
|
|
655
|
-
path,
|
|
656
|
-
options
|
|
657
|
-
}
|
|
658
|
-
});
|
|
659
|
-
}
|
|
660
|
-
var BaseDirectory;
|
|
661
|
-
(function(BaseDirectory2) {
|
|
662
|
-
BaseDirectory2[BaseDirectory2["Audio"] = 1] = "Audio";
|
|
663
|
-
BaseDirectory2[BaseDirectory2["Cache"] = 2] = "Cache";
|
|
664
|
-
BaseDirectory2[BaseDirectory2["Config"] = 3] = "Config";
|
|
665
|
-
BaseDirectory2[BaseDirectory2["Data"] = 4] = "Data";
|
|
666
|
-
BaseDirectory2[BaseDirectory2["LocalData"] = 5] = "LocalData";
|
|
667
|
-
BaseDirectory2[BaseDirectory2["Desktop"] = 6] = "Desktop";
|
|
668
|
-
BaseDirectory2[BaseDirectory2["Document"] = 7] = "Document";
|
|
669
|
-
BaseDirectory2[BaseDirectory2["Download"] = 8] = "Download";
|
|
670
|
-
BaseDirectory2[BaseDirectory2["Executable"] = 9] = "Executable";
|
|
671
|
-
BaseDirectory2[BaseDirectory2["Font"] = 10] = "Font";
|
|
672
|
-
BaseDirectory2[BaseDirectory2["Home"] = 11] = "Home";
|
|
673
|
-
BaseDirectory2[BaseDirectory2["Picture"] = 12] = "Picture";
|
|
674
|
-
BaseDirectory2[BaseDirectory2["Public"] = 13] = "Public";
|
|
675
|
-
BaseDirectory2[BaseDirectory2["Runtime"] = 14] = "Runtime";
|
|
676
|
-
BaseDirectory2[BaseDirectory2["Template"] = 15] = "Template";
|
|
677
|
-
BaseDirectory2[BaseDirectory2["Video"] = 16] = "Video";
|
|
678
|
-
BaseDirectory2[BaseDirectory2["Resource"] = 17] = "Resource";
|
|
679
|
-
BaseDirectory2[BaseDirectory2["App"] = 18] = "App";
|
|
680
|
-
BaseDirectory2[BaseDirectory2["Log"] = 19] = "Log";
|
|
681
|
-
BaseDirectory2[BaseDirectory2["Temp"] = 20] = "Temp";
|
|
682
|
-
BaseDirectory2[BaseDirectory2["AppConfig"] = 21] = "AppConfig";
|
|
683
|
-
BaseDirectory2[BaseDirectory2["AppData"] = 22] = "AppData";
|
|
684
|
-
BaseDirectory2[BaseDirectory2["AppLocalData"] = 23] = "AppLocalData";
|
|
685
|
-
BaseDirectory2[BaseDirectory2["AppCache"] = 24] = "AppCache";
|
|
686
|
-
BaseDirectory2[BaseDirectory2["AppLog"] = 25] = "AppLog";
|
|
687
|
-
})(BaseDirectory || (BaseDirectory = {}));
|
|
688
|
-
|
|
689
|
-
// ../../../../node_modules/@tauri-apps/api/globalShortcut.js
|
|
690
|
-
var exports_globalShortcut = {};
|
|
691
|
-
__export(exports_globalShortcut, {
|
|
692
|
-
unregisterAll: () => unregisterAll,
|
|
693
|
-
unregister: () => unregister,
|
|
694
|
-
registerAll: () => registerAll,
|
|
695
|
-
register: () => register,
|
|
696
|
-
isRegistered: () => isRegistered
|
|
697
|
-
});
|
|
698
|
-
async function register(shortcut, handler) {
|
|
699
|
-
return invokeTauriCommand({
|
|
700
|
-
__tauriModule: "GlobalShortcut",
|
|
701
|
-
message: {
|
|
702
|
-
cmd: "register",
|
|
703
|
-
shortcut,
|
|
704
|
-
handler: transformCallback(handler)
|
|
705
|
-
}
|
|
706
|
-
});
|
|
707
|
-
}
|
|
708
|
-
async function registerAll(shortcuts, handler) {
|
|
709
|
-
return invokeTauriCommand({
|
|
710
|
-
__tauriModule: "GlobalShortcut",
|
|
711
|
-
message: {
|
|
712
|
-
cmd: "registerAll",
|
|
713
|
-
shortcuts,
|
|
714
|
-
handler: transformCallback(handler)
|
|
715
|
-
}
|
|
716
|
-
});
|
|
717
|
-
}
|
|
718
|
-
async function isRegistered(shortcut) {
|
|
719
|
-
return invokeTauriCommand({
|
|
720
|
-
__tauriModule: "GlobalShortcut",
|
|
721
|
-
message: {
|
|
722
|
-
cmd: "isRegistered",
|
|
723
|
-
shortcut
|
|
724
|
-
}
|
|
725
|
-
});
|
|
726
|
-
}
|
|
727
|
-
async function unregister(shortcut) {
|
|
728
|
-
return invokeTauriCommand({
|
|
729
|
-
__tauriModule: "GlobalShortcut",
|
|
730
|
-
message: {
|
|
731
|
-
cmd: "unregister",
|
|
732
|
-
shortcut
|
|
733
|
-
}
|
|
734
|
-
});
|
|
735
|
-
}
|
|
736
|
-
async function unregisterAll() {
|
|
737
|
-
return invokeTauriCommand({
|
|
738
|
-
__tauriModule: "GlobalShortcut",
|
|
739
|
-
message: {
|
|
740
|
-
cmd: "unregisterAll"
|
|
741
|
-
}
|
|
742
|
-
});
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
// ../../../../node_modules/@tauri-apps/api/http.js
|
|
746
|
-
var exports_http = {};
|
|
747
|
-
__export(exports_http, {
|
|
748
|
-
getClient: () => getClient,
|
|
749
|
-
fetch: () => fetch,
|
|
750
|
-
ResponseType: () => ResponseType,
|
|
751
|
-
Response: () => Response,
|
|
752
|
-
Client: () => Client,
|
|
753
|
-
Body: () => Body
|
|
754
|
-
});
|
|
755
|
-
async function formBody(data) {
|
|
756
|
-
const form = {};
|
|
757
|
-
const append = async (key, v) => {
|
|
758
|
-
if (v !== null) {
|
|
759
|
-
let r;
|
|
760
|
-
if (typeof v === "string") {
|
|
761
|
-
r = v;
|
|
762
|
-
} else if (v instanceof Uint8Array || Array.isArray(v)) {
|
|
763
|
-
r = Array.from(v);
|
|
764
|
-
} else if (v instanceof File) {
|
|
765
|
-
r = {
|
|
766
|
-
file: Array.from(new Uint8Array(await v.arrayBuffer())),
|
|
767
|
-
mime: v.type,
|
|
768
|
-
fileName: v.name
|
|
769
|
-
};
|
|
770
|
-
} else if (typeof v.file === "string") {
|
|
771
|
-
r = { file: v.file, mime: v.mime, fileName: v.fileName };
|
|
772
|
-
} else {
|
|
773
|
-
r = { file: Array.from(v.file), mime: v.mime, fileName: v.fileName };
|
|
774
|
-
}
|
|
775
|
-
form[String(key)] = r;
|
|
776
|
-
}
|
|
777
|
-
};
|
|
778
|
-
if (data instanceof FormData) {
|
|
779
|
-
for (const [key, value] of data) {
|
|
780
|
-
await append(key, value);
|
|
781
|
-
}
|
|
782
|
-
} else {
|
|
783
|
-
for (const [key, value] of Object.entries(data)) {
|
|
784
|
-
await append(key, value);
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
return form;
|
|
788
|
-
}
|
|
789
|
-
async function getClient(options) {
|
|
790
|
-
return invokeTauriCommand({
|
|
791
|
-
__tauriModule: "Http",
|
|
792
|
-
message: {
|
|
793
|
-
cmd: "createClient",
|
|
794
|
-
options
|
|
795
|
-
}
|
|
796
|
-
}).then((id) => new Client(id));
|
|
797
|
-
}
|
|
798
|
-
async function fetch(url, options) {
|
|
799
|
-
var _a;
|
|
800
|
-
if (defaultClient === null) {
|
|
801
|
-
defaultClient = await getClient();
|
|
802
|
-
}
|
|
803
|
-
return defaultClient.request({
|
|
804
|
-
url,
|
|
805
|
-
method: (_a = options === null || options === undefined ? undefined : options.method) !== null && _a !== undefined ? _a : "GET",
|
|
806
|
-
...options
|
|
807
|
-
});
|
|
808
|
-
}
|
|
809
|
-
var ResponseType;
|
|
810
|
-
(function(ResponseType2) {
|
|
811
|
-
ResponseType2[ResponseType2["JSON"] = 1] = "JSON";
|
|
812
|
-
ResponseType2[ResponseType2["Text"] = 2] = "Text";
|
|
813
|
-
ResponseType2[ResponseType2["Binary"] = 3] = "Binary";
|
|
814
|
-
})(ResponseType || (ResponseType = {}));
|
|
815
|
-
|
|
816
|
-
class Body {
|
|
817
|
-
constructor(type, payload) {
|
|
818
|
-
this.type = type;
|
|
819
|
-
this.payload = payload;
|
|
820
|
-
}
|
|
821
|
-
static form(data) {
|
|
822
|
-
return new Body("Form", data);
|
|
823
|
-
}
|
|
824
|
-
static json(data) {
|
|
825
|
-
return new Body("Json", data);
|
|
826
|
-
}
|
|
827
|
-
static text(value) {
|
|
828
|
-
return new Body("Text", value);
|
|
829
|
-
}
|
|
830
|
-
static bytes(bytes) {
|
|
831
|
-
return new Body("Bytes", Array.from(bytes instanceof ArrayBuffer ? new Uint8Array(bytes) : bytes));
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
class Response {
|
|
836
|
-
constructor(response) {
|
|
837
|
-
this.url = response.url;
|
|
838
|
-
this.status = response.status;
|
|
839
|
-
this.ok = this.status >= 200 && this.status < 300;
|
|
840
|
-
this.headers = response.headers;
|
|
841
|
-
this.rawHeaders = response.rawHeaders;
|
|
842
|
-
this.data = response.data;
|
|
843
|
-
}
|
|
844
|
-
}
|
|
845
|
-
|
|
846
|
-
class Client {
|
|
847
|
-
constructor(id) {
|
|
848
|
-
this.id = id;
|
|
849
|
-
}
|
|
850
|
-
async drop() {
|
|
851
|
-
return invokeTauriCommand({
|
|
852
|
-
__tauriModule: "Http",
|
|
853
|
-
message: {
|
|
854
|
-
cmd: "dropClient",
|
|
855
|
-
client: this.id
|
|
856
|
-
}
|
|
857
|
-
});
|
|
858
|
-
}
|
|
859
|
-
async request(options) {
|
|
860
|
-
var _a;
|
|
861
|
-
const jsonResponse = !options.responseType || options.responseType === ResponseType.JSON;
|
|
862
|
-
if (jsonResponse) {
|
|
863
|
-
options.responseType = ResponseType.Text;
|
|
864
|
-
}
|
|
865
|
-
if (((_a = options.body) === null || _a === undefined ? undefined : _a.type) === "Form") {
|
|
866
|
-
options.body.payload = await formBody(options.body.payload);
|
|
867
|
-
}
|
|
868
|
-
return invokeTauriCommand({
|
|
869
|
-
__tauriModule: "Http",
|
|
870
|
-
message: {
|
|
871
|
-
cmd: "httpRequest",
|
|
872
|
-
client: this.id,
|
|
873
|
-
options
|
|
874
|
-
}
|
|
875
|
-
}).then((res) => {
|
|
876
|
-
const response = new Response(res);
|
|
877
|
-
if (jsonResponse) {
|
|
878
|
-
try {
|
|
879
|
-
response.data = JSON.parse(response.data);
|
|
880
|
-
} catch (e) {
|
|
881
|
-
if (response.ok && response.data === "") {
|
|
882
|
-
response.data = {};
|
|
883
|
-
} else if (response.ok) {
|
|
884
|
-
throw Error(`Failed to parse response \`${response.data}\` as JSON: ${e};
|
|
885
|
-
try setting the \`responseType\` option to \`ResponseType.Text\` or \`ResponseType.Binary\` if the API does not return a JSON response.`);
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
return response;
|
|
889
|
-
}
|
|
890
|
-
return response;
|
|
891
|
-
});
|
|
892
|
-
}
|
|
893
|
-
async get(url, options) {
|
|
894
|
-
return this.request({
|
|
895
|
-
method: "GET",
|
|
896
|
-
url,
|
|
897
|
-
...options
|
|
898
|
-
});
|
|
899
|
-
}
|
|
900
|
-
async post(url, body, options) {
|
|
901
|
-
return this.request({
|
|
902
|
-
method: "POST",
|
|
903
|
-
url,
|
|
904
|
-
body,
|
|
905
|
-
...options
|
|
906
|
-
});
|
|
907
|
-
}
|
|
908
|
-
async put(url, body, options) {
|
|
909
|
-
return this.request({
|
|
910
|
-
method: "PUT",
|
|
911
|
-
url,
|
|
912
|
-
body,
|
|
913
|
-
...options
|
|
914
|
-
});
|
|
915
|
-
}
|
|
916
|
-
async patch(url, options) {
|
|
917
|
-
return this.request({
|
|
918
|
-
method: "PATCH",
|
|
919
|
-
url,
|
|
920
|
-
...options
|
|
921
|
-
});
|
|
922
|
-
}
|
|
923
|
-
async delete(url, options) {
|
|
924
|
-
return this.request({
|
|
925
|
-
method: "DELETE",
|
|
926
|
-
url,
|
|
927
|
-
...options
|
|
928
|
-
});
|
|
929
|
-
}
|
|
930
|
-
}
|
|
931
|
-
var defaultClient = null;
|
|
932
|
-
|
|
933
|
-
// ../../../../node_modules/@tauri-apps/api/mocks.js
|
|
934
|
-
var exports_mocks = {};
|
|
935
|
-
__export(exports_mocks, {
|
|
936
|
-
mockWindows: () => mockWindows,
|
|
937
|
-
mockIPC: () => mockIPC,
|
|
938
|
-
mockConvertFileSrc: () => mockConvertFileSrc,
|
|
939
|
-
clearMocks: () => clearMocks
|
|
940
|
-
});
|
|
941
|
-
function mockIPC(cb) {
|
|
942
|
-
window.__TAURI_IPC__ = async ({ cmd, callback, error, ...args }) => {
|
|
943
|
-
try {
|
|
944
|
-
window[`_${callback}`](await cb(cmd, args));
|
|
945
|
-
} catch (err) {
|
|
946
|
-
window[`_${error}`](err);
|
|
947
|
-
}
|
|
948
|
-
};
|
|
949
|
-
}
|
|
950
|
-
function mockWindows(current, ...additionalWindows) {
|
|
951
|
-
window.__TAURI_METADATA__ = {
|
|
952
|
-
__windows: [current, ...additionalWindows].map((label) => ({ label })),
|
|
953
|
-
__currentWindow: { label: current }
|
|
954
|
-
};
|
|
955
|
-
}
|
|
956
|
-
function mockConvertFileSrc(osName, windowsProtocolScheme = "https") {
|
|
957
|
-
var _a;
|
|
958
|
-
window.__TAURI__ = (_a = window.__TAURI__) !== null && _a !== undefined ? _a : {};
|
|
959
|
-
window.__TAURI__.convertFileSrc = function(filePath, protocol = "asset") {
|
|
960
|
-
const path = encodeURIComponent(filePath);
|
|
961
|
-
return osName === "windows" ? `${windowsProtocolScheme}://${protocol}.localhost/${path}` : `${protocol}://localhost/${path}`;
|
|
962
|
-
};
|
|
963
|
-
}
|
|
964
|
-
function clearMocks() {
|
|
965
|
-
var _a;
|
|
966
|
-
if ((_a = window.__TAURI__) === null || _a === undefined ? undefined : _a.convertFileSrc)
|
|
967
|
-
delete window.__TAURI__.convertFileSrc;
|
|
968
|
-
if (window.__TAURI_IPC__)
|
|
969
|
-
delete window.__TAURI_IPC__;
|
|
970
|
-
if (window.__TAURI_METADATA__)
|
|
971
|
-
delete window.__TAURI_METADATA__;
|
|
972
|
-
}
|
|
973
|
-
|
|
974
|
-
// ../../../../node_modules/@tauri-apps/api/notification.js
|
|
975
|
-
var exports_notification = {};
|
|
976
|
-
__export(exports_notification, {
|
|
977
|
-
sendNotification: () => sendNotification,
|
|
978
|
-
requestPermission: () => requestPermission,
|
|
979
|
-
isPermissionGranted: () => isPermissionGranted
|
|
980
|
-
});
|
|
981
|
-
async function isPermissionGranted() {
|
|
982
|
-
if (window.Notification.permission !== "default") {
|
|
983
|
-
return Promise.resolve(window.Notification.permission === "granted");
|
|
984
|
-
}
|
|
985
|
-
return invokeTauriCommand({
|
|
986
|
-
__tauriModule: "Notification",
|
|
987
|
-
message: {
|
|
988
|
-
cmd: "isNotificationPermissionGranted"
|
|
989
|
-
}
|
|
990
|
-
});
|
|
991
|
-
}
|
|
992
|
-
async function requestPermission() {
|
|
993
|
-
return window.Notification.requestPermission();
|
|
994
|
-
}
|
|
995
|
-
function sendNotification(options) {
|
|
996
|
-
if (typeof options === "string") {
|
|
997
|
-
new window.Notification(options);
|
|
998
|
-
} else {
|
|
999
|
-
new window.Notification(options.title, options);
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
|
|
1003
|
-
// ../../../../node_modules/@tauri-apps/api/os.js
|
|
1004
|
-
var exports_os = {};
|
|
1005
|
-
__export(exports_os, {
|
|
1006
|
-
version: () => version,
|
|
1007
|
-
type: () => type,
|
|
1008
|
-
tempdir: () => tempdir,
|
|
1009
|
-
platform: () => platform,
|
|
1010
|
-
locale: () => locale,
|
|
1011
|
-
arch: () => arch,
|
|
1012
|
-
EOL: () => EOL
|
|
1013
|
-
});
|
|
1014
|
-
|
|
1015
|
-
// ../../../../node_modules/@tauri-apps/api/helpers/os-check.js
|
|
1016
|
-
function isWindows() {
|
|
1017
|
-
return navigator.appVersion.includes("Win");
|
|
1018
|
-
}
|
|
1019
|
-
|
|
1020
|
-
// ../../../../node_modules/@tauri-apps/api/os.js
|
|
1021
|
-
async function platform() {
|
|
1022
|
-
return invokeTauriCommand({
|
|
1023
|
-
__tauriModule: "Os",
|
|
1024
|
-
message: {
|
|
1025
|
-
cmd: "platform"
|
|
1026
|
-
}
|
|
1027
|
-
});
|
|
1028
|
-
}
|
|
1029
|
-
async function version() {
|
|
1030
|
-
return invokeTauriCommand({
|
|
1031
|
-
__tauriModule: "Os",
|
|
1032
|
-
message: {
|
|
1033
|
-
cmd: "version"
|
|
1034
|
-
}
|
|
1035
|
-
});
|
|
1036
|
-
}
|
|
1037
|
-
async function type() {
|
|
1038
|
-
return invokeTauriCommand({
|
|
1039
|
-
__tauriModule: "Os",
|
|
1040
|
-
message: {
|
|
1041
|
-
cmd: "osType"
|
|
1042
|
-
}
|
|
1043
|
-
});
|
|
1044
|
-
}
|
|
1045
|
-
async function arch() {
|
|
1046
|
-
return invokeTauriCommand({
|
|
1047
|
-
__tauriModule: "Os",
|
|
1048
|
-
message: {
|
|
1049
|
-
cmd: "arch"
|
|
1050
|
-
}
|
|
1051
|
-
});
|
|
1052
|
-
}
|
|
1053
|
-
async function tempdir() {
|
|
1054
|
-
return invokeTauriCommand({
|
|
1055
|
-
__tauriModule: "Os",
|
|
1056
|
-
message: {
|
|
1057
|
-
cmd: "tempdir"
|
|
1058
|
-
}
|
|
1059
|
-
});
|
|
1060
|
-
}
|
|
1061
|
-
async function locale() {
|
|
1062
|
-
return invokeTauriCommand({
|
|
1063
|
-
__tauriModule: "Os",
|
|
1064
|
-
message: {
|
|
1065
|
-
cmd: "locale"
|
|
1066
|
-
}
|
|
1067
|
-
});
|
|
1068
|
-
}
|
|
1069
|
-
var EOL = isWindows() ? "\r\n" : "\n";
|
|
1070
|
-
|
|
1071
|
-
// ../../../../node_modules/@tauri-apps/api/path.js
|
|
1072
|
-
var exports_path = {};
|
|
1073
|
-
__export(exports_path, {
|
|
1074
|
-
videoDir: () => videoDir,
|
|
1075
|
-
templateDir: () => templateDir,
|
|
1076
|
-
sep: () => sep,
|
|
1077
|
-
runtimeDir: () => runtimeDir,
|
|
1078
|
-
resourceDir: () => resourceDir,
|
|
1079
|
-
resolveResource: () => resolveResource,
|
|
1080
|
-
resolve: () => resolve,
|
|
1081
|
-
publicDir: () => publicDir,
|
|
1082
|
-
pictureDir: () => pictureDir,
|
|
1083
|
-
normalize: () => normalize,
|
|
1084
|
-
logDir: () => logDir,
|
|
1085
|
-
localDataDir: () => localDataDir,
|
|
1086
|
-
join: () => join,
|
|
1087
|
-
isAbsolute: () => isAbsolute,
|
|
1088
|
-
homeDir: () => homeDir,
|
|
1089
|
-
fontDir: () => fontDir,
|
|
1090
|
-
extname: () => extname,
|
|
1091
|
-
executableDir: () => executableDir,
|
|
1092
|
-
downloadDir: () => downloadDir,
|
|
1093
|
-
documentDir: () => documentDir,
|
|
1094
|
-
dirname: () => dirname,
|
|
1095
|
-
desktopDir: () => desktopDir,
|
|
1096
|
-
delimiter: () => delimiter,
|
|
1097
|
-
dataDir: () => dataDir,
|
|
1098
|
-
configDir: () => configDir,
|
|
1099
|
-
cacheDir: () => cacheDir,
|
|
1100
|
-
basename: () => basename,
|
|
1101
|
-
audioDir: () => audioDir,
|
|
1102
|
-
appLogDir: () => appLogDir,
|
|
1103
|
-
appLocalDataDir: () => appLocalDataDir,
|
|
1104
|
-
appDir: () => appDir,
|
|
1105
|
-
appDataDir: () => appDataDir,
|
|
1106
|
-
appConfigDir: () => appConfigDir,
|
|
1107
|
-
appCacheDir: () => appCacheDir,
|
|
1108
|
-
BaseDirectory: () => BaseDirectory
|
|
1109
|
-
});
|
|
1110
|
-
async function appDir() {
|
|
1111
|
-
return appConfigDir();
|
|
1112
|
-
}
|
|
1113
|
-
async function appConfigDir() {
|
|
1114
|
-
return invokeTauriCommand({
|
|
1115
|
-
__tauriModule: "Path",
|
|
1116
|
-
message: {
|
|
1117
|
-
cmd: "resolvePath",
|
|
1118
|
-
path: "",
|
|
1119
|
-
directory: BaseDirectory.AppConfig
|
|
1120
|
-
}
|
|
1121
|
-
});
|
|
1122
|
-
}
|
|
1123
|
-
async function appDataDir() {
|
|
1124
|
-
return invokeTauriCommand({
|
|
1125
|
-
__tauriModule: "Path",
|
|
1126
|
-
message: {
|
|
1127
|
-
cmd: "resolvePath",
|
|
1128
|
-
path: "",
|
|
1129
|
-
directory: BaseDirectory.AppData
|
|
1130
|
-
}
|
|
1131
|
-
});
|
|
1132
|
-
}
|
|
1133
|
-
async function appLocalDataDir() {
|
|
1134
|
-
return invokeTauriCommand({
|
|
1135
|
-
__tauriModule: "Path",
|
|
1136
|
-
message: {
|
|
1137
|
-
cmd: "resolvePath",
|
|
1138
|
-
path: "",
|
|
1139
|
-
directory: BaseDirectory.AppLocalData
|
|
1140
|
-
}
|
|
1141
|
-
});
|
|
1142
|
-
}
|
|
1143
|
-
async function appCacheDir() {
|
|
1144
|
-
return invokeTauriCommand({
|
|
1145
|
-
__tauriModule: "Path",
|
|
1146
|
-
message: {
|
|
1147
|
-
cmd: "resolvePath",
|
|
1148
|
-
path: "",
|
|
1149
|
-
directory: BaseDirectory.AppCache
|
|
1150
|
-
}
|
|
1151
|
-
});
|
|
1152
|
-
}
|
|
1153
|
-
async function audioDir() {
|
|
1154
|
-
return invokeTauriCommand({
|
|
1155
|
-
__tauriModule: "Path",
|
|
1156
|
-
message: {
|
|
1157
|
-
cmd: "resolvePath",
|
|
1158
|
-
path: "",
|
|
1159
|
-
directory: BaseDirectory.Audio
|
|
1160
|
-
}
|
|
1161
|
-
});
|
|
1162
|
-
}
|
|
1163
|
-
async function cacheDir() {
|
|
1164
|
-
return invokeTauriCommand({
|
|
1165
|
-
__tauriModule: "Path",
|
|
1166
|
-
message: {
|
|
1167
|
-
cmd: "resolvePath",
|
|
1168
|
-
path: "",
|
|
1169
|
-
directory: BaseDirectory.Cache
|
|
1170
|
-
}
|
|
1171
|
-
});
|
|
1172
|
-
}
|
|
1173
|
-
async function configDir() {
|
|
1174
|
-
return invokeTauriCommand({
|
|
1175
|
-
__tauriModule: "Path",
|
|
1176
|
-
message: {
|
|
1177
|
-
cmd: "resolvePath",
|
|
1178
|
-
path: "",
|
|
1179
|
-
directory: BaseDirectory.Config
|
|
1180
|
-
}
|
|
1181
|
-
});
|
|
1182
|
-
}
|
|
1183
|
-
async function dataDir() {
|
|
1184
|
-
return invokeTauriCommand({
|
|
1185
|
-
__tauriModule: "Path",
|
|
1186
|
-
message: {
|
|
1187
|
-
cmd: "resolvePath",
|
|
1188
|
-
path: "",
|
|
1189
|
-
directory: BaseDirectory.Data
|
|
1190
|
-
}
|
|
1191
|
-
});
|
|
1192
|
-
}
|
|
1193
|
-
async function desktopDir() {
|
|
1194
|
-
return invokeTauriCommand({
|
|
1195
|
-
__tauriModule: "Path",
|
|
1196
|
-
message: {
|
|
1197
|
-
cmd: "resolvePath",
|
|
1198
|
-
path: "",
|
|
1199
|
-
directory: BaseDirectory.Desktop
|
|
1200
|
-
}
|
|
1201
|
-
});
|
|
1202
|
-
}
|
|
1203
|
-
async function documentDir() {
|
|
1204
|
-
return invokeTauriCommand({
|
|
1205
|
-
__tauriModule: "Path",
|
|
1206
|
-
message: {
|
|
1207
|
-
cmd: "resolvePath",
|
|
1208
|
-
path: "",
|
|
1209
|
-
directory: BaseDirectory.Document
|
|
1210
|
-
}
|
|
1211
|
-
});
|
|
1212
|
-
}
|
|
1213
|
-
async function downloadDir() {
|
|
1214
|
-
return invokeTauriCommand({
|
|
1215
|
-
__tauriModule: "Path",
|
|
1216
|
-
message: {
|
|
1217
|
-
cmd: "resolvePath",
|
|
1218
|
-
path: "",
|
|
1219
|
-
directory: BaseDirectory.Download
|
|
1220
|
-
}
|
|
1221
|
-
});
|
|
1222
|
-
}
|
|
1223
|
-
async function executableDir() {
|
|
1224
|
-
return invokeTauriCommand({
|
|
1225
|
-
__tauriModule: "Path",
|
|
1226
|
-
message: {
|
|
1227
|
-
cmd: "resolvePath",
|
|
1228
|
-
path: "",
|
|
1229
|
-
directory: BaseDirectory.Executable
|
|
1230
|
-
}
|
|
1231
|
-
});
|
|
1232
|
-
}
|
|
1233
|
-
async function fontDir() {
|
|
1234
|
-
return invokeTauriCommand({
|
|
1235
|
-
__tauriModule: "Path",
|
|
1236
|
-
message: {
|
|
1237
|
-
cmd: "resolvePath",
|
|
1238
|
-
path: "",
|
|
1239
|
-
directory: BaseDirectory.Font
|
|
1240
|
-
}
|
|
1241
|
-
});
|
|
1242
|
-
}
|
|
1243
|
-
async function homeDir() {
|
|
1244
|
-
return invokeTauriCommand({
|
|
1245
|
-
__tauriModule: "Path",
|
|
1246
|
-
message: {
|
|
1247
|
-
cmd: "resolvePath",
|
|
1248
|
-
path: "",
|
|
1249
|
-
directory: BaseDirectory.Home
|
|
1250
|
-
}
|
|
1251
|
-
});
|
|
1252
|
-
}
|
|
1253
|
-
async function localDataDir() {
|
|
1254
|
-
return invokeTauriCommand({
|
|
1255
|
-
__tauriModule: "Path",
|
|
1256
|
-
message: {
|
|
1257
|
-
cmd: "resolvePath",
|
|
1258
|
-
path: "",
|
|
1259
|
-
directory: BaseDirectory.LocalData
|
|
1260
|
-
}
|
|
1261
|
-
});
|
|
1262
|
-
}
|
|
1263
|
-
async function pictureDir() {
|
|
1264
|
-
return invokeTauriCommand({
|
|
1265
|
-
__tauriModule: "Path",
|
|
1266
|
-
message: {
|
|
1267
|
-
cmd: "resolvePath",
|
|
1268
|
-
path: "",
|
|
1269
|
-
directory: BaseDirectory.Picture
|
|
1270
|
-
}
|
|
1271
|
-
});
|
|
1272
|
-
}
|
|
1273
|
-
async function publicDir() {
|
|
1274
|
-
return invokeTauriCommand({
|
|
1275
|
-
__tauriModule: "Path",
|
|
1276
|
-
message: {
|
|
1277
|
-
cmd: "resolvePath",
|
|
1278
|
-
path: "",
|
|
1279
|
-
directory: BaseDirectory.Public
|
|
1280
|
-
}
|
|
1281
|
-
});
|
|
1282
|
-
}
|
|
1283
|
-
async function resourceDir() {
|
|
1284
|
-
return invokeTauriCommand({
|
|
1285
|
-
__tauriModule: "Path",
|
|
1286
|
-
message: {
|
|
1287
|
-
cmd: "resolvePath",
|
|
1288
|
-
path: "",
|
|
1289
|
-
directory: BaseDirectory.Resource
|
|
1290
|
-
}
|
|
1291
|
-
});
|
|
1292
|
-
}
|
|
1293
|
-
async function resolveResource(resourcePath) {
|
|
1294
|
-
return invokeTauriCommand({
|
|
1295
|
-
__tauriModule: "Path",
|
|
1296
|
-
message: {
|
|
1297
|
-
cmd: "resolvePath",
|
|
1298
|
-
path: resourcePath,
|
|
1299
|
-
directory: BaseDirectory.Resource
|
|
1300
|
-
}
|
|
1301
|
-
});
|
|
1302
|
-
}
|
|
1303
|
-
async function runtimeDir() {
|
|
1304
|
-
return invokeTauriCommand({
|
|
1305
|
-
__tauriModule: "Path",
|
|
1306
|
-
message: {
|
|
1307
|
-
cmd: "resolvePath",
|
|
1308
|
-
path: "",
|
|
1309
|
-
directory: BaseDirectory.Runtime
|
|
1310
|
-
}
|
|
1311
|
-
});
|
|
1312
|
-
}
|
|
1313
|
-
async function templateDir() {
|
|
1314
|
-
return invokeTauriCommand({
|
|
1315
|
-
__tauriModule: "Path",
|
|
1316
|
-
message: {
|
|
1317
|
-
cmd: "resolvePath",
|
|
1318
|
-
path: "",
|
|
1319
|
-
directory: BaseDirectory.Template
|
|
1320
|
-
}
|
|
1321
|
-
});
|
|
1322
|
-
}
|
|
1323
|
-
async function videoDir() {
|
|
1324
|
-
return invokeTauriCommand({
|
|
1325
|
-
__tauriModule: "Path",
|
|
1326
|
-
message: {
|
|
1327
|
-
cmd: "resolvePath",
|
|
1328
|
-
path: "",
|
|
1329
|
-
directory: BaseDirectory.Video
|
|
1330
|
-
}
|
|
1331
|
-
});
|
|
1332
|
-
}
|
|
1333
|
-
async function logDir() {
|
|
1334
|
-
return appLogDir();
|
|
1335
|
-
}
|
|
1336
|
-
async function appLogDir() {
|
|
1337
|
-
return invokeTauriCommand({
|
|
1338
|
-
__tauriModule: "Path",
|
|
1339
|
-
message: {
|
|
1340
|
-
cmd: "resolvePath",
|
|
1341
|
-
path: "",
|
|
1342
|
-
directory: BaseDirectory.AppLog
|
|
1343
|
-
}
|
|
1344
|
-
});
|
|
1345
|
-
}
|
|
1346
|
-
async function resolve(...paths) {
|
|
1347
|
-
return invokeTauriCommand({
|
|
1348
|
-
__tauriModule: "Path",
|
|
1349
|
-
message: {
|
|
1350
|
-
cmd: "resolve",
|
|
1351
|
-
paths
|
|
1352
|
-
}
|
|
1353
|
-
});
|
|
1354
|
-
}
|
|
1355
|
-
async function normalize(path) {
|
|
1356
|
-
return invokeTauriCommand({
|
|
1357
|
-
__tauriModule: "Path",
|
|
1358
|
-
message: {
|
|
1359
|
-
cmd: "normalize",
|
|
1360
|
-
path
|
|
1361
|
-
}
|
|
1362
|
-
});
|
|
1363
|
-
}
|
|
1364
|
-
async function join(...paths) {
|
|
1365
|
-
return invokeTauriCommand({
|
|
1366
|
-
__tauriModule: "Path",
|
|
1367
|
-
message: {
|
|
1368
|
-
cmd: "join",
|
|
1369
|
-
paths
|
|
1370
|
-
}
|
|
1371
|
-
});
|
|
1372
|
-
}
|
|
1373
|
-
async function dirname(path) {
|
|
1374
|
-
return invokeTauriCommand({
|
|
1375
|
-
__tauriModule: "Path",
|
|
1376
|
-
message: {
|
|
1377
|
-
cmd: "dirname",
|
|
1378
|
-
path
|
|
1379
|
-
}
|
|
1380
|
-
});
|
|
1381
|
-
}
|
|
1382
|
-
async function extname(path) {
|
|
1383
|
-
return invokeTauriCommand({
|
|
1384
|
-
__tauriModule: "Path",
|
|
1385
|
-
message: {
|
|
1386
|
-
cmd: "extname",
|
|
1387
|
-
path
|
|
1388
|
-
}
|
|
1389
|
-
});
|
|
1390
|
-
}
|
|
1391
|
-
async function basename(path, ext) {
|
|
1392
|
-
return invokeTauriCommand({
|
|
1393
|
-
__tauriModule: "Path",
|
|
1394
|
-
message: {
|
|
1395
|
-
cmd: "basename",
|
|
1396
|
-
path,
|
|
1397
|
-
ext
|
|
1398
|
-
}
|
|
1399
|
-
});
|
|
1400
|
-
}
|
|
1401
|
-
async function isAbsolute(path) {
|
|
1402
|
-
return invokeTauriCommand({
|
|
1403
|
-
__tauriModule: "Path",
|
|
1404
|
-
message: {
|
|
1405
|
-
cmd: "isAbsolute",
|
|
1406
|
-
path
|
|
1407
|
-
}
|
|
1408
|
-
});
|
|
1409
|
-
}
|
|
1410
|
-
var sep = isWindows() ? "\\" : "/";
|
|
1411
|
-
var delimiter = isWindows() ? ";" : ":";
|
|
1412
|
-
|
|
1413
|
-
// ../../../../node_modules/@tauri-apps/api/process.js
|
|
1414
|
-
var exports_process = {};
|
|
1415
|
-
__export(exports_process, {
|
|
1416
|
-
relaunch: () => relaunch,
|
|
1417
|
-
exit: () => exit
|
|
1418
|
-
});
|
|
1419
|
-
async function exit(exitCode = 0) {
|
|
1420
|
-
return invokeTauriCommand({
|
|
1421
|
-
__tauriModule: "Process",
|
|
1422
|
-
message: {
|
|
1423
|
-
cmd: "exit",
|
|
1424
|
-
exitCode
|
|
1425
|
-
}
|
|
1426
|
-
});
|
|
1427
|
-
}
|
|
1428
|
-
async function relaunch() {
|
|
1429
|
-
return invokeTauriCommand({
|
|
1430
|
-
__tauriModule: "Process",
|
|
1431
|
-
message: {
|
|
1432
|
-
cmd: "relaunch"
|
|
1433
|
-
}
|
|
1434
|
-
});
|
|
1435
|
-
}
|
|
1436
|
-
|
|
1437
|
-
// ../../../../node_modules/@tauri-apps/api/updater.js
|
|
1438
|
-
var exports_updater = {};
|
|
1439
|
-
__export(exports_updater, {
|
|
1440
|
-
onUpdaterEvent: () => onUpdaterEvent,
|
|
1441
|
-
installUpdate: () => installUpdate,
|
|
1442
|
-
checkUpdate: () => checkUpdate
|
|
1443
|
-
});
|
|
1444
|
-
async function onUpdaterEvent(handler) {
|
|
1445
|
-
return listen2(TauriEvent.STATUS_UPDATE, (data) => {
|
|
1446
|
-
handler(data === null || data === undefined ? undefined : data.payload);
|
|
1447
|
-
});
|
|
1448
|
-
}
|
|
1449
|
-
async function installUpdate() {
|
|
1450
|
-
let unlistenerFn;
|
|
1451
|
-
function cleanListener() {
|
|
1452
|
-
if (unlistenerFn) {
|
|
1453
|
-
unlistenerFn();
|
|
1454
|
-
}
|
|
1455
|
-
unlistenerFn = undefined;
|
|
1456
|
-
}
|
|
1457
|
-
return new Promise((resolve2, reject) => {
|
|
1458
|
-
function onStatusChange(statusResult) {
|
|
1459
|
-
if (statusResult.error) {
|
|
1460
|
-
cleanListener();
|
|
1461
|
-
reject(statusResult.error);
|
|
1462
|
-
return;
|
|
1463
|
-
}
|
|
1464
|
-
if (statusResult.status === "DONE") {
|
|
1465
|
-
cleanListener();
|
|
1466
|
-
resolve2();
|
|
1467
|
-
}
|
|
1468
|
-
}
|
|
1469
|
-
onUpdaterEvent(onStatusChange).then((fn) => {
|
|
1470
|
-
unlistenerFn = fn;
|
|
1471
|
-
}).catch((e) => {
|
|
1472
|
-
cleanListener();
|
|
1473
|
-
throw e;
|
|
1474
|
-
});
|
|
1475
|
-
emit2(TauriEvent.INSTALL_UPDATE).catch((e) => {
|
|
1476
|
-
cleanListener();
|
|
1477
|
-
throw e;
|
|
1478
|
-
});
|
|
1479
|
-
});
|
|
1480
|
-
}
|
|
1481
|
-
async function checkUpdate() {
|
|
1482
|
-
let unlistenerFn;
|
|
1483
|
-
function cleanListener() {
|
|
1484
|
-
if (unlistenerFn) {
|
|
1485
|
-
unlistenerFn();
|
|
1486
|
-
}
|
|
1487
|
-
unlistenerFn = undefined;
|
|
1488
|
-
}
|
|
1489
|
-
return new Promise((resolve2, reject) => {
|
|
1490
|
-
function onUpdateAvailable(manifest) {
|
|
1491
|
-
cleanListener();
|
|
1492
|
-
resolve2({
|
|
1493
|
-
manifest,
|
|
1494
|
-
shouldUpdate: true
|
|
1495
|
-
});
|
|
1496
|
-
}
|
|
1497
|
-
function onStatusChange(statusResult) {
|
|
1498
|
-
if (statusResult.error) {
|
|
1499
|
-
cleanListener();
|
|
1500
|
-
reject(statusResult.error);
|
|
1501
|
-
return;
|
|
1502
|
-
}
|
|
1503
|
-
if (statusResult.status === "UPTODATE") {
|
|
1504
|
-
cleanListener();
|
|
1505
|
-
resolve2({
|
|
1506
|
-
shouldUpdate: false
|
|
1507
|
-
});
|
|
1508
|
-
}
|
|
1509
|
-
}
|
|
1510
|
-
once2(TauriEvent.UPDATE_AVAILABLE, (data) => {
|
|
1511
|
-
onUpdateAvailable(data === null || data === undefined ? undefined : data.payload);
|
|
1512
|
-
}).catch((e) => {
|
|
1513
|
-
cleanListener();
|
|
1514
|
-
throw e;
|
|
1515
|
-
});
|
|
1516
|
-
onUpdaterEvent(onStatusChange).then((fn) => {
|
|
1517
|
-
unlistenerFn = fn;
|
|
1518
|
-
}).catch((e) => {
|
|
1519
|
-
cleanListener();
|
|
1520
|
-
throw e;
|
|
1521
|
-
});
|
|
1522
|
-
emit2(TauriEvent.CHECK_UPDATE).catch((e) => {
|
|
1523
|
-
cleanListener();
|
|
1524
|
-
throw e;
|
|
1525
|
-
});
|
|
1526
|
-
});
|
|
1527
|
-
}
|
|
1528
|
-
|
|
1529
|
-
// ../../../../node_modules/@tauri-apps/api/window.js
|
|
1530
|
-
var exports_window = {};
|
|
1531
|
-
__export(exports_window, {
|
|
1532
|
-
primaryMonitor: () => primaryMonitor,
|
|
1533
|
-
getCurrent: () => getCurrent,
|
|
1534
|
-
getAll: () => getAll,
|
|
1535
|
-
currentMonitor: () => currentMonitor,
|
|
1536
|
-
availableMonitors: () => availableMonitors,
|
|
1537
|
-
appWindow: () => appWindow,
|
|
1538
|
-
WindowManager: () => WindowManager,
|
|
1539
|
-
WebviewWindowHandle: () => WebviewWindowHandle,
|
|
1540
|
-
WebviewWindow: () => WebviewWindow,
|
|
1541
|
-
UserAttentionType: () => UserAttentionType,
|
|
1542
|
-
PhysicalSize: () => PhysicalSize,
|
|
1543
|
-
PhysicalPosition: () => PhysicalPosition,
|
|
1544
|
-
LogicalSize: () => LogicalSize,
|
|
1545
|
-
LogicalPosition: () => LogicalPosition,
|
|
1546
|
-
CloseRequestedEvent: () => CloseRequestedEvent
|
|
1547
|
-
});
|
|
1548
|
-
function getCurrent() {
|
|
1549
|
-
return new WebviewWindow(window.__TAURI_METADATA__.__currentWindow.label, {
|
|
1550
|
-
skip: true
|
|
1551
|
-
});
|
|
1552
|
-
}
|
|
1553
|
-
function getAll() {
|
|
1554
|
-
return window.__TAURI_METADATA__.__windows.map((w) => new WebviewWindow(w.label, {
|
|
1555
|
-
skip: true
|
|
1556
|
-
}));
|
|
1557
|
-
}
|
|
1558
|
-
function mapMonitor(m) {
|
|
1559
|
-
return m === null ? null : {
|
|
1560
|
-
name: m.name,
|
|
1561
|
-
scaleFactor: m.scaleFactor,
|
|
1562
|
-
position: mapPhysicalPosition(m.position),
|
|
1563
|
-
size: mapPhysicalSize(m.size)
|
|
1564
|
-
};
|
|
1565
|
-
}
|
|
1566
|
-
function mapPhysicalPosition(m) {
|
|
1567
|
-
return new PhysicalPosition(m.x, m.y);
|
|
1568
|
-
}
|
|
1569
|
-
function mapPhysicalSize(m) {
|
|
1570
|
-
return new PhysicalSize(m.width, m.height);
|
|
1571
|
-
}
|
|
1572
|
-
async function currentMonitor() {
|
|
1573
|
-
return invokeTauriCommand({
|
|
1574
|
-
__tauriModule: "Window",
|
|
1575
|
-
message: {
|
|
1576
|
-
cmd: "manage",
|
|
1577
|
-
data: {
|
|
1578
|
-
cmd: {
|
|
1579
|
-
type: "currentMonitor"
|
|
1580
|
-
}
|
|
1581
|
-
}
|
|
1582
|
-
}
|
|
1583
|
-
}).then(mapMonitor);
|
|
1584
|
-
}
|
|
1585
|
-
async function primaryMonitor() {
|
|
1586
|
-
return invokeTauriCommand({
|
|
1587
|
-
__tauriModule: "Window",
|
|
1588
|
-
message: {
|
|
1589
|
-
cmd: "manage",
|
|
1590
|
-
data: {
|
|
1591
|
-
cmd: {
|
|
1592
|
-
type: "primaryMonitor"
|
|
1593
|
-
}
|
|
1594
|
-
}
|
|
1595
|
-
}
|
|
1596
|
-
}).then(mapMonitor);
|
|
1597
|
-
}
|
|
1598
|
-
async function availableMonitors() {
|
|
1599
|
-
return invokeTauriCommand({
|
|
1600
|
-
__tauriModule: "Window",
|
|
1601
|
-
message: {
|
|
1602
|
-
cmd: "manage",
|
|
1603
|
-
data: {
|
|
1604
|
-
cmd: {
|
|
1605
|
-
type: "availableMonitors"
|
|
1606
|
-
}
|
|
1607
|
-
}
|
|
1608
|
-
}
|
|
1609
|
-
}).then((ms) => ms.map(mapMonitor));
|
|
1610
|
-
}
|
|
1611
|
-
|
|
1612
|
-
class LogicalSize {
|
|
1613
|
-
constructor(width, height) {
|
|
1614
|
-
this.type = "Logical";
|
|
1615
|
-
this.width = width;
|
|
1616
|
-
this.height = height;
|
|
1617
|
-
}
|
|
1618
|
-
}
|
|
1619
|
-
|
|
1620
|
-
class PhysicalSize {
|
|
1621
|
-
constructor(width, height) {
|
|
1622
|
-
this.type = "Physical";
|
|
1623
|
-
this.width = width;
|
|
1624
|
-
this.height = height;
|
|
1625
|
-
}
|
|
1626
|
-
toLogical(scaleFactor) {
|
|
1627
|
-
return new LogicalSize(this.width / scaleFactor, this.height / scaleFactor);
|
|
1628
|
-
}
|
|
1629
|
-
}
|
|
1630
|
-
|
|
1631
|
-
class LogicalPosition {
|
|
1632
|
-
constructor(x, y) {
|
|
1633
|
-
this.type = "Logical";
|
|
1634
|
-
this.x = x;
|
|
1635
|
-
this.y = y;
|
|
1636
|
-
}
|
|
1637
|
-
}
|
|
1638
|
-
|
|
1639
|
-
class PhysicalPosition {
|
|
1640
|
-
constructor(x, y) {
|
|
1641
|
-
this.type = "Physical";
|
|
1642
|
-
this.x = x;
|
|
1643
|
-
this.y = y;
|
|
1644
|
-
}
|
|
1645
|
-
toLogical(scaleFactor) {
|
|
1646
|
-
return new LogicalPosition(this.x / scaleFactor, this.y / scaleFactor);
|
|
1647
|
-
}
|
|
1648
|
-
}
|
|
1649
|
-
var UserAttentionType;
|
|
1650
|
-
(function(UserAttentionType2) {
|
|
1651
|
-
UserAttentionType2[UserAttentionType2["Critical"] = 1] = "Critical";
|
|
1652
|
-
UserAttentionType2[UserAttentionType2["Informational"] = 2] = "Informational";
|
|
1653
|
-
})(UserAttentionType || (UserAttentionType = {}));
|
|
1654
|
-
var localTauriEvents = ["tauri://created", "tauri://error"];
|
|
1655
|
-
|
|
1656
|
-
class WebviewWindowHandle {
|
|
1657
|
-
constructor(label) {
|
|
1658
|
-
this.label = label;
|
|
1659
|
-
this.listeners = Object.create(null);
|
|
1660
|
-
}
|
|
1661
|
-
async listen(event5, handler) {
|
|
1662
|
-
if (this._handleTauriEvent(event5, handler)) {
|
|
1663
|
-
return Promise.resolve(() => {
|
|
1664
|
-
const listeners = this.listeners[event5];
|
|
1665
|
-
listeners.splice(listeners.indexOf(handler), 1);
|
|
1666
|
-
});
|
|
1667
|
-
}
|
|
1668
|
-
return listen(event5, this.label, handler);
|
|
1669
|
-
}
|
|
1670
|
-
async once(event5, handler) {
|
|
1671
|
-
if (this._handleTauriEvent(event5, handler)) {
|
|
1672
|
-
return Promise.resolve(() => {
|
|
1673
|
-
const listeners = this.listeners[event5];
|
|
1674
|
-
listeners.splice(listeners.indexOf(handler), 1);
|
|
1675
|
-
});
|
|
1676
|
-
}
|
|
1677
|
-
return once(event5, this.label, handler);
|
|
1678
|
-
}
|
|
1679
|
-
async emit(event5, payload) {
|
|
1680
|
-
if (localTauriEvents.includes(event5)) {
|
|
1681
|
-
for (const handler of this.listeners[event5] || []) {
|
|
1682
|
-
handler({ event: event5, id: -1, windowLabel: this.label, payload });
|
|
1683
|
-
}
|
|
1684
|
-
return Promise.resolve();
|
|
1685
|
-
}
|
|
1686
|
-
return emit(event5, this.label, payload);
|
|
1687
|
-
}
|
|
1688
|
-
_handleTauriEvent(event5, handler) {
|
|
1689
|
-
if (localTauriEvents.includes(event5)) {
|
|
1690
|
-
if (!(event5 in this.listeners)) {
|
|
1691
|
-
this.listeners[event5] = [handler];
|
|
1692
|
-
} else {
|
|
1693
|
-
this.listeners[event5].push(handler);
|
|
1694
|
-
}
|
|
1695
|
-
return true;
|
|
1696
|
-
}
|
|
1697
|
-
return false;
|
|
1698
|
-
}
|
|
1699
|
-
}
|
|
1700
|
-
|
|
1701
|
-
class WindowManager extends WebviewWindowHandle {
|
|
1702
|
-
async scaleFactor() {
|
|
1703
|
-
return invokeTauriCommand({
|
|
1704
|
-
__tauriModule: "Window",
|
|
1705
|
-
message: {
|
|
1706
|
-
cmd: "manage",
|
|
1707
|
-
data: {
|
|
1708
|
-
label: this.label,
|
|
1709
|
-
cmd: {
|
|
1710
|
-
type: "scaleFactor"
|
|
1711
|
-
}
|
|
1712
|
-
}
|
|
1713
|
-
}
|
|
1714
|
-
});
|
|
1715
|
-
}
|
|
1716
|
-
async innerPosition() {
|
|
1717
|
-
return invokeTauriCommand({
|
|
1718
|
-
__tauriModule: "Window",
|
|
1719
|
-
message: {
|
|
1720
|
-
cmd: "manage",
|
|
1721
|
-
data: {
|
|
1722
|
-
label: this.label,
|
|
1723
|
-
cmd: {
|
|
1724
|
-
type: "innerPosition"
|
|
1725
|
-
}
|
|
1726
|
-
}
|
|
1727
|
-
}
|
|
1728
|
-
}).then(({ x, y }) => new PhysicalPosition(x, y));
|
|
1729
|
-
}
|
|
1730
|
-
async outerPosition() {
|
|
1731
|
-
return invokeTauriCommand({
|
|
1732
|
-
__tauriModule: "Window",
|
|
1733
|
-
message: {
|
|
1734
|
-
cmd: "manage",
|
|
1735
|
-
data: {
|
|
1736
|
-
label: this.label,
|
|
1737
|
-
cmd: {
|
|
1738
|
-
type: "outerPosition"
|
|
1739
|
-
}
|
|
1740
|
-
}
|
|
1741
|
-
}
|
|
1742
|
-
}).then(({ x, y }) => new PhysicalPosition(x, y));
|
|
1743
|
-
}
|
|
1744
|
-
async innerSize() {
|
|
1745
|
-
return invokeTauriCommand({
|
|
1746
|
-
__tauriModule: "Window",
|
|
1747
|
-
message: {
|
|
1748
|
-
cmd: "manage",
|
|
1749
|
-
data: {
|
|
1750
|
-
label: this.label,
|
|
1751
|
-
cmd: {
|
|
1752
|
-
type: "innerSize"
|
|
1753
|
-
}
|
|
1754
|
-
}
|
|
1755
|
-
}
|
|
1756
|
-
}).then(({ width, height }) => new PhysicalSize(width, height));
|
|
1757
|
-
}
|
|
1758
|
-
async outerSize() {
|
|
1759
|
-
return invokeTauriCommand({
|
|
1760
|
-
__tauriModule: "Window",
|
|
1761
|
-
message: {
|
|
1762
|
-
cmd: "manage",
|
|
1763
|
-
data: {
|
|
1764
|
-
label: this.label,
|
|
1765
|
-
cmd: {
|
|
1766
|
-
type: "outerSize"
|
|
1767
|
-
}
|
|
1768
|
-
}
|
|
1769
|
-
}
|
|
1770
|
-
}).then(({ width, height }) => new PhysicalSize(width, height));
|
|
1771
|
-
}
|
|
1772
|
-
async isFullscreen() {
|
|
1773
|
-
return invokeTauriCommand({
|
|
1774
|
-
__tauriModule: "Window",
|
|
1775
|
-
message: {
|
|
1776
|
-
cmd: "manage",
|
|
1777
|
-
data: {
|
|
1778
|
-
label: this.label,
|
|
1779
|
-
cmd: {
|
|
1780
|
-
type: "isFullscreen"
|
|
1781
|
-
}
|
|
1782
|
-
}
|
|
1783
|
-
}
|
|
1784
|
-
});
|
|
1785
|
-
}
|
|
1786
|
-
async isMinimized() {
|
|
1787
|
-
return invokeTauriCommand({
|
|
1788
|
-
__tauriModule: "Window",
|
|
1789
|
-
message: {
|
|
1790
|
-
cmd: "manage",
|
|
1791
|
-
data: {
|
|
1792
|
-
label: this.label,
|
|
1793
|
-
cmd: {
|
|
1794
|
-
type: "isMinimized"
|
|
1795
|
-
}
|
|
1796
|
-
}
|
|
1797
|
-
}
|
|
1798
|
-
});
|
|
1799
|
-
}
|
|
1800
|
-
async isMaximized() {
|
|
1801
|
-
return invokeTauriCommand({
|
|
1802
|
-
__tauriModule: "Window",
|
|
1803
|
-
message: {
|
|
1804
|
-
cmd: "manage",
|
|
1805
|
-
data: {
|
|
1806
|
-
label: this.label,
|
|
1807
|
-
cmd: {
|
|
1808
|
-
type: "isMaximized"
|
|
1809
|
-
}
|
|
1810
|
-
}
|
|
1811
|
-
}
|
|
1812
|
-
});
|
|
1813
|
-
}
|
|
1814
|
-
async isFocused() {
|
|
1815
|
-
return invokeTauriCommand({
|
|
1816
|
-
__tauriModule: "Window",
|
|
1817
|
-
message: {
|
|
1818
|
-
cmd: "manage",
|
|
1819
|
-
data: {
|
|
1820
|
-
label: this.label,
|
|
1821
|
-
cmd: {
|
|
1822
|
-
type: "isFocused"
|
|
1823
|
-
}
|
|
1824
|
-
}
|
|
1825
|
-
}
|
|
1826
|
-
});
|
|
1827
|
-
}
|
|
1828
|
-
async isDecorated() {
|
|
1829
|
-
return invokeTauriCommand({
|
|
1830
|
-
__tauriModule: "Window",
|
|
1831
|
-
message: {
|
|
1832
|
-
cmd: "manage",
|
|
1833
|
-
data: {
|
|
1834
|
-
label: this.label,
|
|
1835
|
-
cmd: {
|
|
1836
|
-
type: "isDecorated"
|
|
1837
|
-
}
|
|
1838
|
-
}
|
|
1839
|
-
}
|
|
1840
|
-
});
|
|
1841
|
-
}
|
|
1842
|
-
async isResizable() {
|
|
1843
|
-
return invokeTauriCommand({
|
|
1844
|
-
__tauriModule: "Window",
|
|
1845
|
-
message: {
|
|
1846
|
-
cmd: "manage",
|
|
1847
|
-
data: {
|
|
1848
|
-
label: this.label,
|
|
1849
|
-
cmd: {
|
|
1850
|
-
type: "isResizable"
|
|
1851
|
-
}
|
|
1852
|
-
}
|
|
1853
|
-
}
|
|
1854
|
-
});
|
|
1855
|
-
}
|
|
1856
|
-
async isMaximizable() {
|
|
1857
|
-
return invokeTauriCommand({
|
|
1858
|
-
__tauriModule: "Window",
|
|
1859
|
-
message: {
|
|
1860
|
-
cmd: "manage",
|
|
1861
|
-
data: {
|
|
1862
|
-
label: this.label,
|
|
1863
|
-
cmd: {
|
|
1864
|
-
type: "isMaximizable"
|
|
1865
|
-
}
|
|
1866
|
-
}
|
|
1867
|
-
}
|
|
1868
|
-
});
|
|
1869
|
-
}
|
|
1870
|
-
async isMinimizable() {
|
|
1871
|
-
return invokeTauriCommand({
|
|
1872
|
-
__tauriModule: "Window",
|
|
1873
|
-
message: {
|
|
1874
|
-
cmd: "manage",
|
|
1875
|
-
data: {
|
|
1876
|
-
label: this.label,
|
|
1877
|
-
cmd: {
|
|
1878
|
-
type: "isMinimizable"
|
|
1879
|
-
}
|
|
1880
|
-
}
|
|
1881
|
-
}
|
|
1882
|
-
});
|
|
1883
|
-
}
|
|
1884
|
-
async isClosable() {
|
|
1885
|
-
return invokeTauriCommand({
|
|
1886
|
-
__tauriModule: "Window",
|
|
1887
|
-
message: {
|
|
1888
|
-
cmd: "manage",
|
|
1889
|
-
data: {
|
|
1890
|
-
label: this.label,
|
|
1891
|
-
cmd: {
|
|
1892
|
-
type: "isClosable"
|
|
1893
|
-
}
|
|
1894
|
-
}
|
|
1895
|
-
}
|
|
1896
|
-
});
|
|
1897
|
-
}
|
|
1898
|
-
async isVisible() {
|
|
1899
|
-
return invokeTauriCommand({
|
|
1900
|
-
__tauriModule: "Window",
|
|
1901
|
-
message: {
|
|
1902
|
-
cmd: "manage",
|
|
1903
|
-
data: {
|
|
1904
|
-
label: this.label,
|
|
1905
|
-
cmd: {
|
|
1906
|
-
type: "isVisible"
|
|
1907
|
-
}
|
|
1908
|
-
}
|
|
1909
|
-
}
|
|
1910
|
-
});
|
|
1911
|
-
}
|
|
1912
|
-
async title() {
|
|
1913
|
-
return invokeTauriCommand({
|
|
1914
|
-
__tauriModule: "Window",
|
|
1915
|
-
message: {
|
|
1916
|
-
cmd: "manage",
|
|
1917
|
-
data: {
|
|
1918
|
-
label: this.label,
|
|
1919
|
-
cmd: {
|
|
1920
|
-
type: "title"
|
|
1921
|
-
}
|
|
1922
|
-
}
|
|
1923
|
-
}
|
|
1924
|
-
});
|
|
1925
|
-
}
|
|
1926
|
-
async theme() {
|
|
1927
|
-
return invokeTauriCommand({
|
|
1928
|
-
__tauriModule: "Window",
|
|
1929
|
-
message: {
|
|
1930
|
-
cmd: "manage",
|
|
1931
|
-
data: {
|
|
1932
|
-
label: this.label,
|
|
1933
|
-
cmd: {
|
|
1934
|
-
type: "theme"
|
|
1935
|
-
}
|
|
1936
|
-
}
|
|
1937
|
-
}
|
|
1938
|
-
});
|
|
1939
|
-
}
|
|
1940
|
-
async center() {
|
|
1941
|
-
return invokeTauriCommand({
|
|
1942
|
-
__tauriModule: "Window",
|
|
1943
|
-
message: {
|
|
1944
|
-
cmd: "manage",
|
|
1945
|
-
data: {
|
|
1946
|
-
label: this.label,
|
|
1947
|
-
cmd: {
|
|
1948
|
-
type: "center"
|
|
1949
|
-
}
|
|
1950
|
-
}
|
|
1951
|
-
}
|
|
1952
|
-
});
|
|
1953
|
-
}
|
|
1954
|
-
async requestUserAttention(requestType) {
|
|
1955
|
-
let requestType_ = null;
|
|
1956
|
-
if (requestType) {
|
|
1957
|
-
if (requestType === UserAttentionType.Critical) {
|
|
1958
|
-
requestType_ = { type: "Critical" };
|
|
1959
|
-
} else {
|
|
1960
|
-
requestType_ = { type: "Informational" };
|
|
1961
|
-
}
|
|
1962
|
-
}
|
|
1963
|
-
return invokeTauriCommand({
|
|
1964
|
-
__tauriModule: "Window",
|
|
1965
|
-
message: {
|
|
1966
|
-
cmd: "manage",
|
|
1967
|
-
data: {
|
|
1968
|
-
label: this.label,
|
|
1969
|
-
cmd: {
|
|
1970
|
-
type: "requestUserAttention",
|
|
1971
|
-
payload: requestType_
|
|
1972
|
-
}
|
|
1973
|
-
}
|
|
1974
|
-
}
|
|
1975
|
-
});
|
|
1976
|
-
}
|
|
1977
|
-
async setResizable(resizable) {
|
|
1978
|
-
return invokeTauriCommand({
|
|
1979
|
-
__tauriModule: "Window",
|
|
1980
|
-
message: {
|
|
1981
|
-
cmd: "manage",
|
|
1982
|
-
data: {
|
|
1983
|
-
label: this.label,
|
|
1984
|
-
cmd: {
|
|
1985
|
-
type: "setResizable",
|
|
1986
|
-
payload: resizable
|
|
1987
|
-
}
|
|
1988
|
-
}
|
|
1989
|
-
}
|
|
1990
|
-
});
|
|
1991
|
-
}
|
|
1992
|
-
async setMaximizable(maximizable) {
|
|
1993
|
-
return invokeTauriCommand({
|
|
1994
|
-
__tauriModule: "Window",
|
|
1995
|
-
message: {
|
|
1996
|
-
cmd: "manage",
|
|
1997
|
-
data: {
|
|
1998
|
-
label: this.label,
|
|
1999
|
-
cmd: {
|
|
2000
|
-
type: "setMaximizable",
|
|
2001
|
-
payload: maximizable
|
|
2002
|
-
}
|
|
2003
|
-
}
|
|
2004
|
-
}
|
|
2005
|
-
});
|
|
2006
|
-
}
|
|
2007
|
-
async setMinimizable(minimizable) {
|
|
2008
|
-
return invokeTauriCommand({
|
|
2009
|
-
__tauriModule: "Window",
|
|
2010
|
-
message: {
|
|
2011
|
-
cmd: "manage",
|
|
2012
|
-
data: {
|
|
2013
|
-
label: this.label,
|
|
2014
|
-
cmd: {
|
|
2015
|
-
type: "setMinimizable",
|
|
2016
|
-
payload: minimizable
|
|
2017
|
-
}
|
|
2018
|
-
}
|
|
2019
|
-
}
|
|
2020
|
-
});
|
|
2021
|
-
}
|
|
2022
|
-
async setClosable(closable) {
|
|
2023
|
-
return invokeTauriCommand({
|
|
2024
|
-
__tauriModule: "Window",
|
|
2025
|
-
message: {
|
|
2026
|
-
cmd: "manage",
|
|
2027
|
-
data: {
|
|
2028
|
-
label: this.label,
|
|
2029
|
-
cmd: {
|
|
2030
|
-
type: "setClosable",
|
|
2031
|
-
payload: closable
|
|
2032
|
-
}
|
|
2033
|
-
}
|
|
2034
|
-
}
|
|
2035
|
-
});
|
|
2036
|
-
}
|
|
2037
|
-
async setTitle(title) {
|
|
2038
|
-
return invokeTauriCommand({
|
|
2039
|
-
__tauriModule: "Window",
|
|
2040
|
-
message: {
|
|
2041
|
-
cmd: "manage",
|
|
2042
|
-
data: {
|
|
2043
|
-
label: this.label,
|
|
2044
|
-
cmd: {
|
|
2045
|
-
type: "setTitle",
|
|
2046
|
-
payload: title
|
|
2047
|
-
}
|
|
2048
|
-
}
|
|
2049
|
-
}
|
|
2050
|
-
});
|
|
2051
|
-
}
|
|
2052
|
-
async maximize() {
|
|
2053
|
-
return invokeTauriCommand({
|
|
2054
|
-
__tauriModule: "Window",
|
|
2055
|
-
message: {
|
|
2056
|
-
cmd: "manage",
|
|
2057
|
-
data: {
|
|
2058
|
-
label: this.label,
|
|
2059
|
-
cmd: {
|
|
2060
|
-
type: "maximize"
|
|
2061
|
-
}
|
|
2062
|
-
}
|
|
2063
|
-
}
|
|
2064
|
-
});
|
|
2065
|
-
}
|
|
2066
|
-
async unmaximize() {
|
|
2067
|
-
return invokeTauriCommand({
|
|
2068
|
-
__tauriModule: "Window",
|
|
2069
|
-
message: {
|
|
2070
|
-
cmd: "manage",
|
|
2071
|
-
data: {
|
|
2072
|
-
label: this.label,
|
|
2073
|
-
cmd: {
|
|
2074
|
-
type: "unmaximize"
|
|
2075
|
-
}
|
|
2076
|
-
}
|
|
2077
|
-
}
|
|
2078
|
-
});
|
|
2079
|
-
}
|
|
2080
|
-
async toggleMaximize() {
|
|
2081
|
-
return invokeTauriCommand({
|
|
2082
|
-
__tauriModule: "Window",
|
|
2083
|
-
message: {
|
|
2084
|
-
cmd: "manage",
|
|
2085
|
-
data: {
|
|
2086
|
-
label: this.label,
|
|
2087
|
-
cmd: {
|
|
2088
|
-
type: "toggleMaximize"
|
|
2089
|
-
}
|
|
2090
|
-
}
|
|
2091
|
-
}
|
|
2092
|
-
});
|
|
2093
|
-
}
|
|
2094
|
-
async minimize() {
|
|
2095
|
-
return invokeTauriCommand({
|
|
2096
|
-
__tauriModule: "Window",
|
|
2097
|
-
message: {
|
|
2098
|
-
cmd: "manage",
|
|
2099
|
-
data: {
|
|
2100
|
-
label: this.label,
|
|
2101
|
-
cmd: {
|
|
2102
|
-
type: "minimize"
|
|
2103
|
-
}
|
|
2104
|
-
}
|
|
2105
|
-
}
|
|
2106
|
-
});
|
|
2107
|
-
}
|
|
2108
|
-
async unminimize() {
|
|
2109
|
-
return invokeTauriCommand({
|
|
2110
|
-
__tauriModule: "Window",
|
|
2111
|
-
message: {
|
|
2112
|
-
cmd: "manage",
|
|
2113
|
-
data: {
|
|
2114
|
-
label: this.label,
|
|
2115
|
-
cmd: {
|
|
2116
|
-
type: "unminimize"
|
|
2117
|
-
}
|
|
2118
|
-
}
|
|
2119
|
-
}
|
|
2120
|
-
});
|
|
2121
|
-
}
|
|
2122
|
-
async show() {
|
|
2123
|
-
return invokeTauriCommand({
|
|
2124
|
-
__tauriModule: "Window",
|
|
2125
|
-
message: {
|
|
2126
|
-
cmd: "manage",
|
|
2127
|
-
data: {
|
|
2128
|
-
label: this.label,
|
|
2129
|
-
cmd: {
|
|
2130
|
-
type: "show"
|
|
2131
|
-
}
|
|
2132
|
-
}
|
|
2133
|
-
}
|
|
2134
|
-
});
|
|
2135
|
-
}
|
|
2136
|
-
async hide() {
|
|
2137
|
-
return invokeTauriCommand({
|
|
2138
|
-
__tauriModule: "Window",
|
|
2139
|
-
message: {
|
|
2140
|
-
cmd: "manage",
|
|
2141
|
-
data: {
|
|
2142
|
-
label: this.label,
|
|
2143
|
-
cmd: {
|
|
2144
|
-
type: "hide"
|
|
2145
|
-
}
|
|
2146
|
-
}
|
|
2147
|
-
}
|
|
2148
|
-
});
|
|
2149
|
-
}
|
|
2150
|
-
async close() {
|
|
2151
|
-
return invokeTauriCommand({
|
|
2152
|
-
__tauriModule: "Window",
|
|
2153
|
-
message: {
|
|
2154
|
-
cmd: "manage",
|
|
2155
|
-
data: {
|
|
2156
|
-
label: this.label,
|
|
2157
|
-
cmd: {
|
|
2158
|
-
type: "close"
|
|
2159
|
-
}
|
|
2160
|
-
}
|
|
2161
|
-
}
|
|
2162
|
-
});
|
|
2163
|
-
}
|
|
2164
|
-
async setDecorations(decorations) {
|
|
2165
|
-
return invokeTauriCommand({
|
|
2166
|
-
__tauriModule: "Window",
|
|
2167
|
-
message: {
|
|
2168
|
-
cmd: "manage",
|
|
2169
|
-
data: {
|
|
2170
|
-
label: this.label,
|
|
2171
|
-
cmd: {
|
|
2172
|
-
type: "setDecorations",
|
|
2173
|
-
payload: decorations
|
|
2174
|
-
}
|
|
2175
|
-
}
|
|
2176
|
-
}
|
|
2177
|
-
});
|
|
2178
|
-
}
|
|
2179
|
-
async setAlwaysOnTop(alwaysOnTop) {
|
|
2180
|
-
return invokeTauriCommand({
|
|
2181
|
-
__tauriModule: "Window",
|
|
2182
|
-
message: {
|
|
2183
|
-
cmd: "manage",
|
|
2184
|
-
data: {
|
|
2185
|
-
label: this.label,
|
|
2186
|
-
cmd: {
|
|
2187
|
-
type: "setAlwaysOnTop",
|
|
2188
|
-
payload: alwaysOnTop
|
|
2189
|
-
}
|
|
2190
|
-
}
|
|
2191
|
-
}
|
|
2192
|
-
});
|
|
2193
|
-
}
|
|
2194
|
-
async setContentProtected(protected_) {
|
|
2195
|
-
return invokeTauriCommand({
|
|
2196
|
-
__tauriModule: "Window",
|
|
2197
|
-
message: {
|
|
2198
|
-
cmd: "manage",
|
|
2199
|
-
data: {
|
|
2200
|
-
label: this.label,
|
|
2201
|
-
cmd: {
|
|
2202
|
-
type: "setContentProtected",
|
|
2203
|
-
payload: protected_
|
|
2204
|
-
}
|
|
2205
|
-
}
|
|
2206
|
-
}
|
|
2207
|
-
});
|
|
2208
|
-
}
|
|
2209
|
-
async setSize(size) {
|
|
2210
|
-
if (!size || size.type !== "Logical" && size.type !== "Physical") {
|
|
2211
|
-
throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");
|
|
2212
|
-
}
|
|
2213
|
-
return invokeTauriCommand({
|
|
2214
|
-
__tauriModule: "Window",
|
|
2215
|
-
message: {
|
|
2216
|
-
cmd: "manage",
|
|
2217
|
-
data: {
|
|
2218
|
-
label: this.label,
|
|
2219
|
-
cmd: {
|
|
2220
|
-
type: "setSize",
|
|
2221
|
-
payload: {
|
|
2222
|
-
type: size.type,
|
|
2223
|
-
data: {
|
|
2224
|
-
width: size.width,
|
|
2225
|
-
height: size.height
|
|
2226
|
-
}
|
|
2227
|
-
}
|
|
2228
|
-
}
|
|
2229
|
-
}
|
|
2230
|
-
}
|
|
2231
|
-
});
|
|
2232
|
-
}
|
|
2233
|
-
async setMinSize(size) {
|
|
2234
|
-
if (size && size.type !== "Logical" && size.type !== "Physical") {
|
|
2235
|
-
throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");
|
|
2236
|
-
}
|
|
2237
|
-
return invokeTauriCommand({
|
|
2238
|
-
__tauriModule: "Window",
|
|
2239
|
-
message: {
|
|
2240
|
-
cmd: "manage",
|
|
2241
|
-
data: {
|
|
2242
|
-
label: this.label,
|
|
2243
|
-
cmd: {
|
|
2244
|
-
type: "setMinSize",
|
|
2245
|
-
payload: size ? {
|
|
2246
|
-
type: size.type,
|
|
2247
|
-
data: {
|
|
2248
|
-
width: size.width,
|
|
2249
|
-
height: size.height
|
|
2250
|
-
}
|
|
2251
|
-
} : null
|
|
2252
|
-
}
|
|
2253
|
-
}
|
|
2254
|
-
}
|
|
2255
|
-
});
|
|
2256
|
-
}
|
|
2257
|
-
async setMaxSize(size) {
|
|
2258
|
-
if (size && size.type !== "Logical" && size.type !== "Physical") {
|
|
2259
|
-
throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");
|
|
2260
|
-
}
|
|
2261
|
-
return invokeTauriCommand({
|
|
2262
|
-
__tauriModule: "Window",
|
|
2263
|
-
message: {
|
|
2264
|
-
cmd: "manage",
|
|
2265
|
-
data: {
|
|
2266
|
-
label: this.label,
|
|
2267
|
-
cmd: {
|
|
2268
|
-
type: "setMaxSize",
|
|
2269
|
-
payload: size ? {
|
|
2270
|
-
type: size.type,
|
|
2271
|
-
data: {
|
|
2272
|
-
width: size.width,
|
|
2273
|
-
height: size.height
|
|
2274
|
-
}
|
|
2275
|
-
} : null
|
|
2276
|
-
}
|
|
2277
|
-
}
|
|
2278
|
-
}
|
|
2279
|
-
});
|
|
2280
|
-
}
|
|
2281
|
-
async setPosition(position) {
|
|
2282
|
-
if (!position || position.type !== "Logical" && position.type !== "Physical") {
|
|
2283
|
-
throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");
|
|
2284
|
-
}
|
|
2285
|
-
return invokeTauriCommand({
|
|
2286
|
-
__tauriModule: "Window",
|
|
2287
|
-
message: {
|
|
2288
|
-
cmd: "manage",
|
|
2289
|
-
data: {
|
|
2290
|
-
label: this.label,
|
|
2291
|
-
cmd: {
|
|
2292
|
-
type: "setPosition",
|
|
2293
|
-
payload: {
|
|
2294
|
-
type: position.type,
|
|
2295
|
-
data: {
|
|
2296
|
-
x: position.x,
|
|
2297
|
-
y: position.y
|
|
2298
|
-
}
|
|
2299
|
-
}
|
|
2300
|
-
}
|
|
2301
|
-
}
|
|
2302
|
-
}
|
|
2303
|
-
});
|
|
2304
|
-
}
|
|
2305
|
-
async setFullscreen(fullscreen) {
|
|
2306
|
-
return invokeTauriCommand({
|
|
2307
|
-
__tauriModule: "Window",
|
|
2308
|
-
message: {
|
|
2309
|
-
cmd: "manage",
|
|
2310
|
-
data: {
|
|
2311
|
-
label: this.label,
|
|
2312
|
-
cmd: {
|
|
2313
|
-
type: "setFullscreen",
|
|
2314
|
-
payload: fullscreen
|
|
2315
|
-
}
|
|
2316
|
-
}
|
|
2317
|
-
}
|
|
2318
|
-
});
|
|
2319
|
-
}
|
|
2320
|
-
async setFocus() {
|
|
2321
|
-
return invokeTauriCommand({
|
|
2322
|
-
__tauriModule: "Window",
|
|
2323
|
-
message: {
|
|
2324
|
-
cmd: "manage",
|
|
2325
|
-
data: {
|
|
2326
|
-
label: this.label,
|
|
2327
|
-
cmd: {
|
|
2328
|
-
type: "setFocus"
|
|
2329
|
-
}
|
|
2330
|
-
}
|
|
2331
|
-
}
|
|
2332
|
-
});
|
|
2333
|
-
}
|
|
2334
|
-
async setIcon(icon) {
|
|
2335
|
-
return invokeTauriCommand({
|
|
2336
|
-
__tauriModule: "Window",
|
|
2337
|
-
message: {
|
|
2338
|
-
cmd: "manage",
|
|
2339
|
-
data: {
|
|
2340
|
-
label: this.label,
|
|
2341
|
-
cmd: {
|
|
2342
|
-
type: "setIcon",
|
|
2343
|
-
payload: {
|
|
2344
|
-
icon: typeof icon === "string" ? icon : Array.from(icon)
|
|
2345
|
-
}
|
|
2346
|
-
}
|
|
2347
|
-
}
|
|
2348
|
-
}
|
|
2349
|
-
});
|
|
2350
|
-
}
|
|
2351
|
-
async setSkipTaskbar(skip) {
|
|
2352
|
-
return invokeTauriCommand({
|
|
2353
|
-
__tauriModule: "Window",
|
|
2354
|
-
message: {
|
|
2355
|
-
cmd: "manage",
|
|
2356
|
-
data: {
|
|
2357
|
-
label: this.label,
|
|
2358
|
-
cmd: {
|
|
2359
|
-
type: "setSkipTaskbar",
|
|
2360
|
-
payload: skip
|
|
2361
|
-
}
|
|
2362
|
-
}
|
|
2363
|
-
}
|
|
2364
|
-
});
|
|
2365
|
-
}
|
|
2366
|
-
async setCursorGrab(grab) {
|
|
2367
|
-
return invokeTauriCommand({
|
|
2368
|
-
__tauriModule: "Window",
|
|
2369
|
-
message: {
|
|
2370
|
-
cmd: "manage",
|
|
2371
|
-
data: {
|
|
2372
|
-
label: this.label,
|
|
2373
|
-
cmd: {
|
|
2374
|
-
type: "setCursorGrab",
|
|
2375
|
-
payload: grab
|
|
2376
|
-
}
|
|
2377
|
-
}
|
|
2378
|
-
}
|
|
2379
|
-
});
|
|
2380
|
-
}
|
|
2381
|
-
async setCursorVisible(visible) {
|
|
2382
|
-
return invokeTauriCommand({
|
|
2383
|
-
__tauriModule: "Window",
|
|
2384
|
-
message: {
|
|
2385
|
-
cmd: "manage",
|
|
2386
|
-
data: {
|
|
2387
|
-
label: this.label,
|
|
2388
|
-
cmd: {
|
|
2389
|
-
type: "setCursorVisible",
|
|
2390
|
-
payload: visible
|
|
2391
|
-
}
|
|
2392
|
-
}
|
|
2393
|
-
}
|
|
2394
|
-
});
|
|
2395
|
-
}
|
|
2396
|
-
async setCursorIcon(icon) {
|
|
2397
|
-
return invokeTauriCommand({
|
|
2398
|
-
__tauriModule: "Window",
|
|
2399
|
-
message: {
|
|
2400
|
-
cmd: "manage",
|
|
2401
|
-
data: {
|
|
2402
|
-
label: this.label,
|
|
2403
|
-
cmd: {
|
|
2404
|
-
type: "setCursorIcon",
|
|
2405
|
-
payload: icon
|
|
2406
|
-
}
|
|
2407
|
-
}
|
|
2408
|
-
}
|
|
2409
|
-
});
|
|
2410
|
-
}
|
|
2411
|
-
async setCursorPosition(position) {
|
|
2412
|
-
if (!position || position.type !== "Logical" && position.type !== "Physical") {
|
|
2413
|
-
throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");
|
|
2414
|
-
}
|
|
2415
|
-
return invokeTauriCommand({
|
|
2416
|
-
__tauriModule: "Window",
|
|
2417
|
-
message: {
|
|
2418
|
-
cmd: "manage",
|
|
2419
|
-
data: {
|
|
2420
|
-
label: this.label,
|
|
2421
|
-
cmd: {
|
|
2422
|
-
type: "setCursorPosition",
|
|
2423
|
-
payload: {
|
|
2424
|
-
type: position.type,
|
|
2425
|
-
data: {
|
|
2426
|
-
x: position.x,
|
|
2427
|
-
y: position.y
|
|
2428
|
-
}
|
|
2429
|
-
}
|
|
2430
|
-
}
|
|
2431
|
-
}
|
|
2432
|
-
}
|
|
2433
|
-
});
|
|
2434
|
-
}
|
|
2435
|
-
async setIgnoreCursorEvents(ignore) {
|
|
2436
|
-
return invokeTauriCommand({
|
|
2437
|
-
__tauriModule: "Window",
|
|
2438
|
-
message: {
|
|
2439
|
-
cmd: "manage",
|
|
2440
|
-
data: {
|
|
2441
|
-
label: this.label,
|
|
2442
|
-
cmd: {
|
|
2443
|
-
type: "setIgnoreCursorEvents",
|
|
2444
|
-
payload: ignore
|
|
2445
|
-
}
|
|
2446
|
-
}
|
|
2447
|
-
}
|
|
2448
|
-
});
|
|
2449
|
-
}
|
|
2450
|
-
async startDragging() {
|
|
2451
|
-
return invokeTauriCommand({
|
|
2452
|
-
__tauriModule: "Window",
|
|
2453
|
-
message: {
|
|
2454
|
-
cmd: "manage",
|
|
2455
|
-
data: {
|
|
2456
|
-
label: this.label,
|
|
2457
|
-
cmd: {
|
|
2458
|
-
type: "startDragging"
|
|
2459
|
-
}
|
|
2460
|
-
}
|
|
2461
|
-
}
|
|
2462
|
-
});
|
|
2463
|
-
}
|
|
2464
|
-
async onResized(handler) {
|
|
2465
|
-
return this.listen(TauriEvent.WINDOW_RESIZED, (e) => {
|
|
2466
|
-
e.payload = mapPhysicalSize(e.payload);
|
|
2467
|
-
handler(e);
|
|
2468
|
-
});
|
|
2469
|
-
}
|
|
2470
|
-
async onMoved(handler) {
|
|
2471
|
-
return this.listen(TauriEvent.WINDOW_MOVED, (e) => {
|
|
2472
|
-
e.payload = mapPhysicalPosition(e.payload);
|
|
2473
|
-
handler(e);
|
|
2474
|
-
});
|
|
2475
|
-
}
|
|
2476
|
-
async onCloseRequested(handler) {
|
|
2477
|
-
return this.listen(TauriEvent.WINDOW_CLOSE_REQUESTED, (event5) => {
|
|
2478
|
-
const evt = new CloseRequestedEvent(event5);
|
|
2479
|
-
Promise.resolve(handler(evt)).then(() => {
|
|
2480
|
-
if (!evt.isPreventDefault()) {
|
|
2481
|
-
return this.close();
|
|
2482
|
-
}
|
|
2483
|
-
});
|
|
2484
|
-
});
|
|
2485
|
-
}
|
|
2486
|
-
async onFocusChanged(handler) {
|
|
2487
|
-
const unlistenFocus = await this.listen(TauriEvent.WINDOW_FOCUS, (event5) => {
|
|
2488
|
-
handler({ ...event5, payload: true });
|
|
2489
|
-
});
|
|
2490
|
-
const unlistenBlur = await this.listen(TauriEvent.WINDOW_BLUR, (event5) => {
|
|
2491
|
-
handler({ ...event5, payload: false });
|
|
2492
|
-
});
|
|
2493
|
-
return () => {
|
|
2494
|
-
unlistenFocus();
|
|
2495
|
-
unlistenBlur();
|
|
2496
|
-
};
|
|
2497
|
-
}
|
|
2498
|
-
async onScaleChanged(handler) {
|
|
2499
|
-
return this.listen(TauriEvent.WINDOW_SCALE_FACTOR_CHANGED, handler);
|
|
2500
|
-
}
|
|
2501
|
-
async onMenuClicked(handler) {
|
|
2502
|
-
return this.listen(TauriEvent.MENU, handler);
|
|
2503
|
-
}
|
|
2504
|
-
async onFileDropEvent(handler) {
|
|
2505
|
-
const unlistenFileDrop = await this.listen(TauriEvent.WINDOW_FILE_DROP, (event5) => {
|
|
2506
|
-
handler({ ...event5, payload: { type: "drop", paths: event5.payload } });
|
|
2507
|
-
});
|
|
2508
|
-
const unlistenFileHover = await this.listen(TauriEvent.WINDOW_FILE_DROP_HOVER, (event5) => {
|
|
2509
|
-
handler({ ...event5, payload: { type: "hover", paths: event5.payload } });
|
|
2510
|
-
});
|
|
2511
|
-
const unlistenCancel = await this.listen(TauriEvent.WINDOW_FILE_DROP_CANCELLED, (event5) => {
|
|
2512
|
-
handler({ ...event5, payload: { type: "cancel" } });
|
|
2513
|
-
});
|
|
2514
|
-
return () => {
|
|
2515
|
-
unlistenFileDrop();
|
|
2516
|
-
unlistenFileHover();
|
|
2517
|
-
unlistenCancel();
|
|
2518
|
-
};
|
|
2519
|
-
}
|
|
2520
|
-
async onThemeChanged(handler) {
|
|
2521
|
-
return this.listen(TauriEvent.WINDOW_THEME_CHANGED, handler);
|
|
2522
|
-
}
|
|
2523
|
-
}
|
|
2524
|
-
|
|
2525
|
-
class CloseRequestedEvent {
|
|
2526
|
-
constructor(event5) {
|
|
2527
|
-
this._preventDefault = false;
|
|
2528
|
-
this.event = event5.event;
|
|
2529
|
-
this.windowLabel = event5.windowLabel;
|
|
2530
|
-
this.id = event5.id;
|
|
2531
|
-
}
|
|
2532
|
-
preventDefault() {
|
|
2533
|
-
this._preventDefault = true;
|
|
2534
|
-
}
|
|
2535
|
-
isPreventDefault() {
|
|
2536
|
-
return this._preventDefault;
|
|
2537
|
-
}
|
|
2538
|
-
}
|
|
2539
|
-
|
|
2540
|
-
class WebviewWindow extends WindowManager {
|
|
2541
|
-
constructor(label, options = {}) {
|
|
2542
|
-
super(label);
|
|
2543
|
-
if (!(options === null || options === undefined ? undefined : options.skip)) {
|
|
2544
|
-
invokeTauriCommand({
|
|
2545
|
-
__tauriModule: "Window",
|
|
2546
|
-
message: {
|
|
2547
|
-
cmd: "createWebview",
|
|
2548
|
-
data: {
|
|
2549
|
-
options: {
|
|
2550
|
-
label,
|
|
2551
|
-
...options
|
|
2552
|
-
}
|
|
2553
|
-
}
|
|
2554
|
-
}
|
|
2555
|
-
}).then(async () => this.emit("tauri://created")).catch(async (e) => this.emit("tauri://error", e));
|
|
2556
|
-
}
|
|
2557
|
-
}
|
|
2558
|
-
static getByLabel(label) {
|
|
2559
|
-
if (getAll().some((w) => w.label === label)) {
|
|
2560
|
-
return new WebviewWindow(label, { skip: true });
|
|
2561
|
-
}
|
|
2562
|
-
return null;
|
|
2563
|
-
}
|
|
2564
|
-
static async getFocusedWindow() {
|
|
2565
|
-
for (const w of getAll()) {
|
|
2566
|
-
if (await w.isFocused()) {
|
|
2567
|
-
return w;
|
|
2568
|
-
}
|
|
2569
|
-
}
|
|
2570
|
-
return null;
|
|
2571
|
-
}
|
|
2572
|
-
}
|
|
2573
|
-
var appWindow;
|
|
2574
|
-
if ("__TAURI_METADATA__" in window) {
|
|
2575
|
-
appWindow = new WebviewWindow(window.__TAURI_METADATA__.__currentWindow.label, {
|
|
2576
|
-
skip: true
|
|
2577
|
-
});
|
|
2578
|
-
} else {
|
|
2579
|
-
console.warn(`Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label.\nNote that this is not an issue if running this frontend on a browser instead of a Tauri window.`);
|
|
2580
|
-
appWindow = new WebviewWindow("main", {
|
|
2581
|
-
skip: true
|
|
2582
|
-
});
|
|
2583
|
-
}
|
|
2584
|
-
|
|
2585
|
-
// src/index.ts
|
|
2586
|
-
async function openShell(link) {
|
|
2587
|
-
await open(link);
|
|
2588
|
-
}
|
|
2589
|
-
|
|
2590
|
-
// src/system-tray.ts
|
|
2591
|
-
var testingThis = "testing this";
|
|
2592
|
-
|
|
2593
|
-
// src/index.ts
|
|
2594
|
-
var desktop = {
|
|
2595
|
-
app: exports_app,
|
|
2596
|
-
event: exports_event,
|
|
2597
|
-
clipboard: exports_clipboard,
|
|
2598
|
-
dialog: exports_dialog,
|
|
2599
|
-
fs: exports_fs,
|
|
2600
|
-
globalShortcut: exports_globalShortcut,
|
|
2601
|
-
http: exports_http,
|
|
2602
|
-
mocks: exports_mocks,
|
|
2603
|
-
notification: exports_notification,
|
|
2604
|
-
os: exports_os,
|
|
2605
|
-
path: exports_path,
|
|
2606
|
-
process: exports_process,
|
|
2607
|
-
shell: exports_shell,
|
|
2608
|
-
tauri: exports_tauri,
|
|
2609
|
-
updater: exports_updater,
|
|
2610
|
-
window: exports_window
|
|
2611
|
-
};
|
|
2612
|
-
export {
|
|
2613
|
-
testingThis,
|
|
2614
|
-
openShell,
|
|
2615
|
-
desktop
|
|
2616
|
-
};
|
|
2617
|
-
|
|
2618
|
-
//# debugId=186A0F79356F64EE64756E2164756E21
|
|
5
|
+
//# debugId=CD078A7503EC431464756E2164756E21
|
|
2619
6
|
//# sourceMappingURL=index.js.map
|