/// <reference types="node" />
import type { IncomingHttpHeaders } from 'node:http';
import type { HttpResponse } from '../server/HttpResponse';
import type { Accept, AcceptCharset, AcceptDatetime, AcceptEncoding, AcceptLanguage, LinkEntry } from './Header';
import { ContentType } from './Header';
/**
 * Replaces all double quoted strings in the input string with `"0"`, `"1"`, etc.
 * @param input - The Accept header string.
 *
 * @throws {@link BadRequestHttpError}
 * Thrown if invalid characters are detected in a quoted string.
 *
 * @returns The transformed string and a map with keys `"0"`, etc. and values the original string that was there.
 */
export declare function transformQuotedStrings(input: string): {
    result: string;
    replacements: Record<string, string>;
};
/**
 * Splits the input string on commas, trims all parts and filters out empty ones.
 *
 * @param input - Input header string.
 *
 * @returns An array of trimmed strings.
 */
export declare function splitAndClean(input: string): string[];
/**
 * Parses a list of split parameters and checks their validity. Parameters with invalid
 * syntax are ignored and not returned.
 *
 * @param parameters - A list of split parameters (token [ "=" ( token / quoted-string ) ])
 * @param replacements - The double quoted strings that need to be replaced.
 * @param strict - Determines if invalid values throw errors (`true`) or log warnings (`false`). Defaults to `false`.
 *
 * @returns An array of name/value objects corresponding to the parameters.
 */
export declare function parseParameters(parameters: string[], replacements: Record<string, string>, strict?: boolean): {
    name: string;
    value: string;
}[];
/**
 * Parses an Accept header string.
 *
 * @param input - The Accept header string.
 * @param strict - Determines if invalid values throw errors (`true`) or log warnings (`false`). Defaults to `false`.
 *
 * @returns An array of {@link Accept} objects, sorted by weight. Accept parts
 * with invalid syntax are ignored and removed from the returned array.
 */
export declare function parseAccept(input: string, strict?: boolean): Accept[];
/**
 * Parses an Accept-Charset header string.
 *
 * @param input - The Accept-Charset header string.
 * @param strict - Determines if invalid values throw errors (`true`) or log warnings (`false`). Defaults to `false`.
 *
 * @returns An array of {@link AcceptCharset} objects, sorted by weight. Invalid ranges
 * are ignored and not returned.
 */
export declare function parseAcceptCharset(input: string, strict?: boolean): AcceptCharset[];
/**
 * Parses an Accept-Encoding header string.
 *
 * @param input - The Accept-Encoding header string.
 * @param strict - Determines if invalid values throw errors (`true`) or log warnings (`false`). Defaults to `false`.
 *
 * @returns An array of {@link AcceptEncoding} objects, sorted by weight. Invalid ranges
 * are ignored and not returned.
 */
export declare function parseAcceptEncoding(input: string, strict?: boolean): AcceptEncoding[];
/**
 * Parses an Accept-Language header string.
 *
 * @param input - The Accept-Language header string.
 * @param strict - Determines if invalid values throw errors (`true`) or log warnings (`false`). Defaults to `false`.
 *
 * @returns An array of {@link AcceptLanguage} objects, sorted by weight. Invalid ranges
 * are ignored and not returned.
 */
export declare function parseAcceptLanguage(input: string, strict?: boolean): AcceptLanguage[];
/**
 * Parses an Accept-DateTime header string.
 *
 * @param input - The Accept-DateTime header string.
 * @param strict - Determines if invalid values throw errors (`true`) or log warnings (`false`). Defaults to `false`.
 *
 * @returns An array with a single {@link AcceptDatetime} object,
 * or an empty array if a range in an invalid format is detected.
 */
export declare function parseAcceptDateTime(input: string, strict?: boolean): AcceptDatetime[];
/**
 * Adds a header value without overriding previous values.
 */
export declare function addHeader(response: HttpResponse, name: string, value: string | string[]): void;
/**
 * Parses the Content-Type header and also parses any parameters in the header.
 *
 * @param input - The Content-Type header string.
 *
 * @throws {@link BadRequestHttpError}
 * Thrown on invalid header syntax.
 *
 * @returns A {@link ContentType} object containing the value and optional parameters.
 */
export declare function parseContentType(input: string): ContentType;
/**
 * The Forwarded header from RFC7239
 */
export interface Forwarded {
    /** The user-agent facing interface of the proxy */
    by?: string;
    /** The node making the request to the proxy */
    for?: string;
    /** The host request header field as received by the proxy */
    host?: string;
    /** The protocol used to make the request */
    proto?: string;
}
/**
 * Parses a Forwarded header value and will fall back to X-Forwarded-* headers.
 *
 * @param headers - The incoming HTTP headers.
 *
 * @returns The parsed Forwarded header.
 */
export declare function parseForwarded(headers: IncomingHttpHeaders): Forwarded;
/**
 * Parses the link header(s) and returns an array of LinkEntry objects.
 *
 * @param link - A single link header or an array of link headers
 * @returns A LinkEntry array, LinkEntry contains a link and a params Record&lt;string,string&gt;
 */
export declare function parseLinkHeader(link?: string | string[]): LinkEntry[];
/**
 * Checks if the value of an HTTP Authorization header matches a specific scheme (e.g. Basic, Bearer, etc).
 *
 * @param scheme - Name of the authorization scheme (case insensitive).
 * @param authorization - The value of the Authorization header (may be undefined).
 * @returns True if the Authorization header uses the specified scheme, false otherwise.
 */
export declare function matchesAuthorizationScheme(scheme: string, authorization?: string): boolean;
/**
 * Checks if the scheme part of the specified url matches at least one of the provided options.
 *
 * @param url - A string representing the URL.
 * @param schemes - Scheme value options (the function will check if at least one matches the URL scheme).
 * @returns True if the URL scheme matches at least one of the provided options, false otherwise.
 */
export declare function hasScheme(url: string, ...schemes: string[]): boolean;
