/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { Metatype } from "../common/index.js";
import { DatatypeElement } from "../elements/DatatypeElement.js";
import { ValueModel } from "./ValueModel.js";
class DatatypeModel extends ValueModel {
  tag = DatatypeElement.Tag;
  get id() {
    return void 0;
  }
  set id(_id) {
  }
  get definesFields() {
    switch (this.effectiveMetatype) {
      case Metatype.object:
      case Metatype.enum:
      case Metatype.bitmap:
        return !!this.definingModel?.children.length;
    }
    return false;
  }
  static Tag = DatatypeElement.Tag;
  constructor(definition, ...children) {
    super(definition, ...children);
    this.metatype = definition.metatype;
  }
  toElement(omitResources = false, extra) {
    return super.toElement(omitResources, {
      metatype: this.metatype,
      ...extra
    });
  }
}
DatatypeModel.register();
export {
  DatatypeModel
};
//# sourceMappingURL=DatatypeModel.js.map
