typeScript:https://www.tslang.cn/samples/index.html
文件 IShape.ts (导出模块)
namespace Drawing {
export interface IShape1 {
draw();
}
}
Circle.ts 文件(导入模块)
/// <reference path = "IShape.ts" />
namespace Drawing {
export class Circle implements IShape1 {
public draw() {
console.log("Circle is drawn");
}
}
}
console.log(new Drawing.Circle())