我试图将easeljs与typescript一起使用
我已经设置了打字稿,并按照以下方式安装了打字:
function executeTransaction() {
tNG_log::log('tNG' . $this->transactionType, 'executeTransaction', 'begin');
if ($this->started) {
tNG_log::log('tNG' . $this->transactionType, 'executeTransaction', 'end');
return false;
}
我有一个名为$ typings install easeljs --ambient
的文件:
canvas.ts
致电/// <reference path="browser/main.d.ts" />
var canv = < HTMLCanvasElement > document.createElement("canvas");
canv.width = 800;
canv.height = 600;
canv.style.border = "5px solid silver";
var stage = new createjs.Stage(canv);
var circle = new createjs.Shape();
circle.graphics.beginFill("DeepSkyBlue").drawCircle(0, 0, 50);
circle.x = 100;
circle.y = 100;
stage.addChild(circle);
stage.update();
document.body.appendChild(canv);
我得到:
tsc canvas.ts
如果我执行typings/main/ambient/easeljs/easeljs.d.ts(187,40): error TS2304: Cannot find name 'EventDispatcher'.
typings/main/ambient/easeljs/easeljs.d.ts(657,19): error TS2304: Cannot find name 'Timeline'.
typings/main/ambient/easeljs/easeljs.d.ts(679,22): error TS2304: Cannot find name 'Tween'.
typings/main/ambient/easeljs/easeljs.d.ts(797,38): error TS2304: Cannot find name 'EventDispatcher'.
typings/main/ambient/easeljs/easeljs.d.ts(818,45): error TS2304: Cannot find name 'EventDispatcher'.
,则仅保留有关typings install tweenjs --ambient
的消息。使用打字安装EventDispatcher
不会有帮助。
调用createjs
后,.js文件似乎正确生成(我可以看到圆圈),但错误似乎表明我做错了。有什么想法吗?
免责声明:之前从未使用过javascript /打字稿,所以它可能是微不足道的。