type HeaderValue = string | undefined | null; export type HeadersLike = Headers | readonly HeaderValue[][] | Record | undefined | null | NullableHeaders; declare const brand_privateNullableHeaders: unique symbol; /** * @internal * Users can pass explicit nulls to unset default headers. When we parse them * into a standard headers type we need to preserve that information. */ export type NullableHeaders = { /** Brand check, prevent users from creating a NullableHeaders. */ [brand_privateNullableHeaders]: true; /** Parsed headers. */ values: Headers; /** Set of lowercase header names explicitly set to null. */ nulls: Set; }; export declare const buildHeaders: (newHeaders: HeadersLike[]) => NullableHeaders; export declare const isEmptyHeaders: (headers: HeadersLike) => boolean; /** A headers object read through a `get` method, like the fetch API's `Headers`. */ export interface HeadersProtocol { get: (header: string) => string | null | undefined; } export declare const isHeadersProtocol: (headers: unknown) => headers is HeadersProtocol; /** * Reads every value of one header, matching its name case-insensitively, from any headers shape a * request handler hands over: each entry of an array value, and the value of every name that differs * only in case, in order. A fetch `Headers`, or any object read through `get`, has already folded * repeated lines into one comma-joined value, so it yields at most one. * * This is the one lookup the webhook verifier and its companions read headers through, so a delivery is * read the same way whichever method receives it. A value that is not a non-empty string is skipped * rather than coerced, since a JavaScript caller may hand over anything. */ export declare const getHeaderValues: (headers: HeadersLike | HeadersProtocol, header: string) => string[]; /** * Reads one header like {@link getHeaderValues}, yielding its first value: the first entry of an array * value, or the first of two names that differ only in case. */ export declare const getHeader: (headers: HeadersLike | HeadersProtocol, header: string) => string | undefined; /** Reads one header like {@link getHeader}, throwing when the headers do not carry it. */ export declare const getRequiredHeader: (headers: HeadersLike | HeadersProtocol, header: string) => string; export {}; //# sourceMappingURL=headers.d.ts.map