/*! * @package @coolgk/utils * @version 3.1.4 * @link https://github.com/coolgk/node-utils * @license MIT * @author Daniel Gong * * Copyright (c) 2017 Daniel Gong . All rights reserved. * Licensed under the MIT License. */ /*! * Copyright (c) 2017 Daniel Gong . All rights reserved. * Licensed under the MIT License. */ import { RedisClient } from 'redis'; export interface ICacheClient extends RedisClient { [key: string]: any; } export interface ICacheConfig { readonly redisClient: ICacheClient; } export declare class Cache { private _redisClient; constructor(options: ICacheConfig); set(name: string, value: any, expiry?: number): Promise; get(name: string): Promise; delete(name: string | string[]): Promise; getSetIfNull(name: string, callback: () => any, expiry?: number): Promise; command(command: string, ...params: any[]): Promise; } export default Cache;