TypeScript/tests/baselines/reference/augmentExportEquals3_1.types
Wesley Wigham 15aff05ff6
Explicitly merge module augmentation members into the exports added by export * declarations (#37691)
* Explicitly merge module augmentation members into the exports added by export * declarations

* Use ?., add namespace merge test

* Add missing merged symbol call to handle enum/ns merges during entity name lookup

* Add test with error case

* Handle missing value declarations in more places, unify duplicate declaration error handling to improve assignment declaration duplicate errors
2020-04-01 16:36:28 -07:00

57 lines
969 B
Plaintext

=== tests/cases/compiler/file1.d.ts ===
declare module "file1" {
>"file1" : typeof import("file1")
function foo(): void;
>foo : typeof import("tests/cases/compiler/file1.d.ts")
namespace foo {
>foo : typeof import("tests/cases/compiler/file1.d.ts")
export var v: number;
>v : number
}
export = foo;
>foo : typeof import("tests/cases/compiler/file1.d.ts")
}
=== tests/cases/compiler/file2.ts ===
/// <reference path="file1.d.ts"/>
import x = require("file1");
>x : typeof x
x.b = 1;
>x.b = 1 : 1
>x.b : number
>x : typeof x
>b : number
>1 : 1
// OK - './file1' is a namespace
declare module "file1" {
>"file1" : typeof x
interface A { a }
>a : any
let b: number;
>b : number
}
=== tests/cases/compiler/file3.ts ===
import * as x from "file1";
>x : typeof x
import "file2";
let a: x.A;
>a : x.A
>x : any
let b = x.b;
>b : number
>x.b : number
>x : typeof x
>b : number