Skip to main content
This page documents every shared TypeScript interface, enum, and event payload type used across the WebviewJS API. Import them alongside the classes you need:

Geometry types

These interfaces describe sizes, positions, and rectangular regions in logical or physical pixels. The API documentation for each method that uses these types specifies which coordinate space applies.

WebviewCookie represents a cookie stored in a webview’s session. Pass it to webview.setCookie() or receive it from webview.getCookies().

HTTP types

HeaderData

A key-value pair used in request and response headers throughout the custom protocol API.

CustomProtocolResponse

The return type for legacy custom-protocol handlers registered with win.registerProtocol(). You can also return a standard Fetch API Response object.

Monitor

Monitor describes a connected display as reported by the operating system. Retrieve monitors with win.getAvailableMonitors(), win.getCurrentMonitor(), or win.getPrimaryMonitor().
VideoMode describes a single display configuration available for the monitor, useful when entering exclusive fullscreen:

IPC

IpcMessage is the object received by webview.onIpcMessage() whenever page JavaScript calls window.ipc.postMessage().

Application events

ApplicationEvent

The payload type for all events emitted by app.on(...).
customMenuEvent is only present when event === WebviewApplicationEvent.CustomMenuClick.

CustomMenuEvent


Enums

WebviewApplicationEvent

Discriminates the event field of every ApplicationEvent payload delivered to app.on(...) listeners.

Theme

Controls or reports the colour scheme of a window or webview.

FullscreenType

Passed to win.setFullscreen() to choose the fullscreen strategy.

ProgressBarState

Passed inside a JsProgressBar object to win.setProgressBar() to update the taskbar progress indicator.

CursorType

Pass a CursorType value to win.setCursor() to change the mouse cursor shape over the window.

Window event types

BrowserWindowEventMap maps event name strings to their typed payload interfaces. Register listeners with win.on(eventName, handler).

Webview event types

WebviewEventMap maps webview event names to their typed payloads. Register listeners with webview.on(eventName, handler).

Application event types

ApplicationEventMap maps application event names to their payloads. Register listeners with app.on(eventName, handler).

SerializationError

SerializationError is a subclass of Error with name === "SerializationError". The webview.expose() helper uses JSON serialization for all static values, function arguments, and return values. If you pass or return a value that cannot be serialized to JSON (such as a Map, a Set, a Symbol, a BigInt, a circular reference, or an undefined property), expose() or the proxied function call rejects with a SerializationError.

WebContextOptions

WebContextOptions is passed to app.createWebContext() to configure an isolated browsing context for one or more webviews. Webviews that share a WebContext also share their cookie store and cache.
See the WebContext reference for full details on context sharing and disposal.