import { FastifyInstance } from 'fastify'; import { ConsumeMessage } from 'amqplib'; import * as amqp from 'amqplib'; declare module 'fastify' { interface FastifyInstance { rabbitmq: { connection: any; channel: amqp.Channel; subscribe: (queueName: string, handler: (msg: amqp.ConsumeMessage) => void) => Promise; publish: (exchange: string, routingKey: string, message: Buffer) => Promise; }; } } export interface QueueConfig { queueName?: string; exchangeName?: string; routingKey?: string; host?: string; port?: number; username?: string; password?: string; vhost?: string; } export interface MessageHandler { handleMessage(msg: ConsumeMessage): Promise; } export interface QueueSubscriberOptions { fastify: FastifyInstance; config?: QueueConfig; messageHandler: MessageHandler; } export interface QueuePublisherOptions { fastify: FastifyInstance; config?: QueueConfig; } export interface PublishMessageOptions { message: any; routingKey?: string; exchangeName?: string; persistent?: boolean; } export interface QueueServiceInterface { startSubscription(): Promise; publishMessage(message: any, routingKey?: string): Promise; publishMessageWithOptions(options: PublishMessageOptions): Promise; closeConnection(): Promise; } //# sourceMappingURL=types.d.ts.map