TypeScript/tests/baselines/reference/importDecl.types
2014-08-18 14:29:42 -07:00

228 lines
5.2 KiB
Text

=== tests/cases/compiler/importDecl_1.ts ===
///<reference path='importDecl_require.ts'/>
///<reference path='importDecl_require1.ts'/>
///<reference path='importDecl_require2.ts'/>
///<reference path='importDecl_require3.ts'/>
///<reference path='importDecl_require4.ts'/>
import m4 = require("importDecl_require"); // Emit used
>m4 : typeof "tests/cases/compiler/importDecl_require"
export var x4 = m4.x;
>x4 : d
>m4.x : d
>m4 : typeof "tests/cases/compiler/importDecl_require"
>x : d
export var d4 = m4.d;
>d4 : typeof d
>m4.d : typeof d
>m4 : typeof "tests/cases/compiler/importDecl_require"
>d : typeof d
export var f4 = m4.foo();
>f4 : d
>m4.foo() : d
>m4.foo : () => d
>m4 : typeof "tests/cases/compiler/importDecl_require"
>foo : () => d
export module m1 {
>m1 : typeof m1
export var x2 = m4.x;
>x2 : d
>m4.x : d
>m4 : typeof "tests/cases/compiler/importDecl_require"
>x : d
export var d2 = m4.d;
>d2 : typeof d
>m4.d : typeof d
>m4 : typeof "tests/cases/compiler/importDecl_require"
>d : typeof d
export var f2 = m4.foo();
>f2 : d
>m4.foo() : d
>m4.foo : () => d
>m4 : typeof "tests/cases/compiler/importDecl_require"
>foo : () => d
var x3 = m4.x;
>x3 : d
>m4.x : d
>m4 : typeof "tests/cases/compiler/importDecl_require"
>x : d
var d3 = m4.d;
>d3 : typeof d
>m4.d : typeof d
>m4 : typeof "tests/cases/compiler/importDecl_require"
>d : typeof d
var f3 = m4.foo();
>f3 : d
>m4.foo() : d
>m4.foo : () => d
>m4 : typeof "tests/cases/compiler/importDecl_require"
>foo : () => d
}
//Emit global only usage
import glo_m4 = require("importDecl_require1");
>glo_m4 : typeof "tests/cases/compiler/importDecl_require1"
export var useGlo_m4_d4 = glo_m4.d;
>useGlo_m4_d4 : typeof d
>glo_m4.d : typeof d
>glo_m4 : typeof "tests/cases/compiler/importDecl_require1"
>d : typeof d
export var useGlo_m4_f4 = glo_m4.foo();
>useGlo_m4_f4 : d
>glo_m4.foo() : d
>glo_m4.foo : () => d
>glo_m4 : typeof "tests/cases/compiler/importDecl_require1"
>foo : () => d
//Emit even when used just in function type
import fncOnly_m4 = require("importDecl_require2");
>fncOnly_m4 : typeof "tests/cases/compiler/importDecl_require2"
export var useFncOnly_m4_f4 = fncOnly_m4.foo();
>useFncOnly_m4_f4 : d
>fncOnly_m4.foo() : d
>fncOnly_m4.foo : () => d
>fncOnly_m4 : typeof "tests/cases/compiler/importDecl_require2"
>foo : () => d
// only used privately no need to emit
import private_m4 = require("importDecl_require3");
>private_m4 : typeof "tests/cases/compiler/importDecl_require3"
export module usePrivate_m4_m1 {
>usePrivate_m4_m1 : typeof usePrivate_m4_m1
var x3 = private_m4.x;
>x3 : d
>private_m4.x : d
>private_m4 : typeof "tests/cases/compiler/importDecl_require3"
>x : d
var d3 = private_m4.d;
>d3 : typeof d
>private_m4.d : typeof d
>private_m4 : typeof "tests/cases/compiler/importDecl_require3"
>d : typeof d
var f3 = private_m4.foo();
>f3 : d
>private_m4.foo() : d
>private_m4.foo : () => d
>private_m4 : typeof "tests/cases/compiler/importDecl_require3"
>foo : () => d
}
// Do not emit unused import
import m5 = require("importDecl_require4");
>m5 : typeof "tests/cases/compiler/importDecl_require4"
export var d = m5.foo2();
>d : d
>m5.foo2() : d
>m5.foo2 : () => d
>m5 : typeof "tests/cases/compiler/importDecl_require4"
>foo2 : () => d
// Do not emit multiple used import statements
import multiImport_m4 = require("importDecl_require"); // Emit used
>multiImport_m4 : typeof "tests/cases/compiler/importDecl_require"
export var useMultiImport_m4_x4 = multiImport_m4.x;
>useMultiImport_m4_x4 : d
>multiImport_m4.x : d
>multiImport_m4 : typeof "tests/cases/compiler/importDecl_require"
>x : d
export var useMultiImport_m4_d4 = multiImport_m4.d;
>useMultiImport_m4_d4 : typeof d
>multiImport_m4.d : typeof d
>multiImport_m4 : typeof "tests/cases/compiler/importDecl_require"
>d : typeof d
export var useMultiImport_m4_f4 = multiImport_m4.foo();
>useMultiImport_m4_f4 : d
>multiImport_m4.foo() : d
>multiImport_m4.foo : () => d
>multiImport_m4 : typeof "tests/cases/compiler/importDecl_require"
>foo : () => d
=== tests/cases/compiler/importDecl_require.ts ===
export class d {
>d : d
foo: string;
>foo : string
}
export var x: d;
>x : d
>d : d
export function foo(): d { return null; }
>foo : () => d
>d : d
=== tests/cases/compiler/importDecl_require1.ts ===
export class d {
>d : d
bar: string;
>bar : string
}
var x: d;
>x : d
>d : d
export function foo(): d { return null; }
>foo : () => d
>d : d
=== tests/cases/compiler/importDecl_require2.ts ===
export class d {
>d : d
baz: string;
>baz : string
}
export var x: d;
>x : d
>d : d
export function foo(): d { return null; }
>foo : () => d
>d : d
=== tests/cases/compiler/importDecl_require3.ts ===
export class d {
>d : d
bing: string;
>bing : string
}
export var x: d;
>x : d
>d : d
export function foo(): d { return null; }
>foo : () => d
>d : d
=== tests/cases/compiler/importDecl_require4.ts ===
import m4 = require("importDecl_require");
>m4 : typeof "tests/cases/compiler/importDecl_require"
export function foo2(): m4.d { return null; }
>foo2 : () => d
>m4 : m4
>d : d