"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 = exports.jsonBoolean = exports.jsonNull = exports.jsonString = exports.jsonNumber = void 0;
const feature_libraries_1 = require("../../feature-libraries");
const core_1 = require("../../core");
const builder = new feature_libraries_1.SchemaBuilder("Json Domain");
/**
 * @public
 */
exports.jsonNumber = builder.leaf("Json.Number", core_1.ValueSchema.Number);
/**
 * @public
 */
exports.jsonString = builder.leaf("Json.String", core_1.ValueSchema.String);
/**
 * @public
 */
exports.jsonNull = builder.struct("Json.Null", {});
/**
 * @public
 */
exports.jsonBoolean = builder.leaf("Json.Boolean", core_1.ValueSchema.Boolean);
const jsonPrimitives = [exports.jsonNumber, exports.jsonString, exports.jsonNull, exports.jsonBoolean];
/**
 * Types allowed as roots of Json content.
 * @public
 */
exports.jsonRoot = [() => exports.jsonObject, () => exports.jsonArray, ...jsonPrimitives];
{
}
/**
 * @public
 */
exports.jsonObject = builder.mapRecursive("Json.Object", feature_libraries_1.SchemaBuilder.fieldRecursive(feature_libraries_1.FieldKinds.optional, ...exports.jsonRoot));
/**
 * @public
 */
exports.jsonArray = builder.fieldNodeRecursive("Json.Array", feature_libraries_1.SchemaBuilder.fieldRecursive(feature_libraries_1.FieldKinds.sequence, ...exports.jsonRoot));
/**
 * @public
 */
exports.jsonSchema = builder.intoLibrary();
//# sourceMappingURL=jsonDomainSchema.js.map