fix returntype of publish() and sendToQueue() (#27322)

This commit is contained in:
Rogier Schouten
2018-07-20 17:31:13 -07:00
committed by Wesley Wigham
parent e3727a66d2
commit 59c9faf71a
2 changed files with 7 additions and 2 deletions
@@ -18,3 +18,8 @@ connection.on("disconnect", (_arg: { err: Error }): void => undefined);
channelWrapper.on("close", () => undefined);
channelWrapper.on("connect", () => undefined);
channelWrapper.on("error", (_error: Error) => undefined);
channelWrapper.sendToQueue("foo", Buffer.from("bar"))
.catch((error: Error): void => {
// nothing
});
+2 -2
View File
@@ -146,7 +146,7 @@ export interface ChannelWrapper extends EventEmitter {
* @param options
* @param callback
*/
publish(exchange: string, routingKey: string, content: Buffer, options?: Options.Publish, callback?: (err: any, ok: Replies.Empty) => void): boolean;
publish(exchange: string, routingKey: string, content: Buffer, options?: Options.Publish, callback?: (err: any, ok: Replies.Empty) => void): Promise<void>;
/**
* @see amqplib
@@ -155,7 +155,7 @@ export interface ChannelWrapper extends EventEmitter {
* @param options
* @param callback
*/
sendToQueue(queue: string, content: Buffer, options?: Options.Publish, callback?: (err: any, ok: Replies.Empty) => void): boolean;
sendToQueue(queue: string, content: Buffer, options?: Options.Publish, callback?: (err: any, ok: Replies.Empty) => void): Promise<void>;
/**
* @see amqplib