DataHandler.d.ts 1014 B

123456789101112131415161718192021222324252627282930313233
  1. /// <reference types="node" />
  2. import { NetStream, CommandItem } from "./types";
  3. import Deque = require("denque");
  4. import { EventEmitter } from "events";
  5. import SubscriptionSet from "./SubscriptionSet";
  6. interface Condition {
  7. select: number;
  8. auth: string;
  9. subscriber: false | SubscriptionSet;
  10. }
  11. interface DataHandledable extends EventEmitter {
  12. stream: NetStream;
  13. status: string;
  14. condition: Condition;
  15. commandQueue: Deque<CommandItem>;
  16. disconnect(reconnect: boolean): void;
  17. recoverFromFatalError(commandError: Error, err: Error, options: any): void;
  18. handleReconnection(err: Error, item: CommandItem): void;
  19. }
  20. interface ParserOptions {
  21. stringNumbers: boolean;
  22. }
  23. export default class DataHandler {
  24. private redis;
  25. constructor(redis: DataHandledable, parserOptions: ParserOptions);
  26. private returnFatalError;
  27. private returnError;
  28. private returnReply;
  29. private handleSubscriberReply;
  30. private handleMonitorReply;
  31. private shiftCommand;
  32. }
  33. export {};