import Widget from './widget/widget';
import AreaContainer from './container';
var Skeleton = /*#__PURE__*/function () {
  function Skeleton() {
    this.leftArea = new AreaContainer('left');
    this.toolbarArea = new AreaContainer('toolbar');
    this.bottomArea = new AreaContainer('bottom');
    this.topLeftArea = new AreaContainer('topLeft');
    this.topRightArea = new AreaContainer('topRight');
    this.topCenterArea = new AreaContainer('topCenter');
  }
  var _proto = Skeleton.prototype;
  _proto.add = function add(config) {
    var handle = function handle(config) {
      return new Widget(config.name, config);
    };
    switch (config.area) {
      case 'bottom':
        return this.bottomArea.add(config, handle);
      case 'left':
        return this.leftArea.add(config, handle);
      case 'toolbar':
        return this.toolbarArea.add(config, handle);
      case 'topCenter':
        return this.topCenterArea.add(config, handle);
      case 'topLeft':
        return this.topLeftArea.add(config, handle);
      case 'topRight':
        return this.topRightArea.add(config, handle);
      default:
        var n = config.area;
        console.warn(n + " \u4E0D\u662F never \u7C7B\u578B");
    }
  };
  _proto.remove = function remove(area, name) {
    switch (area) {
      case 'bottom':
        return this.bottomArea.remove(name);
      case 'left':
        return this.leftArea.remove(name);
      case 'toolbar':
        return this.toolbarArea.remove(name);
      case 'topCenter':
        return this.topCenterArea.remove(name);
      case 'topLeft':
        return this.topLeftArea.remove(name);
      case 'topRight':
        return this.topRightArea.remove(name);
      default:
        var n = area;
        console.warn(n + " \u4E0D\u662F never \u7C7B\u578B");
        return false;
    }
  };
  return Skeleton;
}();
export { Skeleton as default };