import { StandardSchemaV1 } from '@standard-schema/spec';
import { BaseIndex, IndexConstructor } from '../indexes/base-index.js';
import { ChangeMessage } from '../types.js';
import { IndexOptions } from '../indexes/index-options.js';
import { SingleRowRefProxy } from '../query/builder/ref-proxy.js';
import { CollectionLifecycleManager } from './lifecycle.js';
import { CollectionStateManager } from './state.js';
import { CollectionEventsManager, CollectionIndexMetadata } from './events.js';
export declare class CollectionIndexesManager<TOutput extends object = Record<string, unknown>, TKey extends string | number = string | number, TSchema extends StandardSchemaV1 = StandardSchemaV1, TInput extends object = TOutput> {
    private lifecycle;
    private state;
    private defaultIndexType;
    private events;
    indexes: Map<number, BaseIndex<TKey>>;
    indexMetadata: Map<number, CollectionIndexMetadata>;
    indexCounter: number;
    constructor();
    setDeps(deps: {
        state: CollectionStateManager<TOutput, TKey, TSchema, TInput>;
        lifecycle: CollectionLifecycleManager<TOutput, TKey, TSchema, TInput>;
        defaultIndexType?: IndexConstructor<TKey>;
        events: CollectionEventsManager;
    }): void;
    /**
     * Creates an index on a collection for faster queries.
     *
     * @example
     * ```ts
     * // With explicit index type (recommended for tree-shaking)
     * import { BasicIndex } from '@tanstack/db'
     * collection.createIndex((row) => row.userId, { indexType: BasicIndex })
     *
     * // With collection's default index type
     * collection.createIndex((row) => row.userId)
     * ```
     */
    createIndex<TIndexType extends IndexConstructor<TKey>>(indexCallback: (row: SingleRowRefProxy<TOutput>) => any, config?: IndexOptions<TIndexType>): BaseIndex<TKey>;
    /**
     * Removes an index from this collection.
     * Returns true when an index existed and was removed, false otherwise.
     */
    removeIndex(indexOrId: BaseIndex<TKey> | number): boolean;
    /**
     * Returns a sorted snapshot of index metadata.
     * This allows persisted wrappers to bootstrap from indexes that were created
     * before they attached lifecycle listeners.
     */
    getIndexMetadataSnapshot(): Array<CollectionIndexMetadata>;
    /**
     * Updates all indexes when the collection changes
     */
    updateIndexes(changes: Array<ChangeMessage<TOutput, TKey>>): void;
    /**
     * Clean up indexes
     */
    cleanup(): void;
}
