I apologize if this has already been covered or has an obvious fix, but I haven't been able to find a solution. I'm using tsd-jsdoc to generate a types.d.ts file for a node library / npm module. There's a top-level module that's the main entry point and it rexports things that are defined in sub modules. Here's a contrived example:
/** @module mytest */
import * as utils from "./lib/utils";
exports.utils = utils;
Running jsdoc with the tsd-jsdoc template generate something like this:
Not surprisingly this leads to a package that when included as a dependency in a typescript project (eg. import * as mytest from "mytest") gives you a mytest variable that has no properties defined on it.
My expectation for module re-exports was that mytest.utils would be defined, as well as things documented within the submodule itself, like mytest.utils.foo and mytest.utils.bar. I've tried a number of things such as explicitly importing the utility functions by name and re-exporting them under a new export property, but their original JSDoc documantion is not attached to these renamed exports. I've not been able to propagate type definitions from a submodule through the parent module when re-exporting these things. I could make things work by lumping code into one big file, but I'd prefer to keep the modular code organization of separate files. Any recommendations or comments as to whether or not this is, or can be, supported would be appreciated.
I apologize if this has already been covered or has an obvious fix, but I haven't been able to find a solution. I'm using tsd-jsdoc to generate a types.d.ts file for a node library / npm module. There's a top-level module that's the main entry point and it rexports things that are defined in sub modules. Here's a contrived example:
Running jsdoc with the tsd-jsdoc template generate something like this:
Not surprisingly this leads to a package that when included as a dependency in a typescript project (eg.
import * as mytest from "mytest"
) gives you amytest
variable that has no properties defined on it.My expectation for module re-exports was that
mytest.utils
would be defined, as well as things documented within the submodule itself, likemytest.utils.foo
andmytest.utils.bar
. I've tried a number of things such as explicitly importing the utility functions by name and re-exporting them under a new export property, but their original JSDoc documantion is not attached to these renamed exports. I've not been able to propagate type definitions from a submodule through the parent module when re-exporting these things. I could make things work by lumping code into one big file, but I'd prefer to keep the modular code organization of separate files. Any recommendations or comments as to whether or not this is, or can be, supported would be appreciated.Thanks!