diff --git a/.changes/cli-windows-arm64.md b/.changes/cli-windows-arm64.md new file mode 100644 index 000000000000..a4e6244dcc7c --- /dev/null +++ b/.changes/cli-windows-arm64.md @@ -0,0 +1,6 @@ +--- +'tauri-cli': minor +'@tauri-apps/cli': minor +--- + +Provide prebuilt CLIs for Windows ARM64 targets. diff --git a/.changes/event-api-window-label.md b/.changes/event-api-window-label.md new file mode 100644 index 000000000000..e316ee6d84ea --- /dev/null +++ b/.changes/event-api-window-label.md @@ -0,0 +1,5 @@ +--- +"@tauri-apps/api": patch +--- + +Expose the window target option on event APIs. diff --git a/.github/workflows/publish-cli-js.yml b/.github/workflows/publish-cli-js.yml index c493659e4aac..9dab2702317b 100644 --- a/.github/workflows/publish-cli-js.yml +++ b/.github/workflows/publish-cli-js.yml @@ -40,6 +40,10 @@ jobs: build: yarn build:release --target i686-pc-windows-msvc target: i686-pc-windows-msvc architecture: x64 + - host: windows-latest + architecture: x64 + target: aarch64-pc-windows-msvc + build: yarn build:release --target aarch64-pc-windows-msvc --features native-tls-vendored --cargo-flags="--no-default-features" - host: ubuntu-20.04 target: x86_64-unknown-linux-gnu docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian @@ -84,10 +88,6 @@ jobs: rustup target add aarch64-unknown-linux-musl yarn build:release --target aarch64-unknown-linux-musl /aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node - #- host: windows-latest - # architecture: x64 - # target: aarch64-pc-windows-msvc - # build: yarn build:release --target aarch64-pc-windows-msvc name: stable - ${{ matrix.settings.target }} - node@16 runs-on: ${{ matrix.settings.host }} steps: diff --git a/.github/workflows/publish-cli-rs.yml b/.github/workflows/publish-cli-rs.yml index 2fb4b9d058c9..911442eeefe3 100644 --- a/.github/workflows/publish-cli-rs.yml +++ b/.github/workflows/publish-cli-rs.yml @@ -21,15 +21,23 @@ jobs: - os: ubuntu-20.04 rust_target: x86_64-unknown-linux-gnu ext: '' + args: '' - os: macos-latest rust_target: x86_64-apple-darwin ext: '' + args: '' - os: macos-latest rust_target: aarch64-apple-darwin ext: '' + args: '' - os: windows-latest rust_target: x86_64-pc-windows-msvc ext: '.exe' + args: '' + - os: windows-latest + rust_target: aarch64-pc-windows-msvc + ext: '.exe' + args: '--no-default-features --features native-tls-vendored' steps: - uses: actions/checkout@v3 @@ -53,7 +61,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: build - args: --manifest-path ./tooling/cli/Cargo.toml --release + args: --manifest-path ./tooling/cli/Cargo.toml --release ${{ matrix.config.args }} - name: Upload CLI uses: actions/upload-artifact@v3 diff --git a/.github/workflows/test-cli-rs.yml b/.github/workflows/test-cli-rs.yml index 20485b551676..c1e0a5a1b64b 100644 --- a/.github/workflows/test-cli-rs.yml +++ b/.github/workflows/test-cli-rs.yml @@ -24,24 +24,40 @@ concurrency: jobs: test: - runs-on: ${{ matrix.platform }} + runs-on: ${{ matrix.platform.os }} strategy: fail-fast: false matrix: - platform: [ubuntu-latest, macos-latest, windows-latest] + platform: + - { + target: x86_64-pc-windows-msvc, + os: windows-latest + } + - { + target: aarch64-pc-windows-msvc, + os: windows-latest, + args: --no-default-features --features native-tls-vendored + } + - { + target: x86_64-unknown-linux-gnu, + os: ubuntu-latest + } + - { + target: x86_64-apple-darwin, + os: macos-latest + } steps: - uses: actions/checkout@v2 - - name: install stable - uses: actions-rs/toolchain@v1 + - name: 'Setup Rust' + uses: dtolnay/rust-toolchain@stable with: - toolchain: stable - override: true + targets: ${{ matrix.platform.target }} - name: install Linux dependencies - if: matrix.platform == 'ubuntu-latest' + if: matrix.platform.os == 'ubuntu-latest' run: | sudo apt-get update sudo apt-get install -y libgtk-3-dev @@ -54,4 +70,4 @@ jobs: uses: actions-rs/cargo@v1 with: command: build - args: --manifest-path ./tooling/cli/Cargo.toml + args: --manifest-path ./tooling/cli/Cargo.toml ${{ matrix.platform.args }} diff --git a/core/tauri/scripts/bundle.global.js b/core/tauri/scripts/bundle.global.js index 2edffb18f4b9..676ba0c88ef1 100644 --- a/core/tauri/scripts/bundle.global.js +++ b/core/tauri/scripts/bundle.global.js @@ -1,2 +1,2 @@ -"use strict";var __TAURI_IIFE__=(()=>{var m=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var O=Object.prototype.hasOwnProperty;var l=(n,e)=>{for(var i in e)m(n,i,{get:e[i],enumerable:!0})},T=(n,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of k(e))!O.call(n,a)&&a!==i&&m(n,a,{get:()=>e[a],enumerable:!(o=R(e,a))||o.enumerable});return n};var L=n=>T(m({},"__esModule",{value:!0}),n);var b=(n,e,i)=>{if(!e.has(n))throw TypeError("Cannot "+i)};var y=(n,e,i)=>(b(n,e,"read from private field"),i?i.call(n):e.get(n)),A=(n,e,i)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,i)},w=(n,e,i,o)=>(b(n,e,"write to private field"),o?o.call(n,i):e.set(n,i),i);var bn={};l(bn,{event:()=>_,invoke:()=>Dn,path:()=>P,tauri:()=>f});var _={};l(_,{TauriEvent:()=>W,emit:()=>V,listen:()=>S,once:()=>H});var f={};l(f,{Channel:()=>p,PluginListener:()=>d,addPluginListener:()=>U,convertFileSrc:()=>F,invoke:()=>t,transformCallback:()=>u});function x(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function u(n,e=!1){let i=x(),o=`_${i}`;return Object.defineProperty(window,o,{value:a=>(e&&Reflect.deleteProperty(window,o),n?.(a)),writable:!1,configurable:!0}),i}var c,p=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0;A(this,c,()=>{});this.id=u(e=>{y(this,c).call(this,e)})}set onmessage(e){w(this,c,e)}get onmessage(){return y(this,c)}toJSON(){return`__CHANNEL__:${this.id}`}};c=new WeakMap;var d=class{constructor(e,i,o){this.plugin=e,this.event=i,this.channelId=o}async unregister(){return t(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function U(n,e,i){let o=new p;return o.onmessage=i,t(`plugin:${n}|register_listener`,{event:e,handler:o}).then(()=>new d(n,e,o.id))}async function t(n,e={}){return new Promise((i,o)=>{let a=u(g=>{i(g),Reflect.deleteProperty(window,`_${D}`)},!0),D=u(g=>{o(g),Reflect.deleteProperty(window,`_${a}`)},!0);window.__TAURI_IPC__({cmd:n,callback:a,error:D,...e})})}function F(n,e="asset"){let i=encodeURIComponent(n);return navigator.userAgent.includes("Windows")?`https://${e}.localhost/${i}`:`${e}://localhost/${i}`}async function E(n,e){await t("plugin:event|unlisten",{event:n,eventId:e})}async function C(n,e,i){await t("plugin:event|emit",{event:n,windowLabel:e,payload:i})}async function v(n,e,i){return t("plugin:event|listen",{event:n,windowLabel:e,handler:u(i)}).then(o=>async()=>E(n,o))}async function I(n,e,i){return v(n,e,o=>{i(o),E(n,o.id).catch(()=>{})})}var W=(s=>(s.WINDOW_RESIZED="tauri://resize",s.WINDOW_MOVED="tauri://move",s.WINDOW_CLOSE_REQUESTED="tauri://close-requested",s.WINDOW_CREATED="tauri://window-created",s.WINDOW_DESTROYED="tauri://destroyed",s.WINDOW_FOCUS="tauri://focus",s.WINDOW_BLUR="tauri://blur",s.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",s.WINDOW_THEME_CHANGED="tauri://theme-changed",s.WINDOW_FILE_DROP="tauri://file-drop",s.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",s.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",s.MENU="tauri://menu",s))(W||{});async function S(n,e){return v(n,null,e)}async function H(n,e){return I(n,null,e)}async function V(n,e){return C(n,void 0,e)}var P={};l(P,{BaseDirectory:()=>N,appCacheDir:()=>G,appConfigDir:()=>M,appDataDir:()=>j,appLocalDataDir:()=>z,appLogDir:()=>pn,audioDir:()=>q,basename:()=>hn,cacheDir:()=>J,configDir:()=>K,dataDir:()=>Q,delimiter:()=>gn,desktopDir:()=>Y,dirname:()=>vn,documentDir:()=>Z,downloadDir:()=>X,executableDir:()=>B,extname:()=>_n,fontDir:()=>nn,homeDir:()=>en,isAbsolute:()=>Pn,join:()=>fn,localDataDir:()=>rn,normalize:()=>yn,pictureDir:()=>tn,publicDir:()=>on,resolve:()=>mn,resolveResource:()=>an,resourceDir:()=>sn,runtimeDir:()=>cn,sep:()=>dn,templateDir:()=>un,videoDir:()=>ln});function h(){return navigator.appVersion.includes("Win")}var N=(r=>(r[r.Audio=1]="Audio",r[r.Cache=2]="Cache",r[r.Config=3]="Config",r[r.Data=4]="Data",r[r.LocalData=5]="LocalData",r[r.Document=6]="Document",r[r.Download=7]="Download",r[r.Picture=8]="Picture",r[r.Public=9]="Public",r[r.Video=10]="Video",r[r.Resource=11]="Resource",r[r.Temp=12]="Temp",r[r.AppConfig=13]="AppConfig",r[r.AppData=14]="AppData",r[r.AppLocalData=15]="AppLocalData",r[r.AppCache=16]="AppCache",r[r.AppLog=17]="AppLog",r[r.Desktop=18]="Desktop",r[r.Executable=19]="Executable",r[r.Font=20]="Font",r[r.Home=21]="Home",r[r.Runtime=22]="Runtime",r[r.Template=23]="Template",r))(N||{});async function M(){return t("plugin:path|resolve_directory",{directory:13})}async function j(){return t("plugin:path|resolve_directory",{directory:14})}async function z(){return t("plugin:path|resolve_directory",{directory:15})}async function G(){return t("plugin:path|resolve_directory",{directory:16})}async function q(){return t("plugin:path|resolve_directory",{directory:1})}async function J(){return t("plugin:path|resolve_directory",{directory:2})}async function K(){return t("plugin:path|resolve_directory",{directory:3})}async function Q(){return t("plugin:path|resolve_directory",{directory:4})}async function Y(){return t("plugin:path|resolve_directory",{directory:18})}async function Z(){return t("plugin:path|resolve_directory",{directory:6})}async function X(){return t("plugin:path|resolve_directory",{directory:7})}async function B(){return t("plugin:path|resolve_directory",{directory:19})}async function nn(){return t("plugin:path|resolve_directory",{directory:20})}async function en(){return t("plugin:path|resolve_directory",{directory:21})}async function rn(){return t("plugin:path|resolve_directory",{directory:5})}async function tn(){return t("plugin:path|resolve_directory",{directory:8})}async function on(){return t("plugin:path|resolve_directory",{directory:9})}async function sn(){return t("plugin:path|resolve_directory",{directory:11})}async function an(n){return t("plugin:path|resolve_directory",{directory:11,path:n})}async function cn(){return t("plugin:path|resolve_directory",{directory:22})}async function un(){return t("plugin:path|resolve_directory",{directory:23})}async function ln(){return t("plugin:path|resolve_directory",{directory:10})}async function pn(){return t("plugin:path|resolve_directory",{directory:17})}var dn=h()?"\\":"/",gn=h()?";":":";async function mn(...n){return t("plugin:path|resolve",{paths:n})}async function yn(n){return t("plugin:path|normalize",{path:n})}async function fn(...n){return t("plugin:path|join",{paths:n})}async function vn(n){return t("plugin:path|dirname",{path:n})}async function _n(n){return t("plugin:path|extname",{path:n})}async function hn(n,e){return t("plugin:path|basename",{path:n,ext:e})}async function Pn(n){return t("plugin:path|isAbsolute",{path:n})}var Dn=t;return L(bn);})(); +"use strict";var __TAURI_IIFE__=(()=>{var m=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var l=(n,e)=>{for(var i in e)m(n,i,{get:e[i],enumerable:!0})},N=(n,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of E(e))!R.call(n,a)&&a!==i&&m(n,a,{get:()=>e[a],enumerable:!(o=W(e,a))||o.enumerable});return n};var L=n=>N(m({},"__esModule",{value:!0}),n);var D=(n,e,i)=>{if(!e.has(n))throw TypeError("Cannot "+i)};var y=(n,e,i)=>(D(n,e,"read from private field"),i?i.call(n):e.get(n)),b=(n,e,i)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,i)},w=(n,e,i,o)=>(D(n,e,"write to private field"),o?o.call(n,i):e.set(n,i),i);var hn={};l(hn,{event:()=>_,invoke:()=>_n,path:()=>v,tauri:()=>f});var _={};l(_,{TauriEvent:()=>A,emit:()=>F,listen:()=>I,once:()=>U});var f={};l(f,{Channel:()=>p,PluginListener:()=>d,addPluginListener:()=>T,convertFileSrc:()=>x,invoke:()=>t,transformCallback:()=>u});function k(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function u(n,e=!1){let i=k(),o=`_${i}`;return Object.defineProperty(window,o,{value:a=>(e&&Reflect.deleteProperty(window,o),n?.(a)),writable:!1,configurable:!0}),i}var c,p=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0;b(this,c,()=>{});this.id=u(e=>{y(this,c).call(this,e)})}set onmessage(e){w(this,c,e)}get onmessage(){return y(this,c)}toJSON(){return`__CHANNEL__:${this.id}`}};c=new WeakMap;var d=class{constructor(e,i,o){this.plugin=e,this.event=i,this.channelId=o}async unregister(){return t(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function T(n,e,i){let o=new p;return o.onmessage=i,t(`plugin:${n}|register_listener`,{event:e,handler:o}).then(()=>new d(n,e,o.id))}async function t(n,e={}){return new Promise((i,o)=>{let a=u(g=>{i(g),Reflect.deleteProperty(window,`_${P}`)},!0),P=u(g=>{o(g),Reflect.deleteProperty(window,`_${a}`)},!0);window.__TAURI_IPC__({cmd:n,callback:a,error:P,...e})})}function x(n,e="asset"){let i=encodeURIComponent(n);return navigator.userAgent.includes("Windows")?`https://${e}.localhost/${i}`:`${e}://localhost/${i}`}var A=(s=>(s.WINDOW_RESIZED="tauri://resize",s.WINDOW_MOVED="tauri://move",s.WINDOW_CLOSE_REQUESTED="tauri://close-requested",s.WINDOW_CREATED="tauri://window-created",s.WINDOW_DESTROYED="tauri://destroyed",s.WINDOW_FOCUS="tauri://focus",s.WINDOW_BLUR="tauri://blur",s.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",s.WINDOW_THEME_CHANGED="tauri://theme-changed",s.WINDOW_FILE_DROP="tauri://file-drop",s.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",s.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",s.MENU="tauri://menu",s))(A||{});async function C(n,e){await t("plugin:event|unlisten",{event:n,eventId:e})}async function I(n,e,i){return t("plugin:event|listen",{event:n,windowLabel:i?.target,handler:u(e)}).then(o=>async()=>C(n,o))}async function U(n,e,i){return I(n,o=>{e(o),C(n,o.id).catch(()=>{})},i)}async function F(n,e,i){await t("plugin:event|emit",{event:n,windowLabel:i?.target,payload:e})}var v={};l(v,{BaseDirectory:()=>O,appCacheDir:()=>V,appConfigDir:()=>$,appDataDir:()=>S,appLocalDataDir:()=>H,appLogDir:()=>an,audioDir:()=>M,basename:()=>yn,cacheDir:()=>j,configDir:()=>z,dataDir:()=>G,delimiter:()=>un,desktopDir:()=>q,dirname:()=>gn,documentDir:()=>J,downloadDir:()=>K,executableDir:()=>Q,extname:()=>mn,fontDir:()=>Y,homeDir:()=>Z,isAbsolute:()=>fn,join:()=>dn,localDataDir:()=>X,normalize:()=>pn,pictureDir:()=>B,publicDir:()=>nn,resolve:()=>ln,resolveResource:()=>rn,resourceDir:()=>en,runtimeDir:()=>tn,sep:()=>cn,templateDir:()=>on,videoDir:()=>sn});function h(){return navigator.appVersion.includes("Win")}var O=(r=>(r[r.Audio=1]="Audio",r[r.Cache=2]="Cache",r[r.Config=3]="Config",r[r.Data=4]="Data",r[r.LocalData=5]="LocalData",r[r.Document=6]="Document",r[r.Download=7]="Download",r[r.Picture=8]="Picture",r[r.Public=9]="Public",r[r.Video=10]="Video",r[r.Resource=11]="Resource",r[r.Temp=12]="Temp",r[r.AppConfig=13]="AppConfig",r[r.AppData=14]="AppData",r[r.AppLocalData=15]="AppLocalData",r[r.AppCache=16]="AppCache",r[r.AppLog=17]="AppLog",r[r.Desktop=18]="Desktop",r[r.Executable=19]="Executable",r[r.Font=20]="Font",r[r.Home=21]="Home",r[r.Runtime=22]="Runtime",r[r.Template=23]="Template",r))(O||{});async function $(){return t("plugin:path|resolve_directory",{directory:13})}async function S(){return t("plugin:path|resolve_directory",{directory:14})}async function H(){return t("plugin:path|resolve_directory",{directory:15})}async function V(){return t("plugin:path|resolve_directory",{directory:16})}async function M(){return t("plugin:path|resolve_directory",{directory:1})}async function j(){return t("plugin:path|resolve_directory",{directory:2})}async function z(){return t("plugin:path|resolve_directory",{directory:3})}async function G(){return t("plugin:path|resolve_directory",{directory:4})}async function q(){return t("plugin:path|resolve_directory",{directory:18})}async function J(){return t("plugin:path|resolve_directory",{directory:6})}async function K(){return t("plugin:path|resolve_directory",{directory:7})}async function Q(){return t("plugin:path|resolve_directory",{directory:19})}async function Y(){return t("plugin:path|resolve_directory",{directory:20})}async function Z(){return t("plugin:path|resolve_directory",{directory:21})}async function X(){return t("plugin:path|resolve_directory",{directory:5})}async function B(){return t("plugin:path|resolve_directory",{directory:8})}async function nn(){return t("plugin:path|resolve_directory",{directory:9})}async function en(){return t("plugin:path|resolve_directory",{directory:11})}async function rn(n){return t("plugin:path|resolve_directory",{directory:11,path:n})}async function tn(){return t("plugin:path|resolve_directory",{directory:22})}async function on(){return t("plugin:path|resolve_directory",{directory:23})}async function sn(){return t("plugin:path|resolve_directory",{directory:10})}async function an(){return t("plugin:path|resolve_directory",{directory:17})}var cn=h()?"\\":"/",un=h()?";":":";async function ln(...n){return t("plugin:path|resolve",{paths:n})}async function pn(n){return t("plugin:path|normalize",{path:n})}async function dn(...n){return t("plugin:path|join",{paths:n})}async function gn(n){return t("plugin:path|dirname",{path:n})}async function mn(n){return t("plugin:path|extname",{path:n})}async function yn(n,e){return t("plugin:path|basename",{path:n,ext:e})}async function fn(n){return t("plugin:path|isAbsolute",{path:n})}var _n=t;return L(hn);})(); window.__TAURI__ = __TAURI_IIFE__ diff --git a/tooling/api/docs/js-api.json b/tooling/api/docs/js-api.json index 6a81e9ae8769..8af637a71a9f 100644 --- a/tooling/api/docs/js-api.json +++ b/tooling/api/docs/js-api.json @@ -1 +1 @@ -{"id":0,"name":"@tauri-apps/api","variant":"project","kind":1,"flags":{},"children":[{"id":1,"name":"event","variant":"declaration","kind":2,"flags":{},"comment":{"summary":[{"kind":"text","text":"The event system allows you to emit events to the backend and listen to events from it.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.event`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":"."}]},"children":[{"id":3,"name":"TauriEvent","variant":"declaration","kind":8,"flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"children":[{"id":16,"name":"MENU","variant":"declaration","kind":16,"flags":{},"sources":[{"fileName":"event.ts","line":33,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/event.ts#L33"}],"type":{"type":"literal","value":"tauri://menu"}},{"id":10,"name":"WINDOW_BLUR","variant":"declaration","kind":16,"flags":{},"sources":[{"fileName":"event.ts","line":27,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/event.ts#L27"}],"type":{"type":"literal","value":"tauri://blur"}},{"id":6,"name":"WINDOW_CLOSE_REQUESTED","variant":"declaration","kind":16,"flags":{},"sources":[{"fileName":"event.ts","line":23,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/event.ts#L23"}],"type":{"type":"literal","value":"tauri://close-requested"}},{"id":7,"name":"WINDOW_CREATED","variant":"declaration","kind":16,"flags":{},"sources":[{"fileName":"event.ts","line":24,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/event.ts#L24"}],"type":{"type":"literal","value":"tauri://window-created"}},{"id":8,"name":"WINDOW_DESTROYED","variant":"declaration","kind":16,"flags":{},"sources":[{"fileName":"event.ts","line":25,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/event.ts#L25"}],"type":{"type":"literal","value":"tauri://destroyed"}},{"id":13,"name":"WINDOW_FILE_DROP","variant":"declaration","kind":16,"flags":{},"sources":[{"fileName":"event.ts","line":30,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/event.ts#L30"}],"type":{"type":"literal","value":"tauri://file-drop"}},{"id":15,"name":"WINDOW_FILE_DROP_CANCELLED","variant":"declaration","kind":16,"flags":{},"sources":[{"fileName":"event.ts","line":32,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/event.ts#L32"}],"type":{"type":"literal","value":"tauri://file-drop-cancelled"}},{"id":14,"name":"WINDOW_FILE_DROP_HOVER","variant":"declaration","kind":16,"flags":{},"sources":[{"fileName":"event.ts","line":31,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/event.ts#L31"}],"type":{"type":"literal","value":"tauri://file-drop-hover"}},{"id":9,"name":"WINDOW_FOCUS","variant":"declaration","kind":16,"flags":{},"sources":[{"fileName":"event.ts","line":26,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/event.ts#L26"}],"type":{"type":"literal","value":"tauri://focus"}},{"id":5,"name":"WINDOW_MOVED","variant":"declaration","kind":16,"flags":{},"sources":[{"fileName":"event.ts","line":22,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/event.ts#L22"}],"type":{"type":"literal","value":"tauri://move"}},{"id":4,"name":"WINDOW_RESIZED","variant":"declaration","kind":16,"flags":{},"sources":[{"fileName":"event.ts","line":21,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/event.ts#L21"}],"type":{"type":"literal","value":"tauri://resize"}},{"id":11,"name":"WINDOW_SCALE_FACTOR_CHANGED","variant":"declaration","kind":16,"flags":{},"sources":[{"fileName":"event.ts","line":28,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/event.ts#L28"}],"type":{"type":"literal","value":"tauri://scale-change"}},{"id":12,"name":"WINDOW_THEME_CHANGED","variant":"declaration","kind":16,"flags":{},"sources":[{"fileName":"event.ts","line":29,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/event.ts#L29"}],"type":{"type":"literal","value":"tauri://theme-changed"}}],"groups":[{"title":"Enumeration Members","children":[16,10,6,7,8,13,15,14,9,5,4,11,12]}],"sources":[{"fileName":"event.ts","line":20,"character":12,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/event.ts#L20"}]},{"id":106,"name":"Event","variant":"declaration","kind":256,"flags":{},"children":[{"id":107,"name":"event","variant":"declaration","kind":1024,"flags":{},"comment":{"summary":[{"kind":"text","text":"Event name"}]},"sources":[{"fileName":"helpers/event.ts","line":10,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/helpers/event.ts#L10"}],"type":{"type":"reference","target":2,"name":"EventName","package":"@tauri-apps/api"}},{"id":109,"name":"id","variant":"declaration","kind":1024,"flags":{},"comment":{"summary":[{"kind":"text","text":"Event identifier used to unlisten"}]},"sources":[{"fileName":"helpers/event.ts","line":14,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/helpers/event.ts#L14"}],"type":{"type":"intrinsic","name":"number"}},{"id":110,"name":"payload","variant":"declaration","kind":1024,"flags":{},"comment":{"summary":[{"kind":"text","text":"Event payload"}]},"sources":[{"fileName":"helpers/event.ts","line":16,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/helpers/event.ts#L16"}],"type":{"type":"reference","target":-1,"name":"T","refersToTypeParameter":true}},{"id":108,"name":"windowLabel","variant":"declaration","kind":1024,"flags":{},"comment":{"summary":[{"kind":"text","text":"The label of the window that emitted this event."}]},"sources":[{"fileName":"helpers/event.ts","line":12,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/helpers/event.ts#L12"}],"type":{"type":"intrinsic","name":"string"}}],"groups":[{"title":"Properties","children":[107,109,110,108]}],"sources":[{"fileName":"helpers/event.ts","line":8,"character":17,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/helpers/event.ts#L8"}],"typeParameters":[{"id":111,"name":"T","variant":"typeParam","kind":131072,"flags":{}}]},{"id":112,"name":"EventCallback","variant":"declaration","kind":4194304,"flags":{},"sources":[{"fileName":"helpers/event.ts","line":19,"character":12,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/helpers/event.ts#L19"}],"typeParameters":[{"id":116,"name":"T","variant":"typeParam","kind":131072,"flags":{}}],"type":{"type":"reflection","declaration":{"id":113,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"helpers/event.ts","line":19,"character":31,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/helpers/event.ts#L19"}],"signatures":[{"id":114,"name":"__type","variant":"signature","kind":4096,"flags":{},"parameters":[{"id":115,"name":"event","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":106,"typeArguments":[{"type":"reference","target":-1,"name":"T","refersToTypeParameter":true}],"name":"Event","package":"@tauri-apps/api"}}],"type":{"type":"intrinsic","name":"void"}}]}}},{"id":2,"name":"EventName","variant":"declaration","kind":4194304,"flags":{},"sources":[{"fileName":"event.ts","line":15,"character":12,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/event.ts#L15"}],"type":{"type":"union","types":[{"type":"templateLiteral","head":"","tail":[[{"type":"reference","target":3,"name":"TauriEvent","package":"@tauri-apps/api"},""]]},{"type":"intersection","types":[{"type":"intrinsic","name":"string"},{"type":"reference","target":{"sourceFileName":"node_modules/typescript/lib/lib.es5.d.ts","qualifiedName":"Record"},"typeArguments":[{"type":"intrinsic","name":"never"},{"type":"intrinsic","name":"never"}],"name":"Record","package":"typescript","externalUrl":"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type"}]}]}},{"id":117,"name":"UnlistenFn","variant":"declaration","kind":4194304,"flags":{},"sources":[{"fileName":"helpers/event.ts","line":21,"character":12,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/helpers/event.ts#L21"}],"type":{"type":"reflection","declaration":{"id":118,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"helpers/event.ts","line":21,"character":25,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/helpers/event.ts#L21"}],"signatures":[{"id":119,"name":"__type","variant":"signature","kind":4096,"flags":{},"type":{"type":"intrinsic","name":"void"}}]}}},{"id":27,"name":"emit","variant":"declaration","kind":64,"flags":{},"sources":[{"fileName":"event.ts","line":107,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/event.ts#L107"}],"signatures":[{"id":28,"name":"emit","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Emits an event to the backend."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { emit } from '@tauri-apps/api/event';\nawait emit('frontend-loaded', { loggedIn: true, token: 'authToken' });\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"sources":[{"fileName":"event.ts","line":107,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/event.ts#L107"}],"parameters":[{"id":29,"name":"event","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"intrinsic","name":"string"}},{"id":30,"name":"payload","variant":"param","kind":32768,"flags":{"isOptional":true},"type":{"type":"intrinsic","name":"unknown"}}],"type":{"type":"reference","target":{"sourceFileName":"node_modules/typescript/lib/lib.es5.d.ts","qualifiedName":"Promise"},"typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","package":"typescript","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise"}}]},{"id":17,"name":"listen","variant":"declaration","kind":64,"flags":{},"sources":[{"fileName":"event.ts","line":57,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/event.ts#L57"}],"signatures":[{"id":18,"name":"listen","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to an event from the backend."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { listen } from '@tauri-apps/api/event';\nconst unlisten = await listen('error', (event) => {\n console.log(`Got error in window ${event.windowLabel}, payload: ${event.payload}`);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"sources":[{"fileName":"event.ts","line":57,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/event.ts#L57"}],"typeParameter":[{"id":19,"name":"T","variant":"typeParam","kind":131072,"flags":{}}],"parameters":[{"id":20,"name":"event","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"reference","target":2,"name":"EventName","package":"@tauri-apps/api"}},{"id":21,"name":"handler","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"Event handler callback."}]},"type":{"type":"reference","target":112,"typeArguments":[{"type":"reference","target":-1,"name":"T","refersToTypeParameter":true}],"name":"EventCallback","package":"@tauri-apps/api"}}],"type":{"type":"reference","target":{"sourceFileName":"node_modules/typescript/lib/lib.es5.d.ts","qualifiedName":"Promise"},"typeArguments":[{"type":"reference","target":117,"name":"UnlistenFn","package":"@tauri-apps/api"}],"name":"Promise","package":"typescript","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise"}}]},{"id":22,"name":"once","variant":"declaration","kind":64,"flags":{},"sources":[{"fileName":"event.ts","line":88,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/event.ts#L88"}],"signatures":[{"id":23,"name":"once","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to an one-off event from the backend."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { once } from '@tauri-apps/api/event';\ninterface LoadedPayload {\n loggedIn: boolean,\n token: string\n}\nconst unlisten = await once('loaded', (event) => {\n console.log(`App is loaded, loggedIn: ${event.payload.loggedIn}, token: ${event.payload.token}`);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"sources":[{"fileName":"event.ts","line":88,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/event.ts#L88"}],"typeParameter":[{"id":24,"name":"T","variant":"typeParam","kind":131072,"flags":{}}],"parameters":[{"id":25,"name":"event","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"reference","target":2,"name":"EventName","package":"@tauri-apps/api"}},{"id":26,"name":"handler","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":112,"typeArguments":[{"type":"reference","target":-1,"name":"T","refersToTypeParameter":true}],"name":"EventCallback","package":"@tauri-apps/api"}}],"type":{"type":"reference","target":{"sourceFileName":"node_modules/typescript/lib/lib.es5.d.ts","qualifiedName":"Promise"},"typeArguments":[{"type":"reference","target":117,"name":"UnlistenFn","package":"@tauri-apps/api"}],"name":"Promise","package":"typescript","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise"}}]}],"groups":[{"title":"Enumerations","children":[3]},{"title":"Interfaces","children":[106]},{"title":"Type Aliases","children":[112,2,117]},{"title":"Functions","children":[27,17,22]}],"sources":[{"fileName":"event.ts","line":1,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/event.ts#L1"}]},{"id":31,"name":"mocks","variant":"declaration","kind":2,"flags":{},"children":[{"id":43,"name":"clearMocks","variant":"declaration","kind":64,"flags":{},"sources":[{"fileName":"mocks.ts","line":186,"character":16,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/mocks.ts#L186"}],"signatures":[{"id":44,"name":"clearMocks","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Clears mocked functions/data injected by the other functions in this module.\nWhen using a test runner that doesn't provide a fresh window object for each test, calling this function will reset tauri specific properties.\n\n# Example\n\n"},{"kind":"code","text":"```js\nimport { mockWindows, clearMocks } from \"@tauri-apps/api/mocks\"\n\nafterEach(() => {\n clearMocks()\n})\n\ntest(\"mocked windows\", () => {\n mockWindows(\"main\", \"second\", \"third\");\n\n expect(window).toHaveProperty(\"__TAURI_METADATA__\")\n})\n\ntest(\"no mocked windows\", () => {\n expect(window).not.toHaveProperty(\"__TAURI_METADATA__\")\n})\n```"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"sources":[{"fileName":"mocks.ts","line":186,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/mocks.ts#L186"}],"type":{"type":"intrinsic","name":"void"}}]},{"id":32,"name":"mockIPC","variant":"declaration","kind":64,"flags":{},"sources":[{"fileName":"mocks.ts","line":80,"character":16,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/mocks.ts#L80"}],"signatures":[{"id":33,"name":"mockIPC","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Intercepts all IPC requests with the given mock handler.\n\nThis function can be used when testing tauri frontend applications or when running the frontend in a Node.js context during static site generation.\n\n# Examples\n\nTesting setup using vitest:\n"},{"kind":"code","text":"```js\nimport { mockIPC, clearMocks } from \"@tauri-apps/api/mocks\"\nimport { invoke } from \"@tauri-apps/api/tauri\"\n\nafterEach(() => {\n clearMocks()\n})\n\ntest(\"mocked command\", () => {\n mockIPC((cmd, args) => {\n switch (cmd) {\n case \"add\":\n return (args.a as number) + (args.b as number);\n default:\n break;\n }\n });\n\n expect(invoke('add', { a: 12, b: 15 })).resolves.toBe(27);\n})\n```"},{"kind":"text","text":"\n\nThe callback function can also return a Promise:\n"},{"kind":"code","text":"```js\nimport { mockIPC, clearMocks } from \"@tauri-apps/api/mocks\"\nimport { invoke } from \"@tauri-apps/api/tauri\"\n\nafterEach(() => {\n clearMocks()\n})\n\ntest(\"mocked command\", () => {\n mockIPC((cmd, args) => {\n if(cmd === \"get_data\") {\n return fetch(\"https://example.com/data.json\")\n .then((response) => response.json())\n }\n });\n\n expect(invoke('get_data')).resolves.toBe({ foo: 'bar' });\n})\n```"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"sources":[{"fileName":"mocks.ts","line":80,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/mocks.ts#L80"}],"parameters":[{"id":34,"name":"cb","variant":"param","kind":32768,"flags":{},"type":{"type":"reflection","declaration":{"id":35,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"mocks.ts","line":81,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/mocks.ts#L81"}],"signatures":[{"id":36,"name":"__type","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"mocks.ts","line":81,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/mocks.ts#L81"}],"parameters":[{"id":37,"name":"cmd","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":38,"name":"args","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":{"sourceFileName":"node_modules/typescript/lib/lib.es5.d.ts","qualifiedName":"Record"},"typeArguments":[{"type":"intrinsic","name":"string"},{"type":"intrinsic","name":"unknown"}],"name":"Record","package":"typescript","externalUrl":"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type"}}],"type":{"type":"intrinsic","name":"any"}}]}}}],"type":{"type":"intrinsic","name":"void"}}]},{"id":39,"name":"mockWindows","variant":"declaration","kind":64,"flags":{},"sources":[{"fileName":"mocks.ts","line":150,"character":16,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/mocks.ts#L150"}],"signatures":[{"id":40,"name":"mockWindows","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Mocks one or many window labels.\nIn non-tauri context it is required to call this function *before* using the "},{"kind":"code","text":"`@tauri-apps/api/window`"},{"kind":"text","text":" module.\n\nThis function only mocks the *presence* of windows,\nwindow properties (e.g. width and height) can be mocked like regular IPC calls using the "},{"kind":"code","text":"`mockIPC`"},{"kind":"text","text":" function.\n\n# Examples\n\n"},{"kind":"code","text":"```js\nimport { mockWindows } from \"@tauri-apps/api/mocks\";\nimport { getCurrent } from \"@tauri-apps/api/window\";\n\nmockWindows(\"main\", \"second\", \"third\");\n\nconst win = getCurrent();\n\nwin.label // \"main\"\n```"},{"kind":"text","text":"\n\n"},{"kind":"code","text":"```js\nimport { mockWindows } from \"@tauri-apps/api/mocks\";\n\nmockWindows(\"main\", \"second\", \"third\");\n\nmockIPC((cmd, args) => {\n if (cmd === \"tauri\") {\n if (\n args?.__tauriModule === \"Window\" &&\n args?.message?.cmd === \"manage\" &&\n args?.message?.data?.cmd?.type === \"close\"\n ) {\n console.log('closing window!');\n }\n }\n});\n\nconst { getCurrent } = await import(\"@tauri-apps/api/window\");\n\nconst win = getCurrent();\nawait win.close(); // this will cause the mocked IPC handler to log to the console.\n```"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"sources":[{"fileName":"mocks.ts","line":150,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/mocks.ts#L150"}],"parameters":[{"id":41,"name":"current","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"Label of window this JavaScript context is running in."}]},"type":{"type":"intrinsic","name":"string"}},{"id":42,"name":"additionalWindows","variant":"param","kind":32768,"flags":{"isRest":true},"comment":{"summary":[{"kind":"text","text":"Label of additional windows the app has."}]},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}}],"type":{"type":"intrinsic","name":"void"}}]}],"groups":[{"title":"Functions","children":[43,32,39]}],"sources":[{"fileName":"mocks.ts","line":1,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/mocks.ts#L1"}]},{"id":45,"name":"tauri","variant":"declaration","kind":2,"flags":{},"comment":{"summary":[{"kind":"text","text":"Invoke your custom commands.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.tauri`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":"."}]},"children":[{"id":54,"name":"Channel","variant":"declaration","kind":128,"flags":{},"children":[{"id":55,"name":"constructor","variant":"declaration","kind":512,"flags":{},"sources":[{"fileName":"tauri.ts","line":66,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L66"}],"signatures":[{"id":56,"name":"new Channel","variant":"signature","kind":16384,"flags":{},"sources":[{"fileName":"tauri.ts","line":66,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L66"}],"typeParameter":[{"id":57,"name":"T","variant":"typeParam","kind":131072,"flags":{},"default":{"type":"intrinsic","name":"unknown"}}],"type":{"type":"reference","target":54,"typeArguments":[{"type":"reference","target":-1,"name":"T","refersToTypeParameter":true}],"name":"Channel","package":"@tauri-apps/api"}}]},{"id":60,"name":"#onmessage","variant":"declaration","kind":1024,"flags":{"isPrivate":true},"sources":[{"fileName":"tauri.ts","line":62,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L62"}],"type":{"type":"reflection","declaration":{"id":61,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"tauri.ts","line":62,"character":14,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L62"}],"signatures":[{"id":62,"name":"__type","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"tauri.ts","line":62,"character":14,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L62"}],"parameters":[{"id":63,"name":"response","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":-1,"name":"T","refersToTypeParameter":true}}],"type":{"type":"intrinsic","name":"void"}}]}},"defaultValue":"..."},{"id":59,"name":"__TAURI_CHANNEL_MARKER__","variant":"declaration","kind":1024,"flags":{"isPrivate":true,"isReadonly":true},"sources":[{"fileName":"tauri.ts","line":61,"character":19,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L61"}],"type":{"type":"literal","value":true},"defaultValue":"true"},{"id":58,"name":"id","variant":"declaration","kind":1024,"flags":{},"sources":[{"fileName":"tauri.ts","line":59,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L59"}],"type":{"type":"intrinsic","name":"number"}},{"id":64,"name":"onmessage","variant":"declaration","kind":262144,"flags":{},"sources":[{"fileName":"tauri.ts","line":72,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L72"},{"fileName":"tauri.ts","line":76,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L76"}],"getSignature":{"id":65,"name":"onmessage","variant":"signature","kind":524288,"flags":{},"sources":[{"fileName":"tauri.ts","line":76,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L76"}],"type":{"type":"reflection","declaration":{"id":66,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"tauri.ts","line":76,"character":19,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L76"}],"signatures":[{"id":67,"name":"__type","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"tauri.ts","line":76,"character":19,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L76"}],"parameters":[{"id":68,"name":"response","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":-1,"name":"T","refersToTypeParameter":true}}],"type":{"type":"intrinsic","name":"void"}}]}}},"setSignature":{"id":69,"name":"onmessage","variant":"signature","kind":1048576,"flags":{},"sources":[{"fileName":"tauri.ts","line":72,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L72"}],"parameters":[{"id":70,"name":"handler","variant":"param","kind":32768,"flags":{},"type":{"type":"reflection","declaration":{"id":71,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"tauri.ts","line":72,"character":25,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L72"}],"signatures":[{"id":72,"name":"__type","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"tauri.ts","line":72,"character":25,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L72"}],"parameters":[{"id":73,"name":"response","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":-1,"name":"T","refersToTypeParameter":true}}],"type":{"type":"intrinsic","name":"void"}}]}}}],"type":{"type":"intrinsic","name":"void"}}},{"id":74,"name":"toJSON","variant":"declaration","kind":2048,"flags":{},"sources":[{"fileName":"tauri.ts","line":80,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L80"}],"signatures":[{"id":75,"name":"toJSON","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"tauri.ts","line":80,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L80"}],"type":{"type":"intrinsic","name":"string"}}]}],"groups":[{"title":"Constructors","children":[55]},{"title":"Properties","children":[60,59,58]},{"title":"Accessors","children":[64]},{"title":"Methods","children":[74]}],"sources":[{"fileName":"tauri.ts","line":58,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L58"}],"typeParameters":[{"id":76,"name":"T","variant":"typeParam","kind":131072,"flags":{},"default":{"type":"intrinsic","name":"unknown"}}]},{"id":77,"name":"PluginListener","variant":"declaration","kind":128,"flags":{},"children":[{"id":78,"name":"constructor","variant":"declaration","kind":512,"flags":{},"sources":[{"fileName":"tauri.ts","line":90,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L90"}],"signatures":[{"id":79,"name":"new PluginListener","variant":"signature","kind":16384,"flags":{},"sources":[{"fileName":"tauri.ts","line":90,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L90"}],"parameters":[{"id":80,"name":"plugin","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":81,"name":"event","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":82,"name":"channelId","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"reference","target":77,"name":"PluginListener","package":"@tauri-apps/api"}}]},{"id":85,"name":"channelId","variant":"declaration","kind":1024,"flags":{},"sources":[{"fileName":"tauri.ts","line":88,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L88"}],"type":{"type":"intrinsic","name":"number"}},{"id":84,"name":"event","variant":"declaration","kind":1024,"flags":{},"sources":[{"fileName":"tauri.ts","line":87,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L87"}],"type":{"type":"intrinsic","name":"string"}},{"id":83,"name":"plugin","variant":"declaration","kind":1024,"flags":{},"sources":[{"fileName":"tauri.ts","line":86,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L86"}],"type":{"type":"intrinsic","name":"string"}},{"id":86,"name":"unregister","variant":"declaration","kind":2048,"flags":{},"sources":[{"fileName":"tauri.ts","line":96,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L96"}],"signatures":[{"id":87,"name":"unregister","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"tauri.ts","line":96,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L96"}],"type":{"type":"reference","target":{"sourceFileName":"node_modules/typescript/lib/lib.es5.d.ts","qualifiedName":"Promise"},"typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","package":"typescript","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise"}}]}],"groups":[{"title":"Constructors","children":[78]},{"title":"Properties","children":[85,84,83]},{"title":"Methods","children":[86]}],"sources":[{"fileName":"tauri.ts","line":85,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L85"}]},{"id":46,"name":"InvokeArgs","variant":"declaration","kind":4194304,"flags":{},"comment":{"summary":[{"kind":"text","text":"Command arguments."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"sources":[{"fileName":"tauri.ts","line":128,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L128"}],"type":{"type":"reference","target":{"sourceFileName":"node_modules/typescript/lib/lib.es5.d.ts","qualifiedName":"Record"},"typeArguments":[{"type":"intrinsic","name":"string"},{"type":"intrinsic","name":"unknown"}],"name":"Record","package":"typescript","externalUrl":"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type"}},{"id":88,"name":"addPluginListener","variant":"declaration","kind":64,"flags":{},"sources":[{"fileName":"tauri.ts","line":111,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L111"}],"signatures":[{"id":89,"name":"addPluginListener","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Adds a listener to a plugin event."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"The listener object to stop listening to the events."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"sources":[{"fileName":"tauri.ts","line":111,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L111"}],"typeParameter":[{"id":90,"name":"T","variant":"typeParam","kind":131072,"flags":{}}],"parameters":[{"id":91,"name":"plugin","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":92,"name":"event","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":93,"name":"cb","variant":"param","kind":32768,"flags":{},"type":{"type":"reflection","declaration":{"id":94,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"tauri.ts","line":114,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L114"}],"signatures":[{"id":95,"name":"__type","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"tauri.ts","line":114,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L114"}],"parameters":[{"id":96,"name":"payload","variant":"param","kind":32768,"flags":{},"type":{"type":"reference","target":-1,"name":"T","refersToTypeParameter":true}}],"type":{"type":"intrinsic","name":"void"}}]}}}],"type":{"type":"reference","target":{"sourceFileName":"node_modules/typescript/lib/lib.es5.d.ts","qualifiedName":"Promise"},"typeArguments":[{"type":"reference","target":77,"name":"PluginListener","package":"@tauri-apps/api"}],"name":"Promise","package":"typescript","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise"}}]},{"id":102,"name":"convertFileSrc","variant":"declaration","kind":64,"flags":{},"sources":[{"fileName":"tauri.ts","line":194,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L194"}],"signatures":[{"id":103,"name":"convertFileSrc","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Convert a device file path to an URL that can be loaded by the webview.\nNote that "},{"kind":"code","text":"`asset:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`https://asset.localhost`"},{"kind":"text","text":" must be added to ["},{"kind":"code","text":"`tauri.security.csp`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#securityconfig.csp) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":".\nExample CSP value: "},{"kind":"code","text":"`\"csp\": \"default-src 'self'; img-src 'self' asset: https://asset.localhost\"`"},{"kind":"text","text":" to use the asset protocol on image sources.\n\nAdditionally, "},{"kind":"code","text":"`asset`"},{"kind":"text","text":" must be added to ["},{"kind":"code","text":"`tauri.allowlist.protocol`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#allowlistconfig.protocol)\nin "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" and its access scope must be defined on the "},{"kind":"code","text":"`assetScope`"},{"kind":"text","text":" array on the same "},{"kind":"code","text":"`protocol`"},{"kind":"text","text":" object."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appDataDir, join } from '@tauri-apps/api/path';\nimport { convertFileSrc } from '@tauri-apps/api/tauri';\nconst appDataDirPath = await appDataDir();\nconst filePath = await join(appDataDirPath, 'assets/video.mp4');\nconst assetUrl = convertFileSrc(filePath);\n\nconst video = document.getElementById('my-video');\nconst source = document.createElement('source');\nsource.type = 'video/mp4';\nsource.src = assetUrl;\nvideo.appendChild(source);\nvideo.load();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"the URL that can be used as source on the webview."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"sources":[{"fileName":"tauri.ts","line":194,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L194"}],"parameters":[{"id":104,"name":"filePath","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The file path."}]},"type":{"type":"intrinsic","name":"string"}},{"id":105,"name":"protocol","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The protocol to use. Defaults to "},{"kind":"code","text":"`asset`"},{"kind":"text","text":". You only need to set this when using a custom protocol."}]},"type":{"type":"intrinsic","name":"string"},"defaultValue":"'asset'"}],"type":{"type":"intrinsic","name":"string"}}]},{"id":97,"name":"invoke","variant":"declaration","kind":64,"flags":{},"sources":[{"fileName":"tauri.ts","line":144,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L144"}],"signatures":[{"id":98,"name":"invoke","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Sends a message to the backend."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { invoke } from '@tauri-apps/api/tauri';\nawait invoke('login', { user: 'tauri', password: 'poiwe3h4r5ip3yrhtew9ty' });\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving or rejecting to the backend response."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"sources":[{"fileName":"tauri.ts","line":144,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L144"}],"typeParameter":[{"id":99,"name":"T","variant":"typeParam","kind":131072,"flags":{}}],"parameters":[{"id":100,"name":"cmd","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The command name."}]},"type":{"type":"intrinsic","name":"string"}},{"id":101,"name":"args","variant":"param","kind":32768,"flags":{},"comment":{"summary":[{"kind":"text","text":"The optional arguments to pass to the command."}]},"type":{"type":"reference","target":46,"name":"InvokeArgs","package":"@tauri-apps/api"},"defaultValue":"{}"}],"type":{"type":"reference","target":{"sourceFileName":"node_modules/typescript/lib/lib.es5.d.ts","qualifiedName":"Promise"},"typeArguments":[{"type":"reference","target":-1,"name":"T","refersToTypeParameter":true}],"name":"Promise","package":"typescript","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise"}}]},{"id":47,"name":"transformCallback","variant":"declaration","kind":64,"flags":{},"sources":[{"fileName":"tauri.ts","line":36,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L36"}],"signatures":[{"id":48,"name":"transformCallback","variant":"signature","kind":4096,"flags":{},"comment":{"summary":[{"kind":"text","text":"Transforms a callback function to a string identifier that can be passed to the backend.\nThe backend uses the identifier to "},{"kind":"code","text":"`eval()`"},{"kind":"text","text":" the callback."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"A unique identifier associated with the callback function."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"sources":[{"fileName":"tauri.ts","line":36,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L36"}],"parameters":[{"id":49,"name":"callback","variant":"param","kind":32768,"flags":{"isOptional":true},"type":{"type":"reflection","declaration":{"id":50,"name":"__type","variant":"declaration","kind":65536,"flags":{},"sources":[{"fileName":"tauri.ts","line":37,"character":13,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L37"}],"signatures":[{"id":51,"name":"__type","variant":"signature","kind":4096,"flags":{},"sources":[{"fileName":"tauri.ts","line":37,"character":13,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L37"}],"parameters":[{"id":52,"name":"response","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"intrinsic","name":"void"}}]}}},{"id":53,"name":"once","variant":"param","kind":32768,"flags":{},"type":{"type":"intrinsic","name":"boolean"},"defaultValue":"false"}],"type":{"type":"intrinsic","name":"number"}}]}],"groups":[{"title":"Classes","children":[54,77]},{"title":"Type Aliases","children":[46]},{"title":"Functions","children":[88,102,97,47]}],"sources":[{"fileName":"tauri.ts","line":1,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/1ed2600da/tooling/api/src/tauri.ts#L1"}]}],"groups":[{"title":"Modules","children":[1,31,45]}],"packageName":"@tauri-apps/api","symbolIdMap":{"1":{"sourceFileName":"src/event.ts","qualifiedName":""},"2":{"sourceFileName":"src/event.ts","qualifiedName":"EventName"},"3":{"sourceFileName":"src/event.ts","qualifiedName":"TauriEvent"},"4":{"sourceFileName":"src/event.ts","qualifiedName":"TauriEvent.WINDOW_RESIZED"},"5":{"sourceFileName":"src/event.ts","qualifiedName":"TauriEvent.WINDOW_MOVED"},"6":{"sourceFileName":"src/event.ts","qualifiedName":"TauriEvent.WINDOW_CLOSE_REQUESTED"},"7":{"sourceFileName":"src/event.ts","qualifiedName":"TauriEvent.WINDOW_CREATED"},"8":{"sourceFileName":"src/event.ts","qualifiedName":"TauriEvent.WINDOW_DESTROYED"},"9":{"sourceFileName":"src/event.ts","qualifiedName":"TauriEvent.WINDOW_FOCUS"},"10":{"sourceFileName":"src/event.ts","qualifiedName":"TauriEvent.WINDOW_BLUR"},"11":{"sourceFileName":"src/event.ts","qualifiedName":"TauriEvent.WINDOW_SCALE_FACTOR_CHANGED"},"12":{"sourceFileName":"src/event.ts","qualifiedName":"TauriEvent.WINDOW_THEME_CHANGED"},"13":{"sourceFileName":"src/event.ts","qualifiedName":"TauriEvent.WINDOW_FILE_DROP"},"14":{"sourceFileName":"src/event.ts","qualifiedName":"TauriEvent.WINDOW_FILE_DROP_HOVER"},"15":{"sourceFileName":"src/event.ts","qualifiedName":"TauriEvent.WINDOW_FILE_DROP_CANCELLED"},"16":{"sourceFileName":"src/event.ts","qualifiedName":"TauriEvent.MENU"},"17":{"sourceFileName":"src/event.ts","qualifiedName":"listen"},"18":{"sourceFileName":"src/event.ts","qualifiedName":"listen"},"19":{"sourceFileName":"src/event.ts","qualifiedName":"T"},"20":{"sourceFileName":"src/event.ts","qualifiedName":"event"},"21":{"sourceFileName":"src/event.ts","qualifiedName":"handler"},"22":{"sourceFileName":"src/event.ts","qualifiedName":"once"},"23":{"sourceFileName":"src/event.ts","qualifiedName":"once"},"24":{"sourceFileName":"src/event.ts","qualifiedName":"T"},"25":{"sourceFileName":"src/event.ts","qualifiedName":"event"},"26":{"sourceFileName":"src/event.ts","qualifiedName":"handler"},"27":{"sourceFileName":"src/event.ts","qualifiedName":"emit"},"28":{"sourceFileName":"src/event.ts","qualifiedName":"emit"},"29":{"sourceFileName":"src/event.ts","qualifiedName":"event"},"30":{"sourceFileName":"src/event.ts","qualifiedName":"payload"},"31":{"sourceFileName":"src/mocks.ts","qualifiedName":""},"32":{"sourceFileName":"src/mocks.ts","qualifiedName":"mockIPC"},"33":{"sourceFileName":"src/mocks.ts","qualifiedName":"mockIPC"},"34":{"sourceFileName":"src/mocks.ts","qualifiedName":"cb"},"35":{"sourceFileName":"src/mocks.ts","qualifiedName":"__type"},"36":{"sourceFileName":"src/mocks.ts","qualifiedName":"__type"},"37":{"sourceFileName":"src/mocks.ts","qualifiedName":"cmd"},"38":{"sourceFileName":"src/mocks.ts","qualifiedName":"args"},"39":{"sourceFileName":"src/mocks.ts","qualifiedName":"mockWindows"},"40":{"sourceFileName":"src/mocks.ts","qualifiedName":"mockWindows"},"41":{"sourceFileName":"src/mocks.ts","qualifiedName":"current"},"42":{"sourceFileName":"src/mocks.ts","qualifiedName":"additionalWindows"},"43":{"sourceFileName":"src/mocks.ts","qualifiedName":"clearMocks"},"44":{"sourceFileName":"src/mocks.ts","qualifiedName":"clearMocks"},"45":{"sourceFileName":"src/tauri.ts","qualifiedName":""},"46":{"sourceFileName":"src/tauri.ts","qualifiedName":"InvokeArgs"},"47":{"sourceFileName":"src/tauri.ts","qualifiedName":"transformCallback"},"48":{"sourceFileName":"src/tauri.ts","qualifiedName":"transformCallback"},"49":{"sourceFileName":"src/tauri.ts","qualifiedName":"callback"},"50":{"sourceFileName":"src/tauri.ts","qualifiedName":"__type"},"51":{"sourceFileName":"src/tauri.ts","qualifiedName":"__type"},"52":{"sourceFileName":"src/tauri.ts","qualifiedName":"response"},"53":{"sourceFileName":"src/tauri.ts","qualifiedName":"once"},"54":{"sourceFileName":"src/tauri.ts","qualifiedName":"Channel"},"55":{"sourceFileName":"src/tauri.ts","qualifiedName":"Channel.__constructor"},"56":{"sourceFileName":"src/tauri.ts","qualifiedName":"Channel"},"57":{"sourceFileName":"src/tauri.ts","qualifiedName":"Channel.T"},"58":{"sourceFileName":"src/tauri.ts","qualifiedName":"Channel.id"},"59":{"sourceFileName":"src/tauri.ts","qualifiedName":"Channel.__TAURI_CHANNEL_MARKER__"},"60":{"sourceFileName":"src/tauri.ts","qualifiedName":"Channel.#onmessage"},"61":{"sourceFileName":"src/tauri.ts","qualifiedName":"__type"},"62":{"sourceFileName":"src/tauri.ts","qualifiedName":"__type"},"63":{"sourceFileName":"src/tauri.ts","qualifiedName":"response"},"64":{"sourceFileName":"src/tauri.ts","qualifiedName":"Channel.onmessage"},"65":{"sourceFileName":"src/tauri.ts","qualifiedName":"Channel.onmessage"},"66":{"sourceFileName":"src/tauri.ts","qualifiedName":"__type"},"67":{"sourceFileName":"src/tauri.ts","qualifiedName":"__type"},"68":{"sourceFileName":"src/tauri.ts","qualifiedName":"response"},"69":{"sourceFileName":"src/tauri.ts","qualifiedName":"Channel.onmessage"},"70":{"sourceFileName":"src/tauri.ts","qualifiedName":"handler"},"71":{"sourceFileName":"src/tauri.ts","qualifiedName":"__type"},"72":{"sourceFileName":"src/tauri.ts","qualifiedName":"__type"},"73":{"sourceFileName":"src/tauri.ts","qualifiedName":"response"},"74":{"sourceFileName":"src/tauri.ts","qualifiedName":"Channel.toJSON"},"75":{"sourceFileName":"src/tauri.ts","qualifiedName":"Channel.toJSON"},"76":{"sourceFileName":"src/tauri.ts","qualifiedName":"Channel.T"},"77":{"sourceFileName":"src/tauri.ts","qualifiedName":"PluginListener"},"78":{"sourceFileName":"src/tauri.ts","qualifiedName":"PluginListener.__constructor"},"79":{"sourceFileName":"src/tauri.ts","qualifiedName":"PluginListener"},"80":{"sourceFileName":"src/tauri.ts","qualifiedName":"plugin"},"81":{"sourceFileName":"src/tauri.ts","qualifiedName":"event"},"82":{"sourceFileName":"src/tauri.ts","qualifiedName":"channelId"},"83":{"sourceFileName":"src/tauri.ts","qualifiedName":"PluginListener.plugin"},"84":{"sourceFileName":"src/tauri.ts","qualifiedName":"PluginListener.event"},"85":{"sourceFileName":"src/tauri.ts","qualifiedName":"PluginListener.channelId"},"86":{"sourceFileName":"src/tauri.ts","qualifiedName":"PluginListener.unregister"},"87":{"sourceFileName":"src/tauri.ts","qualifiedName":"PluginListener.unregister"},"88":{"sourceFileName":"src/tauri.ts","qualifiedName":"addPluginListener"},"89":{"sourceFileName":"src/tauri.ts","qualifiedName":"addPluginListener"},"90":{"sourceFileName":"src/tauri.ts","qualifiedName":"T"},"91":{"sourceFileName":"src/tauri.ts","qualifiedName":"plugin"},"92":{"sourceFileName":"src/tauri.ts","qualifiedName":"event"},"93":{"sourceFileName":"src/tauri.ts","qualifiedName":"cb"},"94":{"sourceFileName":"src/tauri.ts","qualifiedName":"__type"},"95":{"sourceFileName":"src/tauri.ts","qualifiedName":"__type"},"96":{"sourceFileName":"src/tauri.ts","qualifiedName":"payload"},"97":{"sourceFileName":"src/tauri.ts","qualifiedName":"invoke"},"98":{"sourceFileName":"src/tauri.ts","qualifiedName":"invoke"},"99":{"sourceFileName":"src/tauri.ts","qualifiedName":"T"},"100":{"sourceFileName":"src/tauri.ts","qualifiedName":"cmd"},"101":{"sourceFileName":"src/tauri.ts","qualifiedName":"args"},"102":{"sourceFileName":"src/tauri.ts","qualifiedName":"convertFileSrc"},"103":{"sourceFileName":"src/tauri.ts","qualifiedName":"convertFileSrc"},"104":{"sourceFileName":"src/tauri.ts","qualifiedName":"filePath"},"105":{"sourceFileName":"src/tauri.ts","qualifiedName":"protocol"},"106":{"sourceFileName":"src/helpers/event.ts","qualifiedName":"Event"},"107":{"sourceFileName":"src/helpers/event.ts","qualifiedName":"Event.event"},"108":{"sourceFileName":"src/helpers/event.ts","qualifiedName":"Event.windowLabel"},"109":{"sourceFileName":"src/helpers/event.ts","qualifiedName":"Event.id"},"110":{"sourceFileName":"src/helpers/event.ts","qualifiedName":"Event.payload"},"111":{"sourceFileName":"src/helpers/event.ts","qualifiedName":"Event.T"},"112":{"sourceFileName":"src/helpers/event.ts","qualifiedName":"EventCallback"},"113":{"sourceFileName":"src/helpers/event.ts","qualifiedName":"__type"},"114":{"sourceFileName":"src/helpers/event.ts","qualifiedName":"__type"},"115":{"sourceFileName":"src/helpers/event.ts","qualifiedName":"event"},"116":{"sourceFileName":"src/helpers/event.ts","qualifiedName":"T"},"117":{"sourceFileName":"src/helpers/event.ts","qualifiedName":"UnlistenFn"},"118":{"sourceFileName":"src/helpers/event.ts","qualifiedName":"__type"},"119":{"sourceFileName":"src/helpers/event.ts","qualifiedName":"__type"}}} \ No newline at end of file +{"id":0,"name":"@tauri-apps/api","kind":1,"flags":{},"originalName":"","children":[{"id":1,"name":"event","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"The event system allows you to emit events to the backend and listen to events from it.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.event`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":"."}]},"children":[{"id":36,"name":"TauriEvent","kind":8,"kindString":"Enumeration","flags":{},"comment":{"summary":[],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.1.0"}]}]},"children":[{"id":49,"name":"MENU","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":59,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L59"}],"type":{"type":"literal","value":"tauri://menu"}},{"id":43,"name":"WINDOW_BLUR","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":53,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L53"}],"type":{"type":"literal","value":"tauri://blur"}},{"id":39,"name":"WINDOW_CLOSE_REQUESTED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":49,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L49"}],"type":{"type":"literal","value":"tauri://close-requested"}},{"id":40,"name":"WINDOW_CREATED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":50,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L50"}],"type":{"type":"literal","value":"tauri://window-created"}},{"id":41,"name":"WINDOW_DESTROYED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":51,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L51"}],"type":{"type":"literal","value":"tauri://destroyed"}},{"id":46,"name":"WINDOW_FILE_DROP","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":56,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L56"}],"type":{"type":"literal","value":"tauri://file-drop"}},{"id":48,"name":"WINDOW_FILE_DROP_CANCELLED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":58,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L58"}],"type":{"type":"literal","value":"tauri://file-drop-cancelled"}},{"id":47,"name":"WINDOW_FILE_DROP_HOVER","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":57,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L57"}],"type":{"type":"literal","value":"tauri://file-drop-hover"}},{"id":42,"name":"WINDOW_FOCUS","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":52,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L52"}],"type":{"type":"literal","value":"tauri://focus"}},{"id":38,"name":"WINDOW_MOVED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":48,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L48"}],"type":{"type":"literal","value":"tauri://move"}},{"id":37,"name":"WINDOW_RESIZED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":47,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L47"}],"type":{"type":"literal","value":"tauri://resize"}},{"id":44,"name":"WINDOW_SCALE_FACTOR_CHANGED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":54,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L54"}],"type":{"type":"literal","value":"tauri://scale-change"}},{"id":45,"name":"WINDOW_THEME_CHANGED","kind":16,"kindString":"Enumeration Member","flags":{},"sources":[{"fileName":"event.ts","line":55,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L55"}],"type":{"type":"literal","value":"tauri://theme-changed"}}],"groups":[{"title":"Enumeration Members","children":[49,43,39,40,41,46,48,47,42,38,37,44,45]}],"sources":[{"fileName":"event.ts","line":46,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L46"}]},{"id":2,"name":"Event","kind":256,"kindString":"Interface","flags":{},"children":[{"id":3,"name":"event","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name"}]},"sources":[{"fileName":"event.ts","line":16,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L16"}],"type":{"type":"reference","id":16,"name":"EventName"}},{"id":5,"name":"id","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Event identifier used to unlisten"}]},"sources":[{"fileName":"event.ts","line":20,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L20"}],"type":{"type":"intrinsic","name":"number"}},{"id":6,"name":"payload","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"Event payload"}]},"sources":[{"fileName":"event.ts","line":22,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L22"}],"type":{"type":"reference","id":7,"name":"T"}},{"id":4,"name":"windowLabel","kind":1024,"kindString":"Property","flags":{},"comment":{"summary":[{"kind":"text","text":"The label of the window that emitted this event."}]},"sources":[{"fileName":"event.ts","line":18,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L18"}],"type":{"type":"intrinsic","name":"string"}}],"groups":[{"title":"Properties","children":[3,5,6,4]}],"sources":[{"fileName":"event.ts","line":14,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L14"}],"typeParameters":[{"id":7,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}]},{"id":17,"name":"Options","kind":256,"kindString":"Interface","flags":{},"children":[{"id":18,"name":"target","kind":1024,"kindString":"Property","flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Label of the window the function targets.\n\nWhen listening to events and using this value,\nonly events triggered by the window with the given label are received.\n\nWhen emitting events, only the window with the given label will receive it."}]},"sources":[{"fileName":"event.ts","line":40,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L40"}],"type":{"type":"intrinsic","name":"string"}}],"groups":[{"title":"Properties","children":[18]}],"sources":[{"fileName":"event.ts","line":31,"character":10,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L31"}]},{"id":8,"name":"EventCallback","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"event.ts","line":25,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L25"}],"typeParameters":[{"id":12,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"type":{"type":"reflection","declaration":{"id":9,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"event.ts","line":25,"character":24,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L25"}],"signatures":[{"id":10,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":11,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":2,"typeArguments":[{"type":"reference","id":12,"name":"T"}],"name":"Event"}}],"type":{"type":"intrinsic","name":"void"}}]}}},{"id":16,"name":"EventName","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"event.ts","line":29,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L29"}],"type":{"type":"union","types":[{"type":"template-literal","head":"","tail":[[{"type":"reference","id":36,"name":"TauriEvent"},""]]},{"type":"intersection","types":[{"type":"intrinsic","name":"string"},{"type":"reference","typeArguments":[{"type":"intrinsic","name":"never"},{"type":"intrinsic","name":"never"}],"name":"Record","qualifiedName":"Record","package":"typescript"}]}]}},{"id":13,"name":"UnlistenFn","kind":4194304,"kindString":"Type alias","flags":{},"sources":[{"fileName":"event.ts","line":27,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L27"}],"type":{"type":"reflection","declaration":{"id":14,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"event.ts","line":27,"character":18,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L27"}],"signatures":[{"id":15,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"intrinsic","name":"void"}}]}}},{"id":31,"name":"emit","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"event.ts","line":163,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L163"}],"signatures":[{"id":32,"name":"emit","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Emits an event to the backend."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { emit } from '@tauri-apps/api/event';\nawait emit('frontend-loaded', { loggedIn: true, token: 'authToken' });\n```"}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":33,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"intrinsic","name":"string"}},{"id":34,"name":"payload","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"unknown"}},{"id":35,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","id":17,"name":"Options"}}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":19,"name":"listen","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"event.ts","line":98,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L98"}],"signatures":[{"id":20,"name":"listen","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to an event from the backend."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { listen } from '@tauri-apps/api/event';\nconst unlisten = await listen('error', (event) => {\n console.log(`Got error in window ${event.windowLabel}, payload: ${event.payload}`);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"typeParameter":[{"id":21,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":22,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"reference","id":16,"name":"EventName"}},{"id":23,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event handler callback."}]},"type":{"type":"reference","id":8,"typeArguments":[{"type":"reference","id":21,"name":"T"}],"name":"EventCallback"}},{"id":24,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","id":17,"name":"Options"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":13,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":25,"name":"once","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"event.ts","line":136,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L136"}],"signatures":[{"id":26,"name":"once","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Listen to an one-off event from the backend."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { once } from '@tauri-apps/api/event';\ninterface LoadedPayload {\n loggedIn: boolean,\n token: string\n}\nconst unlisten = await once('loaded', (event) => {\n console.log(`App is loaded, loggedIn: ${event.payload.loggedIn}, token: ${event.payload.token}`);\n});\n\n// you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\nunlisten();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving to a function to unlisten to the event.\nNote that removing the listener is required if your listener goes out of scope e.g. the component is unmounted."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"typeParameter":[{"id":27,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":28,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Event name. Must include only alphanumeric characters, "},{"kind":"code","text":"`-`"},{"kind":"text","text":", "},{"kind":"code","text":"`/`"},{"kind":"text","text":", "},{"kind":"code","text":"`:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`_`"},{"kind":"text","text":"."}]},"type":{"type":"reference","id":16,"name":"EventName"}},{"id":29,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":8,"typeArguments":[{"type":"reference","id":27,"name":"T"}],"name":"EventCallback"}},{"id":30,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reference","id":17,"name":"Options"}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":13,"name":"UnlistenFn"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Enumerations","children":[36]},{"title":"Interfaces","children":[2,17]},{"title":"Type Aliases","children":[8,16,13]},{"title":"Functions","children":[31,19,25]}],"sources":[{"fileName":"event.ts","line":12,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/event.ts#L12"}]},{"id":50,"name":"mocks","kind":2,"kindString":"Module","flags":{},"children":[{"id":62,"name":"clearMocks","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"mocks.ts","line":186,"character":16,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/mocks.ts#L186"}],"signatures":[{"id":63,"name":"clearMocks","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Clears mocked functions/data injected by the other functions in this module.\nWhen using a test runner that doesn't provide a fresh window object for each test, calling this function will reset tauri specific properties.\n\n# Example\n\n"},{"kind":"code","text":"```js\nimport { mockWindows, clearMocks } from \"@tauri-apps/api/mocks\"\n\nafterEach(() => {\n clearMocks()\n})\n\ntest(\"mocked windows\", () => {\n mockWindows(\"main\", \"second\", \"third\");\n\n expect(window).toHaveProperty(\"__TAURI_METADATA__\")\n})\n\ntest(\"no mocked windows\", () => {\n expect(window).not.toHaveProperty(\"__TAURI_METADATA__\")\n})\n```"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"type":{"type":"intrinsic","name":"void"}}]},{"id":51,"name":"mockIPC","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"mocks.ts","line":80,"character":16,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/mocks.ts#L80"}],"signatures":[{"id":52,"name":"mockIPC","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Intercepts all IPC requests with the given mock handler.\n\nThis function can be used when testing tauri frontend applications or when running the frontend in a Node.js context during static site generation.\n\n# Examples\n\nTesting setup using vitest:\n"},{"kind":"code","text":"```js\nimport { mockIPC, clearMocks } from \"@tauri-apps/api/mocks\"\nimport { invoke } from \"@tauri-apps/api/tauri\"\n\nafterEach(() => {\n clearMocks()\n})\n\ntest(\"mocked command\", () => {\n mockIPC((cmd, args) => {\n switch (cmd) {\n case \"add\":\n return (args.a as number) + (args.b as number);\n default:\n break;\n }\n });\n\n expect(invoke('add', { a: 12, b: 15 })).resolves.toBe(27);\n})\n```"},{"kind":"text","text":"\n\nThe callback function can also return a Promise:\n"},{"kind":"code","text":"```js\nimport { mockIPC, clearMocks } from \"@tauri-apps/api/mocks\"\nimport { invoke } from \"@tauri-apps/api/tauri\"\n\nafterEach(() => {\n clearMocks()\n})\n\ntest(\"mocked command\", () => {\n mockIPC((cmd, args) => {\n if(cmd === \"get_data\") {\n return fetch(\"https://example.com/data.json\")\n .then((response) => response.json())\n }\n });\n\n expect(invoke('get_data')).resolves.toBe({ foo: 'bar' });\n})\n```"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":53,"name":"cb","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":54,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"mocks.ts","line":81,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/mocks.ts#L81"}],"signatures":[{"id":55,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":56,"name":"cmd","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":57,"name":"args","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"},{"type":"intrinsic","name":"unknown"}],"name":"Record","qualifiedName":"Record","package":"typescript"}}],"type":{"type":"intrinsic","name":"any"}}]}}}],"type":{"type":"intrinsic","name":"void"}}]},{"id":58,"name":"mockWindows","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"mocks.ts","line":150,"character":16,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/mocks.ts#L150"}],"signatures":[{"id":59,"name":"mockWindows","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Mocks one or many window labels.\nIn non-tauri context it is required to call this function *before* using the "},{"kind":"code","text":"`@tauri-apps/api/window`"},{"kind":"text","text":" module.\n\nThis function only mocks the *presence* of windows,\nwindow properties (e.g. width and height) can be mocked like regular IPC calls using the "},{"kind":"code","text":"`mockIPC`"},{"kind":"text","text":" function.\n\n# Examples\n\n"},{"kind":"code","text":"```js\nimport { mockWindows } from \"@tauri-apps/api/mocks\";\nimport { getCurrent } from \"@tauri-apps/api/window\";\n\nmockWindows(\"main\", \"second\", \"third\");\n\nconst win = getCurrent();\n\nwin.label // \"main\"\n```"},{"kind":"text","text":"\n\n"},{"kind":"code","text":"```js\nimport { mockWindows } from \"@tauri-apps/api/mocks\";\n\nmockWindows(\"main\", \"second\", \"third\");\n\nmockIPC((cmd, args) => {\n if (cmd === \"tauri\") {\n if (\n args?.__tauriModule === \"Window\" &&\n args?.message?.cmd === \"manage\" &&\n args?.message?.data?.cmd?.type === \"close\"\n ) {\n console.log('closing window!');\n }\n }\n});\n\nconst { getCurrent } = await import(\"@tauri-apps/api/window\");\n\nconst win = getCurrent();\nawait win.close(); // this will cause the mocked IPC handler to log to the console.\n```"}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":60,"name":"current","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"Label of window this JavaScript context is running in."}]},"type":{"type":"intrinsic","name":"string"}},{"id":61,"name":"additionalWindows","kind":32768,"kindString":"Parameter","flags":{"isRest":true},"comment":{"summary":[{"kind":"text","text":"Label of additional windows the app has."}]},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}}],"type":{"type":"intrinsic","name":"void"}}]}],"groups":[{"title":"Functions","children":[62,51,58]}],"sources":[{"fileName":"mocks.ts","line":6,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/mocks.ts#L6"}]},{"id":64,"name":"tauri","kind":2,"kindString":"Module","flags":{},"comment":{"summary":[{"kind":"text","text":"Invoke your custom commands.\n\nThis package is also accessible with "},{"kind":"code","text":"`window.__TAURI__.tauri`"},{"kind":"text","text":" when ["},{"kind":"code","text":"`build.withGlobalTauri`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" is set to "},{"kind":"code","text":"`true`"},{"kind":"text","text":"."}]},"children":[{"id":73,"name":"Channel","kind":128,"kindString":"Class","flags":{},"children":[{"id":74,"name":"constructor","kind":512,"kindString":"Constructor","flags":{},"sources":[{"fileName":"tauri.ts","line":66,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/tauri.ts#L66"}],"signatures":[{"id":75,"name":"new Channel","kind":16384,"kindString":"Constructor signature","flags":{},"typeParameter":[{"id":76,"name":"T","kind":131072,"kindString":"Type parameter","flags":{},"default":{"type":"intrinsic","name":"unknown"}}],"type":{"type":"reference","id":73,"typeArguments":[{"type":"reference","id":76,"name":"T"}],"name":"Channel"}}]},{"id":79,"name":"#onmessage","kind":1024,"kindString":"Property","flags":{"isPrivate":true},"sources":[{"fileName":"tauri.ts","line":62,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/tauri.ts#L62"}],"type":{"type":"reflection","declaration":{"id":80,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"tauri.ts","line":62,"character":14,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/tauri.ts#L62"}],"signatures":[{"id":81,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":82,"name":"response","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":76,"name":"T"}}],"type":{"type":"intrinsic","name":"void"}}]}},"defaultValue":"..."},{"id":78,"name":"__TAURI_CHANNEL_MARKER__","kind":1024,"kindString":"Property","flags":{"isPrivate":true,"isReadonly":true},"sources":[{"fileName":"tauri.ts","line":61,"character":19,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/tauri.ts#L61"}],"type":{"type":"literal","value":true},"defaultValue":"true"},{"id":77,"name":"id","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"tauri.ts","line":59,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/tauri.ts#L59"}],"type":{"type":"intrinsic","name":"number"}},{"id":83,"name":"onmessage","kind":262144,"kindString":"Accessor","flags":{},"sources":[{"fileName":"tauri.ts","line":72,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/tauri.ts#L72"},{"fileName":"tauri.ts","line":76,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/tauri.ts#L76"}],"getSignature":{"id":84,"name":"onmessage","kind":524288,"kindString":"Get signature","flags":{},"type":{"type":"reflection","declaration":{"id":85,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"tauri.ts","line":76,"character":19,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/tauri.ts#L76"}],"signatures":[{"id":86,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":87,"name":"response","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":76,"name":"T"}}],"type":{"type":"intrinsic","name":"void"}}]}}},"setSignature":{"id":88,"name":"onmessage","kind":1048576,"kindString":"Set signature","flags":{},"parameters":[{"id":89,"name":"handler","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":90,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"tauri.ts","line":72,"character":25,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/tauri.ts#L72"}],"signatures":[{"id":91,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":92,"name":"response","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":76,"name":"T"}}],"type":{"type":"intrinsic","name":"void"}}]}}}],"type":{"type":"intrinsic","name":"void"}}},{"id":93,"name":"toJSON","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"tauri.ts","line":80,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/tauri.ts#L80"}],"signatures":[{"id":94,"name":"toJSON","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"intrinsic","name":"string"}}]}],"groups":[{"title":"Constructors","children":[74]},{"title":"Properties","children":[79,78,77]},{"title":"Accessors","children":[83]},{"title":"Methods","children":[93]}],"sources":[{"fileName":"tauri.ts","line":58,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/tauri.ts#L58"}],"typeParameters":[{"id":95,"name":"T","kind":131072,"kindString":"Type parameter","flags":{},"default":{"type":"intrinsic","name":"unknown"}}]},{"id":96,"name":"PluginListener","kind":128,"kindString":"Class","flags":{},"children":[{"id":97,"name":"constructor","kind":512,"kindString":"Constructor","flags":{},"sources":[{"fileName":"tauri.ts","line":90,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/tauri.ts#L90"}],"signatures":[{"id":98,"name":"new PluginListener","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":99,"name":"plugin","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":100,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":101,"name":"channelId","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"number"}}],"type":{"type":"reference","id":96,"name":"PluginListener"}}]},{"id":104,"name":"channelId","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"tauri.ts","line":88,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/tauri.ts#L88"}],"type":{"type":"intrinsic","name":"number"}},{"id":103,"name":"event","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"tauri.ts","line":87,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/tauri.ts#L87"}],"type":{"type":"intrinsic","name":"string"}},{"id":102,"name":"plugin","kind":1024,"kindString":"Property","flags":{},"sources":[{"fileName":"tauri.ts","line":86,"character":2,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/tauri.ts#L86"}],"type":{"type":"intrinsic","name":"string"}},{"id":105,"name":"unregister","kind":2048,"kindString":"Method","flags":{},"sources":[{"fileName":"tauri.ts","line":96,"character":8,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/tauri.ts#L96"}],"signatures":[{"id":106,"name":"unregister","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"void"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]}],"groups":[{"title":"Constructors","children":[97]},{"title":"Properties","children":[104,103,102]},{"title":"Methods","children":[105]}],"sources":[{"fileName":"tauri.ts","line":85,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/tauri.ts#L85"}]},{"id":65,"name":"InvokeArgs","kind":4194304,"kindString":"Type alias","flags":{},"comment":{"summary":[{"kind":"text","text":"Command arguments."}],"blockTags":[{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"sources":[{"fileName":"tauri.ts","line":128,"character":5,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/tauri.ts#L128"}],"type":{"type":"reference","typeArguments":[{"type":"intrinsic","name":"string"},{"type":"intrinsic","name":"unknown"}],"name":"Record","qualifiedName":"Record","package":"typescript"}},{"id":107,"name":"addPluginListener","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"tauri.ts","line":111,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/tauri.ts#L111"}],"signatures":[{"id":108,"name":"addPluginListener","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Adds a listener to a plugin event."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"The listener object to stop listening to the events."}]},{"tag":"@since","content":[{"kind":"text","text":"2.0.0"}]}]},"typeParameter":[{"id":109,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":110,"name":"plugin","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":111,"name":"event","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"string"}},{"id":112,"name":"cb","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reflection","declaration":{"id":113,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"tauri.ts","line":114,"character":6,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/tauri.ts#L114"}],"signatures":[{"id":114,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":115,"name":"payload","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"reference","id":109,"name":"T"}}],"type":{"type":"intrinsic","name":"void"}}]}}}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":96,"name":"PluginListener"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":121,"name":"convertFileSrc","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"tauri.ts","line":194,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/tauri.ts#L194"}],"signatures":[{"id":122,"name":"convertFileSrc","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Convert a device file path to an URL that can be loaded by the webview.\nNote that "},{"kind":"code","text":"`asset:`"},{"kind":"text","text":" and "},{"kind":"code","text":"`https://asset.localhost`"},{"kind":"text","text":" must be added to ["},{"kind":"code","text":"`tauri.security.csp`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#securityconfig.csp) in "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":".\nExample CSP value: "},{"kind":"code","text":"`\"csp\": \"default-src 'self'; img-src 'self' asset: https://asset.localhost\"`"},{"kind":"text","text":" to use the asset protocol on image sources.\n\nAdditionally, "},{"kind":"code","text":"`asset`"},{"kind":"text","text":" must be added to ["},{"kind":"code","text":"`tauri.allowlist.protocol`"},{"kind":"text","text":"](https://tauri.app/v1/api/config/#allowlistconfig.protocol)\nin "},{"kind":"code","text":"`tauri.conf.json`"},{"kind":"text","text":" and its access scope must be defined on the "},{"kind":"code","text":"`assetScope`"},{"kind":"text","text":" array on the same "},{"kind":"code","text":"`protocol`"},{"kind":"text","text":" object."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { appDataDir, join } from '@tauri-apps/api/path';\nimport { convertFileSrc } from '@tauri-apps/api/tauri';\nconst appDataDirPath = await appDataDir();\nconst filePath = await join(appDataDirPath, 'assets/video.mp4');\nconst assetUrl = convertFileSrc(filePath);\n\nconst video = document.getElementById('my-video');\nconst source = document.createElement('source');\nsource.type = 'video/mp4';\nsource.src = assetUrl;\nvideo.appendChild(source);\nvideo.load();\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"the URL that can be used as source on the webview."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":123,"name":"filePath","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The file path."}]},"type":{"type":"intrinsic","name":"string"}},{"id":124,"name":"protocol","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The protocol to use. Defaults to "},{"kind":"code","text":"`asset`"},{"kind":"text","text":". You only need to set this when using a custom protocol."}]},"type":{"type":"intrinsic","name":"string"},"defaultValue":"'asset'"}],"type":{"type":"intrinsic","name":"string"}}]},{"id":116,"name":"invoke","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"tauri.ts","line":144,"character":15,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/tauri.ts#L144"}],"signatures":[{"id":117,"name":"invoke","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Sends a message to the backend."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```typescript\nimport { invoke } from '@tauri-apps/api/tauri';\nawait invoke('login', { user: 'tauri', password: 'poiwe3h4r5ip3yrhtew9ty' });\n```"}]},{"tag":"@returns","content":[{"kind":"text","text":"A promise resolving or rejecting to the backend response."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"typeParameter":[{"id":118,"name":"T","kind":131072,"kindString":"Type parameter","flags":{}}],"parameters":[{"id":119,"name":"cmd","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The command name."}]},"type":{"type":"intrinsic","name":"string"}},{"id":120,"name":"args","kind":32768,"kindString":"Parameter","flags":{},"comment":{"summary":[{"kind":"text","text":"The optional arguments to pass to the command."}]},"type":{"type":"reference","id":65,"name":"InvokeArgs"},"defaultValue":"{}"}],"type":{"type":"reference","typeArguments":[{"type":"reference","id":118,"name":"T"}],"name":"Promise","externalUrl":"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise","qualifiedName":"Promise","package":"typescript"}}]},{"id":66,"name":"transformCallback","kind":64,"kindString":"Function","flags":{},"sources":[{"fileName":"tauri.ts","line":36,"character":9,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/tauri.ts#L36"}],"signatures":[{"id":67,"name":"transformCallback","kind":4096,"kindString":"Call signature","flags":{},"comment":{"summary":[{"kind":"text","text":"Transforms a callback function to a string identifier that can be passed to the backend.\nThe backend uses the identifier to "},{"kind":"code","text":"`eval()`"},{"kind":"text","text":" the callback."}],"blockTags":[{"tag":"@returns","content":[{"kind":"text","text":"A unique identifier associated with the callback function."}]},{"tag":"@since","content":[{"kind":"text","text":"1.0.0"}]}]},"parameters":[{"id":68,"name":"callback","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"reflection","declaration":{"id":69,"name":"__type","kind":65536,"kindString":"Type literal","flags":{},"sources":[{"fileName":"tauri.ts","line":37,"character":13,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/tauri.ts#L37"}],"signatures":[{"id":70,"name":"__type","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":71,"name":"response","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"intrinsic","name":"void"}}]}}},{"id":72,"name":"once","kind":32768,"kindString":"Parameter","flags":{},"type":{"type":"intrinsic","name":"boolean"},"defaultValue":"false"}],"type":{"type":"intrinsic","name":"number"}}]}],"groups":[{"title":"Classes","children":[73,96]},{"title":"Type Aliases","children":[65]},{"title":"Functions","children":[107,121,116,66]}],"sources":[{"fileName":"tauri.ts","line":13,"character":0,"url":"https://github.com/tauri-apps/tauri/blob/ee1bf3014/tooling/api/src/tauri.ts#L13"}]}],"groups":[{"title":"Modules","children":[1,50,64]}]} \ No newline at end of file diff --git a/tooling/api/src/event.ts b/tooling/api/src/event.ts index 2942bdf8b9e8..63dec68b0c16 100644 --- a/tooling/api/src/event.ts +++ b/tooling/api/src/event.ts @@ -9,15 +9,41 @@ * @module */ -import * as eventApi from './helpers/event' -import type { EventCallback, UnlistenFn, Event } from './helpers/event' +import { invoke, transformCallback } from './tauri' -export type EventName = `${TauriEvent}` | (string & Record) +interface Event { + /** Event name */ + event: EventName + /** The label of the window that emitted this event. */ + windowLabel: string + /** Event identifier used to unlisten */ + id: number + /** Event payload */ + payload: T +} + +type EventCallback = (event: Event) => void + +type UnlistenFn = () => void + +type EventName = `${TauriEvent}` | (string & Record) + +interface Options { + /** + * Label of the window the function targets. + * + * When listening to events and using this value, + * only events triggered by the window with the given label are received. + * + * When emitting events, only the window with the given label will receive it. + */ + target?: string +} /** * @since 1.1.0 */ -export enum TauriEvent { +enum TauriEvent { WINDOW_RESIZED = 'tauri://resize', WINDOW_MOVED = 'tauri://move', WINDOW_CLOSE_REQUESTED = 'tauri://close-requested', @@ -33,6 +59,21 @@ export enum TauriEvent { MENU = 'tauri://menu' } +/** + * Unregister the event listener associated with the given name and id. + * + * @ignore + * @param event The event name + * @param eventId Event identifier + * @returns + */ +async function _unlisten(event: string, eventId: number): Promise { + await invoke('plugin:event|unlisten', { + event, + eventId + }) +} + /** * Listen to an event from the backend. * @@ -56,9 +97,16 @@ export enum TauriEvent { */ async function listen( event: EventName, - handler: EventCallback + handler: EventCallback, + options?: Options ): Promise { - return eventApi.listen(event, null, handler) + return invoke('plugin:event|listen', { + event, + windowLabel: options?.target, + handler: transformCallback(handler) + }).then((eventId) => { + return async () => _unlisten(event, eventId) + }) } /** @@ -87,9 +135,17 @@ async function listen( */ async function once( event: EventName, - handler: EventCallback + handler: EventCallback, + options?: Options ): Promise { - return eventApi.once(event, null, handler) + return listen( + event, + (eventData) => { + handler(eventData) + _unlisten(event, eventData.id).catch(() => {}) + }, + options + ) } /** @@ -104,10 +160,18 @@ async function once( * * @since 1.0.0 */ -async function emit(event: string, payload?: unknown): Promise { - return eventApi.emit(event, undefined, payload) +async function emit( + event: string, + payload?: unknown, + options?: Options +): Promise { + await invoke('plugin:event|emit', { + event, + windowLabel: options?.target, + payload + }) } -export type { Event, EventCallback, UnlistenFn } +export type { Event, EventCallback, UnlistenFn, EventName, Options } -export { listen, once, emit } +export { listen, once, emit, TauriEvent } diff --git a/tooling/api/src/helpers/event.ts b/tooling/api/src/helpers/event.ts deleted file mode 100644 index 39d3f66d2cf1..000000000000 --- a/tooling/api/src/helpers/event.ts +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2019-2023 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - -import { invoke, transformCallback } from '../tauri' -import { type EventName } from '../event' - -export interface Event { - /** Event name */ - event: EventName - /** The label of the window that emitted this event. */ - windowLabel: string - /** Event identifier used to unlisten */ - id: number - /** Event payload */ - payload: T -} - -export type EventCallback = (event: Event) => void - -export type UnlistenFn = () => void - -/** - * Unregister the event listener associated with the given name and id. - * - * @ignore - * @param event The event name - * @param eventId Event identifier - * @returns - */ -async function _unlisten(event: string, eventId: number): Promise { - await invoke('plugin:event|unlisten', { - event, - eventId - }) -} - -/** - * Emits an event to the backend. - * - * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. - * @param [windowLabel] The label of the window to which the event is sent, if null/undefined the event will be sent to all windows - * @param [payload] Event payload - * @returns - */ -async function emit( - event: string, - windowLabel?: string, - payload?: unknown -): Promise { - await invoke('plugin:event|emit', { - event, - windowLabel, - payload - }) -} - -/** - * Listen to an event from the backend. - * - * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. - * @param handler Event handler callback. - * @return A promise resolving to a function to unlisten to the event. - */ -async function listen( - event: EventName, - windowLabel: string | null, - handler: EventCallback -): Promise { - return invoke('plugin:event|listen', { - event, - windowLabel, - handler: transformCallback(handler) - }).then((eventId) => { - return async () => _unlisten(event, eventId) - }) -} - -/** - * Listen to an one-off event from the backend. - * - * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`. - * @param handler Event handler callback. - * @returns A promise resolving to a function to unlisten to the event. - */ -async function once( - event: EventName, - windowLabel: string | null, - handler: EventCallback -): Promise { - return listen(event, windowLabel, (eventData) => { - handler(eventData) - _unlisten(event, eventData.id).catch(() => {}) - }) -} - -export { emit, listen, once } diff --git a/tooling/bundler/Cargo.toml b/tooling/bundler/Cargo.toml index c25df56786d2..92da1dd55362 100644 --- a/tooling/bundler/Cargo.toml +++ b/tooling/bundler/Cargo.toml @@ -32,12 +32,13 @@ tempfile = "3.5.0" log = { version = "0.4.17", features = [ "kv_unstable" ] } dirs-next = "2.0" os_pipe = "1" -ureq = "2.5" +ureq = { version = "2.5", default-features = false } +native-tls = { version = "0.2", optional = true } hex = "0.4" semver = "1" sha1 = "0.10" sha2 = "0.10" -zip = "0.6" +zip = { version = "0.6", default-features = false } dunce = "1" [target."cfg(target_os = \"windows\")".dependencies] @@ -62,3 +63,9 @@ md5 = "0.7.0" [lib] name = "tauri_bundler" path = "src/lib.rs" + +[features] +default = ["rustls"] +native-tls = [ "ureq/native-tls" ] +native-tls-vendored = [ "native-tls", "native-tls/vendored" ] +rustls = [ "ureq/tls" ] diff --git a/tooling/cli/Cargo.lock b/tooling/cli/Cargo.lock index 824e2e9a87bc..c83bb4688350 100644 --- a/tooling/cli/Cargo.lock +++ b/tooling/cli/Cargo.lock @@ -261,12 +261,6 @@ version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" -[[package]] -name = "base64ct" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" - [[package]] name = "beef" version = "0.5.2" @@ -385,35 +379,11 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" -[[package]] -name = "bzip2" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" -dependencies = [ - "bzip2-sys", - "libc", -] - -[[package]] -name = "bzip2-sys" -version = "0.1.11+1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - [[package]] name = "cc" version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" -dependencies = [ - "jobserver", -] [[package]] name = "cfb" @@ -514,7 +484,7 @@ checksum = "0c49e86fc36d5704151f5996b7b3795385f50ce09e3be0f47a0cfde869681cf8" dependencies = [ "bitflags 1.3.2", "block", - "core-foundation", + "core-foundation 0.7.0", "core-graphics", "foreign-types", "libc", @@ -584,12 +554,6 @@ dependencies = [ "windows-sys 0.45.0", ] -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - [[package]] name = "convert_case" version = "0.4.0" @@ -615,6 +579,16 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys 0.8.4", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.7.0" @@ -634,7 +608,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923" dependencies = [ "bitflags 1.3.2", - "core-foundation", + "core-foundation 0.7.0", "foreign-types", "libc", ] @@ -1817,15 +1791,6 @@ dependencies = [ "regex", ] -[[package]] -name = "jobserver" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" -dependencies = [ - "libc", -] - [[package]] name = "jpeg-decoder" version = "0.3.0" @@ -2323,6 +2288,24 @@ dependencies = [ "libloading", ] +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + [[package]] name = "neli" version = "0.5.3" @@ -2553,6 +2536,12 @@ dependencies = [ "syn 2.0.17", ] +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + [[package]] name = "openssl-src" version = "111.25.3+1.1.1t" @@ -2628,17 +2617,6 @@ dependencies = [ "windows-sys 0.45.0", ] -[[package]] -name = "password-hash" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" -dependencies = [ - "base64ct", - "rand_core 0.6.4", - "subtle", -] - [[package]] name = "path_abs" version = "0.5.1" @@ -2651,18 +2629,6 @@ dependencies = [ "stfu8", ] -[[package]] -name = "pbkdf2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" -dependencies = [ - "digest 0.10.7", - "hmac", - "password-hash", - "sha2", -] - [[package]] name = "pbkdf2" version = "0.12.1" @@ -3254,6 +3220,15 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "schannel" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +dependencies = [ + "windows-sys 0.42.0", +] + [[package]] name = "schemars" version = "0.8.12" @@ -3291,7 +3266,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0516a385866c09368f0b5bcd1caff3366aace790fcd46e2bb032697bb172fd1f" dependencies = [ - "pbkdf2 0.12.1", + "pbkdf2", "salsa20", "sha2", ] @@ -3306,6 +3281,29 @@ dependencies = [ "untrusted", ] +[[package]] +name = "security-framework" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +dependencies = [ + "bitflags 1.3.2", + "core-foundation 0.9.3", + "core-foundation-sys 0.8.4", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +dependencies = [ + "core-foundation-sys 0.8.4", + "libc", +] + [[package]] name = "selectors" version = "0.22.0" @@ -3767,6 +3765,7 @@ dependencies = [ "libflate", "log", "md5", + "native-tls", "os_pipe", "plist", "regex", @@ -3876,13 +3875,13 @@ dependencies = [ [[package]] name = "tauri-mobile" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "596fa2cd0538f040eeb1485f74eb40052625dafd55cef4b3139e200763f6a988" +checksum = "b89f813f457a0f902f4ec37a70d0dd008b1e33473ac39b6df031b7c13880cdd4" dependencies = [ "cocoa", "colored 1.9.3", - "core-foundation", + "core-foundation 0.7.0", "deunicode", "duct", "dunce", @@ -4394,6 +4393,7 @@ dependencies = [ "base64 0.13.1", "flate2", "log", + "native-tls", "once_cell", "rustls", "url", @@ -4942,48 +4942,9 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" dependencies = [ - "aes", "byteorder", - "bzip2", - "constant_time_eq", "crc32fast", "crossbeam-utils", - "flate2", - "hmac", - "pbkdf2 0.11.0", - "sha1", - "time", - "zstd", -] - -[[package]] -name = "zstd" -version = "0.11.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "5.0.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" -dependencies = [ - "libc", - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "2.0.8+zstd.1.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" -dependencies = [ - "cc", - "libc", - "pkg-config", ] [[package]] diff --git a/tooling/cli/Cargo.toml b/tooling/cli/Cargo.toml index c62060e1d4a2..9ceb1087e68f 100644 --- a/tooling/cli/Cargo.toml +++ b/tooling/cli/Cargo.toml @@ -39,7 +39,7 @@ name = "cargo-tauri" path = "src/main.rs" [dependencies] -tauri-mobile = { version = "0.5", default-features = false } +tauri-mobile = { version = "0.5.1", default-features = false } textwrap = { version = "0.11.0", features = [ "term_size" ] } jsonrpsee = { version = "0.16", features = [ "server" ] } jsonrpsee-core = "0.16" @@ -50,7 +50,7 @@ sublime_fuzzy = "0.7" clap_complete = "4" clap = { version = "4.0", features = [ "derive" ] } anyhow = "1.0" -tauri-bundler = { version = "2.0.0-alpha.5", path = "../bundler" } +tauri-bundler = { version = "2.0.0-alpha.5", default-features = false, path = "../bundler" } colored = "2.0" once_cell = "1" serde = { version = "1.0", features = [ "derive" ] } @@ -69,7 +69,7 @@ handlebars = "4.3" include_dir = "0.7" minisign = "0.7" base64 = "0.21.0" -ureq = "2.5" +ureq = { version = "2.5", default-features = false, features = ["gzip"] } os_info = "3" semver = "1.0" regex = "1.6.0" @@ -106,4 +106,7 @@ libc = "0.2" lto = true [features] -openssl-vendored = [ "tauri-mobile/openssl-vendored" ] +default = [ "rustls" ] +native-tls = [ "tauri-bundler/native-tls", "tauri-mobile/native-tls", "ureq/native-tls" ] +native-tls-vendored = [ "native-tls", "tauri-bundler/native-tls-vendored", "tauri-mobile/openssl-vendored" ] +rustls = [ "tauri-bundler/rustls", "tauri-mobile/rustls", "ureq/tls" ] diff --git a/tooling/cli/node/Cargo.toml b/tooling/cli/node/Cargo.toml index 79a08339cb03..c7f5cfeb0fd3 100644 --- a/tooling/cli/node/Cargo.toml +++ b/tooling/cli/node/Cargo.toml @@ -10,11 +10,12 @@ crate-type = ["cdylib"] # Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix napi = { version = "2.12", default-features = false, features = ["napi4"] } napi-derive = "2.12" -tauri-cli = { path = ".." } +tauri-cli = { path = "..", default-features = false } log = "0.4.17" [build-dependencies] napi-build = "2.0" [features] -openssl-vendored = ["tauri-cli/openssl-vendored"] +default = ["tauri-cli/default"] +native-tls-vendored = ["tauri-cli/native-tls-vendored"] diff --git a/tooling/cli/node/npm/win32-arm64-msvc/README.md b/tooling/cli/node/npm/win32-arm64-msvc/README.md new file mode 100644 index 000000000000..eba7d4028ca7 --- /dev/null +++ b/tooling/cli/node/npm/win32-arm64-msvc/README.md @@ -0,0 +1,3 @@ +# `@tauri-apps/cli-win32-arm64-msvc` + +This is the **aarch64-pc-windows-msvc** binary for `@tauri-apps/cli` diff --git a/tooling/cli/node/npm/win32-arm64-msvc/package.json b/tooling/cli/node/npm/win32-arm64-msvc/package.json new file mode 100644 index 000000000000..b7f379b0415b --- /dev/null +++ b/tooling/cli/node/npm/win32-arm64-msvc/package.json @@ -0,0 +1,21 @@ +{ + "name": "@tauri-apps/cli-win32-arm64-msvc", + "version": "0.0.0", + "publishConfig": { + "access": "public" + }, + "os": [ + "win32" + ], + "cpu": [ + "arm64" + ], + "main": "cli.win32-arm64-msvc.node", + "files": [ + "cli.win32-arm64-msvc.node" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + } +} diff --git a/tooling/cli/node/package.json b/tooling/cli/node/package.json index 89fb4b38b448..56f2ffbe9987 100644 --- a/tooling/cli/node/package.json +++ b/tooling/cli/node/package.json @@ -56,7 +56,7 @@ }, "scripts": { "artifacts": "napi artifacts", - "build:release": "cross-env TARGET=node napi build --platform --release --features openssl-vendored", + "build:release": "cross-env TARGET=node napi build --platform --release", "build": "cross-env TARGET=node napi build --platform", "prepublishOnly": "napi prepublish -t npm --gh-release-id $RELEASE_ID", "prepack": "cp ../schema.json .", diff --git a/tooling/cli/src/mobile/ios/open.rs b/tooling/cli/src/mobile/ios/open.rs index c5b137d99b05..b9e8d2b419ea 100644 --- a/tooling/cli/src/mobile/ios/open.rs +++ b/tooling/cli/src/mobile/ios/open.rs @@ -5,7 +5,6 @@ use super::{ensure_init, env, get_app, get_config, MobileTarget}; use crate::{helpers::config::get as get_tauri_config, Result}; -use anyhow::Context; use tauri_mobile::os; pub fn command() -> Result<()> { diff --git a/tooling/cli/src/mobile/ios/xcode_script.rs b/tooling/cli/src/mobile/ios/xcode_script.rs index 655504727430..d9e5ef1390bf 100644 --- a/tooling/cli/src/mobile/ios/xcode_script.rs +++ b/tooling/cli/src/mobile/ios/xcode_script.rs @@ -9,7 +9,6 @@ use crate::{ Result, }; -use anyhow::Context; use clap::Parser; use tauri_mobile::{apple::target::Target, opts::Profile};