55 lines
813 B
Plaintext
55 lines
813 B
Plaintext
=== tests/cases/compiler/file1.d.ts ===
|
|
declare module "file1" {
|
|
function foo(): void;
|
|
>foo : typeof foo
|
|
|
|
namespace foo {
|
|
>foo : typeof foo
|
|
|
|
export var v: number;
|
|
>v : number
|
|
}
|
|
export = foo;
|
|
>foo : typeof foo
|
|
}
|
|
|
|
|
|
=== 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" {
|
|
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
|
|
|