-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Declaration EmitThe issue relates to the emission of d.ts filesThe issue relates to the emission of d.ts files
Milestone
Description
Followup to #40228:
var NS = {}
NS.K =class {
values() {
return new NS.K()
}
}
exports.K = NS.K;Expected behavior:
Should produce d.ts output:
declare namespace NS {
class _K {
values(): _K;
}
export {_K as K};
}
import _K = NS.K;
export {_K as K};Actual behavior:
export var K: {
new (): {
values(): any;
};
};- Inlines and destroys the namespace.
- Only exports a value, not a class.
- Doesn't serialise nested typed references to
Kproperly.
The declaration emitter just needs code to support this; right now it's hitting inaccurate fallback code.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Declaration EmitThe issue relates to the emission of d.ts filesThe issue relates to the emission of d.ts files