import * as amqp from 'amqplib'; import MessagePack from '../utils/msgpack'; export interface IConsumerInfo { channel: amqp.Channel; tag: string; } export default class AbstractBrokerService { protected connection: amqp.Connection; protected options: { rpcTimeout?: number; serviceName?: string; }; protected msgpack: MessagePack; protected initialized: boolean; constructor(connection: amqp.Connection, options?: { rpcTimeout?: number; serviceName?: string; }); initialize(): Promise; protected declareExchange(name: string, type: string, options: amqp.Options.AssertExchange): Promise; protected deleteExchage(name: string, options?: amqp.Options.DeleteExchange): Promise; protected declareQueue(name: string, options: amqp.Options.AssertQueue): Promise; protected deleteQueue(name: string, options?: amqp.Options.DeleteQueue): Promise; protected bindQueue(queue: string, source: string, pattern?: string, args?: any): Promise; protected unbindQueue(queue: string, source: string, pattern?: string, args?: any): Promise; protected sendToQueue(queue: string, content: any, options?: any): Promise; protected ack(message: any, allUpTo?: any): Promise; protected _consume(key: string, handler: (msg: any) => Promise, tag: string, options?: any): Promise; protected _cancel(consumerInfo: IConsumerInfo): Promise; protected _publish(exchange: any, routingKey: any, content: any, options?: any): Promise; private getChannel; private call; }