summaryrefslogtreecommitdiff
path: root/cli/dts/lib.deno.window.d.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/dts/lib.deno.window.d.ts')
-rw-r--r--cli/dts/lib.deno.window.d.ts38
1 files changed, 37 insertions, 1 deletions
diff --git a/cli/dts/lib.deno.window.d.ts b/cli/dts/lib.deno.window.d.ts
index 1dbfb0493..9877ffc75 100644
--- a/cli/dts/lib.deno.window.d.ts
+++ b/cli/dts/lib.deno.window.d.ts
@@ -7,11 +7,13 @@
/// <reference lib="deno.webstorage" />
/// <reference lib="esnext" />
+/** @category Web APIs */
interface WindowEventMap {
"error": ErrorEvent;
"unhandledrejection": PromiseRejectionEvent;
}
+/** @category Web APIs */
declare class Window extends EventTarget {
new(): Window;
readonly window: Window & typeof globalThis;
@@ -63,17 +65,26 @@ declare class Window extends EventTarget {
): void;
}
+/** @category Web APIs */
declare var window: Window & typeof globalThis;
+/** @category Web APIs */
declare var self: Window & typeof globalThis;
+/** @category DOM Events */
declare var onerror: ((this: Window, ev: ErrorEvent) => any) | null;
+/** @category DOM Events */
declare var onload: ((this: Window, ev: Event) => any) | null;
+/** @category DOM Events */
declare var onunload: ((this: Window, ev: Event) => any) | null;
+/** @category Observability */
declare var onunhandledrejection:
| ((this: Window, ev: PromiseRejectionEvent) => any)
| null;
+/** @category Web Storage API */
declare var localStorage: Storage;
+/** @category Web Storage API */
declare var sessionStorage: Storage;
+/** @category Web APIs */
declare class Navigator {
constructor();
readonly gpu: GPU;
@@ -81,29 +92,45 @@ declare class Navigator {
readonly userAgent: string;
}
+/** @category Web APIs */
declare var navigator: Navigator;
/**
* Shows the given message and waits for the enter key pressed.
+ *
* If the stdin is not interactive, it does nothing.
+ *
+ * @category Web APIs
+ *
* @param message
*/
declare function alert(message?: string): void;
/**
* 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.
+ *
+ * @category Web APIs
+ *
* @param message
*/
declare function confirm(message?: string): boolean;
/**
* 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 null.
+ *
* If the stdin is not interactive, it returns null.
+ *
+ * @category Web APIs
+ *
* @param message
* @param defaultValue
*/
@@ -117,6 +144,8 @@ declare function prompt(message?: string, defaultValue?: string): string | null;
* ...
* dispatchEvent(new Event('unload'));
* ```
+ *
+ * @category DOM Events
*/
declare function addEventListener<
K extends keyof WindowEventMap,
@@ -125,6 +154,7 @@ declare function addEventListener<
listener: (this: Window, ev: WindowEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void;
+/** @category DOM Events */
declare function addEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
@@ -138,6 +168,8 @@ declare function addEventListener(
* addEventListener('load', listener);
* removeEventListener('load', listener);
* ```
+ *
+ * @category DOM Events
*/
declare function removeEventListener<
K extends keyof WindowEventMap,
@@ -156,7 +188,10 @@ declare function removeEventListener(
// The types there must first be split into window, worker and global types.
/** 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`. */
+ * `globalThis.location`.
+ *
+ * @category Web APIs
+ */
declare class Location {
constructor();
/** Returns a DOMStringList object listing the origins of the ancestor
@@ -222,4 +257,5 @@ declare class Location {
// TODO(nayeemrmn): Move this to `extensions/web` where its implementation is.
// The types there must first be split into window, worker and global types.
+/** @category Web APIs */
declare var location: Location;