I have a class which looks like this:
export module GameModule {
export class Game {
private boardContainer: HTMLElement;
private board:
Your code compiles fine for me. Here is what I have:
GameModule.ts
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() {
}
}
}
Main.ts
import GameModule = module("./GameModule");
window.onload = () => {
new GameModule.GameModule.Game( document.getElementById('content'));
};
both in the same directory. When I compile it with
tsc --module amd Main.ts
the compiler reports no problems. Can you please check if you can compile exactly those two classes? Also, please post your complete code (if possible). From the error message I would assume that your module resides in another directory.