Repository: denoland/deno
File: cli/tsc/dts/lib.deno.window.d.ts (TypeScript)

Code before:
  readonly prototype: Window;
  new (): never;
};

/** @category Platform */
declare var window: Window & typeof globalThis;
/** @category Platform */
declare var self: Window & typeof globalThis;
/** @category Platform */
declare var closed: boolean;
/** @category Platform */
declare function close(): void;
/** @category Events */
declare var onerror: ((this: Window, ev: ErrorEvent) => any) | null;
/** @category Events */
declare var onload: ((this: Window, ev: Event) => any) | null;
/** @category Events */
declare var onbeforeunload: ((this: Window, ev: Event) => any) | null;
/** @category Events */
declare var onunload: ((this: Window, ev: Event) => any) | null;
/** @category Events */
declare var onunhandledrejection:
  | ((this: Window, ev: PromiseRejectionEvent) => any)
  | null;
/** 
 * Deno's {@linkcode localStorage} API provides a way to store key-value pairs in a web-like environment, 
 * similar to the Web Storage API found in browsers. It allows developers to persist data across sessions in a Deno application. 
 * This API is particularly useful for applications that require a simple and effective way to store data locally.
 * 
 * - Key-Value Storage: Stores data as key-value pairs.
 * - Persistent: Data is retained even after the application is closed.
 * - Synchronous API: Operations are performed synchronously.
 *
 * {@linkcode localStorage} is similar to {@linkcode sessionStorage}, and shares the same API methods, visible in the {@linkcode Storage} type.
 * 
 * @example
 * ```ts
 * // Set a value in localStorage
 * localStorage.setItem("key", "value");
 * 
 * // Get a value from localStorage
 * const value = localStorage.getItem("key");
 * console.log(value); // Output: "value"
 * 
 * // Remove a value from localStorage
 * localStorage.removeItem("key");
 * 
 * // Clear all values from localStorage
 * localStorage.clear();
 * ```
 * 

Review comment (suggestion):
i wouldnt link to itself, i'd find it a bit confusing if there is a link that goes to the same page
```suggestion
 * Deno's `localStorage` API provides a way to store key-value pairs in a web-like environment, 
```

Code after:
  readonly prototype: Window;
  new (): never;
};

/** @category Platform */
declare var window: Window & typeof globalThis;
/** @category Platform */
declare var self: Window & typeof globalThis;
/** @category Platform */
declare var closed: boolean;

/**
 * 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.
 *
 * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/close
 *
 * @example
 * ```ts
 * 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.
 * ```
 *
 * @category Platform
 */
declare function close(): void;

/** @category Events */
declare var onerror: ((this: Window, ev: ErrorEvent) => any) | null;
/** @category Events */
declare var onload: ((this: Window, ev: Event) => any) | null;
/** @category Events */
declare var onbeforeunload: ((this: Window, ev: Event) => any) | null;
/** @category Events */
declare var onunload: ((this: Window, ev: Event) => any) | null;
/** @category Events */
declare var onunhandledrejection:
  | ((this: Window, ev: PromiseRejectionEvent) => any)
  | null;
/**
 * Deno's `localStorage` API provides a way to store key-value pairs in a
 * web-like environment, similar to the Web Storage API found in browsers.
 * It allows developers to persist data across sessions in a Deno application.
 * This API is particularly useful for applications that require a simple