-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Closed
Labels
Milestone
Description
π Search Terms
jsdoc namespace commonjs
π Version & Regression Information
- This changed between versions 3.6 and 3.7 (the first version to support types in JSDoc)
β― Playground Link
π» Code
/**
* @typedef Options
* @property {string} opt
*/
/**
* @param {Options} options
*/
module.exports = function loader(options) {}π Actual behavior
TypeScript emits the following .t.ds.
declare function _exports(options: Options): void;
export = _exports;
export type Options = {
opt: string;
};π Expected behavior
I expect the TypeScript to emit the following:
export = loader;
/**
* @typedef Options
* @property {string} opt
*/
/**
* @param {Options} options
*/
declare function loader(options: Options): void;
declare namespace loader {
export { Options };
}
type Options = {
opt: string;
};Or when the expression is unnamed:
export = _exports;
/**
* @typedef Options
* @property {string} opt
*/
/**
* @param {Options} options
*/
declare function _exports(options: Options): void;
declare namespace _exports {
export { Options };
}
type Options = {
opt: string;
};Additional information about the issue
I initially noticed this in the output of https://github.com/mdx-js/mdx/blob/3.0.0/packages/loader/index.cjs.
Reactions are currently unavailable