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

  • EventTarget
  • AnimationFrameProvider
  • GlobalEventHandlers
  • WindowEventHandlers
  • WindowLocalStorage
  • WindowOrWorkerGlobalScope
  • WindowSessionStorage
    • Window

Indexable

[index: number]: Window

Index

Properties

Accessors

Methods

Properties

MSInputMethodContext?: unknown
__BUILD_MANIFEST?: Record<string, string[]>
__BUILD_MANIFEST_CB?: Function
__DEV_MIDDLEWARE_MANIFEST?: [location: string, isSSR: boolean][]
__DEV_PAGES_MANIFEST?: { pages: string[] }

Type declaration

  • pages: string[]
__MIDDLEWARE_MANIFEST?: [location: string, isSSR: boolean][]
__MIDDLEWARE_MANIFEST_CB?: Function
__NEXT_DATA__: NEXT_DATA
__SSG_MANIFEST?: Set<string>
caches: CacheStorage

Available only in secure contexts.

clientInformation: Navigator
deprecated

This is a legacy alias of navigator.

closed: boolean

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

crossOriginIsolated: boolean
crypto: Crypto
customElements: CustomElementRegistry

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

devicePixelRatio: number
document: Document
event: undefined | Event
deprecated
external: External
deprecated
frameElement: null | Element
frames: Window
gtag: Gtag
history: History
indexedDB: IDBFactory
innerHeight: number
innerWidth: number
isSecureContext: boolean
length: number
localStorage: Storage
locationbar: BarProp

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

menubar: BarProp

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

name: string
navigator: Navigator
onabort: null | ((this: GlobalEventHandlers, ev: UIEvent) => any)

Fires when the user aborts the download.

param ev

The event.

onafterprint: null | ((this: WindowEventHandlers, ev: Event) => any)
onanimationcancel: null | ((this: GlobalEventHandlers, ev: AnimationEvent) => any)
onanimationend: null | ((this: GlobalEventHandlers, ev: AnimationEvent) => any)
onanimationiteration: null | ((this: GlobalEventHandlers, ev: AnimationEvent) => any)
onanimationstart: null | ((this: GlobalEventHandlers, ev: AnimationEvent) => any)
onauxclick: null | ((this: GlobalEventHandlers, ev: MouseEvent) => any)
onbeforeprint: null | ((this: WindowEventHandlers, ev: Event) => any)
onbeforeunload: null | ((this: WindowEventHandlers, ev: BeforeUnloadEvent) => any)
onblur: null | ((this: GlobalEventHandlers, ev: FocusEvent) => any)

Fires when the object loses the input focus.

param ev

The focus event.

oncanplay: null | ((this: GlobalEventHandlers, ev: Event) => any)

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

param ev

The event.

oncanplaythrough: null | ((this: GlobalEventHandlers, ev: Event) => any)
onchange: null | ((this: GlobalEventHandlers, ev: Event) => any)

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

param ev

The event.

onclick: null | ((this: GlobalEventHandlers, ev: MouseEvent) => any)

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

param ev

The mouse event.

onclose: null | ((this: GlobalEventHandlers, ev: Event) => any)
oncontextmenu: null | ((this: GlobalEventHandlers, ev: MouseEvent) => any)

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

param ev

The mouse event.

oncuechange: null | ((this: GlobalEventHandlers, ev: Event) => any)
ondblclick: null | ((this: GlobalEventHandlers, ev: MouseEvent) => any)

Fires when the user double-clicks the object.

param ev

The mouse event.

ondevicemotion: null | ((this: Window, ev: DeviceMotionEvent) => any)

Available only in secure contexts.

ondeviceorientation: null | ((this: Window, ev: DeviceOrientationEvent) => any)

Available only in secure contexts.

ondrag: null | ((this: GlobalEventHandlers, ev: DragEvent) => any)

Fires on the source object continuously during a drag operation.

param ev

The event.

ondragend: null | ((this: GlobalEventHandlers, ev: DragEvent) => any)

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

param ev

The event.

ondragenter: null | ((this: GlobalEventHandlers, ev: DragEvent) => any)

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

param ev

The drag event.

ondragleave: null | ((this: GlobalEventHandlers, 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 ev

The drag event.

ondragover: null | ((this: GlobalEventHandlers, ev: DragEvent) => any)

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

param ev

The event.

ondragstart: null | ((this: GlobalEventHandlers, ev: DragEvent) => any)

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

param ev

The event.

ondrop: null | ((this: GlobalEventHandlers, ev: DragEvent) => any)
ondurationchange: null | ((this: GlobalEventHandlers, ev: Event) => any)

Occurs when the duration attribute is updated.

param ev

The event.

onemptied: null | ((this: GlobalEventHandlers, ev: Event) => any)

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

param ev

The event.

onended: null | ((this: GlobalEventHandlers, ev: Event) => any)

Occurs when the end of playback is reached.

param ev

The event

onerror: OnErrorEventHandler

Fires when an error occurs during object loading.

param ev

The event.

onfocus: null | ((this: GlobalEventHandlers, ev: FocusEvent) => any)

Fires when the object receives focus.

param ev

The event.

onformdata: null | ((this: GlobalEventHandlers, ev: FormDataEvent) => any)
ongamepadconnected: null | ((this: WindowEventHandlers, ev: GamepadEvent) => any)
ongamepaddisconnected: null | ((this: WindowEventHandlers, ev: GamepadEvent) => any)
ongotpointercapture: null | ((this: GlobalEventHandlers, ev: PointerEvent) => any)
onhashchange: null | ((this: WindowEventHandlers, ev: HashChangeEvent) => any)
oninput: null | ((this: GlobalEventHandlers, ev: Event) => any)
oninvalid: null | ((this: GlobalEventHandlers, ev: Event) => any)
onkeydown: null | ((this: GlobalEventHandlers, ev: KeyboardEvent) => any)

Fires when the user presses a key.

param ev

The keyboard event

onkeypress: null | ((this: GlobalEventHandlers, ev: KeyboardEvent) => any)

Fires when the user presses an alphanumeric key.

param ev

The event.

deprecated
onkeyup: null | ((this: GlobalEventHandlers, ev: KeyboardEvent) => any)

Fires when the user releases a key.

param ev

The keyboard event

onlanguagechange: null | ((this: WindowEventHandlers, ev: Event) => any)
onload: null | ((this: GlobalEventHandlers, ev: Event) => any)

Fires immediately after the browser loads the object.

param ev

The event.

onloadeddata: null | ((this: GlobalEventHandlers, ev: Event) => any)

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

param ev

The event.

onloadedmetadata: null | ((this: GlobalEventHandlers, ev: Event) => any)

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

param ev

The event.

onloadstart: null | ((this: GlobalEventHandlers, ev: Event) => any)

Occurs when Internet Explorer begins looking for media data.

param ev

The event.

onlostpointercapture: null | ((this: GlobalEventHandlers, ev: PointerEvent) => any)
onmessage: null | ((this: WindowEventHandlers, ev: MessageEvent<any>) => any)
onmessageerror: null | ((this: WindowEventHandlers, ev: MessageEvent<any>) => any)
onmousedown: null | ((this: GlobalEventHandlers, ev: MouseEvent) => any)

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

param ev

The mouse event.

onmouseenter: null | ((this: GlobalEventHandlers, ev: MouseEvent) => any)
onmouseleave: null | ((this: GlobalEventHandlers, ev: MouseEvent) => any)
onmousemove: null | ((this: GlobalEventHandlers, ev: MouseEvent) => any)

Fires when the user moves the mouse over the object.

param ev

The mouse event.

onmouseout: null | ((this: GlobalEventHandlers, ev: MouseEvent) => any)

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

param ev

The mouse event.

onmouseover: null | ((this: GlobalEventHandlers, ev: MouseEvent) => any)

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

param ev

The mouse event.

onmouseup: null | ((this: GlobalEventHandlers, ev: MouseEvent) => any)

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

param ev

The mouse event.

onoffline: null | ((this: WindowEventHandlers, ev: Event) => any)
ononline: null | ((this: WindowEventHandlers, ev: Event) => any)
onorientationchange: null | ((this: Window, ev: Event) => any)
deprecated
onpagehide: null | ((this: WindowEventHandlers, ev: PageTransitionEvent) => any)
onpageshow: null | ((this: WindowEventHandlers, ev: PageTransitionEvent) => any)
onpause: null | ((this: GlobalEventHandlers, ev: Event) => any)

Occurs when playback is paused.

param ev

The event.

onplay: null | ((this: GlobalEventHandlers, ev: Event) => any)

Occurs when the play method is requested.

param ev

The event.

onplaying: null | ((this: GlobalEventHandlers, ev: Event) => any)

Occurs when the audio or video has started playing.

param ev

The event.

onpointercancel: null | ((this: GlobalEventHandlers, ev: PointerEvent) => any)
onpointerdown: null | ((this: GlobalEventHandlers, ev: PointerEvent) => any)
onpointerenter: null | ((this: GlobalEventHandlers, ev: PointerEvent) => any)
onpointerleave: null | ((this: GlobalEventHandlers, ev: PointerEvent) => any)
onpointermove: null | ((this: GlobalEventHandlers, ev: PointerEvent) => any)
onpointerout: null | ((this: GlobalEventHandlers, ev: PointerEvent) => any)
onpointerover: null | ((this: GlobalEventHandlers, ev: PointerEvent) => any)
onpointerup: null | ((this: GlobalEventHandlers, ev: PointerEvent) => any)
onpopstate: null | ((this: WindowEventHandlers, ev: PopStateEvent) => any)
onprogress: null | ((this: GlobalEventHandlers, ev: ProgressEvent<EventTarget>) => any)

Occurs to indicate progress while downloading media data.

param ev

The event.

onratechange: null | ((this: GlobalEventHandlers, ev: Event) => any)

Occurs when the playback rate is increased or decreased.

param ev

The event.

onrejectionhandled: null | ((this: WindowEventHandlers, ev: PromiseRejectionEvent) => any)
onreset: null | ((this: GlobalEventHandlers, ev: Event) => any)

Fires when the user resets a form.

param ev

The event.

onresize: null | ((this: GlobalEventHandlers, ev: UIEvent) => any)
onscroll: null | ((this: GlobalEventHandlers, ev: Event) => any)

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

param ev

The event.

onsecuritypolicyviolation: null | ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any)
onseeked: null | ((this: GlobalEventHandlers, ev: Event) => any)

Occurs when the seek operation ends.

param ev

The event.

onseeking: null | ((this: GlobalEventHandlers, ev: Event) => any)

Occurs when the current playback position is moved.

param ev

The event.

onselect: null | ((this: GlobalEventHandlers, ev: Event) => any)

Fires when the current selection changes.

param ev

The event.

onselectionchange: null | ((this: GlobalEventHandlers, ev: Event) => any)
onselectstart: null | ((this: GlobalEventHandlers, ev: Event) => any)
onslotchange: null | ((this: GlobalEventHandlers, ev: Event) => any)
onstalled: null | ((this: GlobalEventHandlers, ev: Event) => any)

Occurs when the download has stopped.

param ev

The event.

onstorage: null | ((this: WindowEventHandlers, ev: StorageEvent) => any)
onsubmit: null | ((this: GlobalEventHandlers, ev: SubmitEvent) => any)
onsuspend: null | ((this: GlobalEventHandlers, ev: Event) => any)

Occurs if the load operation has been intentionally halted.

param ev

The event.

ontimeupdate: null | ((this: GlobalEventHandlers, ev: Event) => any)

Occurs to indicate the current playback position.

param ev

The event.

ontoggle: null | ((this: GlobalEventHandlers, ev: Event) => any)
ontouchcancel?: null | ((this: GlobalEventHandlers, ev: TouchEvent) => any)
ontouchend?: null | ((this: GlobalEventHandlers, ev: TouchEvent) => any)
ontouchmove?: null | ((this: GlobalEventHandlers, ev: TouchEvent) => any)
ontouchstart?: null | ((this: GlobalEventHandlers, ev: TouchEvent) => any)
ontransitioncancel: null | ((this: GlobalEventHandlers, ev: TransitionEvent) => any)
ontransitionend: null | ((this: GlobalEventHandlers, ev: TransitionEvent) => any)
ontransitionrun: null | ((this: GlobalEventHandlers, ev: TransitionEvent) => any)
ontransitionstart: null | ((this: GlobalEventHandlers, ev: TransitionEvent) => any)
onunhandledrejection: null | ((this: WindowEventHandlers, ev: PromiseRejectionEvent) => any)
onunload: null | ((this: WindowEventHandlers, ev: Event) => any)
onvolumechange: null | ((this: GlobalEventHandlers, ev: Event) => any)

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

param ev

The event.

onwaiting: null | ((this: GlobalEventHandlers, ev: Event) => any)

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

param ev

The event.

onwebkitanimationend: null | ((this: GlobalEventHandlers, ev: Event) => any)
deprecated

This is a legacy alias of onanimationend.

onwebkitanimationiteration: null | ((this: GlobalEventHandlers, ev: Event) => any)
deprecated

This is a legacy alias of onanimationiteration.

onwebkitanimationstart: null | ((this: GlobalEventHandlers, ev: Event) => any)
deprecated

This is a legacy alias of onanimationstart.

onwebkittransitionend: null | ((this: GlobalEventHandlers, ev: Event) => any)
deprecated

This is a legacy alias of ontransitionend.

onwheel: null | ((this: GlobalEventHandlers, ev: WheelEvent) => any)
opener: any
orientation: number
deprecated
origin: string
outerHeight: number
outerWidth: number
pageXOffset: number
deprecated

This is a legacy alias of scrollX.

pageYOffset: number
deprecated

This is a legacy alias of scrollY.

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.

performance: Performance
personalbar: BarProp

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

screen: Screen
screenLeft: number
screenTop: number
screenX: number
screenY: number
scrollX: number
scrollY: number
scrollbars: BarProp

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

self: Window & typeof globalThis
sessionStorage: Storage
speechSynthesis: SpeechSynthesis
status: string
deprecated
statusbar: BarProp

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

toolbar: BarProp

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

top: null | Window
visualViewport: VisualViewport
window: Window & typeof globalThis

Accessors

  • get location(): Location
  • set location(href: string | Location): void
  • Returns Location

  • Parameters

    • href: string | Location

    Returns void

Methods

  • __SSG_MANIFEST_CB(): void
  • Returns void

  • addEventListener<K>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void
  • addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void
  • Type parameters

    • K: keyof WindowEventMap

    Parameters

    • type: K
    • listener: (this: Window, ev: WindowEventMap[K]) => any
        • (this: Window, ev: WindowEventMap[K]): any
        • Parameters

          • this: Window
          • ev: WindowEventMap[K]

          Returns any

    • Optional options: boolean | AddEventListenerOptions

    Returns void

  • Parameters

    • type: string
    • listener: EventListenerOrEventListenerObject
    • Optional options: boolean | AddEventListenerOptions

    Returns void

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

    • Optional message: any

    Returns void

  • atob(data: string): string
  • Parameters

    • data: string

    Returns string

  • blur(): void
  • Returns void

  • btoa(data: string): string
  • Parameters

    • data: string

    Returns string

  • cancelAnimationFrame(handle: number): void
  • Parameters

    • handle: number

    Returns void

  • cancelIdleCallback(handle: number): void
  • Parameters

    • handle: number

    Returns void

  • captureEvents(): void
  • deprecated

    Returns void

  • clearInterval(id?: number): void
  • Parameters

    • Optional id: number

    Returns void

  • clearTimeout(id?: number): void
  • Parameters

    • Optional id: number

    Returns void

  • close(): void
  • Closes the window.

    Returns void

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

    • Optional message: string

    Returns boolean

  • createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>
  • createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>
  • Parameters

    • image: ImageBitmapSource
    • Optional options: ImageBitmapOptions

    Returns Promise<ImageBitmap>

  • Parameters

    • image: ImageBitmapSource
    • sx: number
    • sy: number
    • sw: number
    • sh: number
    • Optional options: ImageBitmapOptions

    Returns Promise<ImageBitmap>

  • 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

    • event: Event

    Returns boolean

  • fetch(input: RequestInfo, init?: RequestInit): Promise<Response>
  • Parameters

    • input: RequestInfo
    • Optional init: RequestInit

    Returns Promise<Response>

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

    Returns void

  • getComputedStyle(elt: Element, pseudoElt?: null | string): CSSStyleDeclaration
  • Parameters

    • elt: Element
    • Optional pseudoElt: null | string

    Returns CSSStyleDeclaration

  • getSelection(): null | Selection
  • Returns null | Selection

  • matchMedia(query: string): MediaQueryList
  • Parameters

    • query: string

    Returns MediaQueryList

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

    • x: number
    • y: number

    Returns void

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

    • x: number
    • y: number

    Returns void

  • 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(message: any, targetOrigin: string, transfer?: Transferable[]): void
  • postMessage(message: any, options?: WindowPostMessageOptions): void
  • 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

    • message: any
    • Optional options: WindowPostMessageOptions

    Returns void

  • print(): void
  • Returns void

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

    • Optional message: string
    • Optional _default: string

    Returns null | string

  • queueMicrotask(callback: VoidFunction): void
  • Parameters

    • callback: VoidFunction

    Returns void

  • releaseEvents(): void
  • deprecated

    Returns void

  • removeEventListener<K>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void
  • removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void
  • Type parameters

    • K: keyof WindowEventMap

    Parameters

    • type: K
    • listener: (this: Window, ev: WindowEventMap[K]) => any
        • (this: Window, ev: WindowEventMap[K]): any
        • Parameters

          • this: Window
          • ev: WindowEventMap[K]

          Returns any

    • Optional options: boolean | EventListenerOptions

    Returns void

  • Parameters

    • type: string
    • listener: EventListenerOrEventListenerObject
    • Optional options: boolean | EventListenerOptions

    Returns void

  • reportError(e: any): void
  • Parameters

    • e: any

    Returns void

  • requestAnimationFrame(callback: FrameRequestCallback): number
  • Parameters

    • callback: FrameRequestCallback

    Returns number

  • requestIdleCallback(callback: IdleRequestCallback, options?: IdleRequestOptions): number
  • Parameters

    • callback: IdleRequestCallback
    • Optional options: IdleRequestOptions

    Returns number

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

    • x: number
    • y: number

    Returns void

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

    • width: number
    • height: number

    Returns void

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

    • Optional options: ScrollToOptions

    Returns void

  • Parameters

    • x: number
    • y: number

    Returns void

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

    • Optional options: ScrollToOptions

    Returns void

  • Parameters

    • x: number
    • y: number

    Returns void

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

    • Optional options: ScrollToOptions

    Returns void

  • Parameters

    • x: number
    • y: number

    Returns void

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

    • handler: TimerHandler
    • Optional timeout: number
    • Rest ...arguments: any[]

    Returns number

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

    • handler: TimerHandler
    • Optional timeout: number
    • Rest ...arguments: any[]

    Returns number

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

    Returns void

Generated using TypeDoc