/** Data to initialize a header map. */ export declare type HeadersInit = Record | [string, string][] | Headers; /** * Constructs a new immutable header map from the given header record. * * @param headers the headers to construct a readonly instance from. * @returns a readonly headers instance */ export declare const newHeaderMapFromRecord: (headers: Record) => Headers; /** Returns a new header map with its guard set to "request". */ export declare const newRequestHeaderMap: (init?: HeadersInit | undefined) => Headers; /** Returns a new header map with its guard set to "response". */ export declare const newResponseHeaderMap: (init?: HeadersInit | undefined) => Headers; /** * Converts the header map into a record. * * @returns The record. */ export declare const toRecord: (map: Headers) => Record; /** * Represents a modifiable map of HTTP headers. * * @see https://fetch.spec.whatwg.org/#headers-class */ export declare class Headers { #private; /** * Constructs a new header map. * * Optionally initialization data can be passed in. * * @param init Optional header initialization data, will be cloned. */ constructor(init?: HeadersInit); /** * Returns how many headers there are. */ get length(): number; /** * Appends a header to the map. If there already is a header with the given name, * the value will be appended. * * @param name The name of the header to append. * @param value The header value. */ append(name: string, value: string): void; /** * Deletes all headers with the given name from the map. * * @param name The name of the headers to delete. */ delete(name: string): void; /** * Returns an iterator over all the headers that have been inserted. */ entries(): IterableIterator<[string, string]>; /** * Returns an iterator over all the headers that have been inserted. */ [Symbol.iterator](): IterableIterator<[string, string]>; /** Determines whether there is a header with the given name in the map. */ has(name: string): boolean; /** * Gets the header with the given name, or returns `undefined` if it's not there. * * If there are multiple header values they will be joined together. */ get(name: string): string | undefined; /** Returns an iterator over all the header names in the map. */ keys(): IterableIterator; /** * Sets the given header name to the given value. * * If there were any headers with the same name in the map before, they are overwritten. * * @param name The name of the header to insert. * @param value The value of the header to insert. */ set(name: string, value: string): void; /** Returns an iterator over all the header values in the map. */ values(): IterableIterator; }