/** * CSV Parser - Synchronous * * RFC 4180 compliant CSV parser. * Provides parseCsv function and low-level parsing generators. */ import type { CsvParseOptions, CsvParseArrayOptions, CsvParseObjectOptions, CsvParseResult, CsvRecordError, RecordWithInfo } from "../types.js"; import type { ParseConfig } from "./config.js"; import type { RowProcessResult } from "./row-processor.js"; import type { ParseState } from "./state.js"; /** * Parse input using fast mode (no quote detection) */ export declare function parseFastMode(input: string, config: ParseConfig, state: ParseState, errors: CsvRecordError[]): Generator; /** * Parse input using Scanner-based batch scanning. * This is a high-performance alternative that uses indexOf-based field scanning * instead of character-by-character parsing. * * Key optimizations: * 1. Uses indexOf to find delimiters/quotes/newlines in bulk * 2. Uses slice for field extraction (avoids string concatenation) * 3. Processes entire rows at once instead of character-by-character */ export declare function parseWithScanner(input: string, config: ParseConfig, state: ParseState, errors: CsvRecordError[]): Generator; /** * Parse CSV string - returns string[][] when no options provided. */ export declare function parseCsv(input: string): string[][]; /** * Parse CSV string - returns string[][] when headers is false/undefined and no info option. * * Note: When `info: true` is set, returns CsvParseResult instead. */ export declare function parseCsv(input: string, options: CsvParseArrayOptions & { info?: false; }): string[][]; /** * Parse CSV string - returns CsvParseResult with RecordWithInfo when info: true (array mode). */ export declare function parseCsv(input: string, options: CsvParseArrayOptions & { info: true; }): CsvParseResult>; /** * Parse CSV string - returns CsvParseResult when headers are enabled. */ export declare function parseCsv(input: string, options: CsvParseObjectOptions & { info?: false; }): CsvParseResult>; /** * Parse CSV string - returns CsvParseResult with RecordWithInfo when info: true (object mode). */ export declare function parseCsv(input: string, options: CsvParseObjectOptions & { info: true; }): CsvParseResult>>; /** * Parse CSV string - general overload for backward compatibility. */ export declare function parseCsv(input: string, options: CsvParseOptions): string[][] | CsvParseResult> | CsvParseResult> | CsvParseResult>> | CsvParseResult>;