@datapos/datapos-tool-csv-parse 0.0.70 → 0.0.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/datapos-tool-csv-parse.es.js +542 -543
- package/dist/types/src/index.d.ts +8 -3
- package/package.json +1 -1
|
@@ -2,10 +2,15 @@ import { Options as ParseOptions, Parser } from 'csv-parse/browser/esm';
|
|
|
2
2
|
import { RecordDelimiterId, ValueDelimiterId } from '@datapos/datapos-shared';
|
|
3
3
|
import { RetrieveRecordsOptions, RetrieveRecordsSummary } from '@datapos/datapos-shared/component/connector';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Row and row buffer.
|
|
6
|
+
*/
|
|
7
|
+
type Row = string[];
|
|
8
|
+
/**
|
|
9
|
+
* Schema configuration.
|
|
6
10
|
*/
|
|
7
11
|
interface SchemaConfig {
|
|
8
12
|
recordDelimiterId: RecordDelimiterId;
|
|
13
|
+
rows: Row[];
|
|
9
14
|
valueDelimiterId: ValueDelimiterId;
|
|
10
15
|
}
|
|
11
16
|
/** Tool. */
|
|
@@ -15,11 +20,11 @@ declare class Tool {
|
|
|
15
20
|
/**
|
|
16
21
|
* Determine schema configuration.
|
|
17
22
|
*/
|
|
18
|
-
determineSchemaConfig(text: string, delimiters:
|
|
23
|
+
determineSchemaConfig(text: string, delimiters: ValueDelimiterId[]): Promise<SchemaConfig>;
|
|
19
24
|
/**
|
|
20
25
|
* Parse stream.
|
|
21
26
|
*/
|
|
22
27
|
parseStream(retrieveRecordsOptions: RetrieveRecordsOptions, parseOptions: ParseOptions, url: string, abortController: AbortController, chunk: (records: (string[] | Record<string, unknown>)[]) => void): Promise<RetrieveRecordsSummary>;
|
|
23
28
|
}
|
|
24
29
|
export type { Options as ParseOptions, Parser } from 'csv-parse/browser/esm';
|
|
25
|
-
export { type SchemaConfig, Tool };
|
|
30
|
+
export { type Row, type SchemaConfig, Tool };
|