Snažím se odkazovat na stávající kód, který používá Resig je ‚prodloužit‘, ale já jsem stále spoustu chyb
------ 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/)
chyby:
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
Uvědomuji si, že nakonec bych chtěl přepsat rozšířit založený kód strojopisu s, ale do té doby, jak mohu odkazovat jej z nového kódu?
Myslím, že to vyvolává hlubší otázku - proč se to stěžuje chyby typu ve stávající kód JavaScript?













