56 lines
796 B
Text
56 lines
796 B
Text
|
=== tests/cases/compiler/file1.d.ts ===
|
||
|
|
||
|
declare module "file1" {
|
||
|
class foo {}
|
||
|
>foo :
|
||
|
|
||
|
namespace foo {
|
||
|
>foo : typeof
|
||
|
|
||
|
export var v: number;
|
||
|
>v : number
|
||
|
}
|
||
|
export = foo;
|
||
|
>foo : foo
|
||
|
}
|
||
|
|
||
|
|
||
|
=== tests/cases/compiler/file2.ts ===
|
||
|
/// <reference path="file1.d.ts"/>
|
||
|
import x = require("file1");
|
||
|
>x : typeof x
|
||
|
|
||
|
x.b = 1;
|
||
|
>x.b = 1 : number
|
||
|
>x.b : number
|
||
|
>x : typeof x
|
||
|
>b : number
|
||
|
>1 : number
|
||
|
|
||
|
// OK - './file1' is a namespace
|
||
|
declare module "file1" {
|
||
|
interface A { a }
|
||
|
>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
|
||
|
>A : x.A
|
||
|
|
||
|
let b = x.b;
|
||
|
>b : number
|
||
|
>x.b : number
|
||
|
>x : typeof x
|
||
|
>b : number
|
||
|
|