-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Unable to add custom imports for pbts generated types #1034
Comments
I think this'd require some sort of postprocessing at this point, but a mechanism that somehow inherits custom imports from JS in the generated TSD would be ideal, probably. |
Ultimately I'm trying to create an abstract class for implementing RPC server templates and this is the final hurdle. I can approach this in different ways:
I think I'd prefer to see the import syntax included in the target as it keeps the concerns together. Therefore the jsdoc extension approach could be better. I can then share my server work if of interest later. Any preference? |
Perhaps abuse the |
protobuf.js version: master
When using a custom target for
pbjs
I expect to be able to have generated classes inherit from a custom base class (as opposed to something from the protobufjs codebase, e.g. protobuf.Rpc.Service).This can be achieved by writing out a require in the template, but when it comes to generating the types with
pbts
, the requires are lost and tsc fails.I see there is a hardcoded import added by pbts:
https://github.com/dcodeIO/protobuf.js/blob/master/cli/pbts.js#L146
JSDoc doesn't seem to support imports/requires, so is there a way to add custom imports?
The text was updated successfully, but these errors were encountered: