///
import { MicroPlugin, HealthState } from "@pestras/micro";
import { Options, Channel, ConsumeMessage, ConsumeMessageFields, MessageProperties } from 'amqplib';
export declare type ExchangeType = "fanout" | "direct" | "topic" | "headers";
export * from 'amqplib';
export declare class MQMsg {
private _msg;
channel?: Channel;
fields: ConsumeMessageFields;
properties: MessageProperties;
content: Buffer;
json: T;
constructor(_msg: ConsumeMessage, channel?: Channel);
respond(content: any, acknowledge?: boolean): void;
acknowledge(): void;
}
export declare function QUEUE(name: string, assertOptions?: Options.AssertQueue & {
prefetch?: number;
}, consumeOptions?: Options.Consume): (target: any, key: string) => void;
export declare function FANOUT(name: string, options?: Options.AssertExchange & {
prefetch?: number;
}, consumeOptions?: Options.Consume): (target: any, key: string) => void;
export declare function DIRECT(name: string, routingKeys: string[], options?: Options.AssertExchange, consumeOptions?: Options.Consume): (target: any, key: string) => void;
export declare function TOPIC(name: string, patterns: string[], options?: Options.AssertExchange, consumeOptions?: Options.Consume): (target: any, key: string) => void;
export interface MicroMQEvents {
onConnection(): void;
}
export declare class MicroMQ extends MicroPlugin implements HealthState {
private _connectOptions;
private _socketOptions?;
healthy: boolean;
ready: boolean;
constructor(_connectOptions: string | Options.Connect, _socketOptions?: any);
init(): Promise;
onExit(): void;
private _prepareQueues;
private _prepareExchanges;
static Request(queue: string, content: any, timeout?: number): Promise>;
static Queue(name: string, content?: any, options?: Options.AssertQueue): Promise;
static Fanout(name: string, content?: any, options?: Options.AssertExchange): Promise;
static Direct(name: string, routingKey: string, content?: any, options?: Options.AssertExchange): Promise;
static Topic(name: string, pattern: string, content?: any, options?: Options.AssertExchange): Promise;
}