"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.storedEmptyFieldSchema = exports.forbiddenFieldKindIdentifier = exports.ValueSchema = exports.FieldKindIdentifierSchema = exports.FieldKeySchema = exports.TreeNodeSchemaIdentifierSchema = void 0;
const util_1 = require("../../util");
/**
 * TypeBox Schema for encoding {@link TreeNodeSchemaIdentifiers} in persisted data.
 */
exports.TreeNodeSchemaIdentifierSchema = (0, util_1.brandedStringType)();
/**
 * TypeBox Schema for encoding {@link FieldKey} in persisted data.
 */
exports.FieldKeySchema = (0, util_1.brandedStringType)();
exports.FieldKindIdentifierSchema = (0, util_1.brandedStringType)();
/**
 * Schema for what {@link TreeValue} is allowed on a Leaf node.
 * @alpha
 *
 * @privateRemarks
 * This is currently leaked into some persisted formats.
 * A full audit of persisted formats is needed,
 * and all types which are used in them should be moved to locations which indicated they are persisted, or duplicated into a persisted and non-persisted version with explicit encoding between them.
 */
var ValueSchema;
(function (ValueSchema) {
    ValueSchema[ValueSchema["Number"] = 0] = "Number";
    ValueSchema[ValueSchema["String"] = 1] = "String";
    ValueSchema[ValueSchema["Boolean"] = 2] = "Boolean";
    ValueSchema[ValueSchema["FluidHandle"] = 3] = "FluidHandle";
    ValueSchema[ValueSchema["Null"] = 4] = "Null";
})(ValueSchema || (exports.ValueSchema = ValueSchema = {}));
/**
 * Identifier used for the FieldKind for fields which must be empty.
 *
 * @remarks
 * This mainly show up in:
 * 1. The root default field for documents.
 * 2. The schema used for out of schema fields (which thus must be empty/not exist) on object and leaf nodes.
 *
 * @alpha
 */
exports.forbiddenFieldKindIdentifier = "Forbidden";
/**
 * A schema for empty fields (fields which must always be empty).
 * There are multiple ways this could be encoded, but this is the most explicit.
 */
exports.storedEmptyFieldSchema = {
    // This kind requires the field to be empty.
    kind: { identifier: (0, util_1.brand)(exports.forbiddenFieldKindIdentifier) },
    // This type set also forces the field to be empty not not allowing any types as all.
    types: new Set(),
};
//# sourceMappingURL=schema.js.map