/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { FieldKinds, SchemaBuilder } from "../../feature-libraries";
import { ValueSchema, EmptyKey } from "../../core";
const builder = new SchemaBuilder("Json Domain");
/**
 * @alpha
 */
export const jsonNumber = builder.primitive("Json.Number", ValueSchema.Number);
/**
 * @alpha
 */
export const jsonString = builder.primitive("Json.String", ValueSchema.String);
/**
 * @alpha
 */
export const jsonNull = builder.object("Json.Null", {});
/**
 * @alpha
 */
export const jsonBoolean = builder.primitive("Json.Boolean", ValueSchema.Boolean);
const jsonPrimitives = [jsonNumber, jsonString, jsonNull, jsonBoolean];
/**
 * Types allowed as roots of Json content.
 * @alpha
 */
export const jsonRoot = [() => jsonObject, () => jsonArray, ...jsonPrimitives];
{
}
/**
 * @alpha
 */
export const jsonObject = builder.objectRecursive("Json.Object", {
    extraLocalFields: SchemaBuilder.fieldRecursive(FieldKinds.optional, ...jsonRoot),
});
/**
 * @alpha
 */
export const jsonArray = builder.objectRecursive("Json.Array", {
    local: {
        [EmptyKey]: SchemaBuilder.fieldRecursive(FieldKinds.sequence, ...jsonRoot),
    },
});
/**
 * @alpha
 */
export const jsonSchema = builder.intoLibrary();
//# sourceMappingURL=jsonDomainSchema.js.map