/**
 * An API for accessing a regional, volatile cache. Data stored in `@fly/cache` can have an associated per-key time to live (TTL), and we will evict key data automatically after the elapsed TTL. We will also evict unused data when we need to reclaim space.
 *
 * ```javascript
 * import cache from "@fly/cache"
 *
 * await cache.set("test-key", "test-value")
 *
 * const s = await cache.getString("test-key")
 * ```
 *
 * See {@link fly/cache/response} for caching HTTP Response objects.
 *
 * See {@link fly/cache/global} for global cache del/purge
 *
 * @preferred
 * @module fly/cache
 */
export interface CacheSetOptions {
    ttl?: number;
    tags?: string[];
    onlyIfEmpty?: boolean;
}
/**
 * Get an ArrayBuffer value (or null) from the cache
 * @param key The key to get
 * @return Raw bytes stored for provided key or null if empty.
 */
export declare function get(key: string): Promise<ArrayBuffer>;
/**
 * Get a string value (or null) from the cache
 *
 * @param key The key to get
 * @returns Data stored at the key, or null if none exists
 */
export declare function getString(key: string): Promise<string>;
/**
 * Get multiple values from the cache.
 * @param keys list of keys to retrieve
 * @returns List of results in the same order as the provided keys
 */
export declare function getMulti(keys: string[]): Promise<(ArrayBuffer | null)[]>;
/**
 * Get multiple string values from the cache
 * @param keys list of keys to retrieve
 * @returns list of results in the same order as the provided keys
 */
export declare function getMultiString(keys: string[]): Promise<string[]>;
/**
 * Sets a value at the specified key, with an optional ttl
 * @param key The key to add or overwrite
 * @param value Data to store at the specified key, up to 2MB
 * @param ttl Time to live (in seconds)
 * @returns true if the set was successful
 */
export declare function set(key: string, value: string | ArrayBuffer, options?: CacheSetOptions | number): Promise<boolean>;
/**
 * Add or overwrite a key's  time to live
 * @param key The key to modify
 * @param ttl Expiration time remaining in seconds
 * @returns true if ttl was successfully updated
 */
export declare function expire(key: string, ttl: number): Promise<boolean>;
/**
 * Replace tags for a given cache key
 * @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>;
/**
 * Purges all cache entries with the given tag
 * @param tag Tag to purge
 */
export declare function purgeTag(tag: string): Promise<string[]>;
/**
 * Deletes the value (if any) at the specified key
 * @param key Key to delete
 * @returns true if delete was successful
 */
export declare function del(key: string): Promise<boolean>;
/**
 * A library for caching/retrieving Response objects
 *
 * See {@link fly/cache/response}
 */
export { default as responseCache } from "./response";
declare const cache: {
    get: typeof get;
    getString: typeof getString;
    getMulti: typeof getMulti;
    getMultiString: typeof getMultiString;
    set: typeof set;
    expire: typeof expire;
    del: typeof del;
    setTags: typeof setTags;
    purgeTag: typeof purgeTag;
    global: {
        del: typeof import("src/fly/cache/global").del;
        purgeTag: typeof import("src/fly/cache/global").purgeTag;
    };
};
export default cache;
