mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-30 04:16:48 -05:00
@@ -0,0 +1,39 @@
|
||||
//// [tests/cases/compiler/exportAssignmentMembersVisibleInAugmentation.ts] ////
|
||||
|
||||
//// [index.d.ts]
|
||||
export = foo;
|
||||
declare namespace foo {
|
||||
export type T = number;
|
||||
}
|
||||
|
||||
//// [a.ts]
|
||||
import * as foo from "foo";
|
||||
declare module "foo" {
|
||||
export function f(): T; // OK
|
||||
}
|
||||
|
||||
//// [b.ts]
|
||||
import * as foo from "foo";
|
||||
declare module "foo" {
|
||||
export function g(): foo.T; // OK
|
||||
}
|
||||
|
||||
|
||||
//// [a.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
//// [b.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
|
||||
|
||||
//// [a.d.ts]
|
||||
declare module "foo" {
|
||||
function f(): T;
|
||||
}
|
||||
export {};
|
||||
//// [b.d.ts]
|
||||
import * as foo from "foo";
|
||||
declare module "foo" {
|
||||
function g(): foo.T;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
=== /node_modules/foo/index.d.ts ===
|
||||
export = foo;
|
||||
>foo : Symbol(foo, Decl(index.d.ts, 0, 13))
|
||||
|
||||
declare namespace foo {
|
||||
>foo : Symbol(foo, Decl(index.d.ts, 0, 13), Decl(a.ts, 0, 27), Decl(b.ts, 0, 27))
|
||||
|
||||
export type T = number;
|
||||
>T : Symbol(T, Decl(index.d.ts, 1, 23))
|
||||
}
|
||||
|
||||
=== /a.ts ===
|
||||
import * as foo from "foo";
|
||||
>foo : Symbol(foo, Decl(a.ts, 0, 6))
|
||||
|
||||
declare module "foo" {
|
||||
>"foo" : Symbol(foo, Decl(index.d.ts, 0, 13), Decl(a.ts, 0, 27), Decl(b.ts, 0, 27))
|
||||
|
||||
export function f(): T; // OK
|
||||
>f : Symbol(f, Decl(a.ts, 1, 22))
|
||||
>T : Symbol(T, Decl(index.d.ts, 1, 23))
|
||||
}
|
||||
|
||||
=== /b.ts ===
|
||||
import * as foo from "foo";
|
||||
>foo : Symbol(foo, Decl(b.ts, 0, 6))
|
||||
|
||||
declare module "foo" {
|
||||
>"foo" : Symbol(foo, Decl(index.d.ts, 0, 13), Decl(a.ts, 0, 27), Decl(b.ts, 0, 27))
|
||||
|
||||
export function g(): foo.T; // OK
|
||||
>g : Symbol(g, Decl(b.ts, 1, 22))
|
||||
>foo : Symbol(foo, Decl(b.ts, 0, 6))
|
||||
>T : Symbol(T, Decl(index.d.ts, 1, 23))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
=== /node_modules/foo/index.d.ts ===
|
||||
export = foo;
|
||||
>foo : any
|
||||
|
||||
declare namespace foo {
|
||||
>foo : typeof foo
|
||||
|
||||
export type T = number;
|
||||
>T : number
|
||||
}
|
||||
|
||||
=== /a.ts ===
|
||||
import * as foo from "foo";
|
||||
>foo : typeof foo
|
||||
|
||||
declare module "foo" {
|
||||
>"foo" : typeof foo
|
||||
|
||||
export function f(): T; // OK
|
||||
>f : () => number
|
||||
>T : number
|
||||
}
|
||||
|
||||
=== /b.ts ===
|
||||
import * as foo from "foo";
|
||||
>foo : typeof foo
|
||||
|
||||
declare module "foo" {
|
||||
>"foo" : typeof foo
|
||||
|
||||
export function g(): foo.T; // OK
|
||||
>g : () => number
|
||||
>foo : any
|
||||
>T : number
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
// @declaration: true
|
||||
|
||||
// @Filename: /node_modules/foo/index.d.ts
|
||||
export = foo;
|
||||
declare namespace foo {
|
||||
export type T = number;
|
||||
}
|
||||
|
||||
// @Filename: /a.ts
|
||||
import * as foo from "foo";
|
||||
declare module "foo" {
|
||||
export function f(): T; // OK
|
||||
}
|
||||
|
||||
// @Filename: /b.ts
|
||||
import * as foo from "foo";
|
||||
declare module "foo" {
|
||||
export function g(): foo.T; // OK
|
||||
}
|
||||
Reference in New Issue
Block a user