import { g as generateFieldModelFromRawData } from './FieldModelGenerator-03c7516c.js';
import { D as DataModel } from './data-model-f7ccf826.js';

function decodeFields(fieldData = []) {
  return fieldData.map(fd => generateFieldModelFromRawData(fd));
}

class Space extends DataModel {
  static decode(json) {
    return Object.assign(Object.create(Space.prototype), json);
  }
}

class TableConfig extends DataModel {
  static decode(json) {
    const model = Object.assign(Object.create(TableConfig.prototype), json);
    model.space = Space.decode(model.space);
    model.fields = decodeFields(model.fields);
    return model;
  }
}

export { Space as S, TableConfig as T, decodeFields as d };
