import { SeriesData } from '../types/index'; export declare enum CSVHeaderStyle { full = 0, name = 1, none = 2 } export interface CSVConfig { delimiter?: string; newline?: string; quoteChar?: string; encoding?: string; headerStyle?: CSVHeaderStyle; } export interface CSVParseCallbacks { /** * Get a callback before any rows are processed * This can return a modified table to force any * Column configurations */ onHeader: (table: SeriesData) => void; onRow: (row: any[]) => void; } export interface CSVOptions { config?: CSVConfig; callback?: CSVParseCallbacks; } export declare function readCSV(csv: string, options?: CSVOptions): SeriesData[]; declare enum ParseState { Starting = 0, InHeader = 1, ReadingRows = 2 } declare type FieldParser = (value: string) => any; export declare class CSVReader { config: CSVConfig; callback?: CSVParseCallbacks; field: FieldParser[]; series: SeriesData; state: ParseState; data: SeriesData[]; constructor(options?: CSVOptions); private step; readCSV(text: string): SeriesData[]; } export declare function toCSV(data: SeriesData[], config?: CSVConfig): string; export {};