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 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
|
//// [tests/cases/compiler/commentsExternalModules2.ts] ////
//// [commentsExternalModules2_0.ts]
/** Module comment*/
export module m1 {
/** b's comment*/
export var b: number;
/** foo's comment*/
function foo() {
return b;
}
/** m2 comments*/
export module m2 {
/** class comment;*/
export class c {
};
/** i*/
export var i = new c();
}
/** exported function*/
export function fooExport() {
return foo();
}
}
m1.fooExport();
var myvar = new m1.m2.c();
/** Module comment */
export module m4 {
/** b's comment */
export var b: number;
/** foo's comment
*/
function foo() {
return b;
}
/** m2 comments
*/
export module m2 {
/** class comment; */
export class c {
};
/** i */
export var i = new c();
}
/** exported function */
export function fooExport() {
return foo();
}
}
m4.fooExport();
var myvar2 = new m4.m2.c();
//// [commentsExternalModules_1.ts]
/**This is on import declaration*/
import extMod = require("commentsExternalModules2_0"); // trailing comment 1
extMod.m1.fooExport();
export var newVar = new extMod.m1.m2.c();
extMod.m4.fooExport();
export var newVar2 = new extMod.m4.m2.c();
//// [commentsExternalModules2_0.js]
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/** Module comment*/
var m1;
(function (m1) {
/** foo's comment*/
function foo() {
return m1.b;
}
/** m2 comments*/
var m2;
(function (m2) {
/** class comment;*/
var c = /** @class */ (function () {
function c() {
}
return c;
}());
m2.c = c;
;
/** i*/
m2.i = new c();
})(m2 = m1.m2 || (m1.m2 = {}));
/** exported function*/
function fooExport() {
return foo();
}
m1.fooExport = fooExport;
})(m1 = exports.m1 || (exports.m1 = {}));
m1.fooExport();
var myvar = new m1.m2.c();
/** Module comment */
var m4;
(function (m4) {
/** foo's comment
*/
function foo() {
return m4.b;
}
/** m2 comments
*/
var m2;
(function (m2) {
/** class comment; */
var c = /** @class */ (function () {
function c() {
}
return c;
}());
m2.c = c;
;
/** i */
m2.i = new c();
})(m2 = m4.m2 || (m4.m2 = {}));
/** exported function */
function fooExport() {
return foo();
}
m4.fooExport = fooExport;
})(m4 = exports.m4 || (exports.m4 = {}));
m4.fooExport();
var myvar2 = new m4.m2.c();
});
//// [commentsExternalModules_1.js]
define(["require", "exports", "commentsExternalModules2_0"], function (require, exports, extMod) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
extMod.m1.fooExport();
exports.newVar = new extMod.m1.m2.c();
extMod.m4.fooExport();
exports.newVar2 = new extMod.m4.m2.c();
});
//// [commentsExternalModules2_0.d.ts]
/** Module comment*/
export declare module m1 {
/** b's comment*/
var b: number;
/** m2 comments*/
module m2 {
/** class comment;*/
class c {
}
/** i*/
var i: c;
}
/** exported function*/
function fooExport(): number;
}
/** Module comment */
export declare module m4 {
/** b's comment */
var b: number;
/** m2 comments
*/
module m2 {
/** class comment; */
class c {
}
/** i */
var i: c;
}
/** exported function */
function fooExport(): number;
}
//// [commentsExternalModules_1.d.ts]
/**This is on import declaration*/
import extMod = require("commentsExternalModules2_0");
export declare var newVar: extMod.m1.m2.c;
export declare var newVar2: extMod.m4.m2.c;
|