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

Typings don't support publishing objects #246

Closed
jorispz opened this issue Feb 25, 2019 · 0 comments
Closed

Typings don't support publishing objects #246

jorispz opened this issue Feb 25, 2019 · 0 comments

Comments

@jorispz
Copy link
Contributor

jorispz commented Feb 25, 2019

When automatic JSON conversion is enabled, one would want to use the publish function like

const mymessage = { a: 1, b: "2"};
nats.publish("mysubject", mymessage);

However, the current Typescript signatures of the publish function do not support this:

publish(callback: Function):void;
publish(subject: string, callback: Function):void;
publish(subject: string, msg: string | Buffer, callback: Function):void;
publish(subject: string, msg?: string | Buffer, reply?: string, callback?: Function):void;

Instead, they should be

publish(callback: Function):void;
publish(subject: string, callback: Function):void;
publish(subject: string, msg: string | Buffer | object, callback: Function):void;
publish(subject: string, msg?: string | Buffer | object, reply?: string, callback?: Function):void;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant