1 |
|
2 | import * as url from 'url';
|
3 | import { HttpHeaders } from '@hint/utils-types';
|
4 | import { HTMLDocument, HTMLElement } from '@hint/utils-dom';
|
5 | import { NetworkData } from './network';
|
6 | import { Engine } from '../engine';
|
7 | export interface IFetchOptions {
|
8 | content?: string;
|
9 | }
|
10 | export 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 | }
|
20 | export declare type BrowserInfo = {
|
21 | isNew?: boolean;
|
22 | pid: number;
|
23 | port?: number;
|
24 | };
|
25 | export interface ILauncher {
|
26 | launch(url: string, options?: any): Promise<BrowserInfo>;
|
27 | options?: any;
|
28 | }
|
29 | export interface IConnectorConstructor {
|
30 | new (server: Engine, config?: object, launcher?: ILauncher): IConnector;
|
31 | schema: any;
|
32 | }
|
33 | export declare type LauncherOptions = {
|
34 | defaultProfile?: boolean;
|
35 | flags?: string[];
|
36 | port?: number;
|
37 | };
|
38 |
|
\ | No newline at end of file |