我有一个看起来像这样的类:
export module GameModule {
export class Game {
private boardContainer: HTMLElement;
private board: number[][];
constructor (container: HTMLDivElement) {
this.boardContainer = container;
this.board = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];
this.drawGrid();
}
drawGrid() {
}
}
}
和主要应用:
import GameModule = module("./GameModule");
window.onload = () => {
new GameModule.GameModule.Game(<HTMLDivElement> document.getElementById('content'));
};
但是当我尝试编译代码时,我遇到了错误:
>tsc --module amd app.tss
app.tss(1, 27): The name '"./GameModule"' does not exist in the current scope
app.tss(1, 27): A module cannot be aliased to a non-module type
app.tss(4, 8): Expected car, class, interface, or module
我的代码有什么问题?