You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trawling the repository and wiki for information regarding how to import commonjs modules (specifically, those generated by protoc's javascript code generator) into a typescript file.
In particular, these generated files have JsDoc comments such as:
/** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */proto.cockroach.server.serverpb.ClusterFreezeResponse.prototype.serializeBinary=function(){
...
}
As you might imagine, typescript definitions are not generated. Here's where things get confusing: the wiki page https://github.com/Microsoft/TypeScript/wiki/JsDoc-support-in-JavaScript claims that typescript supports gathering type information from some forms of JsDoc comments, but it seems to be impossible to import these commonjs modules without first writing some definitions for them (which ISTM would trample the JsDoc type information).
Does anyone have an example (or even instructions) on how this is meant to work? @RyanCavanaugh you seem to have worked on some of this - do you have an insights?
The text was updated successfully, but these errors were encountered:
I am assuming you are using this file as a module and importing it into a different file and you are not seeing the type information, correct? if so, then #7075 fixes this by loading the .js files from a node package. previously only .d.ts files are loaded, and if none is provided no type information is loaded from a node package.
I've been trawling the repository and wiki for information regarding how to import commonjs modules (specifically, those generated by
protoc
's javascript code generator) into a typescript file.In particular, these generated files have JsDoc comments such as:
As you might imagine, typescript definitions are not generated. Here's where things get confusing: the wiki page https://github.com/Microsoft/TypeScript/wiki/JsDoc-support-in-JavaScript claims that typescript supports gathering type information from some forms of JsDoc comments, but it seems to be impossible to import these commonjs modules without first writing some definitions for them (which ISTM would trample the JsDoc type information).
Does anyone have an example (or even instructions) on how this is meant to work? @RyanCavanaugh you seem to have worked on some of this - do you have an insights?
The text was updated successfully, but these errors were encountered: