types/web.ts

crossws · types/web.ts · typescript · MIT
realtime

TypeScript definitions for web APIs.

// Source: https://github.com/h3js/crossws | License: MIT | Copyright Pooya Parsa <pooya@pi0.io>
// Provided via justclaw.it.com; keep this notice with the code.
// Mirror from @types/web to bypass runtime type pollution
/// <reference types="@types/web" />

// Local aliases for DOM-only globals so that consumers do not need `lib: ["dom"]`

/**
 * Headers accepted by the runtime `Headers` constructor (`HeadersInit`).
 */
export type HeadersInit = NonNullable<ConstructorParameters<typeof globalThis.Headers>[0]>;

type DOMHighResTimeStamp = number;

export type BinaryType = "blob" | "arraybuffer";

type MessageEventSource = unknown;

type EventListenerOrEventListenerObject =
  | ((evt: Event) => void)
  | { handleEvent(object: Event): void };

interface WebSocketEventMap {
  close: CloseEven

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key