/** * Index Persistence Layer * * Handles serialization and storage of indexes for durability. * Indexes are stored in a special collection alongside application data. */ import type { JsDb } from './feltdb.js'; import type { IndexConfig } from './index-types.js'; export interface StoredIndex { config: IndexConfig; version: number; createdAt: number; lastUpdated: number; entryCount: number; } export interface IndexSnapshot { collectionName: string; indexes: StoredIndex[]; timestamp: number; } export declare class IndexStore { private db; private collectionName; constructor(db: JsDb, collectionName: string); /** * Save index metadata to storage. * Stores index configuration but not the actual index data (rebuilt on demand). */ saveIndexConfig(config: IndexConfig, entryCount: number): Promise; /** * Load all index configurations for a collection. */ loadIndexConfigs(): Promise; /** * Get specific index configuration. */ getIndexConfig(indexName: string): Promise; /** * Delete index metadata from storage. */ deleteIndexConfig(indexName: string): Promise; /** * Update index metadata (entry count, timestamp). */ updateIndexStats(indexName: string, entryCount: number): Promise; /** * Get full index snapshot (configuration + metadata). */ getSnapshot(): Promise; } /** * Index rebuilder - reconstructs indexes from collection data. * Used when loading persisted indexes at startup. */ export declare class IndexRebuilder { static rebuildIndexes(db: JsDb, collectionName: string, items: any[], indexConfigs: IndexConfig[]): Promise>; /** * Check if an index is stale by comparing entry count to collection size. */ static isStale(indexEntryCount: number, collectionSize: number): boolean; } //# sourceMappingURL=index-store.d.ts.map