コンテンツにスキップ

@tauri-apps/plugin-window-state

このコンテンツはまだ日本語訳がありません。

Save and restore window positions and sizes.

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/window-state/guest-js/index.ts#L18

Flags controlling which parts of a window’s state are saved and restored. Combine multiple flags with the bitwise OR operator (|).

ALL: 63;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/window-state/guest-js/index.ts#L32

Save and restore every flag above.

DECORATIONS: 16;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/window-state/guest-js/index.ts#L28

Save and restore whether the window has decorations.

FULLSCREEN: 32;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/window-state/guest-js/index.ts#L30

Save and restore whether the window is fullscreen.

MAXIMIZED: 4;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/window-state/guest-js/index.ts#L24

Save and restore whether the window is maximized.

POSITION: 2;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/window-state/guest-js/index.ts#L22

Save and restore the window position.

SIZE: 1;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/window-state/guest-js/index.ts#L20

Save and restore the window size.

VISIBLE: 8;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/window-state/guest-js/index.ts#L26

Save and restore whether the window is visible.

function filename(): Promise<string>;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/window-state/guest-js/index.ts#L102

Get the name of the file used to store window state.

Promise<string>

A promise resolving to the name of the file used to store window state.

import { filename } from '@tauri-apps/plugin-window-state';
const name = await filename();

2.0.0


function restoreState(label, flags?): Promise<void>;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/window-state/guest-js/index.ts#L66

Restore the state for the specified window from disk.

Parameter Type Description
label string The label of the window to restore.
flags? StateFlags Which parts of the state to restore. Defaults to the flags passed to the plugin Builder (all flags if none were set).

Promise<void>

import { restoreState, StateFlags } from '@tauri-apps/plugin-window-state';
await restoreState('main', StateFlags.ALL);

2.0.0


function restoreStateCurrent(flags?): Promise<void>;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/window-state/guest-js/index.ts#L86

Restore the state for the current window from disk.

Parameter Type Description
flags? StateFlags Which parts of the state to restore. Defaults to the flags passed to the plugin Builder (all flags if none were set).

Promise<void>

import { restoreStateCurrent, StateFlags } from '@tauri-apps/plugin-window-state';
await restoreStateCurrent(StateFlags.ALL);

2.0.0


function saveWindowState(flags?): Promise<void>;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/window-state/guest-js/index.ts#L48

Save the state of all open windows to disk.

Parameter Type Description
flags? StateFlags Which parts of the state to save. Defaults to the flags passed to the plugin Builder (all flags if none were set).

Promise<void>

import { saveWindowState, StateFlags } from '@tauri-apps/plugin-window-state';
await saveWindowState(StateFlags.ALL);

2.0.0


© 2026 Tauri Contributors. CC-BY / MIT