Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno/cli/tsc/dts/lib.deno.window.d.ts>Window

A modern runtime for JavaScript and TypeScript.
Go to Latest
interface Window
implements EventTarget
import { type Window } from "https://deno.land/x/deno@v1.36.0/cli/tsc/dts/lib.deno.window.d.ts";

Properties

readonly
window: Window & globalThis
readonly
self: Window & globalThis
onerror: ((this: Window, ev: ErrorEvent) => any) | null
onload: ((this: Window, ev: Event) => any) | null
onbeforeunload: ((this: Window, ev: Event) => any) | null
onunload: ((this: Window, ev: Event) => any) | null
onunhandledrejection: ((this: Window, ev: PromiseRejectionEvent) => any) | null
close: () => void
readonly
closed: boolean
alert: (message?: string) => void
confirm: (message?: string) => boolean
prompt: (message?: string, defaultValue?: string) => string | null
Deno: Deno
Navigator: Navigator
navigator: Navigator
Location: Location
location: Location
localStorage: Storage
sessionStorage: Storage
caches: CacheStorage

Methods

addEventListener<K extends keyof WindowEventMap>(
type: K,
listener: (this: Window, ev: WindowEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void
addEventListener(
type: string,
options?: boolean | AddEventListenerOptions,
): void
removeEventListener<K extends keyof WindowEventMap>(
type: K,
listener: (this: Window, ev: WindowEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void
removeEventListener(
type: string,
options?: boolean | EventListenerOptions,
): void
variable Window
import { Window } from "https://deno.land/x/deno@v1.36.0/cli/tsc/dts/lib.deno.window.d.ts";

type

{ readonly prototype: Window; new (): never; }