text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  /**
   * A decorator that marks a method as a _command_; an externally callable logic block that performs some task.  A name
   * for the command can be optionally specified, otherwise the name of the method being exported as the command will be
   * used.
   * @param name The optional command name
   * @returns decorator
   */
  function command(name) {
      return function (ctor, key, descriptor) {
          var mdk = 'grid:commands';
          var list = Reflect.getMetadata(mdk, ctor);
          if (!list) {
              Reflect.defineMetadata(mdk, (list = []), ctor);
          }
          list.push({
              name: name || key,
              key: key,
              impl: descriptor.value,
          });
      };
  }
  exports.command = command;
  /**
   * A decorator that defines the render function for a GridCell implementation, allowing custom cell types
   * to control their drawing behavior.
   *
   * @param func
   * A decorator that marks a method
   */
  function renderer(func) {
      return function (ctor) {
          Reflect.defineMetadata('custom:renderer', func, ctor);
      };
  }
  exports.renderer = renderer;
  /**
   * A decorator that marks a method as a _routine_; a logic block that can be hooked into or overridden by other
   * modules.  A name for the routine can be optionally specified, otherwise the name of the method being exported
   * as the routine will be used.
   * @param name The optional routine name
   * @returns decorator
   */
  function routine(name) {
      return function (ctor, key, descriptor) {
          var routine = descriptor.value;
          var wrapper = function () {
              var kernel = (this['__kernel'] || this['kernel']);
              return kernel.routines.signal(key, Array.prototype.slice.call(arguments, 0), routine.bind(this));
          };
          return { value: wrapper };
      };
  }
  exports.routine = routine;
  function variable(name, mutable) {
      if (typeof (name) === 'boolean') {
          return variable(undefined, name);
      }
      return function (ctor, key) {
          var mdk = 'grid:variables';
          var list = Reflect.getMetadata(mdk, ctor);
          if (!list) {
              Reflect.defineMetadata(mdk, (list = []), ctor);
          }
          list.push({
              name: name || key,
              key: key,
              mutable: mutable,
          });
          //let valStoreKey = !!name ? key : `__${key}`;
          //let useAltValueStore = !name;
          //
          //Object.defineProperty(ctor, name || key, {
          //    configurable: false,
          //    enumerable: true,
          //    get: function() { return this[valStoreKey]; },
          //    set: function(newVal) { this[valStoreKey] = newVal; }
          //});
      };
  }
  exports.variable = variable;
  /**
   * A decorator for use within implementations of GridCell that marks a field as one that affects the visual
   * appearance of the cell.  This will cause the value of the field to be mapped to the _Visual_ object
   * created before the cell is drawn.
   *
   * @returns decorator
   */
  function visualize() {
      return function (ctor, key) {
          var mdk = 'grid:visualize';
          var list = Reflect.getMetadata(mdk, ctor);
          if (!list) {
              Reflect.defineMetadata(mdk, (list = []), ctor);
          }
          list.push(key);
          var pk = "__" + key;
          return {
              get: function () {
                  return this[pk];
              },
              set: function (val) {
                  this[pk] = val;
                  this['__dirty'] = true;
              }
          };
      };
  }
  exports.visualize = visualize;
  //# sourceMappingURL=Extensibility.js.map