2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/withImportDecl_1.ts ===
|
|
|
|
///<reference path='withImportDecl_0.ts'/>
|
|
|
|
var simpleVar;
|
|
|
|
>simpleVar : any
|
|
|
|
|
|
|
|
var anotherVar: any;
|
|
|
|
>anotherVar : any
|
|
|
|
|
|
|
|
var varWithSimpleType: number;
|
|
|
|
>varWithSimpleType : number
|
|
|
|
|
|
|
|
var varWithArrayType: number[];
|
|
|
|
>varWithArrayType : number[]
|
|
|
|
|
|
|
|
var varWithInitialValue = 30;
|
|
|
|
>varWithInitialValue : number
|
|
|
|
|
|
|
|
var withComplicatedValue = { x: 30, y: 70, desc: "position" };
|
|
|
|
>withComplicatedValue : { x: number; y: number; desc: string; }
|
|
|
|
>{ x: 30, y: 70, desc: "position" } : { x: number; y: number; desc: string; }
|
|
|
|
>x : number
|
|
|
|
>y : number
|
|
|
|
>desc : string
|
|
|
|
|
|
|
|
declare var declaredVar;
|
|
|
|
>declaredVar : any
|
|
|
|
|
|
|
|
declare var declareVar2
|
|
|
|
>declareVar2 : any
|
|
|
|
|
|
|
|
declare var declaredVar;
|
|
|
|
>declaredVar : any
|
|
|
|
|
|
|
|
declare var deckareVarWithType: number;
|
|
|
|
>deckareVarWithType : number
|
|
|
|
|
|
|
|
var arrayVar: string[] = ['a', 'b'];
|
|
|
|
>arrayVar : string[]
|
|
|
|
>['a', 'b'] : string[]
|
|
|
|
|
|
|
|
|
|
|
|
function simpleFunction() {
|
2014-08-28 21:52:44 +02:00
|
|
|
>simpleFunction : () => { x: string; y: string; n: number; }
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
return {
|
2014-08-22 03:39:46 +02:00
|
|
|
>{ x: "Hello", y: "word", n: 2 } : { x: string; y: string; n: number; }
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
x: "Hello",
|
|
|
|
>x : string
|
|
|
|
|
|
|
|
y: "word",
|
|
|
|
>y : string
|
|
|
|
|
|
|
|
n: 2
|
|
|
|
>n : number
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
module m1 {
|
2014-08-28 21:40:58 +02:00
|
|
|
>m1 : typeof m1
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
export function foo() {
|
2014-08-28 21:52:44 +02:00
|
|
|
>foo : () => string
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
return "Hello";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
import m3 = require("withImportDecl_0");
|
2014-08-28 21:40:58 +02:00
|
|
|
>m3 : typeof m3
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var b = new m3.A();
|
2014-08-25 19:36:12 +02:00
|
|
|
>b : m3.A
|
|
|
|
>new m3.A() : m3.A
|
|
|
|
>m3.A : typeof m3.A
|
|
|
|
>m3 : typeof m3
|
|
|
|
>A : typeof m3.A
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
b.foo;
|
|
|
|
>b.foo : string
|
2014-08-25 19:36:12 +02:00
|
|
|
>b : m3.A
|
2014-08-15 23:33:16 +02:00
|
|
|
>foo : string
|
|
|
|
|
|
|
|
=== tests/cases/compiler/withImportDecl_0.ts ===
|
|
|
|
export class A { foo: string; }
|
|
|
|
>A : A
|
|
|
|
>foo : string
|
|
|
|
|