"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.contentSchemaSymbol = exports.typeSchemaSymbol = exports.typeNameSymbol = void 0;
/**
 * The type of a {@link TreeNode}.
 * For more information about the type, use `Tree.schema(theNode)` instead.
 * @remarks
 * This symbol mainly exists on nodes to allow TypeScript to provide more accurate type checking.
 * `Tree.is` and `Tree.schema` provide a superset of this information in more friendly ways.
 *
 * This symbol should not manually be added to objects as doing so allows the object to be invalidly used where nodes are expected.
 * Instead construct a real node of the desired type using its constructor.
 * @privateRemarks
 * This prevents non-nodes from being accidentally used as nodes, as well as allows the type checker to distinguish different node types.
 * @deprecated External code should use `Tree.schema(theNode)` for schema related runtime data access. For type narrowing, use `WithType` instead of the symbols directly.
 * @system @public
 */
exports.typeNameSymbol = Symbol("TreeNode Type");
/**
 * The type of a {@link TreeNode}.
 * For more information about the type, use `Tree.schema(theNode)` instead.
 * @remarks
 * This symbol mainly exists on nodes to allow TypeScript to provide more accurate type checking.
 * `Tree.is` and `Tree.schema` provide a superset of this information in more friendly ways.
 *
 * This symbol should not manually be added to objects as doing so allows the object to be invalidly used where specific nodes are expected.
 * Instead construct a real node of the desired type using its constructor.
 *
 * This symbol should not be used directly for type narrowing. Instead use {@link WithType}.
 * @privateRemarks
 * This prevents non-nodes from being accidentally used as nodes and allows the type-checker to distinguish different node types.
 * @system @public
 */
exports.typeSchemaSymbol = Symbol("TreeNode Schema");
/**
 * The intended type of insertable content that is to become a {@link TreeNode}.
 * @remarks Use the type-safe {@link (TreeAlpha:interface).tagContentSchema} function to tag insertable content with this symbol.
 *
 * If a property with this symbol key is present on an object that is inserted into the tree,
 * the tree will use the schema identifier specified by the value of this property when creating the node.
 * This is particularly useful for specifying the intended schema of untyped content when it would otherwise be ambiguous.
 * @example
 * ```typescript
 * const sf = new SchemaFactory("example");
 * class Dog extends sf.object("Dog", { name: sf.string() }) {}
 * class Cat extends sf.object("Cat", { name: sf.string() }) {}
 * class Root extends sf.object("Root", { pet: [Dog, Cat] }) {}
 * // ...
 * view.root.pet = { name: "Max" }; // Error: ambiguous schema - is it a Dog or a Cat?
 * view.root.pet = { name: "Max", [contentSchemaSymbol]: "example.Dog" }; // No error - it's a Dog.
 * ```
 * @alpha
 */
exports.contentSchemaSymbol = Symbol("SharedTree Schema");
//# sourceMappingURL=withType.js.map