mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-02 20:10:37 +02:00
chore: update to tauri alpha.16, api alpha.9 (#673)
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
This commit is contained in:
co-authored by
Amr Bashir
parent
b7c5407cac
commit
5c137365c6
@@ -2,11 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
__TAURI_INVOKE__: <T>(cmd: string, args?: unknown) => Promise<T>;
|
||||
}
|
||||
}
|
||||
import { invoke } from "@tauri-apps/api/primitives";
|
||||
|
||||
interface WindowDef {
|
||||
label: string;
|
||||
@@ -35,7 +31,7 @@ export enum StateFlags {
|
||||
* Save the state of all open windows to disk.
|
||||
*/
|
||||
async function saveWindowState(flags: StateFlags): Promise<void> {
|
||||
return window.__TAURI_INVOKE__("plugin:window-state|save_window_state", {
|
||||
return invoke("plugin:window-state|save_window_state", {
|
||||
flags,
|
||||
});
|
||||
}
|
||||
@@ -44,7 +40,7 @@ async function saveWindowState(flags: StateFlags): Promise<void> {
|
||||
* Restore the state for the specified window from disk.
|
||||
*/
|
||||
async function restoreState(label: string, flags: StateFlags): Promise<void> {
|
||||
return window.__TAURI_INVOKE__("plugin:window-state|restore_state", {
|
||||
return invoke("plugin:window-state|restore_state", {
|
||||
label,
|
||||
flags,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user