UNPKG

@har-sdk/core

Version:

The base package can be used to import specification files (i.e. HAR, OAS and Postman Collection) and detect their type.

22 lines (21 loc) 921 B
import { SyntaxErrorDetails } from '../loaders'; import { Importer } from './Importer'; import { ImporterErrorProvider } from './ImporterErrorProvider'; import { DocFormat, Spec, Doc, DocType } from './Spec'; export declare abstract class BaseImporter<TDocType extends DocType, TDoc = Doc<TDocType>> implements Importer<TDocType, TDoc>, ImporterErrorProvider { private readonly docFormats; private readonly loaderFactory; private readonly loaders; protected constructor(); abstract get type(): TDocType; abstract isSupported(spec: unknown): spec is TDoc; import(content: string, expectedFormat?: DocFormat): Promise<Spec<TDocType, TDoc> | undefined>; getErrorDetails(format: DocFormat): SyntaxErrorDetails | undefined; protected fileName(_: { doc: TDoc; format: DocFormat; }): string | undefined; private load; private initLoaders; private getLoader; }