@zturnlibs/ztron-api


window

Enumerations

Effect

Defined in: window.ts:1047

macOS vibrancy materials (NSVisualEffectMaterial).

Enumeration Members

Acrylic

Acrylic: "acrylic"

Defined in: window.ts:1065

AppearanceBased

AppearanceBased: "appearanceBased"

Defined in: window.ts:1048

Blur

Blur: "blur"

Defined in: window.ts:1064

Windows only (no-op on macOS, kept for cross-platform config).

ContentBackground

ContentBackground: "contentBackground"

Defined in: window.ts:1060

FullScreenUI

FullScreenUI: "fullScreenUI"

Defined in: window.ts:1058

HeaderView

HeaderView: "headerView"

Defined in: window.ts:1054

HudWindow

HudWindow: "hudWindow"

Defined in: window.ts:1057

Menu: "menu"

Defined in: window.ts:1051

Mica

Mica: "mica"

Defined in: window.ts:1067

Popover

Popover: "popover"

Defined in: window.ts:1052

Selection

Selection: "selection"

Defined in: window.ts:1050

Sheet

Sheet: "sheet"

Defined in: window.ts:1055

Sidebar: "sidebar"

Defined in: window.ts:1053

Tabbed

Tabbed: "tabbed"

Defined in: window.ts:1066

TabbedDark

TabbedDark: "tabbedDark"

Defined in: window.ts:1068

TabbedLight

TabbedLight: "tabbedLight"

Defined in: window.ts:1069

Titlebar

Titlebar: "titlebar"

Defined in: window.ts:1049

ToolTip

ToolTip: "toolTip"

Defined in: window.ts:1059

UnderPageBackground

UnderPageBackground: "underPageBackground"

Defined in: window.ts:1062

UnderWindowBackground

UnderWindowBackground: "underWindowBackground"

Defined in: window.ts:1061

WindowBackground

WindowBackground: "windowBackground"

Defined in: window.ts:1056


EffectState

Defined in: window.ts:1073

Effect active state (macOS only).

Enumeration Members

Active

Active: 0

Defined in: window.ts:1075

FollowsWindowActiveState

FollowsWindowActiveState: -1

Defined in: window.ts:1074

Inactive

Inactive: 1

Defined in: window.ts:1076


ProgressBarStatus

Defined in: window.ts:74

Dock/Tile progress-bar states (upstream ProgressBarStatus).

Enumeration Members

Error

Error: "error"

Defined in: window.ts:79

Indeterminate

Indeterminate: "indeterminate"

Defined in: window.ts:77

None

None: "none"

Defined in: window.ts:75

Normal

Normal: "normal"

Defined in: window.ts:76

Paused

Paused: "paused"

Defined in: window.ts:78


UserAttentionType

Defined in: window.ts:89

Attention request type for Window.requestUserAttention.

Enumeration Members

Critical

Critical: "Critical"

Defined in: window.ts:90

Informational

Informational: "Informational"

Defined in: window.ts:91

Classes

CloseRequestedEvent

Defined in: window.ts:136

Delivered to Window.onCloseRequested: call CloseRequestedEvent.preventDefault inside the handler to keep the window open (a port of @tauri-apps/api CloseRequestedEvent).

Constructors

Constructor

new CloseRequestedEvent(event): CloseRequestedEvent

Defined in: window.ts:142

Parameters
event
event

string

id

number

Returns

CloseRequestedEvent

Properties

event

readonly event: string

Defined in: window.ts:137

id

readonly id: number

Defined in: window.ts:138

Methods

isPreventDefault()

isPreventDefault(): boolean

Defined in: window.ts:151

Returns

boolean

preventDefault()

preventDefault(): void

Defined in: window.ts:147

Returns

void


Window

Defined in: window.ts:156

Extended by

Constructors

Constructor

new Window(label): Window

Defined in: window.ts:159

Parameters
label

string

Returns

Window

Properties

label

readonly label: string

Defined in: window.ts:157

Methods

activityName()

activityName(): Promise<string | null>

Defined in: window.ts:365

Android-only upstream: current activity name (null on desktop).

Returns

Promise<string | null>

center()

center(): Promise<void>

Defined in: window.ts:685

Returns

Promise<void>

clearEffects()

clearEffects(): Promise<void>

Defined in: window.ts:300

Removes any applied vibrancy effect.

Returns

Promise<void>

close()

close(): Promise<void>

Defined in: window.ts:537

Returns

Promise<void>

cursorPosition()

cursorPosition(): Promise<{ x: number; y: number; }>

Defined in: window.ts:388

Screen-space cursor position (no label needed; upstream parity).

Returns

Promise<{ x: number; y: number; }>

destroy()

destroy(): Promise<void>

Defined in: window.ts:421

Force-closes the window, bypassing preventClose.

Returns

Promise<void>

getState()

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).

Returns

Promise<{ alwaysOnTop: boolean; fullscreen: boolean; maximized: boolean; minimized: boolean; resizable: boolean; visible: boolean; } | null>

getTheme()

getTheme(): Promise<string | null>

Defined in: window.ts:210

The OS color scheme the window follows ("light" | "dark").

Returns

Promise<string | null>

getTitle()

getTitle(): Promise<string>

Defined in: window.ts:183

The current native window title.

Returns

Promise<string>

hide()

hide(): Promise<void>

Defined in: window.ts:229

Returns

Promise<void>

innerPosition()

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.

Returns

Promise<{ x: number; y: number; }>

innerSize()

innerSize(): Promise<{ height: number; width: number; }>

Defined in: window.ts:200

The window's inner (content) size in points — excludes title bar.

Returns

Promise<{ height: number; width: number; }>

isAlwaysOnTop()

isAlwaysOnTop(): Promise<boolean>

Defined in: window.ts:725

Whether the window stays on top of other windows.

Returns

Promise<boolean>

isClosable()

isClosable(): Promise<boolean>

Defined in: window.ts:642

Whether the native close button is enabled.

Returns

Promise<boolean>

isDecorated()

isDecorated(): Promise<boolean>

Defined in: window.ts:647

Whether the window has native decorations (title bar / borders).

Returns

Promise<boolean>

isEnabled()

isEnabled(): Promise<boolean>

Defined in: window.ts:193

Whether the window is enabled (macOS: always true — no NSWindow state).

Returns

Promise<boolean>

isFocused()

isFocused(): Promise<boolean>

Defined in: window.ts:652

Whether the window is currently focused (key window).

Returns

Promise<boolean>

isFullscreen()

isFullscreen(): Promise<boolean>

Defined in: window.ts:580

Returns

Promise<boolean>

isMaximizable()

isMaximizable(): Promise<boolean>

Defined in: window.ts:627

Whether the native maximize/zoom button is enabled.

Returns

Promise<boolean>

isMaximized()

isMaximized(): Promise<boolean>

Defined in: window.ts:565

Returns

Promise<boolean>

isMinimizable()

isMinimizable(): Promise<boolean>

Defined in: window.ts:612

Whether the native minimize button is enabled.

Returns

Promise<boolean>

isMinimized()

isMinimized(): Promise<boolean>

Defined in: window.ts:569

Returns

Promise<boolean>

isResizable()

isResizable(): Promise<boolean>

Defined in: window.ts:735

Whether the window is resizable.

Returns

Promise<boolean>

isVisible()

isVisible(): Promise<boolean>

Defined in: window.ts:730

Whether the window is visible.

Returns

Promise<boolean>

maximize()

maximize(): Promise<void>

Defined in: window.ts:556

Sets the native maximize state without toggling (Tauri v2 split).

Returns

Promise<void>

minimize()

minimize(): Promise<void>

Defined in: window.ts:543

Returns

Promise<void>

onBlurred()

onBlurred(handler): Promise<UnlistenFn>

Defined in: window.ts:926

Parameters
handler

() => void

Returns

Promise<UnlistenFn>

onCloseRequested()

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).

Parameters
handler

(event) => unknown

Returns

Promise<() => void>

onDragDropEvent()

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.

Parameters
handler

(payload) => void

Returns

() => void

onFocusChanged()

onFocusChanged(handler): Promise<() => void>

Defined in: window.ts:931

Focus + blur combined (Tauri v2 sugar).

Parameters
handler

(focused) => void

Returns

Promise<() => void>

onFocused()

onFocused(handler): Promise<UnlistenFn>

Defined in: window.ts:922

Parameters
handler

() => void

Returns

Promise<UnlistenFn>

onMoved()

onMoved(handler): Promise<UnlistenFn>

Defined in: window.ts:891

Parameters
handler

(payload) => void

Returns

Promise<UnlistenFn>

onResized()

onResized(handler): Promise<UnlistenFn>

Defined in: window.ts:887

Parameters
handler

(payload) => void

Returns

Promise<UnlistenFn>

onScaleChanged()

onScaleChanged(handler): Promise<UnlistenFn>

Defined in: window.ts:966

Fires when the backing scale factor changes (Retina display moves).

Parameters
handler

(payload) => void

Returns

Promise<UnlistenFn>

onThemeChanged()

onThemeChanged(handler): Promise<UnlistenFn>

Defined in: window.ts:973

Fires when the system theme changes (payload: "dark" | "light").

Parameters
handler

(theme) => void

Returns

Promise<UnlistenFn>

outerPosition()

outerPosition(): Promise<{ x: number; y: number; }>

Defined in: window.ts:751

The window's outer position (top-left origin).

Returns

Promise<{ x: number; y: number; }>

outerSize()

outerSize(): Promise<{ height: number; width: number; }>

Defined in: window.ts:740

The window's outer size (width × height, including decorations).

Returns

Promise<{ height: number; width: number; }>

preventClose()

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()).

Parameters
prevent

boolean

Returns

Promise<void>

requestUserAttention()

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.)

Parameters
type?

UserAttentionType | null

Returns

Promise<void>

scaleFactor()

scaleFactor(): Promise<number | null>

Defined in: window.ts:234

The window's backing scale factor (2 on Retina/HiDPI).

Returns

Promise<number | null>

sceneIdentifier()

sceneIdentifier(): Promise<string | null>

Defined in: window.ts:375

iOS-only upstream: current scene identifier (null on desktop).

Returns

Promise<string | null>

setActivityName()

setActivityName(name): Promise<void>

Defined in: window.ts:370

Android-only upstream: accepted as a documented no-op on desktop.

Parameters
name

string

Returns

Promise<void>

setAlwaysOnBottom()

setAlwaysOnBottom(alwaysOnBottom): Promise<void>

Defined in: window.ts:594

Keeps the window below all other windows (v2-only).

Parameters
alwaysOnBottom

boolean

Returns

Promise<void>

setAlwaysOnTop()

setAlwaysOnTop(alwaysOnTop): Promise<void>

Defined in: window.ts:586

Parameters
alwaysOnTop

boolean

Returns

Promise<void>

setBackgroundColor()

setBackgroundColor(color): Promise<void>

Defined in: window.ts:857

Sets the window background color: "#rrggbb", "#rrggbbaa" or "transparent". Takes effect on frameless/transparent windows.

Parameters
color

string

Returns

Promise<void>

setBadgeCount()

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.

Parameters
count

number | null

Returns

Promise<void>

setBadgeLabel()

setBadgeLabel(badgeLabel): Promise<void>

Defined in: window.ts:846

Sets the dock badge to arbitrary text (macOS only). null/undefined/"" removes the badge.

Parameters
badgeLabel

string | null

Returns

Promise<void>

setBounds()

setBounds(x, y, width?, height?): Promise<void>

Defined in: window.ts:437

Sets the window bounds (position + size in one op, dpi types accepted).

Parameters
x

PositionLike

y

SizeLike

width?

number

height?

number

Returns

Promise<void>

setClosable()

setClosable(closable): Promise<void>

Defined in: window.ts:634

Toggles the native close button.

Parameters
closable

boolean

Returns

Promise<void>

setContentProtected()

setContentProtected(protect): Promise<void>

Defined in: window.ts:665

Prevents the window contents from being captured by other apps.

Parameters
protect

boolean

Returns

Promise<void>

setCursor()

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, …).

Parameters
cursor

string

Returns

Promise<void>

setCursorGrab()

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.

Parameters
grab

boolean

Returns

Promise<void>

setCursorIcon()

setCursorIcon(icon): Promise<void>

Defined in: window.ts:350

Alias of setCursor (Tauri v2 name).

Parameters
icon

string

Returns

Promise<void>

setCursorPosition()

setCursorPosition(x, y?): Promise<void>

Defined in: window.ts:395

Warps the cursor to window coordinates (dpi types accepted).

Parameters
x

PositionLike

y?

number

Returns

Promise<void>

setCursorVisible()

setCursorVisible(visible): Promise<void>

Defined in: window.ts:357

Hides/shows the system cursor (app-global hide counter — pair calls).

Parameters
visible

boolean

Returns

Promise<void>

setDecorations()

setDecorations(decorations): Promise<void>

Defined in: window.ts:783

Toggles native window decorations (title bar / borders).

Parameters
decorations

boolean

Returns

Promise<void>

setEffects()

setEffects(effects): Promise<void>

Defined in: window.ts:292

Vibrancy material (macOS). Windows-only effects are ignored there.

Parameters
effects

Effects

Returns

Promise<void>

setEnabled()

setEnabled(enabled): Promise<void>

Defined in: window.ts:463

Enables/disables the native window.

Parameters
enabled

boolean

Returns

Promise<void>

setFileDropEnabled()

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.

Parameters
enabled

boolean

Returns

Promise<void>

setFocus()

setFocus(): Promise<void>

Defined in: window.ts:689

Returns

Promise<void>

setFocusable()

setFocusable(focusable): Promise<void>

Defined in: window.ts:896

Toggles whether the window can take keyboard focus.

Parameters
focusable

boolean

Returns

Promise<void>

setFullscreen()

setFullscreen(fullscreen): Promise<void>

Defined in: window.ts:573

Parameters
fullscreen

boolean

Returns

Promise<void>

setIcon()

setIcon(icon): Promise<void>

Defined in: window.ts:273

Sets the window/dock icon from an Image (registered host image). Pass null to clear.

Parameters
icon

Image | null

Returns

Promise<void>

setIgnoreCursorEvents()

setIgnoreCursorEvents(ignore): Promise<void>

Defined in: window.ts:239

Toggles whether the window ignores mouse/cursor events.

Parameters
ignore

boolean

Returns

Promise<void>

setMaximizable()

setMaximizable(maximizable): Promise<void>

Defined in: window.ts:619

Toggles the native maximize/zoom button.

Parameters
maximizable

boolean

Returns

Promise<void>

setMaxSize()

setMaxSize(size): Promise<void>

Defined in: window.ts:510

Sets the window maximum inner size. null unsets the constraint (dpi types accepted).

Parameters
size

SizeLike | null | undefined

Returns

Promise<void>

setMinimizable()

setMinimizable(minimizable): Promise<void>

Defined in: window.ts:604

Toggles the native minimize button (macOS/Windows; button-mask based).

Parameters
minimizable

boolean

Returns

Promise<void>

setMinSize()

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)).

Parameters
size

SizeLike | null | undefined

Returns

Promise<void>

setOpacity()

setOpacity(opacity): Promise<void>

Defined in: window.ts:705

Sets the window opacity, 0.0 (transparent) to 1.0 (opaque).

Parameters
opacity

number

Returns

Promise<void>

setOverlayIcon()

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.

Parameters
icon

Image | null

Returns

Promise<void>

setPosition()

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.

Parameters
x

PositionLike

y?

number

Returns

Promise<void>

setProgressBar()

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.

Parameters
progress

number | ProgressBarStateInput | null

Returns

Promise<void>

setResizable()

setResizable(resizable): Promise<void>

Defined in: window.ts:697

Parameters
resizable

boolean

Returns

Promise<void>

setSceneIdentifier()

setSceneIdentifier(id): Promise<void>

Defined in: window.ts:380

iOS-only upstream: accepted as a documented no-op on desktop.

Parameters
id

string

Returns

Promise<void>

setShadow()

setShadow(shadow): Promise<void>

Defined in: window.ts:458

Toggles the native window shadow.

Parameters
shadow

boolean

Returns

Promise<void>

setSimpleFullscreen()

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).

Parameters
fullscreen

boolean

Returns

Promise<void>

setSize()

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.

Parameters
width

SizeLike

height?

number

Returns

Promise<void>

setSizeConstraints()

setSizeConstraints(constraints): Promise<void>

Defined in: window.ts:520

Sets min/max inner-size constraints in one call.

Parameters
constraints

WindowSizeConstraints | null | undefined

Returns

Promise<void>

setSkipTaskbar()

setSkipTaskbar(skipTaskbar): Promise<void>

Defined in: window.ts:657

Hides the window icon from the taskbar/dock (macOS: whole app).

Parameters
skipTaskbar

boolean

Returns

Promise<void>

setTheme()

setTheme(theme): Promise<void>

Defined in: window.ts:220

App-wide theme override ("dark"/"light"; null follows system).

Parameters
theme

"dark" | "light" | null

Returns

Promise<void>

setTitle()

setTitle(title): Promise<void>

Defined in: window.ts:178

Parameters
title

string

Returns

Promise<void>

setTitleBarStyle()

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").

Parameters
style

TitleBarStyle

Returns

Promise<void>

setTrafficLightPosition()

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".

Parameters
x

number

y

number

Returns

Promise<void>

setTransparent()

setTransparent(transparent): Promise<void>

Defined in: window.ts:775

Toggles a transparent window background.

Parameters
transparent

boolean

Returns

Promise<void>

setVisible()

setVisible(visible): Promise<void>

Defined in: window.ts:693

Parameters
visible

boolean

Returns

Promise<void>

setVisibleOnAllWorkspaces()

setVisibleOnAllWorkspaces(visible): Promise<void>

Defined in: window.ts:904

Shows the window on all workspaces / virtual desktops (macOS).

Parameters
visible

boolean

Returns

Promise<void>

setZoom()

setZoom(zoom): Promise<void>

Defined in: window.ts:408

Zooms the web content (CSS zoom factor, e.g. 1.5).

Parameters
zoom

number

Returns

Promise<void>

show()

show(): Promise<void>

Defined in: window.ts:225

Alias of setVisible(true) / setVisible(false) (Tauri v2 parity).

Returns

Promise<void>

startDragging()

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.

Returns

Promise<void>

startResizeDragging()

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.

Parameters
direction?

string = "southeast"

Returns

Promise<void>

theme()

theme(): Promise<string | null>

Defined in: window.ts:215

The OS color scheme, alias of getTheme (Tauri v2 parity).

Returns

Promise<string | null>

title()

title(): Promise<string>

Defined in: window.ts:188

Sets the window title (alias of setTitle for Tauri v2 parity).

Returns

Promise<string>

toggleMaximize()

toggleMaximize(): Promise<void>

Defined in: window.ts:551

Returns

Promise<void>

unmaximize()

unmaximize(): Promise<void>

Defined in: window.ts:561

Restores a maximized window (no-op when not zoomed).

Returns

Promise<void>

unminimize()

unminimize(): Promise<void>

Defined in: window.ts:547

Returns

Promise<void>

getByLabel()

static getByLabel(label): Promise<Window | null>

Defined in: window.ts:164

Looks up a live window by label (null when it doesn't exist).

Parameters
label

string

Returns

Promise<Window | null>

getCurrent()

static getCurrent(): Window

Defined in: window.ts:169

The current window (label from the bootstrap metadata).

Returns

Window

Interfaces

Effects

Defined in: window.ts:1080

Window effect configuration (Tauri Effects).

Properties

color?

optional color?: string | null

Defined in: window.ts:1084

effects

effects: Effect[]

Defined in: window.ts:1081

radius?

optional radius?: number

Defined in: window.ts:1083

state?

optional state?: EffectState

Defined in: window.ts:1082


Monitor

Defined in: window.ts:122

A physical display (values in physical pixels).

Properties

name

name: string | null

Defined in: window.ts:123

position

position: object

Defined in: window.ts:124

x

x: number

y

y: number

scaleFactor

scaleFactor: number

Defined in: window.ts:128

size

size: object

Defined in: window.ts:125

height

height: number

width

width: number

workArea

workArea: object

Defined in: window.ts:127

Usable area (excludes menu bar / dock / taskbar).

height

height: number

width

width: number

x

x: number

y

y: number


ProgressBarStateInput

Defined in: window.ts:82

Properties

status

status: ProgressBarStatus

Defined in: window.ts:83

value?

optional value?: number

Defined in: window.ts:85

Determinate value when status is Normal/Paused/Error.


WindowSizeConstraints

Defined in: window.ts:98

Window inner-size constraints (logical pixels; undefined = unset).

Properties

maxHeight?

optional maxHeight?: number

Defined in: window.ts:102

maxWidth?

optional maxWidth?: number

Defined in: window.ts:101

minHeight?

optional minHeight?: number

Defined in: window.ts:100

minWidth?

optional minWidth?: number

Defined in: window.ts:99

Type Aliases

CursorIcon

CursorIcon = typeof CursorIcon[keyof typeof CursorIcon]

Defined in: window.ts:34

Stock cursor shapes accepted by setCursor/setCursorIcon (upstream CursorIcon union members).


TitleBarStyle

TitleBarStyle = "visible" | "transparent" | "overlay"

Defined in: window.ts:95

Title-bar style (macOS only).


WindowEventName

WindowEventName = "resize" | "move" | "focus" | "blur" | "close-requested" | "suspended" | "resumed" | "scale-change" | "theme-changed" | "drag-enter" | "drag-over" | "drag-drop" | "drag-leave"

Defined in: window.ts:15

Variables

CursorIcon

const CursorIcon: object

Defined in: window.ts:34

Stock cursor shapes accepted by setCursor/setCursorIcon (upstream CursorIcon union members).

Type Declaration

Alias

readonly Alias: "alias" = "alias"

AllScroll

readonly AllScroll: "allScroll" = "allScroll"

Arrow

readonly Arrow: "arrow" = "arrow"

Cell

readonly Cell: "cell" = "cell"

ColResize

readonly ColResize: "colResize" = "colResize"

ContextMenu

readonly ContextMenu: "contextMenu" = "contextMenu"

Copy

readonly Copy: "copy" = "copy"

Crosshair

readonly Crosshair: "crosshair" = "crosshair"

Default

readonly Default: "default" = "default"

EResize

readonly EResize: "eResize" = "eResize"

EwResize

readonly EwResize: "ewResize" = "ewResize"

Grab

readonly Grab: "grab" = "grab"

Grabbing

readonly Grabbing: "grabbing" = "grabbing"

Hand

readonly Hand: "hand" = "hand"

Help

readonly Help: "help" = "help"

Move

readonly Move: "move" = "move"

NeResize

readonly NeResize: "neResize" = "neResize"

NeswResize

readonly NeswResize: "neswResize" = "neswResize"

NoDrop

readonly NoDrop: "noDrop" = "noDrop"

NotAllowed

readonly NotAllowed: "notAllowed" = "notAllowed"

NResize

readonly NResize: "nResize" = "nResize"

NsResize

readonly NsResize: "nsResize" = "nsResize"

NwResize

readonly NwResize: "nwResize" = "nwResize"

NwseResize

readonly NwseResize: "nwseResize" = "nwseResize"

Progress

readonly Progress: "progress" = "progress"

RowResize

readonly RowResize: "rowResize" = "rowResize"

SeResize

readonly SeResize: "seResize" = "seResize"

SResize

readonly SResize: "sResize" = "sResize"

SwResize

readonly SwResize: "swResize" = "swResize"

Text

readonly Text: "text" = "text"

VerticalText

readonly VerticalText: "verticalText" = "verticalText"

Wait

readonly Wait: "wait" = "wait"

WResize

readonly WResize: "wResize" = "wResize"

ZoomIn

readonly ZoomIn: "zoomIn" = "zoomIn"

ZoomOut

readonly ZoomOut: "zoomOut" = "zoomOut"

Functions

availableMonitors()

availableMonitors(): Promise<Monitor[]>

Defined in: window.ts:997

The list of all monitors (physical px).

Returns

Promise<Monitor[]>


currentMonitor()

currentMonitor(): Promise<Monitor | null>

Defined in: window.ts:1005

The monitor containing the window (or null off-screen).

Returns

Promise<Monitor | null>


cursorPosition()

cursorPosition(): Promise<{ x: number; y: number; }>

Defined in: window.ts:1091

Global mouse position in screen coordinates — no window label required (upstream cursorPosition() standalone helper).

Returns

Promise<{ x: number; y: number; }>


getAllWindows()

getAllWindows(): Promise<Window[]>

Defined in: window.ts:991

All live window labels as Window handles.

Returns

Promise<Window[]>


monitorFromPoint()

monitorFromPoint(x, y): Promise<Monitor | null>

Defined in: window.ts:1015

The monitor containing a desktop point (physical px, top-left origin).

Parameters

x

number

y

number

Returns

Promise<Monitor | null>


primaryMonitor()

primaryMonitor(): Promise<Monitor | null>

Defined in: window.ts:1010

The primary display.

Returns

Promise<Monitor | null>


setupDragRegion()

setupDragRegion(target?): () => void

Defined in: window.ts:1029

Enables window dragging from any element with a data-tauri-drag-region attribute (the Tauri frameless-window convention). Call once per page.

Parameters

target?

Document | HTMLElement

Returns

() => void