function enableClassExtend(rootClz, mandatoryMethods) {
  rootClz.$constructor = rootClz; // FIXME: not necessary?

  rootClz.extend = function (proto) {
    if (true) {
      each(mandatoryMethods, function (method) {
        if (!proto[method]) {
          console.warn('Method `' + method + '` should be implemented' + (proto.type ? ' in ' + proto.type : '') + '.');
        }
      });
    }

    var superClass = this; // For backward compat, we both support ts class inheritance and this
    // "extend" approach.
    // The constructor should keep the same behavior as ts class inheritance:
    // If this constructor/$constructor is not declared, auto invoke the super
    // constructor.
    // If this constructor/$constructor is declared, it is responsible for
    // calling the super constructor.

    function ExtendedClass() {
      var args = [];

      for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
      }

      if (!proto.$constructor) {
        if (!isESClass(superClass)) {
          // Will throw error if superClass is an es6 native class.
          superClass.apply(this, arguments);
        } else {
          var ins = createObject( // @ts-ignore
          ExtendedClass.prototype, new (superClass.bind.apply(superClass, tslib_es6_spreadArrays([void 0], args)))());
          return ins;
        }
      } else {
        proto.$constructor.apply(this, arguments);
      }
    }

    ExtendedClass[IS_EXTENDED_CLASS] = true;
    util_extend(ExtendedClass.prototype, proto);
    ExtendedClass.extend = this.extend;
    ExtendedClass.superCall = superCall;
    ExtendedClass.superApply = superApply;
    inherits(ExtendedClass, this);
    ExtendedClass.superClass = superClass;
    return ExtendedClass;
  };
}
Implements `ExtendableConstructor` for `rootClz`.

@usage
```ts
class Xxx {}
type XxxConstructor = typeof Xxx & ExtendableConstructor
enableClassExtend(Xxx as XxxConstructor);
```