UNPKG

1.21 kBTypeScriptView Raw
1/// <reference types="node" />
2import * as url from 'url';
3import { HttpHeaders } from '@hint/utils-types';
4import { HTMLDocument, HTMLElement } from '@hint/utils-dom';
5import { NetworkData } from './network';
6import { Engine } from '../engine';
7export interface IFetchOptions {
8 content?: string;
9}
10export interface IConnector {
11 dom?: HTMLDocument;
12 html?: string;
13 headers?: HttpHeaders;
14 collect(target: url.URL, options?: IFetchOptions): Promise<any>;
15 close(): Promise<void>;
16 fetchContent(target: url.URL | string, customHeaders?: object, options?: IFetchOptions): Promise<NetworkData>;
17 evaluate(code: string): Promise<any>;
18 querySelectorAll(query: string): HTMLElement[];
19}
20export declare type BrowserInfo = {
21 isNew?: boolean;
22 pid: number;
23 port?: number;
24};
25export interface ILauncher {
26 launch(url: string, options?: any): Promise<BrowserInfo>;
27 options?: any;
28}
29export interface IConnectorConstructor {
30 new (server: Engine, config?: object, launcher?: ILauncher): IConnector;
31 schema: any;
32}
33export declare type LauncherOptions = {
34 defaultProfile?: boolean;
35 flags?: string[];
36 port?: number;
37};
38//# sourceMappingURL=connector.d.ts.map
\No newline at end of file