@tauri-apps/plugin-os
Advanced tools
Comparing version 2.0.0-alpha.3 to 2.0.0-alpha.4
@@ -1,5 +0,42 @@ | ||
var f=Object.defineProperty;var g=(a,b)=>{for(var c in b)f(a,c,{get:b[c],enumerable:!0});};var e=(a,b,c)=>{if(!b.has(a))throw TypeError("Cannot "+c)};var h=(a,b,c)=>(e(a,b,"read from private field"),c?c.call(a):b.get(a)),i$1=(a,b,c)=>{if(b.has(a))throw TypeError("Cannot add the same private member more than once");b instanceof WeakSet?b.add(a):b.set(a,c);},j=(a,b,c,d)=>(e(a,b,"write to private field"),d?d.call(a,c):b.set(a,c),c); | ||
/****************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
var T={};g(T,{Channel:()=>i,PluginListener:()=>o,addPluginListener:()=>l,convertFileSrc:()=>v,invoke:()=>u,transformCallback:()=>_});function _(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}var r,i=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0;i$1(this,r,()=>{});this.id=_(n=>{h(this,r).call(this,n);});}set onmessage(n){j(this,r,n);}get onmessage(){return h(this,r)}toJSON(){return `__CHANNEL__:${this.id}`}};r=new WeakMap;var o=class{constructor(n,s,t){this.plugin=n,this.event=s,this.channelId=t;}async unregister(){return u(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function l(e,n,s){let t=new i;return t.onmessage=s,u(`plugin:${e}|register_listener`,{event:n,handler:t}).then(()=>new o(e,n,t.id))}async function u(e,n={},s){return window.__TAURI_INTERNALS__.invoke(e,n,s)}function v(e,n="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(e,n)} | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
/* global Reflect, Promise, SuppressedError, Symbol */ | ||
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { | ||
var e = new Error(message); | ||
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; | ||
}; | ||
/** | ||
* Sends a message to the backend. | ||
* @example | ||
* ```typescript | ||
* import { invoke } from '@tauri-apps/api/primitives'; | ||
* await invoke('login', { user: 'tauri', password: 'poiwe3h4r5ip3yrhtew9ty' }); | ||
* ``` | ||
* | ||
* @param cmd The command name. | ||
* @param args The optional arguments to pass to the command. | ||
* @param options The request options. | ||
* @return A promise resolving or rejecting to the backend response. | ||
* | ||
* @since 1.0.0 | ||
*/ | ||
async function invoke(cmd, args = {}, options) { | ||
return window.__TAURI_INTERNALS__.invoke(cmd, args, options); | ||
} | ||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy | ||
@@ -37,3 +74,3 @@ // SPDX-License-Identifier: Apache-2.0 | ||
async function platform() { | ||
return u("plugin:os|platform"); | ||
return invoke("plugin:os|platform"); | ||
} | ||
@@ -51,3 +88,3 @@ /** | ||
async function version() { | ||
return u("plugin:os|version"); | ||
return invoke("plugin:os|version"); | ||
} | ||
@@ -65,3 +102,3 @@ /** | ||
async function family() { | ||
return u("plugin:os|family"); | ||
return invoke("plugin:os|family"); | ||
} | ||
@@ -79,3 +116,3 @@ /** | ||
async function type() { | ||
return u("plugin:os|os_type"); | ||
return invoke("plugin:os|os_type"); | ||
} | ||
@@ -94,3 +131,3 @@ /** | ||
async function arch() { | ||
return u("plugin:os|arch"); | ||
return invoke("plugin:os|arch"); | ||
} | ||
@@ -111,3 +148,3 @@ /** | ||
async function locale() { | ||
return u("plugin:os|locale"); | ||
return invoke("plugin:os|locale"); | ||
} | ||
@@ -125,3 +162,3 @@ /** | ||
async function exeExtension() { | ||
return u("plugin:os|exe_extension"); | ||
return invoke("plugin:os|exe_extension"); | ||
} | ||
@@ -137,3 +174,3 @@ /** | ||
async function hostname() { | ||
return u("plugin:os|hostname"); | ||
return invoke("plugin:os|hostname"); | ||
} | ||
@@ -140,0 +177,0 @@ |
{ | ||
"name": "@tauri-apps/plugin-os", | ||
"version": "2.0.0-alpha.3", | ||
"version": "2.0.0-alpha.4", | ||
"license": "MIT or APACHE-2.0", | ||
@@ -27,3 +27,3 @@ "authors": [ | ||
"dependencies": { | ||
"@tauri-apps/api": "2.0.0-alpha.9" | ||
"@tauri-apps/api": "2.0.0-alpha.11" | ||
}, | ||
@@ -30,0 +30,0 @@ "scripts": { |
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
15875
411
1
+ Added@tauri-apps/api@2.0.0-alpha.11(transitive)
- Removed@tauri-apps/api@2.0.0-alpha.9(transitive)