Window

interface

interface Window extends EventTarget

Represents the global window object in the Ende runtime environment.

While Ende doesn't have a browser window, this interface mimics browser window functionality for compatibility with web APIs. It provides access to global properties and methods such as timers, storage, and event handling.

Example

// Accessing global objects
const localStorage = window.localStorage;

// Event handling
window.addEventListener("unhandledrejection", (event) => {
  console.log("Unhandled promise rejection:", event.reason);d
});

variable

var Window: { … }

Constructor for Window objects.

Note: This constructor cannot be used to create new Window instances in Ende. The global window object is pre-defined in the runtime environment.

Constructors

constructor

new Window(): never

Properties

window

readonly window: Window & typeof globalThis

self

readonly self: Window & typeof globalThis

onerror

onerror: ((this: Window, ev: ErrorEvent) => any) | null

onload

onload: ((this: Window, ev: Event) => any) | null

onbeforeunload

onbeforeunload: ((this: Window, ev: Event) => any) | null

onunload

onunload: ((this: Window, ev: Event) => any) | null

onunhandledrejection

onunhandledrejection: ((this: Window, ev: PromiseRejectionEvent) => any) | null

onrejectionhandled

onrejectionhandled: ((this: Window, ev: PromiseRejectionEvent) => any) | null

close

close: () => void

closed

readonly closed: boolean

alert

alert: (message?: string) => void

confirm

confirm: (message?: string) => boolean

prompt

prompt: (message?: string, defaultValue?: string) => string | null

Ende

Ende: typeof Ende

Deno

Deno: typeof Ende
Navigator: typeof Navigator
navigator: Navigator

Location

Location: typeof Location

location

location: Location

localStorage

localStorage: Storage

sessionStorage

sessionStorage: Storage

caches

caches: CacheStorage

name

name: string

prototype

readonly prototype: Window

Methods

addEventListener

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

removeEventListener

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