remcode
Version:
Turn your AI assistant into a codebase expert. Intelligent code analysis, semantic search, and software engineering guidance through MCP integration.
46 lines (45 loc) • 1.39 kB
TypeScript
import { CodeChunk, ChunkingStrategy } from '../types';
/**
* Manages code chunking with various strategies tailored to different code types
*/
export declare class ChunkingManager {
private strategy;
private languageMap;
/**
* Creates a new ChunkingManager with the specified strategy
* @param strategy Chunking strategy configuration
*/
constructor(strategy: ChunkingStrategy);
/**
* Chunks a file's content based on the specified strategy
* @param content The file content to chunk
* @param strategy The chunking strategy to apply
* @param fileInfo Information about the file
* @returns An array of code chunks
*/
chunkFile(content: string, strategy: string, fileInfo: any): Promise<CodeChunk[]>;
/**
* Chunks code by function boundaries
*/
private chunkByFunction;
/**
* Chunks code by class boundaries
*/
private chunkByClass;
/**
* Treats the entire file as one chunk
*/
private chunkAsFile;
/**
* Chunks content using a sliding window approach with configurable overlap
*/
private chunkBySlidingWindow;
/**
* Simple fallback chunking strategy when advanced methods fail
*/
private fallbackChunking;
/**
* Determines appropriate chunk size based on content and language
*/
private determineChunkSize;
}