make node_redis inherits from EventEmitter

This commit is contained in:
Aymeric Beaumet 2014-10-21 19:14:40 +02:00
parent bd9a1922e4
commit b5f6b3d5b1
2 changed files with 6 additions and 3 deletions

View File

@ -51,7 +51,9 @@ client.exists(str, numCallback);
client.publish(str, value);
client.subscribe(str);
client.on(str, messageHandler);
client.once(str, messageHandler);
// ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
@ -61,4 +63,4 @@ client.get(args, resCallback);
client.set(args);
client.set(args, resCallback);
client.incr(str, resCallback);
client.incr(str, resCallback);

5
redis/redis.d.ts vendored
View File

@ -5,6 +5,8 @@
// Imported from: https://github.com/soywiz/typescript-node-definitions/redis.d.ts
/// <reference path="../node/node.d.ts" />
declare module "redis" {
export function createClient(port_arg: number, host_arg?: string, options?: ClientOpts): RedisClient;
export function createClient(unix_socket: string, options?: ClientOpts): RedisClient;
@ -43,7 +45,7 @@ declare module "redis" {
auth_pass?: boolean;
}
interface RedisClient {
interface RedisClient extends NodeJS.EventEmitter {
// event: connect
// event: error
// event: message
@ -76,7 +78,6 @@ declare module "redis" {
publish(channel: string, value: any): void;
subscribe(channel: string): void;
on(channel: string, handler: MessageHandler): void;
/*
commands = set_union([