import { isLegacyDescriptor } from "./descriptors";
import { Types as PropControllerTypes } from "@makeswift/prop-controllers";
import {
  ControlInstance,
  DefaultControlInstance
} from "@makeswift/controls";
const TableFormFieldsMessageType = {
  TABLE_FORM_LAYOUT_CHANGE: "TABLE_FORM_LAYOUT_CHANGE",
  TABLE_FORM_FIELD_LAYOUT_CHANGE: "TABLE_FORM_FIELD_LAYOUT_CHANGE"
};
class TableFormFieldsPropController extends ControlInstance {
  recv = () => {
  };
  child(_key) {
    return void 0;
  }
  tableFormLayoutChange(payload) {
    this.sendMessage({ type: TableFormFieldsMessageType.TABLE_FORM_LAYOUT_CHANGE, payload });
  }
  tableFormFieldLayoutChange(payload) {
    this.sendMessage({ type: TableFormFieldsMessageType.TABLE_FORM_FIELD_LAYOUT_CHANGE, payload });
  }
}
function createPropController(descriptor, send) {
  if (!isLegacyDescriptor(descriptor)) {
    return descriptor.createInstance(send);
  }
  switch (descriptor.type) {
    case PropControllerTypes.TableFormFields:
      return new TableFormFieldsPropController(send);
    default:
      return new DefaultControlInstance(send);
  }
}
export {
  TableFormFieldsMessageType,
  TableFormFieldsPropController,
  createPropController
};
//# sourceMappingURL=instances.js.map