Options
All
  • Public
  • Public/Protected
  • All
Menu

A window containing a DOM document; the document property points to the DOM document loaded in that window.

Hierarchy

Indexable

[index: number]: Window

Index

Properties

Accessors

Methods

Properties

after

Execute after running tests.

  • Only available when invoked via the mocha CLI.
see

https://mochajs.org/api/global.html#after

afterEach

afterEach: HookFunction

Execute after each test case.

  • Only available when invoked via the mocha CLI.
see

https://mochajs.org/api/global.html#afterEach

before

before: HookFunction

Execute before running tests.

  • Only available when invoked via the mocha CLI.
see

https://mochajs.org/api/global.html#before

beforeEach

beforeEach: HookFunction

Execute before each test case.

  • Only available when invoked via the mocha CLI.
see

https://mochajs.org/api/global.html#beforeEach

Readonly caches

caches: CacheStorage

Readonly clientInformation

clientInformation: Navigator
deprecated

This is a legacy alias of navigator.

Readonly closed

closed: boolean

Returns true if the window has been closed, false otherwise.

context

context: SuiteFunction

Describe a "suite" containing nested suites and tests.

  • Only available when invoked via the mocha CLI.

Readonly crossOriginIsolated

crossOriginIsolated: boolean

Readonly crypto

crypto: Crypto

Readonly customElements

customElements: CustomElementRegistry

Defines a new custom element, mapping the given name to the given constructor as an autonomous custom element.

describe

describe: SuiteFunction

Describe a "suite" containing nested suites and tests.

  • Only available when invoked via the mocha CLI.

Readonly devicePixelRatio

devicePixelRatio: number

Readonly document

document: Document

Readonly event

event: undefined | Event
deprecated

Readonly external

external: External
deprecated

Readonly frameElement

frameElement: null | Element

Readonly frames

frames: Window

Readonly history

history: History

Readonly indexedDB

indexedDB: IDBFactory

Readonly innerHeight

innerHeight: number

Readonly innerWidth

innerWidth: number

Readonly isSecureContext

isSecureContext: boolean

it

Describes a test case.

  • Only available when invoked via the mocha CLI.

Readonly length

length: number

Readonly localStorage

localStorage: Storage

Readonly locationbar

locationbar: BarProp

Returns true if the location bar is visible; otherwise, returns false.

Readonly menubar

menubar: BarProp

Returns true if the menu bar is visible; otherwise, returns false.

name

name: string

Readonly navigator

navigator: Navigator

onabort

onabort: null | ((ev: UIEvent) => any)

Fires when the user aborts the download.

param

The event.

onafterprint

onafterprint: null | ((ev: Event) => any)

onanimationcancel

onanimationcancel: null | ((ev: AnimationEvent) => any)

onanimationend

onanimationend: null | ((ev: AnimationEvent) => any)

onanimationiteration

onanimationiteration: null | ((ev: AnimationEvent) => any)

onanimationstart

onanimationstart: null | ((ev: AnimationEvent) => any)

onauxclick

onauxclick: null | ((ev: MouseEvent) => any)

onbeforeprint

onbeforeprint: null | ((ev: Event) => any)

onbeforeunload

onbeforeunload: null | ((ev: BeforeUnloadEvent) => any)

onblur

onblur: null | ((ev: FocusEvent) => any)

Fires when the object loses the input focus.

param

The focus event.

oncanplay

oncanplay: null | ((ev: Event) => any)

Occurs when playback is possible, but would require further buffering.

param

The event.

oncanplaythrough

oncanplaythrough: null | ((ev: Event) => any)

onchange

onchange: null | ((ev: Event) => any)

Fires when the contents of the object or selection have changed.

param

The event.

onclick

onclick: null | ((ev: MouseEvent) => any)

Fires when the user clicks the left mouse button on the object

param

The mouse event.

onclose

onclose: null | ((ev: Event) => any)

oncontextmenu

oncontextmenu: null | ((ev: MouseEvent) => any)

Fires when the user clicks the right mouse button in the client area, opening the context menu.

param

The mouse event.

oncuechange

oncuechange: null | ((ev: Event) => any)

ondblclick

ondblclick: null | ((ev: MouseEvent) => any)

Fires when the user double-clicks the object.

param

The mouse event.

ondevicemotion

ondevicemotion: null | ((ev: DeviceMotionEvent) => any)

ondeviceorientation

ondeviceorientation: null | ((ev: DeviceOrientationEvent) => any)

ondrag

ondrag: null | ((ev: DragEvent) => any)

Fires on the source object continuously during a drag operation.

param

The event.

ondragend

ondragend: null | ((ev: DragEvent) => any)

Fires on the source object when the user releases the mouse at the close of a drag operation.

param

The event.

ondragenter

ondragenter: null | ((ev: DragEvent) => any)

Fires on the target element when the user drags the object to a valid drop target.

param

The drag event.

ondragleave

ondragleave: null | ((ev: DragEvent) => any)

Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.

param

The drag event.

ondragover

ondragover: null | ((ev: DragEvent) => any)

Fires on the target element continuously while the user drags the object over a valid drop target.

param

The event.

ondragstart

ondragstart: null | ((ev: DragEvent) => any)

Fires on the source object when the user starts to drag a text selection or selected object.

param

The event.

ondrop

ondrop: null | ((ev: DragEvent) => any)

ondurationchange

ondurationchange: null | ((ev: Event) => any)

Occurs when the duration attribute is updated.

param

The event.

onemptied

onemptied: null | ((ev: Event) => any)

Occurs when the media element is reset to its initial state.

param

The event.

onended

onended: null | ((ev: Event) => any)

Occurs when the end of playback is reached.

param

The event

onerror

Fires when an error occurs during object loading.

param

The event.

onfocus

onfocus: null | ((ev: FocusEvent) => any)

Fires when the object receives focus.

param

The event.

onformdata

onformdata: null | ((ev: FormDataEvent) => any)

ongamepadconnected

ongamepadconnected: null | ((ev: Event) => any)

ongamepaddisconnected

ongamepaddisconnected: null | ((ev: Event) => any)

ongotpointercapture

ongotpointercapture: null | ((ev: PointerEvent) => any)

onhashchange

onhashchange: null | ((ev: Event) => any)

oninput

oninput: null | ((ev: Event) => any)

oninvalid

oninvalid: null | ((ev: Event) => any)

onkeydown

onkeydown: null | ((ev: KeyboardEvent) => any)

Fires when the user presses a key.

param

The keyboard event

onkeypress

onkeypress: null | ((ev: KeyboardEvent) => any)

Fires when the user presses an alphanumeric key.

param

The event.

deprecated

onkeyup

onkeyup: null | ((ev: KeyboardEvent) => any)

Fires when the user releases a key.

param

The keyboard event

onlanguagechange

onlanguagechange: null | ((ev: Event) => any)

onload

onload: null | ((ev: Event) => any)

Fires immediately after the browser loads the object.

param

The event.

onloadeddata

onloadeddata: null | ((ev: Event) => any)

Occurs when media data is loaded at the current playback position.

param

The event.

onloadedmetadata

onloadedmetadata: null | ((ev: Event) => any)

Occurs when the duration and dimensions of the media have been determined.

param

The event.

onloadstart

onloadstart: null | ((ev: Event) => any)

Occurs when Internet Explorer begins looking for media data.

param

The event.

onlostpointercapture

onlostpointercapture: null | ((ev: PointerEvent) => any)

onmessage

onmessage: null | ((ev: MessageEvent<any>) => any)

onmessageerror

onmessageerror: null | ((ev: MessageEvent<any>) => any)

onmousedown

onmousedown: null | ((ev: MouseEvent) => any)

Fires when the user clicks the object with either mouse button.

param

The mouse event.

onmouseenter

onmouseenter: null | ((ev: MouseEvent) => any)

onmouseleave

onmouseleave: null | ((ev: MouseEvent) => any)

onmousemove

onmousemove: null | ((ev: MouseEvent) => any)

Fires when the user moves the mouse over the object.

param

The mouse event.

onmouseout

onmouseout: null | ((ev: MouseEvent) => any)

Fires when the user moves the mouse pointer outside the boundaries of the object.

param

The mouse event.

onmouseover

onmouseover: null | ((ev: MouseEvent) => any)

Fires when the user moves the mouse pointer into the object.

param

The mouse event.

onmouseup

onmouseup: null | ((ev: MouseEvent) => any)

Fires when the user releases a mouse button while the mouse is over the object.

param

The mouse event.

onoffline

onoffline: null | ((ev: Event) => any)

ononline

ononline: null | ((ev: Event) => any)

onorientationchange

onorientationchange: null | ((ev: Event) => any)
deprecated

onpagehide

onpagehide: null | ((ev: PageTransitionEvent) => any)

onpageshow

onpageshow: null | ((ev: PageTransitionEvent) => any)

onpause

onpause: null | ((ev: Event) => any)

Occurs when playback is paused.

param

The event.

onplay

onplay: null | ((ev: Event) => any)

Occurs when the play method is requested.

param

The event.

onplaying

onplaying: null | ((ev: Event) => any)

Occurs when the audio or video has started playing.

param

The event.

onpointercancel

onpointercancel: null | ((ev: PointerEvent) => any)

onpointerdown

onpointerdown: null | ((ev: PointerEvent) => any)

onpointerenter

onpointerenter: null | ((ev: PointerEvent) => any)

onpointerleave

onpointerleave: null | ((ev: PointerEvent) => any)

onpointermove

onpointermove: null | ((ev: PointerEvent) => any)

onpointerout

onpointerout: null | ((ev: PointerEvent) => any)

onpointerover

onpointerover: null | ((ev: PointerEvent) => any)

onpointerup

onpointerup: null | ((ev: PointerEvent) => any)

onpopstate

onpopstate: null | ((ev: PopStateEvent) => any)

onprogress

onprogress: null | ((ev: ProgressEvent<EventTarget>) => any)

Occurs to indicate progress while downloading media data.

param

The event.

onratechange

onratechange: null | ((ev: Event) => any)

Occurs when the playback rate is increased or decreased.

param

The event.

onrejectionhandled

onrejectionhandled: null | ((ev: PromiseRejectionEvent) => any)

onreset

onreset: null | ((ev: Event) => any)

Fires when the user resets a form.

param

The event.

onresize

onresize: null | ((ev: UIEvent) => any)

onscroll

onscroll: null | ((ev: Event) => any)

Fires when the user repositions the scroll box in the scroll bar on the object.

param

The event.

onseeked

onseeked: null | ((ev: Event) => any)

Occurs when the seek operation ends.

param

The event.

onseeking

onseeking: null | ((ev: Event) => any)

Occurs when the current playback position is moved.

param

The event.

onselect

onselect: null | ((ev: Event) => any)

Fires when the current selection changes.

param

The event.

onselectionchange

onselectionchange: null | ((ev: Event) => any)

onselectstart

onselectstart: null | ((ev: Event) => any)

onstalled

onstalled: null | ((ev: Event) => any)

Occurs when the download has stopped.

param

The event.

onstorage

onstorage: null | ((ev: StorageEvent) => any)

onsubmit

onsubmit: null | ((ev: Event) => any)

onsuspend

onsuspend: null | ((ev: Event) => any)

Occurs if the load operation has been intentionally halted.

param

The event.

ontimeupdate

ontimeupdate: null | ((ev: Event) => any)

Occurs to indicate the current playback position.

param

The event.

ontoggle

ontoggle: null | ((ev: Event) => any)

Optional ontouchcancel

ontouchcancel: null | ((ev: TouchEvent) => any)

Optional ontouchend

ontouchend: null | ((ev: TouchEvent) => any)

Optional ontouchmove

ontouchmove: null | ((ev: TouchEvent) => any)

Optional ontouchstart

ontouchstart: null | ((ev: TouchEvent) => any)

ontransitioncancel

ontransitioncancel: null | ((ev: TransitionEvent) => any)

ontransitionend

ontransitionend: null | ((ev: TransitionEvent) => any)

ontransitionrun

ontransitionrun: null | ((ev: TransitionEvent) => any)

ontransitionstart

ontransitionstart: null | ((ev: TransitionEvent) => any)

onunhandledrejection

onunhandledrejection: null | ((ev: PromiseRejectionEvent) => any)

onunload

onunload: null | ((ev: Event) => any)

onvolumechange

onvolumechange: null | ((ev: Event) => any)

Occurs when the volume is changed, or playback is muted or unmuted.

param

The event.

onwaiting

onwaiting: null | ((ev: Event) => any)

Occurs when playback stops because the next frame of a video resource is not available.

param

The event.

onwebkitanimationend

onwebkitanimationend: null | ((ev: Event) => any)

onwebkitanimationiteration

onwebkitanimationiteration: null | ((ev: Event) => any)

onwebkitanimationstart

onwebkitanimationstart: null | ((ev: Event) => any)

onwebkittransitionend

onwebkittransitionend: null | ((ev: Event) => any)

onwheel

onwheel: null | ((ev: WheelEvent) => any)

opener

opener: any

Readonly orientation

orientation: number
deprecated

Readonly origin

origin: string

Readonly outerHeight

outerHeight: number

Readonly outerWidth

outerWidth: number

Readonly pageXOffset

pageXOffset: number
deprecated

This is a legacy alias of scrollX.

Readonly pageYOffset

pageYOffset: number
deprecated

This is a legacy alias of scrollY.

Readonly parent

parent: Window

Refers to either the parent WindowProxy, or itself. It can rarely be null e.g. for contentWindow of an iframe that is already removed from the parent.

Readonly performance

performance: Performance

Readonly personalbar

personalbar: BarProp

Returns true if the personal bar is visible; otherwise, returns false.

run

run: () => void

Type declaration

Readonly screen

screen: Screen

Readonly screenLeft

screenLeft: number

Readonly screenTop

screenTop: number

Readonly screenX

screenX: number

Readonly screenY

screenY: number

Readonly scrollX

scrollX: number

Readonly scrollY

scrollY: number

Readonly scrollbars

scrollbars: BarProp

Returns true if the scrollbars are visible; otherwise, returns false.

Readonly self

self: Window & typeof globalThis

Readonly sessionStorage

sessionStorage: Storage

setup

Execute before each test case.

  • Only available when invoked via the mocha CLI.
see

https://mochajs.org/api/global.html#beforeEach

specify

specify: TestFunction

Describes a test case.

  • Only available when invoked via the mocha CLI.

Readonly speechSynthesis

speechSynthesis: SpeechSynthesis

status

status: string
deprecated

Readonly statusbar

statusbar: BarProp

Returns true if the status bar is visible; otherwise, returns false.

suite

Describe a "suite" containing nested suites and tests.

  • Only available when invoked via the mocha CLI.

suiteSetup

suiteSetup: HookFunction

Execute before running tests.

  • Only available when invoked via the mocha CLI.
see

https://mochajs.org/api/global.html#before

suiteTeardown

suiteTeardown: HookFunction

Execute after running tests.

  • Only available when invoked via the mocha CLI.
see

https://mochajs.org/api/global.html#after

teardown

teardown: HookFunction

Execute after each test case.

  • Only available when invoked via the mocha CLI.
see

https://mochajs.org/api/global.html#afterEach

test

Describes a test case.

  • Only available when invoked via the mocha CLI.

Readonly toolbar

toolbar: BarProp

Returns true if the toolbar is visible; otherwise, returns false.

Readonly top

top: null | Window

Readonly visualViewport

visualViewport: VisualViewport

Readonly window

window: Window & typeof globalThis

xcontext

Pending suite.

  • Only available when invoked via the mocha CLI.

xdescribe

Pending suite.

  • Only available when invoked via the mocha CLI.

xit

Describes a pending test case.

  • Only available when invoked via the mocha CLI.

xspecify

Describes a pending test case.

  • Only available when invoked via the mocha CLI.

Accessors

location

  • Returns Location

  • Parameters

    Returns void

Methods

addEventListener

alert

  • alert(message?: any): void
  • Parameters

    • Optional message: any

    Returns void

atob

  • atob(data: string): string
  • Parameters

    • data: string

    Returns string

blur

  • blur(): void
  • Returns void

btoa

  • btoa(data: string): string
  • Parameters

    • data: string

    Returns string

cancelAnimationFrame

  • cancelAnimationFrame(handle: number): void

cancelIdleCallback

  • cancelIdleCallback(handle: number): void
  • Parameters

    • handle: number

    Returns void

captureEvents

  • captureEvents(): void
  • deprecated

    Returns void

clearInterval

  • clearInterval(handle?: number): void

clearTimeout

  • clearTimeout(handle?: number): void

close

  • close(): void
  • Closes the window.

    Returns void

confirm

  • confirm(message?: string): boolean
  • Parameters

    • Optional message: string

    Returns boolean

createImageBitmap

dispatchEvent

  • dispatchEvent(event: Event): boolean
  • Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

    Parameters

    Returns boolean

fetch

focus

  • focus(): void
  • Moves the focus to the window's browsing context, if any.

    Returns void

getComputedStyle

  • Parameters

    • elt: Element
    • Optional pseudoElt: null | string

    Returns CSSStyleDeclaration

getSelection

  • Returns null | Selection

matchMedia

  • Parameters

    • query: string

    Returns MediaQueryList

moveBy

  • moveBy(x: number, y: number): void
  • Parameters

    • x: number
    • y: number

    Returns void

moveTo

  • moveTo(x: number, y: number): void
  • Parameters

    • x: number
    • y: number

    Returns void

open

  • open(url?: string | URL, target?: string, features?: string): null | Window
  • Parameters

    • Optional url: string | URL
    • Optional target: string
    • Optional features: string

    Returns null | Window

postMessage

  • Posts a message to the given window. Messages can be structured objects, e.g. nested objects and arrays, can contain JavaScript values (strings, numbers, Date objects, etc), and can contain certain data objects such as File Blob, FileList, and ArrayBuffer objects.

    Objects listed in the transfer member of options are transferred, not just cloned, meaning that they are no longer usable on the sending side.

    A target origin can be specified using the targetOrigin member of options. If not provided, it defaults to "/". This default restricts the message to same-origin targets only.

    If the origin of the target window doesn't match the given target origin, the message is discarded, to avoid information leakage. To send the message to the target regardless of origin, set the target origin to "*".

    Throws a "DataCloneError" DOMException if transfer array contains duplicate objects or if message could not be cloned.

    Parameters

    • message: any
    • targetOrigin: string
    • Optional transfer: Transferable[]

    Returns void

  • Parameters

    Returns void

print

  • print(): void
  • Returns void

prompt

  • prompt(message?: string, _default?: string): null | string
  • Parameters

    • Optional message: string
    • Optional _default: string

    Returns null | string

queueMicrotask

releaseEvents

  • releaseEvents(): void
  • deprecated

    Returns void

removeEventListener

requestAnimationFrame

requestIdleCallback

resizeBy

  • resizeBy(x: number, y: number): void
  • Parameters

    • x: number
    • y: number

    Returns void

resizeTo

  • resizeTo(width: number, height: number): void
  • Parameters

    • width: number
    • height: number

    Returns void

scroll

  • scroll(options?: ScrollToOptions): void
  • scroll(x: number, y: number): void
  • Parameters

    Returns void

  • Parameters

    • x: number
    • y: number

    Returns void

scrollBy

  • scrollBy(options?: ScrollToOptions): void
  • scrollBy(x: number, y: number): void
  • Parameters

    Returns void

  • Parameters

    • x: number
    • y: number

    Returns void

scrollTo

  • scrollTo(options?: ScrollToOptions): void
  • scrollTo(x: number, y: number): void
  • Parameters

    Returns void

  • Parameters

    • x: number
    • y: number

    Returns void

setInterval

  • setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number

setTimeout

  • setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number

stop

  • stop(): void
  • Cancels the document load.

    Returns void