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, TKey extends string | number = string | number, TSchema extends StandardSchemaV1 = StandardSchemaV1, TInput extends object = TOutput> { private lifecycle; private state; private defaultIndexType; private events; indexes: Map>; indexMetadata: Map; indexCounter: number; constructor(); setDeps(deps: { state: CollectionStateManager; lifecycle: CollectionLifecycleManager; defaultIndexType?: IndexConstructor; 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>(indexCallback: (row: SingleRowRefProxy) => any, config?: IndexOptions): BaseIndex; /** * Removes an index from this collection. * Returns true when an index existed and was removed, false otherwise. */ removeIndex(indexOrId: BaseIndex | 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; /** * Updates all indexes when the collection changes */ updateIndexes(changes: Array>): void; /** * Clean up indexes */ cleanup(): void; }