/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { type TreeIndexNodes, type TreeIndex } from "../../feature-libraries/index.js";
import { type TreeNode, type TreeNodeSchema, type NodeFromSchema, type TreeLeafValue } from "../core/index.js";
import type { ImplicitFieldSchema } from "../fieldSchema.js";
import type { TreeView } from "./tree.js";
/**
 * Value that may be used as keys in a {@link TreeIndex}.
 * @remarks
 * This supports values which have value semantics and are compared by value, just like {@link TreeLeafValue}.
 * This allows using any tree value as a key (for example in an index tracking where those values occur in the tree).
 * @beta
 */
export type TreeIndexKey = TreeLeafValue;
/**
 * Creates a {@link TreeIndex} with a specified indexer.
 *
 * @param view - the view for the tree being indexed
 * @param indexer - a function that takes in a {@link TreeNodeSchema} and returns the field name that all nodes of the given schema
 * should be keyed on, must be pure and functional
 * @param getValue - given at least one {@link TreeNode}, returns an associated value
 * @param isKeyValid - function for verifying the validity of the key retrieved based on the information given by the indexer
 *
 * @beta
 */
export declare function createTreeIndex<TFieldSchema extends ImplicitFieldSchema, TKey extends TreeIndexKey, TValue>(view: TreeView<TFieldSchema>, indexer: (schema: TreeNodeSchema) => string | undefined, getValue: (nodes: TreeIndexNodes<TreeNode>) => TValue, isKeyValid: (key: TreeIndexKey) => key is TKey): TreeIndex<TKey, TValue>;
/**
 * Creates a {@link TreeIndex} with a specified indexer.
 *
 * @param view - the view for the tree being indexed
 * @param indexer - a function that takes in a {@link TreeNodeSchema} and returns the field name that all nodes of the given schema
 * should be keyed on, must be pure and functional
 * @param getValue - given at least one {@link TreeNode}, returns an associated value
 * @param isKeyValid - function for verifying the validity of the key retrieved based on the information given by the indexer
 * @param indexableSchema - a list of all the schema types that can be indexed
 *
 * @beta
 */
export declare function createTreeIndex<TFieldSchema extends ImplicitFieldSchema, TKey extends TreeIndexKey, TValue, TSchema extends TreeNodeSchema>(view: TreeView<TFieldSchema>, indexer: (schema: TSchema) => string | undefined, getValue: (nodes: TreeIndexNodes<NodeFromSchema<TSchema>>) => TValue, isKeyValid: (key: TreeIndexKey) => key is TKey, indexableSchema: readonly TSchema[]): TreeIndex<TKey, TValue>;
/**
 * Creates a {@link TreeIndex} with a specified indexer.
 *
 * @param view - the view for the tree being indexed
 * @param indexer - a map from {@link TreeNodeSchema} to the field name that all nodes of the given schema
 * should be keyed on
 * @param getValue - given at least one {@link TreeNode}, returns an associated value
 * @param isKeyValid - function for verifying the validity of the key retrieved based on the information given by the indexer
 *
 * @beta
 */
export declare function createTreeIndex<TFieldSchema extends ImplicitFieldSchema, TKey extends TreeIndexKey, TValue>(view: TreeView<TFieldSchema>, indexer: Map<TreeNodeSchema, string>, getValue: (nodes: TreeIndexNodes<TreeNode>) => TValue, isKeyValid: (key: TreeIndexKey) => key is TKey): TreeIndex<TKey, TValue>;
/**
 * Creates a {@link TreeIndex} with a specified indexer.
 *
 * @param view - the view for the tree being indexed
 * @param indexer - a map from {@link TreeNodeSchema} to the field name that all nodes of the given schema
 * should be keyed on
 * @param getValue - given at least one {@link TreeNode}, returns an associated value
 * @param isKeyValid - function for verifying the validity of the key retrieved based on the information given by the indexer
 * @param indexableSchema - a list of all the schema types that can be indexed
 *
 * @beta
 */
export declare function createTreeIndex<TFieldSchema extends ImplicitFieldSchema, TKey extends TreeIndexKey, TValue, TSchema extends TreeNodeSchema>(view: TreeView<TFieldSchema>, indexer: Map<TreeNodeSchema, string>, getValue: (nodes: TreeIndexNodes<NodeFromSchema<TSchema>>) => TValue, isKeyValid: (key: TreeIndexKey) => key is TKey, indexableSchema: readonly TSchema[]): TreeIndex<TKey, TValue>;
//# sourceMappingURL=simpleTreeIndex.d.ts.map