mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-03 11:41:44 +00:00
ioredis: Add some missing properties (#10240)
These are minor changes: * There's a `status` field that can be used to check if the connection to the redis server is active. * There's a `getBuffer` method that returns a node `Buffer` instance instead of a string (if you're saving binary data on redis, this is useful). * The callback on `connect` is optional.
This commit is contained in:
committed by
Mohamed Hegazy
parent
10f5180288
commit
994439d8ed
Vendored
+3
-1
@@ -41,7 +41,8 @@ declare module IORedis {
|
||||
}
|
||||
|
||||
interface Redis extends NodeJS.EventEmitter, Commander {
|
||||
connect(callback: Function): Promise<any>;
|
||||
status: string;
|
||||
connect(callback?: Function): Promise<any>;
|
||||
disconnect(): void;
|
||||
duplicate(): Redis;
|
||||
monitor(calback: (error: Error, monitor: NodeJS.EventEmitter) => void): Promise<NodeJS.EventEmitter>;
|
||||
@@ -59,6 +60,7 @@ declare module IORedis {
|
||||
subscribe(channel: string): any;
|
||||
get(args: any[], callback?: ResCallbackT<string>): any;
|
||||
get(...args: any[]): any;
|
||||
getBuffer(key: string, callback?: ResCallbackT<Buffer>): any;
|
||||
set(args: any[], callback?: ResCallbackT<string>): any;
|
||||
set(...args: any[]): any;
|
||||
setnx(args: any[], callback?: ResCallbackT<any>): any;
|
||||
|
||||
Reference in New Issue
Block a user