/** * @nahisaho/yata-scale - Index Manager * * Manages indexes for efficient querying */ import type { Entity, Relationship, IndexStats, SearchResult } from './types.js'; /** * B+Tree index for ordered lookups */ export declare class BPlusTreeIndex { private data; insert(key: K, value: V): void; get(key: K): V | undefined; delete(key: K): boolean; range(minKey: K, maxKey: K): V[]; get size(): number; clear(): void; } /** * Full-text search index */ export declare class FullTextIndex { private documents; private invertedIndex; private termFrequency; add(id: string, text: string): void; remove(id: string): void; search(query: string): SearchResult[]; private tokenize; get size(): number; getTerms(): string[]; clear(): void; } /** * Graph index for traversal queries */ export declare class GraphIndex { private outgoing; private incoming; private nodes; addEdge(source: string, target: string, type: string): void; removeEdge(source: string, target: string): void; removeNode(nodeId: string): void; hasEdge(source: string, target: string): boolean; getOutgoing(nodeId: string): Array<{ target: string; type: string; }>; getIncoming(nodeId: string): Array<{ source: string; type: string; }>; kHop(startId: string, k: number): string[]; shortestPath(source: string, target: string): string[]; get nodeCount(): number; clear(): void; } /** * Bloom filter for membership testing */ export declare class BloomFilter { private bits; private hashCount; constructor(expectedItems: number, falsePositiveRate: number); private hash; add(item: string): void; test(item: string): boolean; approximateCount(): number; serialize(): { bits: number[]; hashCount: number; }; static deserialize(data: { bits: number[]; hashCount: number; }): BloomFilter; union(other: BloomFilter): void; clear(): void; } /** * Index manager for all indexes */ export declare class IndexManager { private entityIndex; private typeIndex; private fullTextIndex; private graphIndex; private bloomFilter; private _relationshipCount; indexEntity(entity: Entity): void; removeEntity(entityId: string): void; indexRelationship(rel: Relationship): void; removeRelationship(_relId: string): void; getEntity(entityId: string): Entity | undefined; searchByText(query: string): SearchResult[]; findByType(type: string): Entity[]; possiblyExists(entityId: string): boolean; get entityCount(): number; get relationshipCount(): number; getAllStats(): IndexStats[]; clear(): void; } //# sourceMappingURL=IndexManager.d.ts.map