/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import type { LocalNodeKey, StableNodeKey } from "../feature-libraries/index.js";
import type { TreeNode } from "./types.js";
/**
 * A collection of utilities for managing {@link StableNodeKey}s.
 * A node key can be assigned to a node and allows that node to be easily retrieved from the tree at a later time. (see `nodeKey.map`).
 * @remarks {@link LocalNodeKey}s are put on {@link FlexTreeObjectNode}s via a special field.
 * A node with a node key in its schema must always have a node key.
 * TODO: A node key index leveraging this {@link NodeKeys} interface should be implemented for the simple tree layer.
 * @internal
 */
export interface NodeKeys {
    /**
     * Create a new {@link LocalNodeKey} which can be used as the key for a node in the tree.
     */
    generate(): LocalNodeKey;
    /**
     * Convert the given {@link LocalNodeKey} into a UUID that can be serialized.
     * @param key - the key to convert
     */
    stabilize(key: LocalNodeKey): StableNodeKey;
    /**
     * Convert a {@link StableNodeKey} back into its {@link LocalNodeKey} form.
     * @param key - the key to convert
     */
    localize(key: StableNodeKey): LocalNodeKey;
    /**
     * Attempts to recompress a string key back into its {@link LocalNodeKey} form.
     * @param key - The key to convert.
     * @returns The {@link LocalNodeKey} associated with `key` or undefined if the key was not generated by any session known to this compressor.
     */
    tryLocalize(key: string): LocalNodeKey | undefined;
    /**
     * A map of all {@link LocalNodeKey}s in the document to their corresponding nodes.
     */
    readonly map: ReadonlyMap<LocalNodeKey, TreeNode>;
}
//# sourceMappingURL=nodeKeys.d.ts.map