"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.areCursors = exports.TreeStatus = exports.setField = exports.localNodeKeySymbol = exports.proxyTargetSymbol = void 0;
const core_1 = require("../../core");
const contextuallyTyped_1 = require("../contextuallyTyped");
const untypedTree_1 = require("../untypedTree");
/**
 * A symbol for extracting target from {@link EditableTree} proxies.
 * Useful for debugging and testing, but not part of the public API.
 * @alpha
 */
exports.proxyTargetSymbol = Symbol("editable-tree:proxyTarget");
/**
 * A symbol to get the {@link LocalNodeKey} that identifies this {@link EditableTree} node.
 * @alpha
 */
exports.localNodeKeySymbol = Symbol("editable-tree:localNodeKey");
/**
 * A symbol to get the function, which replaces the content of a field of {@link EditableTree}.
 * @alpha
 */
exports.setField = Symbol("editable-tree:setField()");
/**
 * Status of the tree that a particular node in {@link EditableTree} and {@link UntypedTree} belongs to.
 * @alpha
 */
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 = exports.TreeStatus || (exports.TreeStatus = {}));
/**
 * Check if NewFieldContent is made of {@link ITreeCursor}s.
 *
 * Useful when APIs want to take in tree data in multiple formats, including cursors.
 */
function areCursors(data) {
    if ((0, core_1.isCursor)(data)) {
        return true;
    }
    if (Array.isArray(data) && data.length >= 0 && (0, core_1.isCursor)(data[0])) {
        return true;
    }
    return false;
}
exports.areCursors = areCursors;
//# sourceMappingURL=editableTreeTypes.js.map