import { Readable } from 'stream'; import type { CsvEvent, CsvLimits, CsvRow } from '../../../services/reader/readCsv.js'; import type { ImportIssue } from '../../../services/types.js'; export interface ReadResult { columns?: string[]; headerRow?: number; rows: CsvRow[]; issues: ImportIssue[]; dataRows: number; stopped: boolean; events: CsvEvent[]; } /** Cuts the input into chunks of `size` bytes (the whole input when absent). */ export declare function chunked(input: string | Buffer, size?: number): Readable; export declare function collect(source: Readable, limits?: Partial): Promise; /** Chunk sizes that put a chunk boundary in every possible place. */ export declare const CHUNK_SIZES: readonly [undefined, 1, 2, 3, 4, 7, 64]; /** * Reads the input once for each chunk size and requires the same result every * time: where the stream happens to be cut must never change it. * * When a problem with the whole file stops the reading, the rows that were read * before it may be fewer or more depending on the cut (the stream is destroyed * at once), so for those files only the issues and the stop are compared: * `same: 'issues'`. */ export declare function readAll(input: string | Buffer, limits?: Partial, same?: 'events' | 'issues'): Promise;