fastify-rabbitmq
Version:
A Fastify RabbitMQ Plugin Developed in Pure TypeScript.
36 lines • 1.72 kB
TypeScript
import { FastifyInstance } from "fastify";
import { FastifyRabbitMQOptions } from "./decorate";
export { type FastifyRabbitMQOptions } from "./decorate";
/**
* How we talk with Fastify
* @since 1.0.0
* @param fastify
* @param options
* @param connection
*/
declare const decorateFastifyInstance: (fastify: FastifyInstance, options: FastifyRabbitMQOptions, connection: any) => void;
/**
* Main Function
* @since 1.0.0
* @example
* This is the basics on how to use this plugin:
* ```js
* app.register(fastifyRabbit, {
* connection: 'amqp://guest:guest@localhost'
* })
* ```
* This will allow you to read from your Fastify "object" and
* use this plugin at the "rabbitmq" level. From there you can execute and maintain
* the RabbitMQ Connection using the 'rabbitmq-client' package, which is wrapping around
* this plugin to execute functions it provides.
*
* @see [https://cody-greene.github.io/node-rabbitmq-client/latest/index.html](https://cody-greene.github.io/node-rabbitmq-client/latest/index.html)
*
*/
declare const fastifyRabbit: import("fastify").FastifyPluginCallback<FastifyRabbitMQOptions, import("fastify").RawServerDefault, import("fastify").FastifyTypeProviderDefault, import("fastify").FastifyBaseLogger>;
export default fastifyRabbit;
export { decorateFastifyInstance };
export * from "./types";
export type { AsyncMessage, Channel, Connection, ConnectionOptions, Consumer, ConsumerHandler, ConsumerProps, Envelope, HeaderFields, MessageBody, Publisher, PublisherProps, ReturnedMessage, RPCClient, RPCProps, SyncMessage, } from "rabbitmq-client";
export { AMQPChannelError, AMQPConnectionError, AMQPError, ConsumerStatus, } from "rabbitmq-client";
//# sourceMappingURL=index.d.ts.map