mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-09-25 10:30:25 +00:00
fix returntype of publish() and sendToQueue() (#27322)
This commit is contained in:
committed by
Wesley Wigham
parent
e3727a66d2
commit
59c9faf71a
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user