"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.jsonSchema = exports.jsonArray = exports.jsonObject = exports.jsonRoot = void 0;
const feature_libraries_1 = require("../../feature-libraries");
const leafDomain_1 = require("../leafDomain");
const builder = new feature_libraries_1.SchemaBuilderInternal({
    scope: "com.fluidframework.json",
    libraries: [leafDomain_1.leaf.library],
});
const jsonPrimitives = [...leafDomain_1.leaf.primitives, leafDomain_1.leaf.null];
/**
 * Types allowed as roots of Json content.
 */
exports.jsonRoot = [() => exports.jsonObject, () => exports.jsonArray, ...jsonPrimitives];
{
}
exports.jsonObject = builder.mapRecursive("object", feature_libraries_1.TreeFieldSchema.createUnsafe(feature_libraries_1.FieldKinds.optional, exports.jsonRoot));
exports.jsonArray = builder.fieldNodeRecursive("array", feature_libraries_1.TreeFieldSchema.createUnsafe(feature_libraries_1.FieldKinds.sequence, exports.jsonRoot));
exports.jsonSchema = builder.intoLibrary();
//# sourceMappingURL=jsonDomainSchema.js.map