export declare namespace cache {
    enum CacheErrorMessages {
        locked = "Object locked",
        notFound = "Object not found"
    }
    interface CacheObject {
        key: string;
        value: any;
        createdAt: number;
    }
    interface CacheOptions {
        expireTimeMS?: number;
        retry?: boolean | number;
    }
    const redisPrefix: string;
    const lockPrefix: string;
    const lockDuration: number;
    const scanCount: number;
    const lockRetry: number;
    function client(): import("ioredis").default;
    function lockName(): string;
    function overrideLockName(name: string): void;
    /**
     * A generic method to find all keys which match a pattern.
     * @pattern likely has a * at the end of the string.  Other arguments are for recursion and not required.
     */
    function getKeys(pattern: string, count?: number, keysAry?: string[], cursor?: number): Promise<Array<string>>;
    /**
     * Returns all the keys in redis which are under this Actionhero namespace.  Potentially very slow.
     */
    function keys(optionalScopePrefix?: string): Promise<Array<string>>;
    /**
     * Returns all the locks in redis which are under this Actionhero namespace.  Potentially slow.
     */
    function locks(optionalScopePrefix?: string): Promise<Array<string>>;
    /**
     * Returns the number of keys in redis which are under this Actionhero namespace.  Potentially very slow.
     */
    function size(pattern?: string): Promise<number>;
    /**
     * Removes all keys in redis which are under this Actionhero namespace.  Potentially very slow.
     * Returns the deleted keys.
     */
    function clear(pattern?: string): Promise<string[]>;
    /**
     * Write the current concents of redis (only the keys in Actionhero's namespace) to a file.
     */
    function dumpWrite(file: string): Promise<number>;
    /**
     * Load in contents for redis (and api.cache) saved to a file
     * Warning! Any existing keys in redis (under this Actionhero namespace) will be removed.
     */
    function dumpRead(file: string): Promise<number>;
    /**
     * Load an item from the cache.  Will throw an error if the item named by `key` cannot be found.
     * Automatically handles `api.cache.redisPrefix`
     */
    function load(key: string, options?: CacheOptions): Promise<CacheObject>;
    /**
     * Delete an item in the cache.  Will throw an error if the item named by `key` is locked.
     * Automatically handles `api.cache.redisPrefix`
     */
    function destroy(key: string): Promise<boolean>;
    /**
     * Save an item in the cache.  If an item is already in the cache with the same key, it will be overwritten.  Throws an error if the object is already in the cache and is locked.
     * Automatically handles `api.cache.redisPrefix`
     */
    function save(key: string, value: any, expireTimeMS?: number): Promise<boolean>;
    /**
     * Push an item to a shared queue/list in redis.
     * Automatically handles `api.cache.redisPrefix`
     */
    function push(key: string, item: any): Promise<boolean>;
    /**
     * Pop (get) an item to a shared queue/list in redis.
     * Automatically handles `api.cache.redisPrefix`
     */
    function pop(key: string): Promise<boolean>;
    /**
     * Check how many items are stored in a shared queue/list in redis.
     */
    function listLength(key: string): Promise<number>;
    /**
     * Lock an item in redis (can be a list or a saved item) to this Actionhero process.
     */
    function lock(key: string, expireTimeMS?: number): Promise<boolean>;
    /**
     * Unlock an item in redis (can be a list or a saved item) which was previously locked by this Actionhero process.
     */
    function unlock(key: string): Promise<boolean>;
    function checkLock(key: string, retry?: boolean | number, startTime?: number): Promise<boolean>;
}
