import { Chunk, ChunkingOptions, ChunkingResult, ChunkType, CodeExtractionResult, DependencyGraph, FileRangeRequest, ImportExportMap } from '../types'; /** * Main chunking service */ export declare class Chunker { private extractors; options: Required; private parserPool; private astCache; constructor(options?: ChunkingOptions); /** * Set adapter based on file type (using parser pool) */ private getAdapter; /** * Release adapter back to pool */ private releaseAdapter; /** * Update adapters for all extractors, including nested ones */ private updateExtractorAdapters; /** * Chunk a single file */ chunkFile(filePath: string): Promise; /** * Chunk code from a string */ chunkCode(sourceCode: string, filePath: string): Chunk[]; /** * Post-process chunks: merge small chunks, handle size limits */ private postProcessChunks; /** * Estimate token count from range (rough approximation) */ private estimateSizeFromRange; /** * Reconstruct code content for a chunk from its file and range * Useful when includeContent is false to get content on-demand */ getChunkContent(chunk: Chunk): Promise; /** * Merge content from two chunks */ private mergeChunkContent; /** * Build dependency graph from chunks with proper import resolution */ buildDependencyGraph(chunks: Chunk[]): DependencyGraph; /** * Resolve a dependency to actual chunks */ private resolveDependency; /** * Resolve relative import path to absolute file path */ private resolveRelativePath; /** * Check if file exists */ private fileExists; /** * Build comprehensive import/export map with deduplication and metadata */ buildImportExportMap(chunks: Chunk[]): ImportExportMap; /** * Chunk multiple files and return full result */ chunkFiles(filePaths: string[]): Promise; /** * Calculate chunking statistics */ calculateStats(chunks: Chunk[], fileCount: number): { totalFiles: number; totalChunks: number; chunksByType: Record; averageChunkSize: number; totalTokens: number; }; /** * Extract code chunks with dependencies for specified file ranges * Returns complete functions, variables, and all their dependencies */ extractCodeWithDependencies(requests: FileRangeRequest[]): Promise; /** * Check if a chunk overlaps with a line range */ private chunkOverlapsRange; /** * Get cache statistics */ getCacheStats(): { parserPool: { hitRate: number; poolSizes: { key: string; size: number; }[]; created: number; reused: number; released: number; }; astCache: { hitRate: number; size: number; maxSize: number; hits: number; misses: number; evictions: number; }; }; /** * Clear all caches */ clearCaches(): void; /** * Invalidate AST cache for a specific file */ invalidateASTCache(filePath: string): void; } //# sourceMappingURL=chunker.d.ts.map