/**
 * Streaming File Reader
 *
 * Reads files with token-budget awareness using Node.js streams.
 * Memory usage is proportional to what's returned, not what's on disk.
 *
 * Inspired by Kilocode's token-budget streaming reader pattern:
 * uses createReadStream + readline, counts tokens per line,
 * stops when budget is exhausted.
 *
 * @example
 * ```typescript
 * // Read lines 100-200 of a large file with a 5000 token budget
 * const result = await StreamingReader.readLines('/path/to/file.csv', {
 *   startLine: 100,
 *   endLine: 200,
 *   tokenBudget: 5000,
 *   provider: 'anthropic',
 * });
 * // result.content = "line 100 content\nline 101 content\n..."
 * // result.truncated = true if budget was hit before line 200
 * ```
 */
import type { FileReadResult, FileSearchResult, StreamingReaderOptions } from "./types.js";
/**
 * Streaming file reader with token-budget-aware line reading.
 *
 * All methods use Node.js streams to avoid loading entire files into memory.
 * A 2GB CSV file: only the requested lines/matches are read from disk.
 */
export declare class StreamingReader {
    /**
     * Read lines from a file with a token budget.
     *
     * Uses createReadStream + readline for memory-efficient reading.
     * Stops reading when the token budget is exhausted or endLine is reached.
     *
     * @param filePath - Absolute path to the file
     * @param options - Reading options (startLine, endLine, tokenBudget, provider)
     * @returns FileReadResult with content, line info, and truncation status
     */
    static readLines(filePath: string, options?: StreamingReaderOptions): Promise<FileReadResult>;
    /**
     * Count total lines in a file without reading entire content into memory.
     *
     * @param filePath - Absolute path to the file
     * @param encoding - File encoding (default: utf-8)
     * @returns Total line count
     */
    static countLines(filePath: string, encoding?: BufferEncoding): Promise<number>;
    /**
     * Search for a pattern within a file, returning matching lines with context.
     *
     * Uses streaming to avoid loading the entire file into memory.
     * Returns up to maxMatches results, each with contextBefore/contextAfter lines.
     *
     * @param filePath - Absolute path to the file
     * @param pattern - Regex pattern or string to search for
     * @param options - Search options
     * @returns FileSearchResult with matches, total count, and truncation status
     */
    static searchInFile(filePath: string, pattern: string | RegExp, options?: {
        maxMatches?: number;
        contextLines?: number;
        encoding?: BufferEncoding;
    }): Promise<FileSearchResult>;
    /**
     * Read a preview of a file (first N characters / lines).
     *
     * Optimized for speed: reads only the first chunk of the file.
     *
     * @param filePath - Absolute path to the file
     * @param maxChars - Maximum characters to return (default: 2000)
     * @param encoding - File encoding (default: utf-8)
     * @returns Preview string
     */
    static readPreview(filePath: string, maxChars?: number, encoding?: BufferEncoding): Promise<string>;
    /**
     * Read a file from a Buffer with line range and token budget.
     *
     * For files already in memory (e.g., from URL download or Buffer input).
     * Does NOT use streams — the buffer is already in memory.
     *
     * @param buffer - File content as Buffer
     * @param options - Reading options
     * @returns FileReadResult
     */
    static readFromBuffer(buffer: Buffer, options?: StreamingReaderOptions): FileReadResult;
    /**
     * Escape a string for use in a regular expression.
     */
    private static escapeRegex;
}
