WME/aufgabe5/node_modules/csvtojson/src/Processor.ts

19 lines
661 B
TypeScript
Raw Normal View History

2019-01-09 11:25:28 +00:00
import { Converter } from "./Converter";
import P from "bluebird";
import { JSONResult } from "./lineToJson";
import { CSVParseParam } from "./Parameters";
import { ParseRuntime } from "./ParseRuntime";
export abstract class Processor {
protected params: CSVParseParam;
protected runtime: ParseRuntime;
constructor(protected converter: Converter) {
this.params = converter.parseParam;
this.runtime = converter.parseRuntime;
}
abstract process(chunk: Buffer,finalChunk?:boolean): P<ProcessLineResult[]>
abstract destroy():P<void>;
abstract flush(): P<ProcessLineResult[]>;
}
export type ProcessLineResult = string | string[] | JSONResult;