"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.nodeKeySchema = exports.nodeKeyField = exports.nodeKeyTreeSchema = void 0;
const core_1 = require("../../core");
const feature_libraries_1 = require("../../feature-libraries");
const builder = new feature_libraries_1.SchemaBuilder("Node Key Schema");
/**
 * Schema for a node which holds a {@link StableNodeKey}.
 * @public
 */
exports.nodeKeyTreeSchema = builder.leaf(feature_libraries_1.nodeKeyTreeIdentifier, core_1.ValueSchema.String);
/**
 * Key and Field schema for working with {@link LocalNodeKey}s in a shared tree.
 * Node keys are added to struct nodes via a field.
 * This object can be expanded into a schema to add the field.
 *
 * Requires including {@link nodeKeySchema}.
 * @public
 */
exports.nodeKeyField = {
    [feature_libraries_1.nodeKeyFieldKey]: feature_libraries_1.SchemaBuilder.field(feature_libraries_1.FieldKinds.nodeKey, exports.nodeKeyTreeSchema),
};
/**
 * The schema library for working with {@link StableNodeKey}s in a tree.
 * Required to use {@link nodeKeyField}.
 * @public
 */
exports.nodeKeySchema = builder.intoLibrary();
//# sourceMappingURL=nodeKeySchema.js.map