/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { anchorSlot, } from "../../core/index.js";
/**
 * An anchor slot which records the {@link FlexTreeNode} associated with that anchor, if there is one.
 * @remarks This always points to a "real" {@link FlexTreeNode} (i.e. a `LazyTreeNode`), never to a "raw" node.
 */
export const flexTreeSlot = anchorSlot();
/**
 * Indicates that an object is a flex tree.
 * @internal
 */
export const flexTreeMarker = Symbol("flexTreeMarker");
export function isFlexTreeEntity(t) {
    return typeof t === "object" && t !== null && flexTreeMarker in t;
}
export function isFlexTreeNode(t) {
    return isFlexTreeEntity(t) && t[flexTreeMarker] === FlexTreeEntityKind.Node;
}
/**
 * @internal
 */
export var FlexTreeEntityKind;
(function (FlexTreeEntityKind) {
    FlexTreeEntityKind[FlexTreeEntityKind["Node"] = 0] = "Node";
    FlexTreeEntityKind[FlexTreeEntityKind["Field"] = 1] = "Field";
})(FlexTreeEntityKind || (FlexTreeEntityKind = {}));
/**
 * Status of the tree that a particular node belongs to.
 * @public
 */
export var TreeStatus;
(function (TreeStatus) {
    /**
     * Is parented under the root field.
     */
    TreeStatus[TreeStatus["InDocument"] = 0] = "InDocument";
    /**
     * Is not parented under the root field, but can be added back to the original document tree.
     */
    TreeStatus[TreeStatus["Removed"] = 1] = "Removed";
    /**
     * Is removed and cannot be added back to the original document tree.
     */
    TreeStatus[TreeStatus["Deleted"] = 2] = "Deleted";
})(TreeStatus || (TreeStatus = {}));
/**
 * Reserved object node field property names to avoid collisions with the rest of the object node API.
 * @internal
 */
export const reservedObjectNodeFieldPropertyNames = [
    "anchorNode",
    "constructor",
    "context",
    "is",
    "on",
    "parentField",
    "schema",
    "treeStatus",
    "tryGetField",
    "type",
    "value",
    "boxedIterator",
    "iterator",
    "getBoxed",
];
/**
 * Reserved object node field property names prefixes.
 * These are reserved to avoid collisions with properties derived from field other field names.
 *
 * Field names starting with these must be followed by a lowercase letter, or be escaped.
 * @internal
 */
export const reservedObjectNodeFieldPropertyNamePrefixes = [
    "set",
    "boxed",
    "field",
    "Field",
];
// #endregion
//# sourceMappingURL=flexTreeTypes.js.map