@tauri-apps/plugin-window-state
このコンテンツはまだ日本語訳がありません。
Save and restore window positions and sizes.
Enumerations
Section titled “Enumerations”StateFlags
Section titled “StateFlags”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 (|).
Enumeration Members
Section titled “Enumeration Members”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
Section titled “DECORATIONS”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
Section titled “FULLSCREEN”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
Section titled “MAXIMIZED”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
Section titled “POSITION”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
Section titled “VISIBLE”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.
Functions
Section titled “Functions”filename()
Section titled “filename()”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.
Returns
Section titled “Returns”Promise<string>
A promise resolving to the name of the file used to store window state.
Example
Section titled “Example”import { filename } from '@tauri-apps/plugin-window-state';
const name = await filename();2.0.0
restoreState()
Section titled “restoreState()”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.
Parameters
Section titled “Parameters”| 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). |
Returns
Section titled “Returns”Promise<void>
Example
Section titled “Example”import { restoreState, StateFlags } from '@tauri-apps/plugin-window-state';
await restoreState('main', StateFlags.ALL);2.0.0
restoreStateCurrent()
Section titled “restoreStateCurrent()”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.
Parameters
Section titled “Parameters”| 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). |
Returns
Section titled “Returns”Promise<void>
Example
Section titled “Example”import { restoreStateCurrent, StateFlags } from '@tauri-apps/plugin-window-state';
await restoreStateCurrent(StateFlags.ALL);2.0.0
saveWindowState()
Section titled “saveWindowState()”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.
Parameters
Section titled “Parameters”| 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). |
Returns
Section titled “Returns”Promise<void>
Example
Section titled “Example”import { saveWindowState, StateFlags } from '@tauri-apps/plugin-window-state';
await saveWindowState(StateFlags.ALL);2.0.0
© 2026 Tauri Contributors. CC-BY / MIT