1

I create jquery widgets like this: http://alexsexton.com/blog/2010/02/using-inheritance-patterns-to-organize-large-jquery-applications/

/*mywidget.js*/ 
(function ($) {

    function MyWidget(options, element) {
        $.Widget.call(options, element);
    }

    MyWidget.prototype = Object.Create($.Widget.prototype);

    MyWidget.prototype._create = function () {
        /*my code here*/
    }

    MyWidget.prototype.destroy = function () {
        /*my code here*/
        $.Widget.prototype.destroy.call(this);
    }

    $.widget.bridge("mywidget", MyWidget);

}(jQuery));

How write this code in typescript ? I know d.ts jquery-ui, but it only provides interfaces. Can not inherit interface.

Abraão Alves
  • 803
  • 1
  • 8
  • 14

0 Answers0