/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { Type } from "@sinclair/typebox";
import { schemaFormat } from "../schema-stored/index.js";
const EncodedFieldMapObject = (tChild) => Type.Record(Type.String(), Type.Array(tChild, { minItems: 1 }));
const EncodedNodeData = Type.Object({
    value: Type.Optional(Type.Any()),
    type: Type.Readonly(schemaFormat.TreeNodeSchemaIdentifierSchema),
});
const EncodedGenericFieldsNode = (tChild) => Type.Object({
    fields: Type.Optional(EncodedFieldMapObject(tChild)),
    globalFields: Type.Optional(EncodedFieldMapObject(tChild)),
});
const EncodedGenericTreeNode = (tChild) => Type.Composite([EncodedGenericFieldsNode(tChild), EncodedNodeData], {
    additionalProperties: false,
});
export const EncodedJsonableTree = Type.Recursive((Self) => EncodedGenericTreeNode(Self));
//# sourceMappingURL=persistedTreeTextFormat.js.map