import { CacheControl } from '@tusbar/cache-control'; import { type H3Event } from 'h3'; import type { FetchResponse } from 'ofetch'; import { type MaxAge } from './maxAge.js'; import type { CacheableItemInterface } from '../types/index.js'; import type { CacheabilityInterface } from './CacheabilityInterface.js'; declare const numericProperties: readonly ["maxAge", "maxStaleDuration", "minFresh", "sharedMaxAge", "staleIfError", "staleWhileRevalidate"]; declare const booleanProperties: readonly ["immutable", "maxStale", "mustRevalidate", "noCache", "noStore", "noTransform", "onlyIfCached", "proxyRevalidate"]; type CacheControlProperties = keyof Omit; type CacheControlNumericProperties = keyof Pick; type CacheControlBooleanProperties = keyof Pick; export declare class NuxtMultiCacheCDNHelper implements CacheabilityInterface { private readonly now; readonly cacheControlHeader: string; readonly cacheTagsHeader: string; _tags: string[]; _control: CacheControl; constructor(now: number, cacheControlHeader?: string, cacheTagsHeader?: string); /** * Add the cache control and cache tags header to the event. * * The method is already called when using useCDNHeaders(), so there is no * need to call it yourself in this case. * * @param event - The event. */ applyToEvent(event: H3Event): NuxtMultiCacheCDNHelper; /** * Merge the cacheability from a fetch response. */ mergeFromResponse(arg: FetchResponse): NuxtMultiCacheCDNHelper; /** * Merge from a cache-control header. * * @param header - The value of the cache-control header. */ mergeCacheControlHeader(header: string): NuxtMultiCacheCDNHelper; /** * Set a cache-control property. */ set(key: T, value: CacheControl[T]): NuxtMultiCacheCDNHelper; /** * Add cache tags. */ addTags(tags?: string | string[]): NuxtMultiCacheCDNHelper; /** * Sets a numeric value only if it's lower than the current value or if it * isn't yet set. * * For example, this can be used when setting maxAge: You can set a global * max age of 1 year for every response. But a component down the tree that * shows the current weather can set it to 1 hour. If another component tries * to set the max age to 7 days the value won't be set. * * This basically means that the lowest value will always "win". */ setNumeric(key: T, providedValue: MaxAge): NuxtMultiCacheCDNHelper; /** * Sets a boolean value to true. */ setBoolean(key: T): NuxtMultiCacheCDNHelper; /** * Set as private. * * Note that once it's set to private you can't change it back to public. * This is so that it's possible to change it at any time during the request * without running into race conditions. */ private(): NuxtMultiCacheCDNHelper; /** * Set public. * * Note that if `private` was already set to `true` this will have no effect. */ public(): NuxtMultiCacheCDNHelper; mergeFromCacheItem(item: CacheableItemInterface): NuxtMultiCacheCDNHelper; mergeFromCacheability(cacheability: CacheabilityInterface): NuxtMultiCacheCDNHelper; getMaxAge(): number | null; getStaleIfError(): number | null; getTags(): string[]; } export {};