export class Tedis { //////////////////////////////////////////////////////////////////////////////////////////// base public id: string; constructor(options?: { host?: string; port?: number; password?: string }); constructor(options?: { host?: string; port?: number; password?: string }); public command(...parameters: Array): Promise; public close(): void; public on(event: "connect" | "timeout", listener: () => void): void; public on(event: "close", listener: (had_error: boolean) => void): void; public on(event: "error", listener: (err: Error) => void): void; public on(event: string, listener: (...args: any[]) => void): void; //////////////////////////////////////////////////////////////////////////////////////////// key public del(key: string, ...keys: string[]): Promise; // dump(key: string): Promise; public exists(key: string, ...keys: string[]): Promise; public expire(key: string, seconds: number): Promise; public expireat(key: string, timestamp: number): Promise; public keys(pattern: string): Promise; // MIGRATE public move(key: string, db: number): Promise; // object public persist(key: string): Promise; public pexpire(key: string, milliseconds: number): Promise; public pexpireat(key: string, millisecondsTimestamp: number): Promise; public pttl(key: string): Promise; public randomkey(): Promise; public rename(key: string, newKey: string): Promise; public renamenx(key: string, newKey: string): Promise<0 | 1>; // RESTORE // scan // sort // touch public ttl(key: string): Promise; public type(key: string): Promise; // unlink // wait //////////////////////////////////////////////////////////////////////////////////////////// string public append(key: string, value: string): Promise; // BITCOUNT // BITFIELD // BITOP // BITPOS public decr(key: string): Promise; public decrby(key: string, decrement: number): Promise; public get(key: string): Promise; public getbit(key: string, offset: number): Promise<0 | 1>; public getrange(key: string, [start, end]?: [number, number]): Promise; public getset(key: string, value: string): Promise; public incr(key: string): Promise; public incrby(key: string, increment: number): Promise; public incrbyfloat(key: string, increment: number): Promise; public mget(key: string, ...keys: string[]): Promise>; public mset(objKv: { [propName: string]: string }): Promise; public msetnx(objKv: { [propName: string]: string }): Promise; public psetex(key: string, milliseconds: number, value: string): Promise; public set(key: string, value: string): Promise; public setbit(key: string, offset: number, value: 0 | 1): Promise<0 | 1>; public setex(key: string, seconds: number, value: string): Promise; public setnx(key: string, value: string): Promise<0 | 1>; public setrange(key: string, offset: number, value: string): Promise; public strlen(key: string): Promise; //////////////////////////////////////////////////////////////////////////////////////////// hash public hdel(key: string, field: string, ...fields: string[]): Promise; public hexists(key: string, field: string): Promise; public hget(key: string, field: string): Promise; public hgetall(key: string): Promise<{ [propName: string]: string }>; public hincrby(key: string, field: string, increment: number): Promise; public hincrbyfloat(key: string, field: string, increment: number): Promise; public hkeys(key: string): Promise; public hlen(key: string): Promise; public hmget( key: string, field: string, ...fields: string[] ): Promise>; public hmset( key: string, hash: { [propName: string]: string | number; } ): Promise; // hscan public hset(key: string, field: string, value: string | number): Promise<0 | 1>; public hsetnx(key: string, field: string, value: string): Promise<0 | 1>; public hstrlen(key: string, field: string): Promise; public hvals(key: string): Promise; //////////////////////////////////////////////////////////////////////////////////////////// list public blpop(timeout: number, ...keys: string[]): Promise>; public brpop(timeout: number, ...keys: string[]): Promise>; public brpoplpush( source: string, destination: string, timeout: number ): Promise; public lindex(key: string, index: number): Promise; public linsert( key: string, type: "BEFORE" | "AFTER", pivot: string, value: string ): Promise; public llen(key: string): Promise; public lpop(key: string): Promise; public lpush( key: string, value: string | number, ...values: Array ): Promise; public lpushx(key: string, value: string | number): Promise; public lrange(key: string, start: number, stop: number): Promise; public lrem(key: string, count: number, value: string): Promise; public lset(key: string, index: number, value: string | number): Promise; public ltrim(key: string, start: number, stop: number): Promise; public rpop(key: string): Promise; public rpoplpush(source: string, destination: string): Promise; public rpush( key: string, value: string | number, ...values: Array ): Promise; public rpushx(key: string, value: string | number): Promise; //////////////////////////////////////////////////////////////////////////////////////////// set public sadd( key: string, member: string | number, ...members: Array ): Promise; public scard(key: string): Promise; public sdiff(key: string, anotherkey: string, ...keys: string[]): Promise; public sdiffstore( destination: string, key: string, anotherkey: string, ...keys: string[] ): Promise; public sinter(key: string, anotherkey: string, ...keys: string[]): Promise; public sinterstore( destination: string, key: string, anotherkey: string, ...keys: string[] ): Promise; public sismember(key: string, member: string | number): Promise; public smembers(key: string): Promise; public smove( source: string, destination: string, member: string | number ): Promise; public spop(key: string, count: number): Promise; public spop(key: string): Promise; public spop(key: string, count?: number): any; public srandmember(key: string, count: number): Promise; public srandmember(key: string): Promise; public srandmember(key: string, count?: number): any; public srem( key: string, member: string | number, ...members: Array ): Promise; // sscan(): Promise; public sunion(key: string, anotherkey: string, ...keys: string[]): Promise; public sunionstore( destination: string, key: string, anotherkey: string, ...keys: string[] ): Promise; //////////////////////////////////////////////////////////////////////////////////////////// zset // bzpopmax // bzpopmin public zadd( key: string, objMS: { [propName: string]: number }, options?: { nxxx?: "NX" | "XX"; ch?: "CH"; } ): Promise; public zadd( key: string, objMS: { [propName: string]: number }, options?: { nxxx?: "NX" | "XX"; ch?: "CH"; incr?: "INCR"; } ): Promise; public zadd( key: string, objMS: { [propName: string]: number }, options?: { nxxx?: "NX" | "XX"; ch?: "CH"; incr?: "INCR"; } ): any; public zcard(key: string): Promise; public zcount(key: string, min: string, max: string): Promise; public zincrby(key: string, increment: number, member: string): Promise; public zinterstore( destination: string, objectKW: { [PropName: string]: number }, aggregate?: "SUM" | "MIN" | "MAX" ): Promise; public zlexcount(key: string, min: string, max: string): Promise; // zpopmax // zpopmin public zrange(key: string, start: number, stop: number): Promise; public zrange( key: string, start: number, stop: number, withscores: "WITHSCORES" ): Promise<{ [propName: string]: string }>; public zrange( key: string, start: number, stop: number, withscores?: "WITHSCORES" ): any; public zrangebylex( key: string, min: string, max: string, options?: { offset: number; count: number; } ): Promise; public zrangebyscore( key: string, min: string, max: string, options?: { limit?: { offset: number; count: number; }; } ): Promise; public zrangebyscore( key: string, min: string, max: string, options?: { withscores: "WITHSCORES"; limit?: { offset: number; count: number; }; } ): Promise<{ [propName: string]: string }>; public zrangebyscore( key: string, min: string, max: string, options?: { limit?: { offset: number; count: number; }; withscores?: "WITHSCORES"; } ): Promise; public zrank(key: string, member: string): Promise; public zrem(key: string, member: string, ...members: string[]): Promise; public zremrangebylex(key: string, min: string, max: string): Promise; public zremrangebyrank(key: string, start: number, stop: number): Promise; public zremrangebyscore(key: string, min: string, max: string): Promise; public zrevrange(key: string, start: number, stop: number): Promise; public zrevrange( key: string, start: number, stop: number, withscores: "WITHSCORES" ): Promise<{ [propName: string]: string }>; public zrevrange( key: string, start: number, stop: number, withscores?: "WITHSCORES" ): Promise; // zrevrangebylex public zrevrangebyscore( key: string, max: string, min: string, options?: { limit?: { offset: number; count: number; }; } ): Promise; public zrevrangebyscore( key: string, max: string, min: string, options?: { withscores: "WITHSCORES"; limit?: { offset: number; count: number; }; } ): Promise<{ [propName: string]: string }>; public zrevrangebyscore( key: string, max: string, min: string, options?: { limit?: { offset: number; count: number; }; withscores?: "WITHSCORES"; } ): Promise; public zrevrank(key: string, member: string): Promise; // zscan public zscore(key: string, member: string): Promise; public zunionstore( destination: string, objectKW: { [PropName: string]: number }, aggregate?: "SUM" | "MIN" | "MAX" ): Promise; } export class TedisPool { constructor(options?: { host?: string; port?: number; password?: string; min_conn?: number; max_conn?: number; }); public getTedis(): Promise; public putTedis(tedis: Tedis): void; public release(): void; }