Class AsyncParser<FetchResult>Abstract

An abstract class for the implementation of connector custom parsing that asynchronously parses the results yielded from the Fetcher.

For TypeScript, the fetcherResult type can be provided via the type parameter. By default, fetcherResult is typed as any.

Example

export default class MyParser extends AsyncParser<Uint8Array> {
async parse(fetcherResult: Uint8Array, options: ParseOptions): Promise<DataContainer> {
// ...
}
}

Type Parameters

  • FetchResult = any

Hierarchy

  • BaseParser
    • AsyncParser

Constructors

  • Type Parameters

    • FetchResult = any

    Returns AsyncParser<FetchResult>

Methods

  • The method to implement the parsing logic for transforming the fetcherResult into a DataContainer. When a custom parser is defined, the connector must implement this method to perform data parsing.

    Parameters

    Returns Promise<DataContainer>

  • A static method to create a DataContainerBuilder instance based on the provided dataContainer object.

    Parameters

    Returns DataContainerBuilder

Generated using TypeDoc