chore: update to tauri alpha.16, api alpha.9 (#673)

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
This commit is contained in:
Lucas Fernandes Nogueira
2023-10-20 13:50:18 -03:00
committed by GitHub
co-authored by Amr Bashir
parent b7c5407cac
commit 5c137365c6
132 changed files with 1569 additions and 1692 deletions
+13 -17
View File
@@ -4,11 +4,7 @@
import { listen, UnlistenFn } from "@tauri-apps/api/event";
declare global {
interface Window {
__TAURI_INVOKE__: <T>(cmd: string, args?: unknown) => Promise<T>;
}
}
import { invoke } from "@tauri-apps/api/primitives";
interface ChangePayload<T> {
path: string;
@@ -33,7 +29,7 @@ export class Store {
* @returns
*/
async set(key: string, value: unknown): Promise<void> {
return await window.__TAURI_INVOKE__("plugin:store|set", {
return await invoke("plugin:store|set", {
path: this.path,
key,
value,
@@ -47,7 +43,7 @@ export class Store {
* @returns
*/
async get<T>(key: string): Promise<T | null> {
return await window.__TAURI_INVOKE__("plugin:store|get", {
return await invoke("plugin:store|get", {
path: this.path,
key,
});
@@ -60,7 +56,7 @@ export class Store {
* @returns
*/
async has(key: string): Promise<boolean> {
return await window.__TAURI_INVOKE__("plugin:store|has", {
return await invoke("plugin:store|has", {
path: this.path,
key,
});
@@ -73,7 +69,7 @@ export class Store {
* @returns
*/
async delete(key: string): Promise<boolean> {
return await window.__TAURI_INVOKE__("plugin:store|delete", {
return await invoke("plugin:store|delete", {
path: this.path,
key,
});
@@ -86,7 +82,7 @@ export class Store {
* @returns
*/
async clear(): Promise<void> {
return await window.__TAURI_INVOKE__("plugin:store|clear", {
return await invoke("plugin:store|clear", {
path: this.path,
});
}
@@ -98,7 +94,7 @@ export class Store {
* @returns
*/
async reset(): Promise<void> {
return await window.__TAURI_INVOKE__("plugin:store|reset", {
return await invoke("plugin:store|reset", {
path: this.path,
});
}
@@ -109,7 +105,7 @@ export class Store {
* @returns
*/
async keys(): Promise<string[]> {
return await window.__TAURI_INVOKE__("plugin:store|keys", {
return await invoke("plugin:store|keys", {
path: this.path,
});
}
@@ -120,7 +116,7 @@ export class Store {
* @returns
*/
async values<T>(): Promise<T[]> {
return await window.__TAURI_INVOKE__("plugin:store|values", {
return await invoke("plugin:store|values", {
path: this.path,
});
}
@@ -131,7 +127,7 @@ export class Store {
* @returns
*/
async entries<T>(): Promise<Array<[key: string, value: T]>> {
return await window.__TAURI_INVOKE__("plugin:store|entries", {
return await invoke("plugin:store|entries", {
path: this.path,
});
}
@@ -142,7 +138,7 @@ export class Store {
* @returns
*/
async length(): Promise<number> {
return await window.__TAURI_INVOKE__("plugin:store|length", {
return await invoke("plugin:store|length", {
path: this.path,
});
}
@@ -156,7 +152,7 @@ export class Store {
* @returns
*/
async load(): Promise<void> {
return await window.__TAURI_INVOKE__("plugin:store|load", {
return await invoke("plugin:store|load", {
path: this.path,
});
}
@@ -169,7 +165,7 @@ export class Store {
* @returns
*/
async save(): Promise<void> {
return await window.__TAURI_INVOKE__("plugin:store|save", {
return await invoke("plugin:store|save", {
path: this.path,
});
}