/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * Represents the header configuration options for an HTTP request. * Instances are immutable. Modifying methods return a cloned * instance with the change. The original object is never changed. * * @publicApi */ export declare class HttpHeaders { /** * Internal map of lowercase header names to values. */ private headers; /** * Internal map of lowercased header names to the normalized * form of the name (the form seen first). */ private normalizedNames; /** * Complete the lazy initialization of this object (needed before reading). */ private lazyInit; /** * Queued updates to be materialized the next initialization. */ private lazyUpdate; /** Constructs a new HTTP header object with the given values.*/ constructor(headers?: string | { [name: string]: string | number | (string | number)[]; } | Headers); /** * Checks for existence of a given header. * * @param name The header name to check for existence. * * @returns True if the header exists, false otherwise. */ has(name: string): boolean; /** * Retrieves the first value of a given header. * * @param name The header name. * * @returns The value string if the header exists, null otherwise */ get(name: string): string | null; /** * Retrieves the names of the headers. * * @returns A list of header names. */ keys(): string[]; /** * Retrieves a list of values for a given header. * * @param name The header name from which to retrieve values. * * @returns A string of values if the header exists, null otherwise. */ getAll(name: string): string[] | null; /** * Appends a new value to the existing set of values for a header * and returns them in a clone of the original instance. * * @param name The header name for which to append the values. * @param value The value to append. * * @returns A clone of the HTTP headers object with the value appended to the given header. */ append(name: string, value: string | string[]): HttpHeaders; /** * Sets or modifies a value for a given header in a clone of the original instance. * If the header already exists, its value is replaced with the given value * in the returned object. * * @param name The header name. * @param value The value or values to set or override for the given header. * * @returns A clone of the HTTP headers object with the newly set header value. */ set(name: string, value: string | string[]): HttpHeaders; /** * Deletes values for a given header in a clone of the original instance. * * @param name The header name. * @param value The value or values to delete for the given header. * * @returns A clone of the HTTP headers object with the given value deleted. */ delete(name: string, value?: string | string[]): HttpHeaders; private maybeSetNormalizedName; private init; private copyFrom; private clone; private applyUpdate; private setHeaderEntries; /** * @internal */ forEach(fn: (name: string, values: string[]) => void): void; }