"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.jsonRoot = exports.jsonSchemaData = exports.jsonBoolean = exports.jsonNull = exports.jsonString = exports.jsonNumber = exports.jsonArray = exports.jsonObject = void 0;
const feature_libraries_1 = require("../../feature-libraries");
const core_1 = require("../../core");
/**
 * Types allowed as roots of Json content.
 * Since the Json domain is recursive, this set is declared,
 * then used in the schema, then populated below.
 */
const jsonTypes = [
    "Json.Object",
    "Json.Array",
    "Json.Number",
    "Json.String",
    "Json.Null",
    "Json.Boolean",
];
/**
 * @alpha
 */
exports.jsonObject = feature_libraries_1.TypedSchema.tree("Json.Object", {
    extraLocalFields: feature_libraries_1.TypedSchema.field(feature_libraries_1.FieldKinds.optional, ...jsonTypes),
});
/**
 * @alpha
 */
exports.jsonArray = feature_libraries_1.TypedSchema.tree("Json.Array", {
    local: { [core_1.EmptyKey]: feature_libraries_1.TypedSchema.field(feature_libraries_1.FieldKinds.sequence, ...jsonTypes) },
});
/**
 * @alpha
 */
exports.jsonNumber = feature_libraries_1.TypedSchema.tree("Json.Number", {
    value: core_1.ValueSchema.Number,
});
/**
 * @alpha
 */
exports.jsonString = feature_libraries_1.TypedSchema.tree("Json.String", {
    value: core_1.ValueSchema.String,
});
/**
 * @alpha
 */
exports.jsonNull = feature_libraries_1.TypedSchema.tree("Json.Null", {});
/**
 * @alpha
 */
exports.jsonBoolean = feature_libraries_1.TypedSchema.tree("Json.Boolean", {
    value: core_1.ValueSchema.Boolean,
});
/**
 * @alpha
 */
exports.jsonSchemaData = feature_libraries_1.SchemaAware.typedSchemaData([], exports.jsonObject, exports.jsonArray, exports.jsonNumber, exports.jsonString, exports.jsonNull, exports.jsonBoolean);
/**
 * @alpha
 */
exports.jsonRoot = feature_libraries_1.TypedSchema.field(feature_libraries_1.FieldKinds.value, ...jsonTypes);
//# sourceMappingURL=jsonDomainSchema.js.map