/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { GlobalFieldKey, SchemaData, ValueSchema } from "../core";
import { EditableTree, EditableTreeContext } from "./editable-tree";
/**
 * The primitive type used as an identifier
 * @alpha
 */
export declare type Identifier = number;
/**
 * The tree schema for the identifier primitive
 */
export declare const identifierSchema: import("./modular-schema").TreeSchema<"identifier", {
    value: ValueSchema.Number;
}>;
/**
 * The field schema for fields which contain identifiers (see {@link identifierSchema})
 */
export declare const identifierFieldSchema: import("./modular-schema").GlobalFieldSchema<import("./defaultFieldKinds").ValueFieldKind, [import("./modular-schema").TreeSchema<"identifier", {
    value: ValueSchema.Number;
}>]>;
export declare const identifierFieldSchemaLibrary: import("./modular-schema").SchemaLibrary;
/**
 * The identifier index allows nodes that have a special identifier field to be looked up via a query.
 */
export declare class IdentifierIndex<TField extends GlobalFieldKey> implements ReadonlyMap<Identifier, EditableTree> {
    private readonly identifierFieldKey;
    private readonly identifierFieldKeySymbol;
    private readonly nodes;
    constructor(identifierFieldKey: TField, identifiers?: Iterable<[Identifier, EditableTree]>);
    /**
     * Returns true if the given schema contains the global identifier field, otherwise false
     */
    identifiersAreInSchema(schema: SchemaData): boolean;
    /**
     * Search the tree for all nodes with identifiers, and record them in this index for lookup.
     * This should be called each time the tree changes; each call to scan forgets all existing identifiers.
     * @param context - the editable tree context in which to search for identifiers
     */
    scanIdentifiers(context: EditableTreeContext): void;
    /**
     * Create a copy of this index which can be mutated without affecting this one.
     */
    clone(context: EditableTreeContext): IdentifierIndex<TField>;
    forEach(callbackfn: (value: EditableTree, key: Identifier, map: ReadonlyMap<Identifier, EditableTree>) => void, thisArg?: any): void;
    get(key: Identifier): EditableTree | undefined;
    has(key: Identifier): boolean;
    get size(): number;
    entries(): IterableIterator<[Identifier, EditableTree]>;
    keys(): IterableIterator<Identifier>;
    values(): IterableIterator<EditableTree>;
    [Symbol.iterator](): IterableIterator<[Identifier, EditableTree]>;
    private findIdentifiers;
}
//# sourceMappingURL=identifierIndex.d.ts.map