Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more useful type exports. #70

Merged
merged 3 commits into from
Mar 17, 2024
Merged

Add more useful type exports. #70

merged 3 commits into from
Mar 17, 2024

Conversation

ramhr
Copy link
Contributor

@ramhr ramhr commented Mar 17, 2024

The argument type for the produce and consume functions were not exported, and so was the type of the Arnavmq object itself.

@@ -7,7 +7,7 @@ declare class ProducerError extends Error {
constructor(error: { name: string; message: string });
}

interface PublishOptions extends amqp.Options.Publish {
interface ProduceOptions extends amqp.Options.Publish {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We said we want to deprecate "publish" in favor of "produce", even though currently "produce" is marked deprecated, so I the exported type to "produce".

@@ -7,7 +7,7 @@ declare class ProducerError extends Error {
constructor(error: { name: string; message: string });
}

interface PublishOptions extends amqp.Options.Publish {
interface ProduceOptions extends amqp.Options.Publish {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to decide, which is of the ones we shoul depricate: either Publish/Subscribe or Produce/Consume

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be produce / consume, this is how RabbitMQ clients call it.
Maybe let's deprecate publish / subscribe in our next version?

@shamil shamil removed their assignment Mar 17, 2024
@@ -7,7 +7,7 @@ declare class ProducerError extends Error {
constructor(error: { name: string; message: string });
}

interface PublishOptions extends amqp.Options.Publish {
interface ProduceOptions extends amqp.Options.Publish {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be produce / consume, this is how RabbitMQ clients call it.
Maybe let's deprecate publish / subscribe in our next version?

@@ -45,7 +45,7 @@ declare class Producer {
* @param msg The message to publish
* @param options The publish options
*/
publishOrSendToQueue(queue: string, msg: Buffer, options: PublishOptions): Promise<boolean>;
publishOrSendToQueue(queue: string, msg: Buffer, options: ProduceOptions): Promise<boolean>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method should be private I think

@yosiat yosiat assigned ramhr and unassigned yosiat Mar 17, 2024
@ramhr ramhr merged commit d320fb1 into master Mar 17, 2024
4 checks passed
@ramhr ramhr deleted the export_more_types branch March 17, 2024 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants