import * as amqp from 'amqplib'; export interface Event { key: string; args: T; publishedAt?: Date; } export declare class BaseEvent implements Event { key: string; args: T; publishedAt: Date; constructor(key: string, args: T); } export declare class DebugBaseEvent implements Event { key: string; args: T; publishedAt?: Date | undefined; constructor(key: string, args: T, publishedAt?: Date | undefined); } export declare class DebugEvent extends DebugBaseEvent { debugClass: { key: string; args: T; }; publishedAt?: Date | undefined; constructor(debugClass: { key: string; args: T; }, publishedAt?: Date | undefined); } export interface EventHandler { (event: T): Promise | any; } export interface Message { content: Buffer; fields: { routingKey: string; }; properties: amqp.Options.Publish; } export declare abstract class Subscriber { abstract getQueue(): string; abstract setQueue(queue: string): void; abstract getRoutingPattern(): string; abstract isRoutingKeyMatched(routingKey: string): boolean; abstract handleEvent(content: any, msg: Message): Promise; } export declare class EventSubscriber extends Subscriber { private handler; private eventClass; private key; private queue; constructor(handler: EventHandler>, eventClass: new (args: any) => Event); getQueue(): string; setQueue(queue: string): void; getRoutingPattern(): string; readonly routingKey: string; isRoutingKeyMatched(routingKey: string): boolean; handleEvent(content: any, msg: Message): Promise; } export declare class PatternSubscriber extends Subscriber { private handler; private pattern; private regExp; private queue; constructor(handler: EventHandler>, pattern: string); getQueue(): string; setQueue(queue: string): void; getRoutingPattern(): string; isRoutingKeyMatched(routingKey: string): boolean; handleEvent(content: any, msg: Message): Promise; private convertRoutingKeyPatternToRegexp; } export interface SubscriptionOptions { everyNodeListen?: boolean; }