@types/k6 0.44.2 → 0.44.3

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.
@@ -1,101 +1,101 @@
1
- import { ResourceType, ResourceTiming } from "./";
2
- import { Response } from "./response";
3
- import { Frame } from "./frame";
1
+ import { ResourceType, ResourceTiming } from './';
2
+ import { Response } from './response';
3
+ import { Frame } from './frame';
4
4
 
5
5
  /**
6
6
  * Request class represents requests which are sent by a page.
7
7
  */
8
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>;
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
15
 
16
- /**
17
- * @returns the Frame that initiated this request
18
- */
19
- frame(): Frame;
16
+ /**
17
+ * @returns the Frame that initiated this request
18
+ */
19
+ frame(): Frame;
20
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>;
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
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 }>;
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
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;
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
42
 
43
- /**
44
- * @returns a boolean stating whether the request is for a navigation
45
- */
46
- isNavigationRequest(): boolean;
43
+ /**
44
+ * @returns a boolean stating whether the request is for a navigation
45
+ */
46
+ isNavigationRequest(): boolean;
47
47
 
48
- /**
49
- * Request's method (GET, POST, etc.)
50
- * @returns request's method name
51
- */
52
- method(): string;
48
+ /**
49
+ * Request's method (GET, POST, etc.)
50
+ * @returns request's method name
51
+ */
52
+ method(): string;
53
53
 
54
- /**
55
- * Contains the request's post body, if any.
56
- * @returns request's post body
57
- */
58
- postData(): string;
54
+ /**
55
+ * Contains the request's post body, if any.
56
+ * @returns request's post body
57
+ */
58
+ postData(): string;
59
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;
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
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;
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
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;
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
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 };
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
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;
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
95
 
96
- /**
97
- * URL of the request.
98
- * @returns request URL
99
- */
100
- url(): string;
96
+ /**
97
+ * URL of the request.
98
+ * @returns request URL
99
+ */
100
+ url(): string;
101
101
  }
@@ -1,115 +1,115 @@
1
1
  import { SecurityDetailsObject } from './';
2
- import { Request } from "./request";
3
- import { Frame } from "./frame";
2
+ import { Request } from './request';
3
+ import { Frame } from './frame';
4
4
 
5
5
  /**
6
6
  * Response class represents responses which are received by page.
7
7
  */
8
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;
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
115
  }
@@ -4,10 +4,10 @@
4
4
  * viewport.
5
5
  */
6
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;
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
13
  }
@@ -1,13 +1,13 @@
1
- import { PageFunction } from ".";
2
- import { JSHandle } from "./js_handle";
1
+ import { PageFunction } from '.';
2
+ import { JSHandle } from './js_handle';
3
3
 
4
4
  /**
5
5
  * The Worker class represents a [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API).
6
6
  */
7
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;
8
+ /**
9
+ * Get the URL of the web worker.
10
+ * @return The URL of the web worker.
11
+ */
12
+ url(): string;
13
13
  }
@@ -54,7 +54,7 @@ export class Client {
54
54
  del<RT extends ResponseType | undefined>(
55
55
  url: string | HttpURL,
56
56
  body?: RequestBody | null,
57
- params?: RefinedParams<RT> | null
57
+ params?: RefinedParams<RT> | null,
58
58
  ): RefinedResponse<RT>;
59
59
 
60
60
  /**
@@ -66,7 +66,7 @@ export class Client {
66
66
  */
67
67
  head<RT extends ResponseType | undefined>(
68
68
  url: string | HttpURL,
69
- params?: RefinedParams<RT> | null
69
+ params?: RefinedParams<RT> | null,
70
70
  ): RefinedResponse<RT>;
71
71
 
72
72
  /**
@@ -78,7 +78,7 @@ export class Client {
78
78
  */
79
79
  get<RT extends ResponseType | undefined>(
80
80
  url: string | HttpURL,
81
- params?: RefinedParams<RT> | null
81
+ params?: RefinedParams<RT> | null,
82
82
  ): RefinedResponse<RT>;
83
83
 
84
84
  /**
@@ -92,7 +92,7 @@ export class Client {
92
92
  options<RT extends ResponseType | undefined>(
93
93
  url: string | HttpURL,
94
94
  body?: RequestBody | null,
95
- params?: RefinedParams<RT> | null
95
+ params?: RefinedParams<RT> | null,
96
96
  ): RefinedResponse<RT>;
97
97
 
98
98
  /**
@@ -106,7 +106,7 @@ export class Client {
106
106
  patch<RT extends ResponseType | undefined>(
107
107
  url: string | HttpURL,
108
108
  body?: RequestBody | null,
109
- params?: RefinedParams<RT> | null
109
+ params?: RefinedParams<RT> | null,
110
110
  ): RefinedResponse<RT>;
111
111
 
112
112
  /**
@@ -120,7 +120,7 @@ export class Client {
120
120
  post<RT extends ResponseType | undefined>(
121
121
  url: string | HttpURL,
122
122
  body?: RequestBody | null,
123
- params?: RefinedParams<RT> | null
123
+ params?: RefinedParams<RT> | null,
124
124
  ): RefinedResponse<RT>;
125
125
 
126
126
  /**
@@ -134,7 +134,7 @@ export class Client {
134
134
  put<RT extends ResponseType | undefined>(
135
135
  url: string | HttpURL,
136
136
  body?: RequestBody | null,
137
- params?: RefinedParams<RT> | null
137
+ params?: RefinedParams<RT> | null,
138
138
  ): RefinedResponse<RT>;
139
139
 
140
140
  /**
@@ -150,7 +150,7 @@ export class Client {
150
150
  method: string,
151
151
  url: string | HttpURL,
152
152
  body?: RequestBody | null,
153
- params?: RefinedParams<RT> | null
153
+ params?: RefinedParams<RT> | null,
154
154
  ): RefinedResponse<RT>;
155
155
 
156
156
  /**
@@ -169,7 +169,7 @@ export class Client {
169
169
  method: string,
170
170
  url: string | HttpURL,
171
171
  body?: RequestBody | null,
172
- params?: RefinedParams<RT> | null
172
+ params?: RefinedParams<RT> | null,
173
173
  ): Promise<RefinedResponse<RT>>;
174
174
  }
175
175
 
@@ -202,5 +202,5 @@ export interface Options {
202
202
  * Returned value from http.url method.
203
203
  */
204
204
  export interface HttpURL {
205
- __brand: "http-url";
205
+ __brand: 'http-url';
206
206
  }