@loaders.gl/csv
Version:
Framework-independent loader for CSV and DSV table formats
48 lines • 2.03 kB
TypeScript
import type { LoaderOptions } from '@loaders.gl/loader-utils';
import type { ArrayRowTable, ObjectRowTable, TableBatch } from '@loaders.gl/schema';
export type CSVLoaderOptions = LoaderOptions & {
csv?: {
shape?: 'array-row-table' | 'object-row-table';
/** optimizes memory usage but increases parsing time. */
optimizeMemoryUsage?: boolean;
columnPrefix?: string;
header?: 'auto';
quoteChar?: string;
escapeChar?: string;
dynamicTyping?: boolean;
comments?: boolean;
skipEmptyLines?: boolean | 'greedy';
delimitersToGuess?: string[];
};
};
export declare const CSVLoader: {
readonly dataType: ObjectRowTable | ArrayRowTable;
readonly batchType: TableBatch;
readonly id: "csv";
readonly module: "csv";
readonly name: "CSV";
readonly version: any;
readonly extensions: ["csv", "tsv", "dsv"];
readonly mimeTypes: ["text/csv", "text/tab-separated-values", "text/dsv"];
readonly category: "table";
readonly parse: (arrayBuffer: ArrayBuffer, options?: CSVLoaderOptions) => Promise<ObjectRowTable | ArrayRowTable>;
readonly parseText: (text: string, options?: CSVLoaderOptions) => Promise<ObjectRowTable | ArrayRowTable>;
readonly parseInBatches: typeof parseCSVInBatches;
readonly options: {
readonly csv: {
readonly shape: "object-row-table";
readonly optimizeMemoryUsage: false;
readonly header: "auto";
readonly columnPrefix: "column";
readonly quoteChar: "\"";
readonly escapeChar: "\"";
readonly dynamicTyping: true;
readonly comments: false;
readonly skipEmptyLines: true;
readonly delimitersToGuess: [",", "\t", "|", ";"];
};
};
};
declare function parseCSVInBatches(asyncIterator: AsyncIterable<ArrayBuffer> | Iterable<ArrayBuffer>, options?: CSVLoaderOptions): AsyncIterable<TableBatch>;
export {};
//# sourceMappingURL=csv-loader.d.ts.map