-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
55 lines (47 loc) · 1.1 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
declare enum ProxyType {
'datacenter',
'residential'
}
declare type CustomHeaders = {
[headerName: string]: string,
}
declare type ExtractionRules = {
[propertyName: string]: string,
}
declare type ScenarioStep = {
evaluate?: string,
click?: string,
wait?: number,
wait_for?: string,
wait_for_and_click?: string,
scroll_x?: number,
scroll_y?: number,
fill?: Array<string>
}
declare type ScrapeitCloudAPIParams = {
url: string,
screenshot?: boolean,
wait?: number,
wait_for?: string,
proxy_type?: string|ProxyType,
proxy_country?: string,
block_resources?: boolean,
block_urls?: Array<string>,
headers?: CustomHeaders,
extract_rules?: ExtractionRules
js_scenario?: Array<ScenarioStep>,
window_height?: number,
window_width?: number,
}
declare type ScrapeitCloudAPIResponse = {
screenshot?: string,
content: string,
headers?: Object,
cookies?: Array<Object>
}
declare class ScrapeitCloud {
private readonly apiKey: string;
constructor(apiKey: string);
scrape(params: ScrapeitCloudAPIParams): Promise<ScrapeitCloudAPIResponse>;
}
export default ScrapeitCloud;