///
import { WriteOptions } from './index';
export declare class CSVTranslator {
static read(src: string, cb: ResultCb): any;
static read(src: string, opts: ReadOptions, cb: ResultCb): void;
static createReadStream(src: string, readOptions?: ReadOptions): NodeJS.ReadableStream;
static parse(content: string, delimiter: string, cb: ResultCb): void;
static write(dest: string, data: any[], cb: ErrorCb): void;
static write(dest: string, data: any[], opts: WriteOptions, cb: ErrorCb): void;
static writeParallel(pairs: [string, any[]][], mainCb: ErrorCb): void;
static writeParallel(pairs: [string, any[]][], opts: WriteOptions, mainCb: ErrorCb): void;
static createWriteStream(dest: string, opts?: WriteOptions): CSVWriteStream;
static stringify(data: any[], opts: WriteOptions, cb: ResultCb): void;
private static getParseOptions(delimiter);
private static getDefaultDelimiter(filePath);
private static getStringifyOptions(writeOptions, data?);
private static getDataFields(data);
private static getNestedArrayData(data, columns);
}
export interface ReadOptions {
delimiter?: string;
}
export interface WriteOptions {
delimiter?: string;
columns?: string[];
}
export interface ErrorCb {
(err?: Error): void;
}
export interface ResultCb {
(err: Error, result?: T): void;
}
export interface CSVWriteStream extends NodeJS.WritableStream {
write(chunk: string[] | Object): boolean;
}