UNPKG

@neoncitylights/typed-http

Version:

Provides strongly typed HTTP header names. Supports the Fetch API, XmlHttpRequest, and the Node.js HTTP module with zero-runtime overhead.

12 lines (10 loc) 385 B
import { HttpRequestHeader, HttpResponseHeader } from 'headers'; import { HttpMethod } from 'httpMethods'; declare global { interface XmlHttpRequest { getResponseHeader(header: HttpResponseHeader): string|null; getAllResponseHeaders(): HttpResponseHeader[]; open(method: HttpMethod, url: string): void; setRequestHeader(header: HttpRequestHeader, value: string): void; } }