flatfile-csv-importer
Version:
A simple adapter for elegantly importing CSV files via flatfile.io (Typescript, ES6, Browser)
58 lines (57 loc) • 1.62 kB
TypeScript
import { StreamedMeta } from './obj.meta';
import RecordObject from './obj.record';
export default class StreamedResults {
/**
* Helpful meta information
*/
private $meta;
/**
* Raw data output from the importer
*/
private $data;
constructor(data: Array<RecordObject>, meta: StreamedMeta);
/**
* The raw output from the importer including all deleted rows
* and sequence info
*/
readonly rawOutput: Array<RecordObject>;
/**
* An array of valid data, key-mapped to the configuration provided
* (alias of validData)
*/
readonly data: Array<any>;
/**
* An array of valid data, key-mapped to the configuration provided
*/
readonly validData: Array<any>;
/**
* Rows of data the user excluded from the final results,
* key-mapped to the configuration provided
*/
readonly deletedData: Array<any>;
/**
* All data from the original file upload including deleted rows,
* key-mapped to the configuration provided
*/
readonly allData: Array<any>;
/**
* The number of remaining chunks in the stream
*/
readonly remainingChunks: number;
/**
* The total number of chunks that will have to be received before data processing is completed
*/
readonly totalChunks: number;
/**
* The size of chunks as configured when requesting data.
*/
readonly chunkSize: number;
/**
* The current chunk by index
*/
readonly currentChunk: number;
/**
* The current chunk by index
*/
readonly hasMore: boolean;
}