/** * Represents the possible values of a `Cache-Control` HTTP header. * * All properties are optional, allowing partial objects to be passed to {@link format}. */ interface CacheControlValue { maxAge?: number | null; sharedMaxAge?: number | null; maxStale?: boolean | null; maxStaleDuration?: number | null; minFresh?: number | null; immutable?: boolean | null; mustRevalidate?: boolean | null; mustUnderstand?: boolean | null; noCache?: boolean | null; noCacheFields?: string[] | null; noStore?: boolean | null; noTransform?: boolean | null; onlyIfCached?: boolean | null; private?: boolean | null; privateFields?: string[] | null; proxyRevalidate?: boolean | null; public?: boolean | null; staleWhileRevalidate?: number | null; staleIfError?: number | null; } /** * A parsed `Cache-Control` HTTP header. * * Properties are initialized to `null` (unset). After calling {@link CacheControl.parse}, * boolean directives that were absent in the header are set to `false`, * while duration directives that were absent remain `null`. */ declare class CacheControl implements CacheControlValue { maxAge: number | null; sharedMaxAge: number | null; maxStale: boolean | null; maxStaleDuration: number | null; minFresh: number | null; immutable: boolean | null; mustRevalidate: boolean | null; mustUnderstand: boolean | null; noCache: boolean | null; noCacheFields: string[] | null; noStore: boolean | null; noTransform: boolean | null; onlyIfCached: boolean | null; private: boolean | null; privateFields: string[] | null; proxyRevalidate: boolean | null; public: boolean | null; staleWhileRevalidate: number | null; staleIfError: number | null; parse(header: string | undefined): this; format(): string; } /** * Parses a `Cache-Control` HTTP header value into a {@link CacheControl} instance. * * @param header - The raw header string (e.g. `"public, max-age=31536000"`). * If `undefined` or empty, all properties remain `null` (unset). * @returns A {@link CacheControl} instance with the parsed directive values. */ declare function parse(header?: string): CacheControl; /** * Formats a {@link CacheControlValue} object into a `Cache-Control` HTTP header string. * * @param cc - An object (or {@link CacheControl} instance) with directive values. * Only truthy booleans and non-null numbers are included in the output. * @returns The formatted header string (e.g. `"public, max-age=31536000"`), * or an empty string if no directives are set. */ declare function format(cc: CacheControlValue): string; export { CacheControl, type CacheControlValue, format, parse };