Window
interface
interface Window extends EventTargetRepresents 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(): neverProperties
window
readonly window: Window & typeof globalThisself
readonly self: Window & typeof globalThisonerror
onerror: ((this: Window, ev: ErrorEvent) => any) | nullonload
onload: ((this: Window, ev: Event) => any) | nullonbeforeunload
onbeforeunload: ((this: Window, ev: Event) => any) | nullonunload
onunload: ((this: Window, ev: Event) => any) | nullonunhandledrejection
onunhandledrejection: ((this: Window, ev: PromiseRejectionEvent) => any) | nullonrejectionhandled
onrejectionhandled: ((this: Window, ev: PromiseRejectionEvent) => any) | nullclose
close: () => voidclosed
readonly closed: booleanalert
alert: (message?: string) => voidconfirm
confirm: (message?: string) => booleanprompt
prompt: (message?: string, defaultValue?: string) => string | nullEnde
Ende: typeof EndeDeno
Deno: typeof EndeNavigator
Navigator: typeof Navigatornavigator
navigator: NavigatorLocation
Location: typeof Locationlocation
location: LocationlocalStorage
localStorage: StoragesessionStorage
sessionStorage: Storagecaches
caches: CacheStoragename
name: stringprototype
readonly prototype: WindowMethods
addEventListener
addEventListener<K extends keyof WindowEventMap>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): voidaddEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): voidremoveEventListener
removeEventListener<K extends keyof WindowEventMap>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): voidremoveEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void