File: augmentExportEquals6.js

package info (click to toggle)
node-typescript 2.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 203,952 kB
  • ctags: 52,987
  • sloc: sh: 11; makefile: 5
file content (63 lines) | stat: -rw-r--r-- 1,300 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//// [tests/cases/compiler/augmentExportEquals6.ts] ////

//// [file1.ts]

class foo {}
namespace foo {
    export class A {}
    export namespace B { export let a; }
}
export = foo;

//// [file2.ts]
import x = require("./file1"); 
x.B.b = 1;

// OK - './file1' is a namespace
declare module "./file1" {
    interface A { a: number }
    namespace B {
        export let b: number;
    }
}

//// [file3.ts]
import * as x from "./file1";
import "./file2";
let a: x.A;
let b = a.a;
let c = x.B.b;

//// [file1.js]
define(["require", "exports"], function (require, exports) {
    "use strict";
    var foo = (function () {
        function foo() {
        }
        return foo;
    }());
    (function (foo) {
        var A = (function () {
            function A() {
            }
            return A;
        }());
        foo.A = A;
        var B;
        (function (B) {
        })(B = foo.B || (foo.B = {}));
    })(foo || (foo = {}));
    return foo;
});
//// [file2.js]
define(["require", "exports", "./file1"], function (require, exports, x) {
    "use strict";
    x.B.b = 1;
});
//// [file3.js]
define(["require", "exports", "./file1", "./file2"], function (require, exports, x) {
    "use strict";
    var a;
    var b = a.a;
    var c = x.B.b;
});