text: define(["require", "exports"], function (require, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", { value: true });
      /**
       * Autobind is a utility for binding methods in a class. This simplifies tagging methods as being "bound" to the this pointer
       * so that they can be used in scenarios that simply require a function callback.
       */
      // tslint:disable-next-line:no-any
      function autobind(target, key, descriptor) {
          var fn = descriptor.value;
          var defining = false;
          return {
              configurable: true,
              get: function () {
                  if (defining || (fn && this === fn.prototype) || this.hasOwnProperty(key)) {
                      return fn;
                  }
                  // Bind method only once, and update the property to return the bound value from now on
                  var fnBound = fn && fn.bind(this);
                  defining = true;
                  Object.defineProperty(this, key, {
                      configurable: true,
                      writable: true,
                      enumerable: true,
                      value: fnBound
                  });
                  defining = false;
                  return fnBound;
              },
              // tslint:disable-next-line:no-any
              set: function (newValue) {
                  Object.defineProperty(this, key, {
                      configurable: true,
                      writable: true,
                      enumerable: true,
                      value: newValue
                  });
              }
          };
      }
      exports.autobind = autobind;
  });
  //# sourceMappingURL=autobind.js.map