Resig の 'extend' を使用する既存のコードを参照しようとしていますが、大量のエラーが発生します
------ test.ts --------
/// <reference path="myclass.js" />
var m = new MyClass (3);
------ myclass.js --------
/// <reference path="class.js" />
var MyClass = Class.extend({
init: function (i)
{
this.i = i;
},
})
------ class.js --------
(copied from http://ejohn.org/blog/simple-javascript-inheritance/)
エラー:
Supplied parameters do not match any signature of call target
The name 'Class' does not exist in the current scope
The property 'extend' does not exist on value of type '() => void'
The name 'Class' does not exist in the current scope
最終的には拡張ベースのコードを TypeScript に書き直したいと思いますが、それまでは新しいコードからどのように参照すればよいでしょうか?
これは、より深い疑問を投げかけていると思います-既存の JavaScript コードの型エラーについて不平を言うのはなぜですか?