"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLocKeysFromSkinPack = exports.validateSkinPackJson = void 0;
const SchemaValidation_1 = require("../../jsonschema/SchemaValidation");
/*
 Schema for validating SkinPack
*/
const SkinPackSchema = {
    type: "object",
    properties: {
        localization_name: { type: "string" },
        serialize_name: { type: "string" },
        skins: {
            type: "array",
            items: {
                type: "object",
                properties: {
                    localization_name: { type: "string" },
                    geometry: { type: "string" },
                    texture: { type: "string" },
                    type: { type: "string" },
                },
                required: ["localization_name", "geometry", "texture", "type"],
            },
        },
    },
    required: ["localization_name", "serialize_name", "skins"],
};
/*
  validates json against SkinPack-Schema and returns it as a fully typed SkinPack object

  alias of validateJsonAndAssert for clarity and convenience
*/
const validateSkinPackJson = (json) => (0, SchemaValidation_1.validateJsonAndAssert)(json, SkinPackSchema);
exports.validateSkinPackJson = validateSkinPackJson;
function getLocKeysFromSkinPack(pack) {
    const skinKeys = pack.skins.map((skin) => `skin.${pack.localization_name}.${skin.localization_name}`);
    return [`skinpack.${pack.localization_name}`, ...skinKeys];
}
exports.getLocKeysFromSkinPack = getLocKeysFromSkinPack;

//# sourceMappingURL=../../maps/minecraft/skins/SkinPack.js.map
