From 994439d8ed69b57f5779cec2b07bf91f9dfddf49 Mon Sep 17 00:00:00 2001 From: Esteban Ordano Date: Sun, 24 Jul 2016 02:59:38 -0300 Subject: [PATCH] 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. --- ioredis/ioredis.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ioredis/ioredis.d.ts b/ioredis/ioredis.d.ts index a3769fee6c..983ed39f10 100644 --- a/ioredis/ioredis.d.ts +++ b/ioredis/ioredis.d.ts @@ -41,7 +41,8 @@ declare module IORedis { } interface Redis extends NodeJS.EventEmitter, Commander { - connect(callback: Function): Promise; + status: string; + connect(callback?: Function): Promise; disconnect(): void; duplicate(): Redis; monitor(calback: (error: Error, monitor: NodeJS.EventEmitter) => void): Promise; @@ -59,6 +60,7 @@ declare module IORedis { subscribe(channel: string): any; get(args: any[], callback?: ResCallbackT): any; get(...args: any[]): any; + getBuffer(key: string, callback?: ResCallbackT): any; set(args: any[], callback?: ResCallbackT): any; set(...args: any[]): any; setnx(args: any[], callback?: ResCallbackT): any;