UNPKG

source-scraper-core

Version:
14 lines (13 loc) 853 B
import { Configurable, IConfigurable, IOptions } from './Configurable'; export declare type IRunnerOptions = IOptions; export interface IRunnerArgs<RO extends IRunnerOptions = IRunnerOptions> { url: string; options?: RO; } export interface IRunner<T, RO extends IRunnerOptions = IRunnerOptions, RA extends IRunnerArgs<RO> = IRunnerArgs<RO>> extends IConfigurable<RO> { run: (url: string, scraper: (args: RA) => Promise<T>, options?: RO) => Promise<T>; } export declare abstract class Runner<T, RO extends IRunnerOptions = IRunnerOptions, RA extends IRunnerArgs<RO> = IRunnerArgs<RO>> extends Configurable<RO> implements IRunner<T, RO, RA> { run(url: string, scraper: (args: RA) => Promise<T>, options?: RO): Promise<T>; protected abstract exec(url: string, scraper: (args: RA) => Promise<T>, options: RO): Promise<T>; }