मैं Resig के उपयोग करता है 'का विस्तार' मौजूदा कोड को संदर्भित कर रहा हूँ, लेकिन मैं त्रुटियों की एक गुच्छा हो रही है
------ 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
मैं पता है कि अंत में मैं टाइपप्रति का विस्तार आधारित कोड को फिर से लिखने के लिए चाहते हैं, लेकिन तब तक, मैं कैसे यह नए कोड से संदर्भ करते हैं?
कारण है कि यह मौजूदा जावास्क्रिप्ट कोड में टाइप त्रुटियों के बारे में शिकायत कर रहा है - मैं इस भीख माँगता गहरा सवाल लगता है?













