"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.EncodedJsonableTree = void 0;
const typebox_1 = require("@sinclair/typebox");
const schema_stored_1 = require("../schema-stored");
const EncodedFieldMapObject = (tChild) => typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Array(tChild, { minItems: 1 }));
const EncodedNodeData = typebox_1.Type.Object({
    value: typebox_1.Type.Optional(typebox_1.Type.Any()),
    type: typebox_1.Type.Readonly(schema_stored_1.TreeSchemaIdentifierSchema),
});
const EncodedGenericFieldsNode = (tChild) => typebox_1.Type.Object({
    fields: typebox_1.Type.Optional(EncodedFieldMapObject(tChild)),
    globalFields: typebox_1.Type.Optional(EncodedFieldMapObject(tChild)),
});
const EncodedGenericTreeNode = (tChild) => typebox_1.Type.Composite([EncodedGenericFieldsNode(tChild), EncodedNodeData], {
    additionalProperties: false,
});
exports.EncodedJsonableTree = typebox_1.Type.Recursive((Self) => EncodedGenericTreeNode(Self));
//# sourceMappingURL=persistedTreeTextFormat.js.map