/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import type { IIdCompressor } from "@fluidframework/id-compressor";
import type { LocalNodeKey, StableNodeKey } from "./nodeKey.js";
/**
 * An object which handles the generation of node keys as well as conversion between their two types ({@link StableNodeKey} and {@link LocalNodeKey}).
 */
export interface NodeKeyManager {
    /**
     * Generate a {@link StableNodeKey}.
     */
    generateLocalNodeKey(): LocalNodeKey;
    /**
     * Convert the given {@link StableNodeKey} into its {@link LocalNodeKey} form.
     */
    localizeNodeKey(key: StableNodeKey): LocalNodeKey;
    /**
     * Convert the given {@link LocalNodeKey} into its {@link StableNodeKey} form.
     */
    stabilizeNodeKey(key: LocalNodeKey): StableNodeKey;
    /**
     * Attempts to recompress a StableNodeKey.
     * @param key - The key that is attempted to recompress.
     * @returns The `LocalNodeKey` associated with `key` or undefined if the key was not generated by any session known to this compressor.
     */
    tryLocalizeNodeKey(key: string): LocalNodeKey | undefined;
}
/**
 * Creates a {@link NodeKeyManager} from the given {@link IIdCompressor}.
 * @param idCompressor - the compressor to use for key generation, compression, and decompression.
 * If undefined, then attempts to generate or convert keys will throw an error.
 */
export declare function createNodeKeyManager(idCompressor?: IIdCompressor | undefined): NodeKeyManager;
export declare function isStableNodeKey(key: string): key is StableNodeKey;
//# sourceMappingURL=nodeKeyManager.d.ts.map