Skip to main content

Platform

A set of essential interfaces and functions to interact with the browser environment. Eg handling user interactions, getting browser and device information, scheduling and canceling periodic or one-time tasks.

prompt, console

Functions

f
alert

Shows the given message and waits for the enter key pressed.

    f
    close

    Exits the current Deno process.

      f
      confirm

      Shows the given message and waits for the answer. Returns the user's answer as boolean.

        f
        prompt

        Shows the given message and waits for the user's input. Returns the user's input as string.

          f
          queueMicrotask

          A microtask is a short function which is executed after the function or module which created it exits and only if the JavaScript execution stack is empty, but before returning control to the event loop being used to drive the script's execution environment. This event loop may be either the main event loop or the event loop driving a web worker.

            f
            reportError

            Dispatch an uncaught exception. Similar to a synchronous version of:

              f
              structuredClone

              Creates a deep copy of a given value using the structured clone algorithm.

                Interfaces

                I
                v
                AbortController

                A controller object that allows you to abort one or more DOM requests as and when desired.

                I
                v
                AbortSignal

                A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object.

                I
                AbortSignalEventMap
                No documentation available
                I
                v
                CSSRule

                A single CSS rule of a CSSStyleSheet, as returned from its cssRules property. Available only when the --unstable-raw-imports flag is enabled.

                I
                v
                CSSStyleSheet

                A style sheet backing a CSS module script. This is what a import sheet from "./styles.css" with { type: "css" } import evaluates to. Available only when the --unstable-raw-imports flag is enabled.

                I
                DomIterable
                No documentation available
                I
                DOMStringList
                No documentation available
                I
                ImageDataSettings
                No documentation available
                I
                ImportMeta

                Deno provides extra properties on import.meta. These are included here to ensure that these are still available when using the Deno namespace in conjunction with other type libs, like dom.

                I
                v
                Location

                The location (URL) of the object it is linked to. Changes done on it are reflected on the object it relates to. Accessible via globalThis.location.

                I
                Math
                No documentation available
                I
                v
                Navigator

                Provides information about the Deno runtime environment and the system on which it's running. Similar to the browser Navigator object but adapted for the Deno context.

                I
                NavigatorUABrandVersion

                A brand and version pair describing a user agent, as returned by NavigatorUAData.

                I
                v
                NavigatorUAData

                Gives access to information about the runtime's user agent, exposed via Navigator.userAgentData. This is the User-Agent Client Hints API.

                I
                v
                QuotaExceededError

                Represents an error when a quota has been exceeded.

                I
                QuotaExceededErrorOptions
                No documentation available
                I
                RegExpConstructor
                No documentation available
                I
                StructuredSerializeOptions

                Options that control structured serialization operations such as structuredClone(value, options) and MessagePort.postMessage(message, options).

                I
                Uint8ArrayConstructor
                No documentation available
                I
                VoidFunction
                No documentation available
                  I
                  WebTransportCloseInfo
                  No documentation available
                  I
                  WebTransportHash
                  No documentation available
                  I
                  WindowEventMap

                  Defines the mapping between event names and their corresponding event types for the Window interface in Deno.

                  Type Aliases

                  T
                  AllowSharedBufferSource
                  No documentation available
                    T
                    BufferSource
                    No documentation available
                      T
                      ImageDataArray
                      No documentation available
                        T
                        ImageDataPixelFormat
                        No documentation available
                          T
                          PredefinedColorSpace
                          No documentation available
                            T
                            WebTransportCongestionControl
                            No documentation available
                              T
                              WebTransportErrorSource
                              No documentation available

                                Variables

                                v
                                closed

                                Indicates whether the current window (context) is closed. In Deno, this property is primarily for API compatibility with browsers.

                                  v
                                  location

                                  The Location object describing the absolute URL of the main module, available when the program is started with the --location flag. Accessing it without --location throws.

                                    v
                                    name

                                    Gets or sets the name of the global scope's browsing context.

                                      v
                                      navigator

                                      Provides access to the Deno runtime's Navigator interface, which contains information about the environment in which the script is running.

                                        v
                                        onabort

                                        Marker used so that @types/node defers its Storage global to Deno's. The main scope has no abort event handler, so this is null.

                                          v
                                          onmessage

                                          Marker used so that @types/node defers its web-platform globals to Deno's. The main scope has no message event handler, so this is null.

                                            v
                                            ReportingObserver

                                            Marker used so that @types/node defers its CompressionStream and DecompressionStream globals to Deno's.

                                              v
                                              self

                                              Reference to the global object itself. Equivalent to the global window object in browser environments.


                                                function alert

                                                #alert(message?: string): void

                                                Shows the given message and waits for the enter key pressed.

                                                If the stdin is not interactive, it does nothing.

                                                Examples #

                                                #
                                                // Displays the message "Acknowledge me! [Enter]" and waits for the enter key to be pressed before continuing.
                                                alert("Acknowledge me!");
                                                

                                                Parameters #

                                                #message: string
                                                optional

                                                Return Type #

                                                void

                                                See #


                                                function close

                                                #close(): void

                                                Exits the current Deno process.

                                                This function terminates the process by signaling the runtime to exit. Similar to exit(0) in posix. Its behavior is similar to the window.close() method in the browser, but specific to the Deno runtime.

                                                Note: Use this function cautiously, as it will stop the execution of the entire Deno program immediately.

                                                Examples #

                                                #
                                                console.log("About to close the Deno process.");
                                                close(); // The process will terminate here.
                                                console.log("This will not be logged."); // This line will never execute.
                                                

                                                Return Type #

                                                void

                                                See #


                                                function confirm

                                                #confirm(message?: string): boolean

                                                Shows the given message and waits for the answer. Returns the user's answer as boolean.

                                                Only y and Y are considered as true.

                                                If the stdin is not interactive, it returns false.

                                                Examples #

                                                #
                                                const shouldProceed = confirm("Do you want to proceed?");
                                                
                                                // If the user presses 'y' or 'Y', the result will be true
                                                // If the user presses 'n' or 'N', the result will be false
                                                console.log("Should proceed?", shouldProceed);
                                                

                                                Parameters #

                                                #message: string
                                                optional

                                                Return Type #

                                                boolean

                                                See #


                                                function prompt

                                                #prompt(
                                                message?: string,
                                                defaultValue?: string,
                                                ): string | null

                                                Shows the given message and waits for the user's input. Returns the user's input as string.

                                                If the default value is given and the user inputs the empty string, then it returns the given default value.

                                                If the default value is not given and the user inputs the empty string, it returns the empty string.

                                                If the stdin is not interactive, it returns null.

                                                Examples #

                                                #
                                                const pet = prompt("Cats or dogs?", "It's fine to love both!");
                                                
                                                // Displays the user's input or the default value of "It's fine to love both!"
                                                console.log("Best pet:", pet);
                                                

                                                Parameters #

                                                #message: string
                                                optional
                                                #defaultValue: string
                                                optional

                                                Return Type #

                                                string | null

                                                See #


                                                function queueMicrotask

                                                #queueMicrotask(func: VoidFunction): void

                                                A microtask is a short function which is executed after the function or module which created it exits and only if the JavaScript execution stack is empty, but before returning control to the event loop being used to drive the script's execution environment. This event loop may be either the main event loop or the event loop driving a web worker.

                                                queueMicrotask(() => { console.log('This event loop stack is complete'); });
                                                

                                                Parameters #

                                                Return Type #

                                                void

                                                function reportError

                                                #reportError(error: any): void

                                                Dispatch an uncaught exception. Similar to a synchronous version of:

                                                setTimeout(() => { throw error; }, 0);
                                                

                                                The error can not be caught with a try/catch block. An error event will be dispatched to the global scope. You can prevent the error from being reported to the console with Event.prototype.preventDefault():

                                                addEventListener("error", (event) => {
                                                  event.preventDefault();
                                                });
                                                reportError(new Error("foo")); // Will not be reported.
                                                

                                                In Deno, this error will terminate the process if not intercepted like above.

                                                Parameters #

                                                #error: any

                                                Return Type #

                                                void

                                                function structuredClone

                                                #structuredClone<T = any>(
                                                value: T,
                                                ): T

                                                Creates a deep copy of a given value using the structured clone algorithm.

                                                Unlike a shallow copy, a deep copy does not hold the same references as the source object, meaning its properties can be changed without affecting the source. For more details, see MDN.

                                                Throws a DataCloneError if any part of the input value is not serializable.

                                                Examples #

                                                #
                                                const object = { x: 0, y: 1 };
                                                
                                                const deepCopy = structuredClone(object);
                                                deepCopy.x = 1;
                                                console.log(deepCopy.x, object.x); // 1 0
                                                
                                                const shallowCopy = object;
                                                shallowCopy.x = 1;
                                                // shallowCopy.x is pointing to the same location in memory as object.x
                                                console.log(shallowCopy.x, object.x); // 1 1
                                                

                                                Type Parameters #

                                                #T = any

                                                Parameters #

                                                #value: T
                                                #options: StructuredSerializeOptions
                                                optional

                                                Return Type #

                                                T

                                                interface AbortController

                                                A controller object that allows you to abort one or more DOM requests as and when desired.

                                                Properties #

                                                Returns the AbortSignal object associated with this object.

                                                Methods #

                                                #abort(reason?: any): void

                                                Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.

                                                variable AbortController

                                                A controller object that allows you to abort one or more DOM requests as and when desired.

                                                Type #

                                                globalThis extends { document: any; AbortController: infer T; } ? T : { readonly prototype: AbortController; }

                                                interface AbortSignal

                                                extends EventTarget

                                                A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object.

                                                Properties #

                                                #aborted: boolean
                                                readonly

                                                Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.

                                                #reason: any
                                                readonly
                                                #onabort: ((
                                                ev: Event,
                                                ) => any) | null

                                                Methods #

                                                #addEventListener<K extends keyof AbortSignalEventMap>(
                                                type: K,
                                                listener: () => any,
                                                options?: boolean | AddEventListenerOptions,
                                                ): void
                                                #addEventListener(
                                                type: string,
                                                options?: boolean | AddEventListenerOptions,
                                                ): void
                                                #removeEventListener<K extends keyof AbortSignalEventMap>(
                                                type: K,
                                                listener: () => any,
                                                options?: boolean | EventListenerOptions,
                                                ): void
                                                #removeEventListener(
                                                type: string,
                                                options?: boolean | EventListenerOptions,
                                                ): void

                                                Throws this AbortSignal's abort reason, if its AbortController has signaled to abort; otherwise, does nothing.

                                                variable AbortSignal

                                                The constructor object for AbortSignal.

                                                AbortSignal instances are obtained from an AbortController or via the static abort, timeout, and any factory methods rather than constructed directly, so calling the constructor throws.

                                                Type #

                                                globalThis extends { document: any; AbortSignal: infer T; } ? T : { readonly prototype: AbortSignal; abort(reason?: any): AbortSignal; any(signals: AbortSignal[]): AbortSignal; timeout(milliseconds: number): AbortSignal; }


                                                interface CSSRule

                                                unstable

                                                A single CSS rule of a CSSStyleSheet, as returned from its cssRules property. Available only when the --unstable-raw-imports flag is enabled.

                                                Note: cssText is the verbatim text of one top-level rule of the style sheet; Deno does not implement a full CSS object model.

                                                Properties #

                                                #cssText: string
                                                readonly

                                                variable CSSRule

                                                unstable

                                                Properties #


                                                interface CSSStyleSheet

                                                unstable

                                                A style sheet backing a CSS module script. This is what a import sheet from "./styles.css" with { type: "css" } import evaluates to. Available only when the --unstable-raw-imports flag is enabled.

                                                Deno has no DOM, so a sheet can't be adopted anywhere; the implementation is backed by the raw CSS text.

                                                Note: cssRules returns a frozen array of CSSRule instead of a live CSSRuleList.

                                                Properties #

                                                #cssRules: readonly CSSRule[]
                                                readonly

                                                Methods #

                                                #replace(text: string): Promise<CSSStyleSheet>
                                                #replaceSync(text: string): void

                                                variable CSSStyleSheet

                                                unstable

                                                Properties #


                                                interface DOMException

                                                extends Error

                                                Properties #

                                                #name: string
                                                readonly
                                                #message: string
                                                readonly
                                                #code: number
                                                deprecated
                                                readonly
                                                #INDEX_SIZE_ERR: 1
                                                readonly
                                                #NOT_FOUND_ERR: 8
                                                readonly
                                                #NOT_SUPPORTED_ERR: 9
                                                readonly
                                                #INVALID_STATE_ERR: 11
                                                readonly
                                                #SYNTAX_ERR: 12
                                                readonly
                                                #NAMESPACE_ERR: 14
                                                readonly
                                                #INVALID_ACCESS_ERR: 15
                                                readonly
                                                #VALIDATION_ERR: 16
                                                readonly
                                                #TYPE_MISMATCH_ERR: 17
                                                readonly
                                                #SECURITY_ERR: 18
                                                readonly
                                                #NETWORK_ERR: 19
                                                readonly
                                                #ABORT_ERR: 20
                                                readonly
                                                #URL_MISMATCH_ERR: 21
                                                readonly
                                                #QUOTA_EXCEEDED_ERR: 22
                                                readonly
                                                #TIMEOUT_ERR: 23
                                                readonly
                                                #DATA_CLONE_ERR: 25
                                                readonly

                                                variable DOMException

                                                The constructor object for DOMException, used to construct an exception describing an abnormal event raised by a web API. It also exposes the legacy numeric error code constants (e.g. ABORT_ERR).

                                                Type #

                                                globalThis extends { document: any; DOMException: infer T; } ? T : { readonly prototype: DOMException; readonly INDEX_SIZE_ERR: 1; readonly DOMSTRING_SIZE_ERR: 2; readonly HIERARCHY_REQUEST_ERR: 3; readonly WRONG_DOCUMENT_ERR: 4; readonly INVALID_CHARACTER_ERR: 5; readonly NO_DATA_ALLOWED_ERR: 6; readonly NO_MODIFICATION_ALLOWED_ERR: 7; readonly NOT_FOUND_ERR: 8; readonly NOT_SUPPORTED_ERR: 9; readonly INUSE_ATTRIBUTE_ERR: 10; readonly INVALID_STATE_ERR: 11; readonly SYNTAX_ERR: 12; readonly INVALID_MODIFICATION_ERR: 13; readonly NAMESPACE_ERR: 14; readonly INVALID_ACCESS_ERR: 15; readonly VALIDATION_ERR: 16; readonly TYPE_MISMATCH_ERR: 17; readonly SECURITY_ERR: 18; readonly NETWORK_ERR: 19; readonly ABORT_ERR: 20; readonly URL_MISMATCH_ERR: 21; readonly QUOTA_EXCEEDED_ERR: 22; readonly TIMEOUT_ERR: 23; readonly INVALID_NODE_TYPE_ERR: 24; readonly DATA_CLONE_ERR: 25; }


                                                interface DOMStringList

                                                Index Signatures #

                                                #[index: number]: string

                                                Properties #

                                                #length: number
                                                readonly

                                                Returns the number of strings in strings.

                                                Methods #

                                                #contains(string: string): boolean

                                                Returns true if strings contains string, and false otherwise.

                                                #item(index: number): string | null

                                                Returns the string with index index from strings.





                                                interface ImportMeta

                                                Deno provides extra properties on import.meta. These are included here to ensure that these are still available when using the Deno namespace in conjunction with other type libs, like dom.

                                                Properties #

                                                #url: string

                                                A string representation of the fully qualified module URL. When the module is loaded locally, the value will be a file URL (e.g. file:///path/module.ts).

                                                You can also parse the string as a URL to determine more information about how the current module was loaded. For example to determine if a module was local or not:

                                                const url = new URL(import.meta.url);
                                                if (url.protocol === "file:") {
                                                  console.log("this module was loaded locally");
                                                }
                                                
                                                #filename: string

                                                The absolute path of the current module.

                                                For local modules (ie. using file:// URLs) this is the module's path; for non-local modules (eg. https:// or data:) it is an empty string.

                                                Example:

                                                // Unix
                                                console.log(import.meta.filename); // /home/alice/my_module.ts
                                                
                                                // Windows
                                                console.log(import.meta.filename); // C:\alice\my_module.ts
                                                
                                                #dirname: string

                                                The absolute path of the directory containing the current module.

                                                For local modules (ie. using file:// URLs) this is the directory path; for non-local modules (eg. https:// or data:) it is an empty string.

                                                • Example:
                                                // Unix
                                                console.log(import.meta.dirname); // /home/alice
                                                
                                                // Windows
                                                console.log(import.meta.dirname); // C:\alice
                                                
                                                #main: boolean

                                                A flag that indicates if the current module is the main module that was called when starting the program under Deno.

                                                if (import.meta.main) {
                                                  // this was loaded as the main module, maybe do some bootstrapping
                                                }
                                                

                                                Methods #

                                                #resolve(specifier: string): string

                                                A function that returns resolved specifier as if it would be imported using import(specifier).

                                                console.log(import.meta.resolve("./foo.js"));
                                                // file:///dev/foo.js
                                                

                                                interface Location

                                                The location (URL) of the object it is linked to. Changes done on it are reflected on the object it relates to. Accessible via globalThis.location.

                                                Properties #

                                                Returns a DOMStringList object listing the origins of the ancestor browsing contexts, from the parent browsing context to the top-level browsing context.

                                                Always empty in Deno.

                                                #hash: string

                                                Returns the Location object's URL's fragment (includes leading "#" if non-empty).

                                                Cannot be set in Deno.

                                                #host: string

                                                Returns the Location object's URL's host and port (if different from the default port for the scheme).

                                                Cannot be set in Deno.

                                                #hostname: string

                                                Returns the Location object's URL's host.

                                                Cannot be set in Deno.

                                                #href: string

                                                Returns the Location object's URL.

                                                Cannot be set in Deno.

                                                #origin: string
                                                readonly

                                                Returns the Location object's URL's origin.

                                                #pathname: string

                                                Returns the Location object's URL's path.

                                                Cannot be set in Deno.

                                                #port: string

                                                Returns the Location object's URL's port.

                                                Cannot be set in Deno.

                                                #protocol: string

                                                Returns the Location object's URL's scheme.

                                                Cannot be set in Deno.

                                                Methods #

                                                #toString(): string
                                                #assign(url: string): void

                                                Navigates to the given URL.

                                                Cannot be set in Deno.

                                                #reload(): void

                                                Reloads the current page.

                                                Disabled in Deno.

                                                #reload(forcedReload: boolean): void
                                                deprecated
                                                #replace(url: string): void

                                                Removes the current page from the session history and navigates to the given URL.

                                                Disabled in Deno.

                                                variable Location

                                                The location (URL) of the object it is linked to. Changes done on it are reflected on the object it relates to. Accessible via globalThis.location.

                                                Properties #


                                                interface Math

                                                Methods #

                                                #sumPrecise(values: Iterable<number>): number

                                                Returns the sum of the given values using a more precise algorithm than a naive +-based reduction, avoiding the floating-point rounding errors that accumulate when summing many numbers.

                                                MDN Reference







                                                interface RegExpConstructor

                                                unstable

                                                Methods #

                                                #escape(string: string): string

                                                Returns a new string in which characters that are potentially special in a regular expression pattern are replaced with escape sequences.


                                                interface StructuredSerializeOptions

                                                Options that control structured serialization operations such as structuredClone(value, options) and MessagePort.postMessage(message, options).

                                                The optional transfer array lists Transferable objects whose underlying resources should be moved (transferred) to the receiving side instead of being cloned. After a successful transfer:

                                                • For an ArrayBuffer, the original buffer becomes neutered (its byteLength is set to 0).
                                                • For a MessagePort, the port becomes unusable on the sending side and future events will arrive only on the transferred port at the receiver.

                                                Validation rules:

                                                • Each transferable may appear only once in the transfer list.
                                                • A MessagePort cannot be listed together with its counterpart port from the same MessageChannel in the same transfer operation.
                                                • Duplicate or otherwise invalid entries will cause a DataCloneError DOMException to be thrown.

                                                Transferring improves performance for large binary data and allows moving communication endpoints without copying.

                                                Examples #

                                                #
                                                // Transferring an ArrayBuffer (zero-copy for large data)
                                                const buffer = new ArrayBuffer(16);
                                                const cloned = structuredClone(buffer, { transfer: [buffer] });
                                                
                                                // After transfer, the original buffer is neutered
                                                console.log(buffer.byteLength); // 0
                                                console.log(cloned.byteLength); // 16
                                                

                                                Properties #

                                                List of transferable objects whose ownership is moved instead of cloned.


                                                interface UADataValues

                                                The values returned by NavigatorUAData.getHighEntropyValues.

                                                Properties #

                                                #brands: NavigatorUABrandVersion[]
                                                readonly
                                                optional
                                                #mobile: boolean
                                                readonly
                                                optional
                                                #platform: string
                                                readonly
                                                optional
                                                #architecture: string
                                                readonly
                                                optional
                                                #bitness: string
                                                readonly
                                                optional
                                                #formFactors: string[]
                                                readonly
                                                optional
                                                #model: string
                                                readonly
                                                optional
                                                #platformVersion: string
                                                readonly
                                                optional
                                                #uaFullVersion: string
                                                readonly
                                                optional
                                                #wow64: boolean
                                                readonly
                                                optional


                                                interface Uint8Array

                                                unstable

                                                Methods #

                                                #toBase64(options?: { alphabet?: "base64" | "base64url"; omitPadding?: boolean; }): string

                                                Converts this Uint8Array object to a base64 string.

                                                MDN

                                                #setFromBase64(
                                                string: string,
                                                options?: { alphabet?: "base64" | "base64url"; lastChunkHandling?:
                                                "loose"
                                                | "strict"
                                                | "stop-before-partial"
                                                ; }
                                                ,
                                                ): { read: number; written: number; }

                                                Populates this Uint8Array object with data from a base64 string.

                                                MDN

                                                #toHex(): string

                                                Converts this Uint8Array object to a hex string.

                                                MDN

                                                #setFromHex(string: string): { read: number; written: number; }

                                                Populates this Uint8Array object with data from a hex string.

                                                MDN


                                                interface Uint8ArrayConstructor

                                                unstable

                                                Methods #

                                                #fromBase64(
                                                string: string,
                                                options?: { alphabet?: "base64" | "base64url"; lastChunkHandling?:
                                                "loose"
                                                | "strict"
                                                | "stop-before-partial"
                                                ; }
                                                ,
                                                ): Uint8Array<ArrayBuffer>

                                                Creates a new Uint8Array object from a base64 string.

                                                MDN

                                                #fromHex(string: string): Uint8Array<ArrayBuffer>

                                                Creates a new Uint8Array object from a hex string.

                                                MDN



                                                variable WebTransport

                                                The constructor object for WebTransport, used to open a new WebTransport session to the server at the given url.

                                                Properties #




                                                variable WebTransportDatagramDuplexStream

                                                The constructor object for WebTransportDatagramDuplexStream.

                                                The datagram duplex stream is obtained from WebTransport.datagrams rather than constructed directly.

                                                Properties #









                                                variable WebTransportSendStream

                                                The constructor object for WebTransportSendStream.

                                                Instances are obtained from a WebTransport session rather than constructed directly.

                                                Properties #





                                                interface Window

                                                extends EventTarget

                                                Represents the global window object in the Deno runtime environment.

                                                While Deno 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.

                                                Examples #

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

                                                Properties #

                                                #window: Window & globalThis
                                                readonly
                                                #self: Window & globalThis
                                                readonly
                                                #onerror: ((
                                                this: Window,
                                                ) => any) | null
                                                #onload: ((
                                                this: Window,
                                                ev: Event,
                                                ) => any) | null
                                                #onbeforeunload: ((
                                                this: Window,
                                                ev: Event,
                                                ) => any) | null
                                                #onunload: ((
                                                this: Window,
                                                ev: Event,
                                                ) => any) | null
                                                #onunhandledrejection: (() => any) | null
                                                #onrejectionhandled: (() => any) | null
                                                #close: () => void
                                                #closed: boolean
                                                readonly
                                                #alert: (message?: string) => void
                                                #confirm: (message?: string) => boolean
                                                #prompt: (
                                                message?: string,
                                                defaultValue?: string,
                                                ) => string | null
                                                #Deno: Deno
                                                #name: string

                                                Methods #

                                                #addEventListener<K extends keyof WindowEventMap>(
                                                type: K,
                                                listener: (
                                                this: Window,
                                                ) => any
                                                ,
                                                options?: boolean | AddEventListenerOptions,
                                                ): void
                                                #addEventListener(
                                                type: string,
                                                options?: boolean | AddEventListenerOptions,
                                                ): void
                                                #removeEventListener<K extends keyof WindowEventMap>(
                                                type: K,
                                                listener: (
                                                this: Window,
                                                ) => any
                                                ,
                                                options?: boolean | EventListenerOptions,
                                                ): void
                                                #removeEventListener(
                                                type: string,
                                                options?: boolean | EventListenerOptions,
                                                ): void

                                                variable Window

                                                Constructor for Window objects.

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

                                                Properties #

                                                #prototype: Window
                                                readonly



                                                type alias BufferSource

                                                Definition #

                                                ArrayBufferView<ArrayBuffer> | ArrayBuffer

                                                type alias ImageDataArray

                                                Definition #

                                                Uint8ClampedArray<ArrayBuffer> | Float16Array<ArrayBuffer>





                                                variable closed

                                                Indicates whether the current window (context) is closed. In Deno, this property is primarily for API compatibility with browsers.

                                                Type #

                                                boolean

                                                variable location

                                                The Location object describing the absolute URL of the main module, available when the program is started with the --location flag. Accessing it without --location throws.

                                                Type #


                                                variable name

                                                Gets or sets the name of the global scope's browsing context.

                                                Provided for web compatibility; Deno has no browsing context, so this is an empty string by default.

                                                Type #

                                                string


                                                variable onabort

                                                Marker used so that @types/node defers its Storage global to Deno's. The main scope has no abort event handler, so this is null.

                                                Type #

                                                globalThis extends { document: any; onabort: infer T; } ? T : ((
                                                this: void,
                                                ev: Event,
                                                ) => unknown) | null

                                                variable onmessage

                                                Marker used so that @types/node defers its web-platform globals to Deno's. The main scope has no message event handler, so this is null.

                                                Type #

                                                globalThis extends { document: any; onmessage: infer T; } ? T : ((
                                                this: void,
                                                ) => unknown) | null

                                                variable ReportingObserver

                                                Marker used so that @types/node defers its CompressionStream and DecompressionStream globals to Deno's.

                                                Type #

                                                globalThis extends { document: any; ReportingObserver: infer T; } ? T : { readonly prototype: unknown; }

                                                variable self

                                                Reference to the global object itself. Equivalent to the global window object in browser environments.

                                                Type #

                                                Window & globalThis

                                                Did you find what you needed?

                                                Privacy policy