/// import { EventEmitter } from 'events'; import Transaction from './transaction'; import Batch from './batch'; import { IRedisKeyOptions } from './types/redis'; export interface IRedisOptions { host: string; port: number; prefix?: string; } declare class Redis extends EventEmitter { private _client; private _prefix; /** * Constructor */ constructor(options: IRedisOptions); /** * Get the underlying redis client */ readonly client: any; /** * Close the client */ dispose(): Promise; /** * Return the transaction prototype */ static readonly Transaction: typeof Transaction; /** * Get a transaction */ transaction(): Transaction; /** * Watch a key */ watch(key: string): Promise; /** * Begin a batch of commands */ batch(): Batch; /** * Key exists */ exists(key: string): Promise; /** * Get a key value */ get(key: string): Promise; /** * Set a key value */ set(key: string, value: string | number, options?: IRedisKeyOptions): Promise; /** * Increment an integer value */ incrby(key: string, value: number, options?: IRedisKeyOptions): Promise; /** * Increment a float value */ incrbyfloat(key: string, value: number, options?: IRedisKeyOptions): Promise; /** * Increment an integer value in a hash set */ hincrby(key: string, hashKey: string, value: number, options?: IRedisKeyOptions): Promise; /** * Increment a float value in a hash set */ hincrbyfloat(key: string, hashKey: string, value: number, options?: IRedisKeyOptions): Promise; /** * Hash map set */ hmset(key: string, hash: object, options?: IRedisKeyOptions): Promise; /** * Get a hash set */ hgetall(key: string): Promise; /** * Delete a key */ del(key: string): Promise; /** * Add to a set */ sadd(key: string, value: string | number | Array, options?: IRedisKeyOptions): Promise; /** * Get a set */ smembers(key: any): Promise; /** * Remove from set */ srem(key: string, value: string | number): Promise; /** * Scan and delete keys */ scanDel(pattern: string): Promise; /** * Scan keys */ scan(pattern: string, delegate: (keys: string[]) => Promise | void): Promise; /** * Get the remaining time of a key */ ttl(key: any): Promise; /** * Set the expiry in seconds */ private _checkExpiry(key, options); /** * Check to make sure this transaction is still open */ private _checkDisposed(); } export default Redis;