@dpuse/dpuse-shared 1.0.147 → 1.0.148

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.
@@ -2,4 +2,5 @@ import { ModuleConfig } from '..';
2
2
  export interface ToolConfig extends ModuleConfig {
3
3
  typeId: 'tool';
4
4
  }
5
+ export type { ParserInterface, ParseStreamOptions, ParseTextOptions, ParseTextResult } from './parser';
5
6
  export declare function loadTool<T>(toolConfigs: ToolConfig[], toolId: string): Promise<T>;
@@ -0,0 +1,24 @@
1
+ import { DataFormatId, ParsingRecord, PreviewIssue, RecordDelimiterId, ValueDelimiterId } from '../../dataView';
2
+ import { RecordRetrievalTypeId, RetrieveRecordsSummary } from '../connector';
3
+ export interface ParserInterface {
4
+ parseStream: (stream: ReadableStream<Uint8Array>, options: ParseStreamOptions, chunk: (typeId: RecordRetrievalTypeId, records: ParsingRecord[]) => void) => Promise<RetrieveRecordsSummary>;
5
+ parseText: (text: string, options: ParseTextOptions) => Promise<ParseTextResult>;
6
+ }
7
+ export interface ParseTextOptions {
8
+ dataFormatId: DataFormatId;
9
+ isComplete: boolean;
10
+ valueDelimiterIds: ValueDelimiterId[];
11
+ }
12
+ export interface ParseTextResult {
13
+ issues: PreviewIssue[];
14
+ parsedRecords: ParsingRecord[];
15
+ recordDelimiterId: RecordDelimiterId;
16
+ valueDelimiterId: ValueDelimiterId | undefined;
17
+ }
18
+ export interface ParseStreamOptions {
19
+ abortSignal: AbortSignal;
20
+ chunkSize: number | undefined;
21
+ dataFormatId: DataFormatId;
22
+ encodingId: string;
23
+ valueDelimiterId: ValueDelimiterId;
24
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dpuse/dpuse-shared",
3
- "version": "1.0.147",
3
+ "version": "1.0.148",
4
4
  "private": false,
5
5
  "description": "Common constants, types and utilities used across DPUse projects.",
6
6
  "license": "MIT",