"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");
/**
 * @alpha
 */
exports.jsonNumber = builder.primitive("Json.Number", core_1.ValueSchema.Number);
/**
 * @alpha
 */
exports.jsonString = builder.primitive("Json.String", core_1.ValueSchema.String);
/**
 * @alpha
 */
exports.jsonNull = builder.object("Json.Null", {});
/**
 * @alpha
 */
exports.jsonBoolean = builder.primitive("Json.Boolean", core_1.ValueSchema.Boolean);
const jsonPrimitives = [exports.jsonNumber, exports.jsonString, exports.jsonNull, exports.jsonBoolean];
/**
 * Types allowed as roots of Json content.
 * @alpha
 */
exports.jsonRoot = [() => exports.jsonObject, () => exports.jsonArray, ...jsonPrimitives];
{
}
/**
 * @alpha
 */
exports.jsonObject = builder.objectRecursive("Json.Object", {
    extraLocalFields: feature_libraries_1.SchemaBuilder.fieldRecursive(feature_libraries_1.FieldKinds.optional, ...exports.jsonRoot),
});
/**
 * @alpha
 */
exports.jsonArray = builder.objectRecursive("Json.Array", {
    local: {
        [core_1.EmptyKey]: feature_libraries_1.SchemaBuilder.fieldRecursive(feature_libraries_1.FieldKinds.sequence, ...exports.jsonRoot),
    },
});
/**
 * @alpha
 */
exports.jsonSchema = builder.intoLibrary();
//# sourceMappingURL=jsonDomainSchema.js.map