Typescriptで外部ファイルのクラスを読み込むソース
//Mymodule.ts export class Mymodule{ function test(){ console.log('test'); } }
//Main.ts import s = require('./Mymodule'); var mymodule = new s.Mymodule(); mymodule.test();
上記のソースを
tsc Main.ts --outFile Mymodule.ts
でコンパイルするとエラーが出ました。
Mymodule.ts(3,3): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. Mymodule.ts(7,1): error TS1128: Declaration or statement expected.
どのような修正が必要でしょうか?
よろしくお願いします。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/09/04 02:28
2016/09/04 02:35