rabbitmq-event-manager
Version:
A nodeJS Event Manager to emit, and listen event through RabbitMQ
23 lines (22 loc) • 1.17 kB
TypeScript
import * as amqp from 'amqplib';
import { IEventManagerOptions, IEventPayload } from '../lib/interfaces';
/**
* Connect to the rabbitMQ server.
*
* @param url The url of the RabbitMQ Server (including crentials and vhosts)
*/
export declare function connect(url: string): Promise<amqp.Connection>;
/**
* Disconnect everything from RabbitMQ
*/
export declare function disconnect(): Promise<void>;
export declare function createChannel(url: string): Promise<amqp.ConfirmChannel>;
export declare function createExchange(channel: amqp.ConfirmChannel, name: string, alternateExchangeName?: string | null, options?: {
durable: boolean;
autoDelete: boolean;
}): Promise<string>;
export declare function publish(channel: amqp.ConfirmChannel, exchangeName: string, payload: IEventPayload, options: IEventManagerOptions): Promise<IEventPayload>;
export declare function createQueue(channel: amqp.ConfirmChannel, queueName: string, exchangeName: string, options?: amqp.Options.AssertQueue): Promise<string>;
export { consume } from './helper/consume';
export { deleteExchange } from './helper/deleteExchange';
export { deleteQueue } from './helper/deleteQueue';