Installation
npm install --save @types/node-redis-pubsub
Summary
This package contains type definitions for node-redis-pubsub (https://github.com/louischatriot/node-redis-pubsub#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-redis-pubsub.
index.d.ts
import * as redis from "redis";
declare function NRP(options: object): NRP.NodeRedisPubSub;
declare namespace NRP {
function initClient(options: object): NodeRedisPubSub;
class NodeRedisPubSub {
constructor(options: object);
getRedisClient(): redis.RedisClient;
on(
channel: string,
handler: (data: string, channel: string) => void,
callback?: () => void,
): () => void;
subscribe(
channel: string,
handler: (data: string, channel: string) => void,
callback?: () => void,
): () => void;
emit(channel: string, message: string): void;
publish(channel: string, message: string): void;
quit(): void;
end(): void;
}
}
export = NRP;
Additional Details
- Last updated: Tue, 07 Nov 2023 09:09:39 GMT
- Dependencies: @types/redis
Credits
These definitions were written by Rene Keijzer.