@types/k6 0.45.0 → 0.45.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- k6/README.md +1 -1
- k6/experimental/browser.d.ts +3360 -0
- k6/index.d.ts +9 -0
- k6/package.json +2 -2
- k6/experimental/browser/element_handle.d.ts +0 -213
- k6/experimental/browser/frame.d.ts +0 -370
- k6/experimental/browser/index.d.ts +0 -389
- k6/experimental/browser/js_handle.d.ts +0 -51
- k6/experimental/browser/keyboard.d.ts +0 -43
- k6/experimental/browser/locator.d.ts +0 -194
- k6/experimental/browser/mouse.d.ts +0 -43
- k6/experimental/browser/page.d.ts +0 -1524
- k6/experimental/browser/request.d.ts +0 -101
- k6/experimental/browser/response.d.ts +0 -115
- k6/experimental/browser/touchscreen.d.ts +0 -13
- k6/experimental/browser/worker.d.ts +0 -13
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { ResourceType, ResourceTiming } from './';
|
|
2
|
-
import { Response } from './response';
|
|
3
|
-
import { Frame } from './frame';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Request class represents requests which are sent by a page.
|
|
7
|
-
*/
|
|
8
|
-
export class Request {
|
|
9
|
-
/**
|
|
10
|
-
* An object with HTTP headers associated with the request. All header names are
|
|
11
|
-
* lower-case.
|
|
12
|
-
* @returns The headers object.
|
|
13
|
-
*/
|
|
14
|
-
allHeaders(): Record<string, string>;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @returns the Frame that initiated this request
|
|
18
|
-
*/
|
|
19
|
-
frame(): Frame;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* An object with HTTP headers associated with the request. All header names are
|
|
23
|
-
* lower-case.
|
|
24
|
-
* @returns An object with HTTP headers associated with the request.
|
|
25
|
-
*/
|
|
26
|
-
headers(): Record<string, string>;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* An array with all the request HTTP headers. Unlike `Request.allHeaders()`,
|
|
30
|
-
* header names are not lower-cased. Headers with multiple entries, such as
|
|
31
|
-
* `Set-Cookie`, appear in the array multiple times.
|
|
32
|
-
* @returns An array of all the request HTTP headers.
|
|
33
|
-
*/
|
|
34
|
-
headersArray(): Array<{ name: string; value: string }>;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Retuns the value of the header matching the name. The name is case insensitive.
|
|
38
|
-
* @param name Header name to retrieve value for.
|
|
39
|
-
* @returns The value of the header matching the name.
|
|
40
|
-
*/
|
|
41
|
-
headerValue(name: string): string | null;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* @returns a boolean stating whether the request is for a navigation
|
|
45
|
-
*/
|
|
46
|
-
isNavigationRequest(): boolean;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Request's method (GET, POST, etc.)
|
|
50
|
-
* @returns request's method name
|
|
51
|
-
*/
|
|
52
|
-
method(): string;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Contains the request's post body, if any.
|
|
56
|
-
* @returns request's post body
|
|
57
|
-
*/
|
|
58
|
-
postData(): string;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Request's post body in a binary form, if any.
|
|
62
|
-
* @returns an ArrayBuffer with request's post data
|
|
63
|
-
*/
|
|
64
|
-
postDataBuffer(): ArrayBuffer | null;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Contains the request's resource type as it was perceived by the rendering engine.
|
|
68
|
-
* ResourceType will be one of the following: `document`, `stylesheet`, `image`,
|
|
69
|
-
* `media`, `font`, `script`, `texttrack`, `xhr`, `fetch`, `eventsource`,
|
|
70
|
-
* `websocket`, `manifest`, `other`.
|
|
71
|
-
* @returns resource type name
|
|
72
|
-
*/
|
|
73
|
-
resourceType(): ResourceType;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Returns the matching `Response` object, or `null` if the response was not received
|
|
77
|
-
* due to error.
|
|
78
|
-
* @returns The `Response` object, or `null` if the response was not received due to error.
|
|
79
|
-
*/
|
|
80
|
-
response(): Response | null;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Returns resource size information for given request.
|
|
84
|
-
* @returns Resource size information for given request.
|
|
85
|
-
*/
|
|
86
|
-
size(): { body: number; headers: number };
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Returns resource timing information for given request. Most of the timing values
|
|
90
|
-
* become available upon the response, `responseEnd` becomes available when request
|
|
91
|
-
* finishes.
|
|
92
|
-
* @returns Resource timing information for given request.
|
|
93
|
-
*/
|
|
94
|
-
timing(): ResourceTiming;
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* URL of the request.
|
|
98
|
-
* @returns request URL
|
|
99
|
-
*/
|
|
100
|
-
url(): string;
|
|
101
|
-
}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { SecurityDetailsObject } from './';
|
|
2
|
-
import { Request } from './request';
|
|
3
|
-
import { Frame } from './frame';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Response class represents responses which are received by page.
|
|
7
|
-
*/
|
|
8
|
-
export class Response {
|
|
9
|
-
/**
|
|
10
|
-
* An object with HTTP headers associated with the response. All header names are
|
|
11
|
-
* lower-case.
|
|
12
|
-
* @returns The headers object.
|
|
13
|
-
*/
|
|
14
|
-
allHeaders(): Record<string, string>;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Returns the response body.
|
|
18
|
-
* @returns A buffer with response body.
|
|
19
|
-
*/
|
|
20
|
-
body(): ArrayBuffer;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @returns the Frame that initiated this response
|
|
24
|
-
*/
|
|
25
|
-
frame(): Frame;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* An object with HTTP headers associated with the response. All header names are
|
|
29
|
-
* lower-case.
|
|
30
|
-
* @returns The headers object.
|
|
31
|
-
*/
|
|
32
|
-
headers(): Record<string, string>;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* An array with all the request HTTP response headers. Unlike `Response.headers()`, header
|
|
36
|
-
* names are not lower-cased. Headers with multiple entries, such as `Set-Cookie`,
|
|
37
|
-
* appear in the array multiple times.
|
|
38
|
-
* @returns An array of all the request HTTP headers.
|
|
39
|
-
*/
|
|
40
|
-
headersArray(): Array<{ name: string; value: string }>;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Returns the value of the header matching the name. The name is case insensitive.
|
|
44
|
-
* If multiple headers have the same name (except `Set-Cookie`), they are returned
|
|
45
|
-
* as a list separated by ``,``. For `Set-Cookie`, the `\n` separator is used. If
|
|
46
|
-
* no headers are found, `null` is returned.
|
|
47
|
-
* @param name Header name to retrieve value for.
|
|
48
|
-
* @returns The header value for the given name.
|
|
49
|
-
*/
|
|
50
|
-
headerValue(name: string): string | null;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Returns all values of the headers matching the name, for example `set-cookie`.
|
|
54
|
-
* The name is case insensitive.
|
|
55
|
-
* @param name Header name to retrieve values for.
|
|
56
|
-
* @returns An array of header values for the given name.
|
|
57
|
-
*/
|
|
58
|
-
headerValues(name: string): string[];
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Returns the JSON representation of response body. Throws if response body is not
|
|
62
|
-
* parsable via `JSON.parse`.
|
|
63
|
-
* @returns JSON representation of response body.
|
|
64
|
-
*/
|
|
65
|
-
json(): any;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Contains a boolean stating whether the response was successful (status in the
|
|
69
|
-
* range 200-299) or not.
|
|
70
|
-
* @returns a boolean stating whether the response was successful
|
|
71
|
-
*/
|
|
72
|
-
ok(): boolean;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* The request that was used to produce the response.
|
|
76
|
-
* @returns the matching `Request` object
|
|
77
|
-
*/
|
|
78
|
-
request(): Request;
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Security details associated with this response.
|
|
82
|
-
* @returns A matching `SecurityDetailsObject`
|
|
83
|
-
*/
|
|
84
|
-
securityDetails(): SecurityDetailsObject | null;
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Returns the IP address and port of the server for this response.
|
|
88
|
-
* @returns The IP address and port of the server
|
|
89
|
-
*/
|
|
90
|
-
serverAddr(): { ipAddress: string; port: number } | null;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Contains the status code of the response (e.g., 200 for a success).
|
|
94
|
-
* @returns the status code of the response
|
|
95
|
-
*/
|
|
96
|
-
status(): number;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Contains the status text of the response (e.g. usually an "OK" for a success).
|
|
100
|
-
* @returns the status text of the response
|
|
101
|
-
*/
|
|
102
|
-
statusText(): string;
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* The size of the response body and the headers.
|
|
106
|
-
* @returns The size of the response body and the headers.
|
|
107
|
-
*/
|
|
108
|
-
size(): { body: number; headers: number };
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Contains the URL of the response.
|
|
112
|
-
* @returns the URL of the response
|
|
113
|
-
*/
|
|
114
|
-
url(): string;
|
|
115
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Touchscreen provides an api for interacting with a virtual touchscreen. It
|
|
3
|
-
* operates in main-frame CSS pixels relative to the top-left corner of the
|
|
4
|
-
* viewport.
|
|
5
|
-
*/
|
|
6
|
-
export class Touchscreen {
|
|
7
|
-
/**
|
|
8
|
-
* Taps on the specified position (`x`,`y`), which internally dispatches a `touchstart` and `touchend` event.
|
|
9
|
-
* @param x The x position.
|
|
10
|
-
* @param y The y position.
|
|
11
|
-
*/
|
|
12
|
-
tap(x: number, y: number): void;
|
|
13
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { PageFunction } from '.';
|
|
2
|
-
import { JSHandle } from './js_handle';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* The Worker class represents a [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API).
|
|
6
|
-
*/
|
|
7
|
-
export class Worker {
|
|
8
|
-
/**
|
|
9
|
-
* Get the URL of the web worker.
|
|
10
|
-
* @return The URL of the web worker.
|
|
11
|
-
*/
|
|
12
|
-
url(): string;
|
|
13
|
-
}
|