Skip to content

Commit

Permalink
Update typings to show encode() returning Buffer (#220)
Browse files Browse the repository at this point in the history
* Update typings to shpw encode() returning Buffer

* Updated docs for send

* Updated docs for format in send

* Add more clarification on format
  • Loading branch information
ramya-rao-a authored and grs committed Apr 29, 2019
1 parent c037df1 commit e5212a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions typings/link.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,12 @@ export declare interface Sender extends link {
/**
* Sends a message
* @param {Message | Buffer} msg The message to be sent. For default AMQP format msg parameter
* should be of type Message interface. For a custom format, the msg parameter should be a Buffer.
* should be of type Message interface. For a custom format, the msg parameter should be a Buffer
* and a valid value should be passed to the `format` argument.
* @param {Buffer | string} [tag] The message tag if any.
* @param {number} [format] The message format. Usually it is zero. Specify this
* if a message with custom format needs to be sent.
* @param {number} [format] The message format. Specify this if a message with custom format needs
* to be sent. `0` implies the standard AMQP 1.0 defined format. If no value is provided, then the
* given message is assumed to be of type Message interface and encoded appropriately.
* @returns {Delivery} Delivery
*/
send(msg: Message | Buffer, tag?: Buffer | string, format?: number): Delivery;
Expand Down
2 changes: 1 addition & 1 deletion typings/message.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface message {
sequence_section: (list: any) => any;
data_sections: (data_elements: any) => any;
sequence_sections: (lists: any) => any;
encode: (msg: any) => any;
encode: (msg: any) => Buffer;
decode: (buffer: Buffer) => Message;
are_outcomes_equivalent: (a: any, b: any) => boolean;
is_received: (o: Readonly<DeliveryOutcome>) => boolean;
Expand Down

0 comments on commit e5212a2

Please sign in to comment.