/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { ClusterElement } from "../../elements/index.js";
import { AttributeModel, CommandModel, DatatypeModel, EventModel } from "../../models/index.js";
import { ModelValidator } from "./ModelValidator.js";
ModelValidator.validators[ClusterElement.Tag] = class DeviceTypeValidator extends ModelValidator {
  validate() {
    this.validateStructure(false, DatatypeModel, AttributeModel, CommandModel, EventModel);
    this.validateProperty({ name: "singleton", type: "boolean" });
    this.validateProperty({ name: "classification", type: ClusterElement.Classification });
    if (!this.model.children.length && this.model.type === void 0) {
      this.error("EMPTY_CLUSTER", "Cluster has no elements");
    }
    super.validate();
  }
};
//# sourceMappingURL=ClusterValidator.js.map
