UNPKG

webshot-factory

Version:

screenshots at scale based on headless chrome

33 lines (32 loc) 843 B
/// <reference types="node" /> import * as P from 'bluebird'; export interface WorkerConfig { callbackName?: string; warmerUrl?: string; width?: number; height?: number; timeout?: number; } export declare class ShotWorker { id: number; creationTime: number; private debugPort; private browser; private page; private timeout; private shotCallback; private isBusy; config: WorkerConfig; constructor(id: number); static create(idx: number, config: WorkerConfig): Promise<ShotWorker>; takeShot(url: string): P<Buffer>; reload(): any; exit(): void; getStatus(): { id: number; browser: any; debugPort: number; isBusy: boolean; }; private init(idx?, callbackName?, warmerUrl?, width?, height?, timeout?, chromeExecutablePath?); }