Defined in: webview-window.ts:17
A native window created at runtime (multi-window).
new WebviewWindow(
label,options?):WebviewWindow
Defined in: webview-window.ts:20
string
WebviewWindowOptions = {}
readonlylabel:string
Defined in: window.ts:157
activityName():
Promise<string|null>
Defined in: window.ts:365
Android-only upstream: current activity name (null on desktop).
Promise<string | null>
center():
Promise<void>
Defined in: window.ts:685
Promise<void>
clearEffects():
Promise<void>
Defined in: window.ts:300
Removes any applied vibrancy effect.
Promise<void>
close():
Promise<void>
Defined in: window.ts:537
Promise<void>
create():
Promise<void>
Defined in: webview-window.ts:26
Creates the native window with this instance's label + options.
Promise<void>
cursorPosition():
Promise<{x:number;y:number; }>
Defined in: window.ts:388
Screen-space cursor position (no label needed; upstream parity).
Promise<{ x: number; y: number; }>
destroy():
Promise<void>
Defined in: window.ts:421
Force-closes the window, bypassing preventClose.
Promise<void>
getState():
Promise<{alwaysOnTop:boolean;fullscreen:boolean;maximized:boolean;minimized:boolean;resizable:boolean;visible:boolean; } |null>
Defined in: window.ts:713
Reads the window's boolean state flags (maximized/fullscreen/etc).
Promise<{ alwaysOnTop: boolean; fullscreen: boolean; maximized: boolean; minimized: boolean; resizable: boolean; visible: boolean; } | null>
getTheme():
Promise<string|null>
Defined in: window.ts:210
The OS color scheme the window follows ("light" | "dark").
Promise<string | null>
getTitle():
Promise<string>
Defined in: window.ts:183
The current native window title.
Promise<string>
hide():
Promise<void>
Defined in: window.ts:229
Promise<void>
innerPosition():
Promise<{x:number;y:number; }>
Defined in: window.ts:765
The window's inner position (content top-left). Approximated by the outer frame origin — exact content origin needs titlebar-height measurement.
Promise<{ x: number; y: number; }>
innerSize():
Promise<{height:number;width:number; }>
Defined in: window.ts:200
The window's inner (content) size in points — excludes title bar.
Promise<{ height: number; width: number; }>
isAlwaysOnTop():
Promise<boolean>
Defined in: window.ts:725
Whether the window stays on top of other windows.
Promise<boolean>
isClosable():
Promise<boolean>
Defined in: window.ts:642
Whether the native close button is enabled.
Promise<boolean>
isDecorated():
Promise<boolean>
Defined in: window.ts:647
Whether the window has native decorations (title bar / borders).
Promise<boolean>
isEnabled():
Promise<boolean>
Defined in: window.ts:193
Whether the window is enabled (macOS: always true — no NSWindow state).
Promise<boolean>
isFocused():
Promise<boolean>
Defined in: window.ts:652
Whether the window is currently focused (key window).
Promise<boolean>
isFullscreen():
Promise<boolean>
Defined in: window.ts:580
Promise<boolean>
isMaximizable():
Promise<boolean>
Defined in: window.ts:627
Whether the native maximize/zoom button is enabled.
Promise<boolean>
isMaximized():
Promise<boolean>
Defined in: window.ts:565
Promise<boolean>
isMinimizable():
Promise<boolean>
Defined in: window.ts:612
Whether the native minimize button is enabled.
Promise<boolean>
isMinimized():
Promise<boolean>
Defined in: window.ts:569
Promise<boolean>
isResizable():
Promise<boolean>
Defined in: window.ts:735
Whether the window is resizable.
Promise<boolean>
isVisible():
Promise<boolean>
Defined in: window.ts:730
Whether the window is visible.
Promise<boolean>
maximize():
Promise<void>
Defined in: window.ts:556
Sets the native maximize state without toggling (Tauri v2 split).
Promise<void>
minimize():
Promise<void>
Defined in: window.ts:543
Promise<void>
onBlurred(
handler):Promise<UnlistenFn>
Defined in: window.ts:926
() => void
Promise<UnlistenFn>
onCloseRequested(
handler):Promise<() =>void>
Defined in: window.ts:947
Fires when a close is requested. The handler decides dynamically:
call event.preventDefault() to keep the window open, otherwise the
window is destroyed when the handler completes (Tauri v2 semantics).
(event) => unknown
Promise<() => void>
onDragDropEvent(
handler): () =>void
Defined in: window.ts:310
A normalized drag-and-drop notification (Tauri DragDropEvent): enter
carries paths + position, over only the position, drop paths +
position, and leave fires when the drag leaves the window without a
drop. Positions are physical pixels relative to the window's top-left.
(payload) => void
() => void
onFocusChanged(
handler):Promise<() =>void>
Defined in: window.ts:931
Focus + blur combined (Tauri v2 sugar).
(focused) => void
Promise<() => void>
onFocused(
handler):Promise<UnlistenFn>
Defined in: window.ts:922
() => void
Promise<UnlistenFn>
onMoved(
handler):Promise<UnlistenFn>
Defined in: window.ts:891
(payload) => void
Promise<UnlistenFn>
onResized(
handler):Promise<UnlistenFn>
Defined in: window.ts:887
(payload) => void
Promise<UnlistenFn>
onScaleChanged(
handler):Promise<UnlistenFn>
Defined in: window.ts:966
Fires when the backing scale factor changes (Retina display moves).
(payload) => void
Promise<UnlistenFn>
onThemeChanged(
handler):Promise<UnlistenFn>
Defined in: window.ts:973
Fires when the system theme changes (payload: "dark" | "light").
(theme) => void
Promise<UnlistenFn>
outerPosition():
Promise<{x:number;y:number; }>
Defined in: window.ts:751
The window's outer position (top-left origin).
Promise<{ x: number; y: number; }>
outerSize():
Promise<{height:number;width:number; }>
Defined in: window.ts:740
The window's outer size (width × height, including decorations).
Promise<{ height: number; width: number; }>
preventClose(
prevent):Promise<void>
Defined in: window.ts:416
Prevents the window from closing; a ztron://close-requested event is
emitted instead, letting the frontend confirm (then call destroy()).
boolean
Promise<void>
requestUserAttention(
type?):Promise<void>
Defined in: window.ts:676
Bounces the dock icon until activated. null cancels the request.
(macOS maps Critical/Informational to the bounce style.)
UserAttentionType | null
Promise<void>
scaleFactor():
Promise<number|null>
Defined in: window.ts:234
The window's backing scale factor (2 on Retina/HiDPI).
Promise<number | null>
sceneIdentifier():
Promise<string|null>
Defined in: window.ts:375
iOS-only upstream: current scene identifier (null on desktop).
Promise<string | null>
setActivityName(
name):Promise<void>
Defined in: window.ts:370
Android-only upstream: accepted as a documented no-op on desktop.
string
Promise<void>
setAlwaysOnBottom(
alwaysOnBottom):Promise<void>
Defined in: window.ts:594
Keeps the window below all other windows (v2-only).
boolean
Promise<void>
setAlwaysOnTop(
alwaysOnTop):Promise<void>
Defined in: window.ts:586
boolean
Promise<void>
setBackgroundColor(
color):Promise<void>
Defined in: window.ts:857
Sets the window background color: "#rrggbb", "#rrggbbaa" or
"transparent". Takes effect on frameless/transparent windows.
string
Promise<void>
setBadgeCount(
count):Promise<void>
Defined in: window.ts:835
Sets the dock badge count. null/undefined removes the badge.
macOS dock / Windows taskbar; unsupported elsewhere.
number | null
Promise<void>
setBadgeLabel(
badgeLabel):Promise<void>
Defined in: window.ts:846
Sets the dock badge to arbitrary text (macOS only).
null/undefined/"" removes the badge.
string | null
Promise<void>
setBounds(
x,y,width?,height?):Promise<void>
Defined in: window.ts:437
Sets the window bounds (position + size in one op, dpi types accepted).
number
number
Promise<void>
setClosable(
closable):Promise<void>
Defined in: window.ts:634
Toggles the native close button.
boolean
Promise<void>
setContentProtected(
protect):Promise<void>
Defined in: window.ts:665
Prevents the window contents from being captured by other apps.
boolean
Promise<void>
setCursor(
cursor):Promise<void>
Defined in: window.ts:345
Sets the window cursor (CSS-style name: "default", "pointer", "text", "crosshair", "move", "not-allowed", resize cursors, …).
string
Promise<void>
setCursorGrab(
grab):Promise<void>
Defined in: window.ts:262
Locks the cursor at its current position (Tauri setCursorGrab). On
macOS the cursor visually parks in place; release with false.
boolean
Promise<void>
setCursorIcon(
icon):Promise<void>
Defined in: window.ts:350
Alias of setCursor (Tauri v2 name).
string
Promise<void>
setCursorPosition(
x,y?):Promise<void>
Defined in: window.ts:395
Warps the cursor to window coordinates (dpi types accepted).
number
Promise<void>
setCursorVisible(
visible):Promise<void>
Defined in: window.ts:357
Hides/shows the system cursor (app-global hide counter — pair calls).
boolean
Promise<void>
setDecorations(
decorations):Promise<void>
Defined in: window.ts:783
Toggles native window decorations (title bar / borders).
boolean
Promise<void>
setEffects(
effects):Promise<void>
Defined in: window.ts:292
Vibrancy material (macOS). Windows-only effects are ignored there.
Promise<void>
setEnabled(
enabled):Promise<void>
Defined in: window.ts:463
Enables/disables the native window.
boolean
Promise<void>
setFileDropEnabled(
enabled):Promise<void>
Defined in: window.ts:251
Enables/disables the native file drag-and-drop handler. While enabled
(default) file drags produce Window.onDragDropEvent events;
disable it to let the page use the HTML5 drag-and-drop APIs instead.
boolean
Promise<void>
setFocus():
Promise<void>
Defined in: window.ts:689
Promise<void>
setFocusable(
focusable):Promise<void>
Defined in: window.ts:896
Toggles whether the window can take keyboard focus.
boolean
Promise<void>
setFullscreen(
fullscreen):Promise<void>
Defined in: window.ts:573
boolean
Promise<void>
setIcon(
icon):Promise<void>
Defined in: window.ts:273
Sets the window/dock icon from an Image (registered host
image). Pass null to clear.
Image | null
Promise<void>
setIgnoreCursorEvents(
ignore):Promise<void>
Defined in: window.ts:239
Toggles whether the window ignores mouse/cursor events.
boolean
Promise<void>
setMaximizable(
maximizable):Promise<void>
Defined in: window.ts:619
Toggles the native maximize/zoom button.
boolean
Promise<void>
setMaxSize(
size):Promise<void>
Defined in: window.ts:510
Sets the window maximum inner size. null unsets the constraint
(dpi types accepted).
SizeLike | null | undefined
Promise<void>
setMinimizable(
minimizable):Promise<void>
Defined in: window.ts:604
Toggles the native minimize button (macOS/Windows; button-mask based).
boolean
Promise<void>
setMinSize(
size):Promise<void>
Defined in: window.ts:497
Sets the window minimum inner size. null unsets the constraint
(dpi types accepted, like new LogicalSize(300, 200)).
SizeLike | null | undefined
Promise<void>
setOpacity(
opacity):Promise<void>
Defined in: window.ts:705
Sets the window opacity, 0.0 (transparent) to 1.0 (opaque).
number
Promise<void>
setOverlayIcon(
icon):Promise<void>
Defined in: window.ts:284
Sets a small titlebar accessory icon (the macOS take on Windows'
overlay/status badge). Pass null to clear.
Image | null
Promise<void>
setPosition(
x,y?):Promise<void>
Defined in: window.ts:484
Moves the window. Accepts plain numbers, a LogicalPosition /
PhysicalPosition, or a plain { x, y } object.
number
Promise<void>
setProgressBar(
progress):Promise<void>
Defined in: window.ts:809
Dock/taskbar progress. Accepts a bare determinate value / null (v1
shape) or an upstream ProgressBarState object: Indeterminate toggles
the spinning bar, None clears it.
number | ProgressBarStateInput | null
Promise<void>
setResizable(
resizable):Promise<void>
Defined in: window.ts:697
boolean
Promise<void>
setSceneIdentifier(
id):Promise<void>
Defined in: window.ts:380
iOS-only upstream: accepted as a documented no-op on desktop.
string
Promise<void>
setShadow(
shadow):Promise<void>
Defined in: window.ts:458
Toggles the native window shadow.
boolean
Promise<void>
setSimpleFullscreen(
fullscreen):Promise<void>
Defined in: window.ts:915
Borderless "simple" fullscreen: content fills the screen without the native fullscreen space transition (frame + decorations restored on off).
boolean
Promise<void>
setSize(
width,height?):Promise<void>
Defined in: window.ts:471
Sets the window size. Accepts plain numbers, a LogicalSize /
PhysicalSize, or a plain { width, height } object.
number
Promise<void>
setSizeConstraints(
constraints):Promise<void>
Defined in: window.ts:520
Sets min/max inner-size constraints in one call.
WindowSizeConstraints | null | undefined
Promise<void>
setSkipTaskbar(
skipTaskbar):Promise<void>
Defined in: window.ts:657
Hides the window icon from the taskbar/dock (macOS: whole app).
boolean
Promise<void>
setTheme(
theme):Promise<void>
Defined in: window.ts:220
App-wide theme override ("dark"/"light"; null follows system).
"dark" | "light" | null
Promise<void>
setTitle(
title):Promise<void>
Defined in: window.ts:178
string
Promise<void>
setTitleBarStyle(
style):Promise<void>
Defined in: window.ts:869
Sets the title-bar style (macOS only): "visible" (default),
"transparent" (hidden chrome) or "overlay" (content under the
traffic lights — the Tauri "transparent + full-size content view").
Promise<void>
setTrafficLightPosition(
x,y):Promise<void>
Defined in: window.ts:981
Moves the traffic-light buttons (close/minimize/zoom) — for frameless
macOS windows with titleBarStyle: "overlay".
number
number
Promise<void>
Window.setTrafficLightPosition
setTransparent(
transparent):Promise<void>
Defined in: window.ts:775
Toggles a transparent window background.
boolean
Promise<void>
setVisible(
visible):Promise<void>
Defined in: window.ts:693
boolean
Promise<void>
setVisibleOnAllWorkspaces(
visible):Promise<void>
Defined in: window.ts:904
Shows the window on all workspaces / virtual desktops (macOS).
boolean
Promise<void>
Window.setVisibleOnAllWorkspaces
setZoom(
zoom):Promise<void>
Defined in: window.ts:408
Zooms the web content (CSS zoom factor, e.g. 1.5).
number
Promise<void>
show():
Promise<void>
Defined in: window.ts:225
Alias of setVisible(true) / setVisible(false) (Tauri v2 parity).
Promise<void>
startDragging():
Promise<void>
Defined in: window.ts:794
Starts a native window drag — call from a mousedown on a
data-tauri-drag-region element of a frameless window.
Promise<void>
startResizeDragging(
direction?):Promise<void>
Defined in: window.ts:429
Starts a native resize drag (direction: "north"/"south"/"east"/"west" or combinations like "southeast"). macOS is not implemented.
string = "southeast"
Promise<void>
theme():
Promise<string|null>
Defined in: window.ts:215
The OS color scheme, alias of getTheme (Tauri v2 parity).
Promise<string | null>
title():
Promise<string>
Defined in: window.ts:188
Sets the window title (alias of setTitle for Tauri v2 parity).
Promise<string>
toggleMaximize():
Promise<void>
Defined in: window.ts:551
Promise<void>
unmaximize():
Promise<void>
Defined in: window.ts:561
Restores a maximized window (no-op when not zoomed).
Promise<void>
unminimize():
Promise<void>
Defined in: window.ts:547
Promise<void>
staticgetByLabel(label):Promise<Window|null>
Defined in: window.ts:164
Looks up a live window by label (null when it doesn't exist).
string
Promise<Window | null>
staticgetCurrent():Window
Defined in: window.ts:169
The current window (label from the bootstrap metadata).
Defined in: webview-window.ts:8
optionalheight?:number
Defined in: webview-window.ts:11
optionalhtml?:string
Defined in: webview-window.ts:13
optionaltitle?:string
Defined in: webview-window.ts:9
optionalurl?:string
Defined in: webview-window.ts:12
optionalwidth?:number
Defined in: webview-window.ts:10
getCurrentWebviewWindow():
Window
Defined in: webview-window.ts:35
The window that invoked this call (single-window alias of Window).