Installation
npm install --save @types/http-headers
Summary
This package contains type definitions for http-headers (https://github.com/watson/http-headers).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/http-headers.
import { ServerResponse } from "http";
export = httpHeaders;
declare function httpHeaders<T extends boolean>(
data: string | Buffer | ServerResponse,
onlyHeaders?: T,
): T extends true ? httpHeaders.Headers : (httpHeaders.RequestData | httpHeaders.ResponseData | httpHeaders.Headers);
declare namespace httpHeaders {
interface RequestData {
method: string;
url: string;
version: HttpVersion;
headers: Headers;
}
interface ResponseData {
version: HttpVersion;
statusCode: number;
statusMessage: string;
headers: Headers;
}
interface HttpVersion {
major: number;
minor: number;
}
type Headers = {
"set-cookie"?: string[] | undefined;
} & { [key in string]?: string | undefined };
}
Additional Details
- Last updated: Tue, 01 Oct 2024 22:07:40 GMT
- Dependencies: @types/node
Credits
These definitions were written by BendingBender.