/**
 * An API for efficiently caching Response objects in the regional Fly cache.
 *
 * Usage:
 *
 * ```javascript
 * import { responseCache } from "@fly/cache"
 *
 * const resp = await fetch("http://example.com")
 *
 * // cache for an hour
 * await responseCache.set("example-com", resp, 3600)
 *
 * const cachedResponse = await responseCache.get("example-com")
 * ```
 *
 * See {@link fly/cache} for caching lower level types.
 * @preferred
 * @module fly/cache/response
 */
/** */
import { CacheSetOptions } from ".";
/**
 * Response metadata suitable for caching
 */
export interface Metadata {
    status: number;
    headers: {
        [key: string]: string | null;
    };
    at?: number;
    ttl: number;
    tags?: string[];
}
export interface ResponseCacheSetOptions extends CacheSetOptions {
    skipCacheHeaders?: string[];
}
/**
 * A response with cache info attached
 */
export declare type CachedResponse = Response & {
    key: string;
};
/**
 * Get a Response object from cache.
 * @param key cache key to get
 * @return The response associated with the key, or null if empty
 */
export declare function get(key: string): Promise<CachedResponse>;
/**
 * Gets Request metatadata from the cache
 * @param key cache key to get metadata for
 */
export declare function getMeta(key: string): Promise<Metadata>;
/**
 *
 * @param key Cache key to set
 * @param meta Metadata for the Response
 * @param opts Time to live
 */
export declare function setMeta(key: string, meta: Metadata, options?: CacheSetOptions | number): Promise<boolean>;
/**
 * Stores a Response object in the Fly cache.
 * @param key Cache key to set
 * @param resp The response to cache
 * @param options Time to live
 */
export declare function set(key: string, resp: Response, options?: ResponseCacheSetOptions | number): Promise<boolean>;
/**
 * Resets the "age" of the cached Response object
 * @param key Response to "touch"
 */
export declare function touch(key: string): Promise<boolean>;
/**
 * Sets a new expiration time for a Response object
 * @param key Key to set an expiration for
 * @param ttl Time to live
 */
export declare function expire(key: string, ttl: number): Promise<boolean>;
/**
 * Replace tags for a cached Response
 * @param key The key to modify
 * @param tags Tags to apply to key
 * @returns true if tags were successfully updated
 */
export declare function setTags(key: string, tags: string[]): Promise<boolean>;
/**
 * Deletes a Response object from the cache
 * @param key Key to delete
 */
export declare function del(key: string): Promise<boolean>;
declare const _default: {
    get: typeof get;
    getMeta: typeof getMeta;
    set: typeof set;
    setTags: typeof setTags;
    touch: typeof touch;
    expire: typeof expire;
    del: typeof del;
};
export default _default;
