This page catalogs every type exported fromDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/webviewjs/webview/llms.txt
Use this file to discover all available pages before exploring further.
@webviewjs/webview that is shared across multiple parts of the API. Consult it when you need the exact shape of a payload, the numeric value of an enum member, or the precise signature of a utility type. Types that belong entirely to one feature area are documented in detail on their own page (Tray, Notification, Menu, BrowserWindow, Webview) — cross-references are provided below.
Enums
ControlFlow
Controls how the native tao event loop behaves between events. Kept for backward compatibility; normal applications use app.run() or app.whenReady() instead.
| Member | Value | Description |
|---|---|---|
Poll | 0 | Pump events as fast as possible without sleeping |
Wait | 1 | Block until the next event arrives |
WaitUntil | 2 | Block until a specific instant or the next event |
Exit | 3 | Exit the event loop cleanly |
ExitWithCode | 4 | Exit with a specific process exit code |
CursorType
Cursor shape values passed to BrowserWindow.setCursor().
| Member | Value | Member | Value |
|---|---|---|---|
Default | 0 | Crosshair | 1 |
Hand | 2 | Arrow | 3 |
Move | 4 | Text | 5 |
Wait | 6 | Help | 7 |
Progress | 8 | NotAllowed | 9 |
ContextMenu | 10 | Cell | 11 |
VerticalText | 12 | Alias | 13 |
Copy | 14 | NoDrop | 15 |
Grab | 16 | Grabbing | 17 |
ZoomIn | 18 | ZoomOut | 19 |
ResizeEast | 20 | ResizeNorth | 21 |
ResizeNorthEast | 22 | ResizeNorthWest | 23 |
ResizeSouth | 24 | ResizeSouthEast | 25 |
ResizeSouthWest | 26 | ResizeWest | 27 |
ResizeEastWest | 28 | ResizeNorthSouth | 29 |
ResizeNorthEastSouthWest | 30 | ResizeNorthWestSouthEast | 31 |
ResizeColumn | 32 | ResizeRow | 33 |
AllScroll | 34 |
FullscreenType
Passed to BrowserWindow.setFullscreen() and BrowserWindowOptions.fullscreen.
| Member | Value | Description |
|---|---|---|
Exclusive | 0 | Exclusive fullscreen — takes over the entire display |
Borderless | 1 | Borderless windowed fullscreen — window fills the screen with no chrome |
IosValidOrientations
Passed to BrowserWindow.setValidOrientations() and BrowserWindowOptions.iosValidOrientations on iOS.
| Member | Value | Description |
|---|---|---|
LandscapeAndPortrait | 0 | Allow all orientations |
Landscape | 1 | Landscape only |
Portrait | 2 | Portrait only |
ProgressBarState
Passed inside JsProgressBar to BrowserWindow.setProgressBar().
| Member | Value | Description |
|---|---|---|
None | 0 | No progress indicator |
Normal | 1 | Standard progress bar |
Indeterminate | 2 | Spinning/pulsing indicator |
Paused | 3 | Paused state (yellow on Windows) |
Error | 4 | Error state (red on Windows) |
Theme
Passed to BrowserWindowOptions and WebviewOptions.theme.
| Member | Value | Description |
|---|---|---|
Light | 0 | Force light theme |
Dark | 1 | Force dark theme |
System | 2 | Follow the OS preference |
WebviewApplicationEvent
Discriminant values for ApplicationEvent.event. In normal code you key on the string event name passed to app.on(), not on this numeric enum.
| Member | Value | app.on() name |
|---|---|---|
WindowCloseRequested | 0 | "window-close-requested" |
ApplicationCloseRequested | 1 | "application-close-requested" |
CustomMenuClick | 2 | "custom-menu-click" |
Ready | 3 | "ready" |
WebviewEventType
Numeric discriminant carried in WebviewEventPayload.event. Normal code keys on the string name via webview.on().
| Member | Value | webview.on() name |
|---|---|---|
PageLoadStarted | 0 | "page-load-started" |
PageLoadFinished | 1 | "page-load-finished" |
TitleChanged | 2 | "title-changed" |
DownloadStarted | 3 | "download-started" |
DownloadCompleted | 4 | "download-completed" |
NavigationStarted | 5 | "navigation" |
NewWindowRequested | 6 | "new-window" |
WindowEventType
Numeric discriminant carried in WindowEventPayload.event. Normal code keys on the string name via win.on().
| Member | Value | win.on() name | Typed payload | Key payload fields |
|---|---|---|---|---|
Moved | 0 | "move" | WindowMoveEvent | x, y (physical px, outer position) |
Resized | 1 | "resize" | WindowResizeEvent | width, height (physical px, inner size) |
CloseRequested | 2 | "close" | WindowBaseEvent | — |
Focused | 3 | "focus" | WindowBaseEvent | — |
Blurred | 4 | "blur" | WindowBaseEvent | — |
MouseEnter | 5 | "mouse-enter" | WindowMouseEvent | x, y |
MouseLeave | 6 | "mouse-leave" | WindowBaseEvent | — |
MouseMove | 7 | "mouse-move" | WindowMouseEvent | x, y |
MouseDown | 8 | "mouse-down" | WindowMouseEvent | x, y, button |
MouseUp | 9 | "mouse-up" | WindowMouseEvent | x, y, button |
Scroll | 10 | "scroll" | WindowScrollEvent | deltaX, deltaY |
KeyDown | 11 | "key-down" | WindowKeyEvent | key, code, modifiers, isRepeat |
KeyUp | 12 | "key-up" | WindowKeyEvent | key, code, modifiers |
FileDrop | 13 | "file-drop" | WindowFileEvent | files |
FileHover | 14 | "file-hover" | WindowFileEvent | files |
FileHoverCancelled | 15 | "file-hover-cancelled" | WindowBaseEvent | — |
ScaleFactorChanged | 16 | "scale-factor-changed" | WindowScaleEvent | scaleFactor |
ThemeChanged | 17 | "theme-changed" | WindowThemeEvent | text ("light" | "dark") |
Ime | 18 | "ime" | WindowImeEvent | text, phase |
Touch | 19 | "touch" | WindowTouchEvent | x, y, touchId, phase |
Interfaces
AndroidContentRect
Inset rectangle reported by BrowserWindow.androidContentRect() on Android.
ApplicationEvent
Payload delivered to app.on() listeners.
Numeric discriminant identifying the event type.
Present only for
CustomMenuClick events.ApplicationOptions
Passed to new Application(options?).
Event-loop scheduling strategy. Defaults to the Rust tao default.
Maximum milliseconds to wait between event-loop ticks when using
ControlFlow.WaitUntil.Process exit code used when
ControlFlow.ExitWithCode terminates the loop.ApplicationRunOptions
Passed to app.run(options?).
Milliseconds between event-loop pumps. Defaults to
16 (≈60 FPS).Whether the pump timer should keep the Node.js event loop alive. Defaults to
true.ApplicationWhenReadyOptions
Passed to app.whenReady(options?). Two overloads exist:
CustomMenuEvent
Carried inside ApplicationEvent for custom-menu-click events.
The
id set on the MenuItemOptions that was activated.Numeric identifier of the window whose menu bar contained the item.
CustomProtocolRequest
Legacy plain-object shape delivered to low-level protocol handlers. The public BrowserWindow.registerProtocol() callback receives a standard Fetch API Request instead.
Full URL, e.g.
"app://localhost/index.html".HTTP method string, e.g.
"GET", "POST".Request headers as key/value pairs.
Request body bytes. Present for POST / PUT requests.
CustomProtocolResponse
Returned by protocol handlers. registerProtocol() also accepts a standard Fetch API Response.
Response body bytes. Required.
MIME type, e.g.
"text/html". Defaults to "application/octet-stream".HTTP status code. Defaults to
200.Additional response headers.
Dimensions
A width/height pair used throughout the API.
ExposeCallData
Delivered to the internal handler when the page calls a function exposed via webview.expose().
The namespace name passed to
expose().The function name the page called.
Unique call ID used to route the response back.
JSON-serialized array of arguments the page passed.
FileDialogOptions
Passed to BrowserWindow.openFileDialog().
Allow selecting multiple files. Defaults to
false.Dialog window title.
Initial directory or file path.
File type filters shown in the dialog.
HeaderData
A single HTTP header key/value pair used in protocol requests and responses.
IpcMessage
Received by the webview.onIpcMessage() callback when page JavaScript calls window.ipc.postMessage().
Raw message body bytes.
HTTP-style method string.
IPC message headers.
Destination URI.
JsProgressBar
Passed to BrowserWindow.setProgressBar().
Visual state of the progress bar.
Progress value (0–100).
Monitor
Describes a physical display, returned by BrowserWindow.getAvailableMonitors() and related methods.
Platform display name.
DPI scale factor (e.g.
2 for HiDPI).Display resolution in physical pixels.
Top-left corner of the monitor in the virtual screen space.
Available video modes for this display.
VideoMode
One entry in Monitor.videoModes.
Resolution in physical pixels.
Color depth in bits per pixel.
Refresh rate in Hz.
NativeNotificationOptions
Low-level options consumed by the NativeNotification NAPI class. Normal application code uses the higher-level Notification class instead.
Notification title.
Body text.
Icon path or platform name.
Local file path for the inline image.
Encoded image bytes for the inline image.
Persist until interaction.
Keep process alive until interaction or closure.
Action buttons.
NativeNotificationAction
Position
An x/y coordinate pair.
WebContextOptions
Passed to app.createWebContext().
Custom path for WebView data storage. Useful on Windows when the application is installed in Program Files.
Enable WebDriver automation for testing. Currently only enforced on Linux. At most one context may have automation enabled at a time.
WebviewBounds
Logical-pixel rectangle used by Webview.setBounds() / getBounds().
WebviewCookie
Represents a browser cookie, used with Webview.getCookies(), setCookie(), and deleteCookie().
Cookie name.
Cookie value.
Scope domain.
Scope path.
Whether the cookie is HTTP-only.
Whether the cookie requires HTTPS.
SameSite policy.
WebviewEventPayload
Delivered to the internal webview event callback. Normal code uses webview.on() string events.
Numeric event discriminant.
URL for navigation, page-load, and download events.
Document title for
TitleChanged events.Download success flag for
DownloadCompleted events.Webview event interfaces
Typed payloads delivered towebview.on() listeners, keyed by the WebviewEventMap.
WebviewEventMap — maps webview.on() event names to their typed payloads:
| Event name | Payload type |
|---|---|
"page-load-started" | WebviewPageLoadEvent |
"page-load-finished" | WebviewPageLoadEvent |
"title-changed" | WebviewTitleChangedEvent |
"download-started" | WebviewDownloadStartedEvent |
"download-completed" | WebviewDownloadEvent |
"navigation" | WebviewNavigationEvent |
"new-window" | WebviewNewWindowEvent |
Window event interfaces
Typed payloads delivered towin.on() listeners, keyed by BrowserWindowEventMap. All interfaces carry an event: number discriminant matching the WindowEventType value.
WindowEventPayload
Delivered to the internal window event callback. Normal code uses win.on() string events.
Numeric event discriminant.
Physical x position (cursor or outer window).
Physical y position (cursor or outer window).
Physical width (resize events).
Physical height (resize events).
Mouse button index:
0=left, 1=middle, 2=right.Horizontal scroll delta in pixels.
Vertical scroll delta in pixels.
DOM
KeyboardEvent.key value, e.g. "a", "Enter", "ArrowLeft".DOM
KeyboardEvent.code value, e.g. "KeyA", "ArrowLeft".Modifier bitmask:
1=Shift, 2=Ctrl, 4=Alt, 8=Meta/Super/Command.Whether the key event is a repeat from holding the key.
File paths for
FileDrop / FileHover events.DPI scale factor for
ScaleFactorChanged events.IME preedit/committed text, or
"light" / "dark" for ThemeChanged events.Touch point identifier for
Touch events.Phase string:
"started" / "moved" / "ended" / "cancelled" for Touch; "enabled" / "preedit" / "commit" / "disabled" for IME.Helper Types
JsonValue
Represents any JSON-serializable value. Used as the constraint for static properties exposed via webview.expose().
ExposedTarget
The shape of the object passed to webview.expose(name, target). Values may be JsonValue (serialized as static properties) or functions (proxied as async stubs in the page).
EventListener<TPayload>
Typed event listener callback used throughout the TypedEventEmitter interface.
TypedEventEmitter<TEventMap>
The shared EventEmitter interface implemented by Application, BrowserWindow, Webview, TrayIcon, Notification, and WebContext. TEventMap maps event name strings to their payload types.
SerializationError
Extends Error. Thrown (or used to reject returned Promises) by webview.expose() when an argument, return value, or static property cannot be serialized to JSON.
BrowserWindowEventMap
Maps win.on() event names to their typed payload interfaces. All payloads include an event: number discriminant.
ApplicationEventMap
Maps app.on() event names to their typed payload.
TrayEventMap
Maps tray.on() event names to their typed payload. See the Tray Icon API page for full details.
Notification types
| Type | Definition |
|---|---|
NotificationPermission | 'granted' |
NotificationDirection | 'auto' | 'ltr' | 'rtl' |
NotificationEventName | 'click' | 'close' | 'error' | 'show' |
Notification class, NotificationOptions, NotificationAction, and NotificationEvent documentation.
Tray types
TrayIconOptions, TrayIconImage, TrayRect, and TrayEventPayload are documented in full on the Tray Icon API page.
Menu types
MenuOptions and MenuItemOptions are documented in full on the Menu API page.
Standalone Exports
getWebviewVersion()
VERSION
@webviewjs/webview package, inlined at build time.