TypeScript/tests/cases/compiler/jsExportMemberMergedWithModuleAugmentation.ts
Andrew Branch ce95d9ca6b
Fix values and types merging in JS module exports (#37896)
* Fix values and types merging in JS module exports

* Fix everything

* Share `setValueDeclaration` between binder (local merge) and checker (cross-file merge)

* Revert accidental changes to baselines

* Update baseline from master merge
2020-04-24 13:49:48 -07:00

27 lines
412 B
TypeScript

// @allowJs: true
// @checkJs: true
// @noEmit: true
// @Filename: /test.js
class Abcde {
/** @type {string} */
x;
}
module.exports = {
Abcde
};
// @Filename: /index.ts
import { Abcde } from "./test";
declare module "./test" {
interface Abcde { b: string }
}
new Abcde().x;
// Bug: the type meaning from /test.js does not
// propagate through the object literal export.
const x: Abcde = { b: "" };