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
|
//// [sourceMap-FileWithComments.ts]
// Interface
interface IPoint {
getDist(): number;
}
// Module
module Shapes {
// Class
export class Point implements IPoint {
// Constructor
constructor(public x: number, public y: number) { }
// Instance member
getDist() { return Math.sqrt(this.x * this.x + this.y * this.y); }
// Static member
static origin = new Point(0, 0);
}
// Variable comment after class
var a = 10;
export function foo() {
}
/** comment after function
* this is another comment
*/
var b = 10;
}
/** Local Variable */
var p: IPoint = new Shapes.Point(3, 4);
var dist = p.getDist();
//// [sourceMap-FileWithComments.js]
// Module
var Shapes;
(function (Shapes) {
// Class
var Point = /** @class */ (function () {
// Constructor
function Point(x, y) {
this.x = x;
this.y = y;
}
// Instance member
Point.prototype.getDist = function () { return Math.sqrt(this.x * this.x + this.y * this.y); };
// Static member
Point.origin = new Point(0, 0);
return Point;
}());
Shapes.Point = Point;
// Variable comment after class
var a = 10;
function foo() {
}
Shapes.foo = foo;
/** comment after function
* this is another comment
*/
var b = 10;
})(Shapes || (Shapes = {}));
/** Local Variable */
var p = new Shapes.Point(3, 4);
var dist = p.getDist();
//# sourceMappingURL=sourceMap-FileWithComments.js.map
|