Skip to content

Interface: BrowserWindow

API / @xmachines/play-dom-router / BrowserWindow

Defined in: play-dom-router/src/create-browser-history.ts:59

The minimal window interface of createBrowserHistory

This structural interface holds only the properties that the package uses. It accepts Window, a JSDOM window, and every compatible test double. The package therefore does not depend on Window & typeof globalThis, which is different in each environment.

Properties

PropertyModifierTypeDefined in
historypublicobjectplay-dom-router/src/create-browser-history.ts:60
history.statereadonlyunknownplay-dom-router/src/create-browser-history.ts:61
history.backpublicvoidplay-dom-router/src/create-browser-history.ts:65
history.forwardpublicvoidplay-dom-router/src/create-browser-history.ts:66
history.gopublicvoidplay-dom-router/src/create-browser-history.ts:64
history.pushStatepublicvoidplay-dom-router/src/create-browser-history.ts:62
history.replaceStatepublicvoidplay-dom-router/src/create-browser-history.ts:63
locationpublicobjectplay-dom-router/src/create-browser-history.ts:68
location.hashreadonlystringplay-dom-router/src/create-browser-history.ts:71
location.pathnamereadonlystringplay-dom-router/src/create-browser-history.ts:69
location.searchreadonlystringplay-dom-router/src/create-browser-history.ts:70

Methods

addEventListener()

addEventListener(type, listener): void;

Defined in: play-dom-router/src/create-browser-history.ts:73

Parameters

ParameterType
type"popstate"
listener() => void

Returns

void


removeEventListener()

removeEventListener(type, listener): void;

Defined in: play-dom-router/src/create-browser-history.ts:74

Parameters

ParameterType
type"popstate"
listener() => void

Returns

void