-
Notifications
You must be signed in to change notification settings - Fork 173
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
Fix TypeScript annotations for setters #289
Comments
UPD I've checked generated JS code and it seems that JS actually returns /**
* @param {string} value
* @return {!proto.MyMessage} returns this
*/
proto.MyMessage.prototype.setSymbol = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
export class MyMessage extends jspb.Message {
setSymbol(value: string): void;
} |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
It's still relevant. |
The fix should be relatively easy. The file to modify is here: https://github.com/improbable-eng/ts-protoc-gen/blob/master/src/ts/message.ts |
Currently there's no way to chain setters, because they don't return anything.
It would be convenient to have setters return the object they're called on:
The text was updated successfully, but these errors were encountered: