@types/k6 0.44.1 → 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.
- k6/README.md +1 -1
- k6/crypto.d.ts +20 -74
- k6/data.d.ts +2 -2
- k6/encoding.d.ts +1 -1
- k6/experimental/browser/element_handle.d.ts +213 -0
- k6/experimental/browser/frame.d.ts +370 -0
- k6/experimental/browser/index.d.ts +389 -0
- k6/experimental/browser/js_handle.d.ts +51 -0
- k6/experimental/browser/keyboard.d.ts +43 -0
- k6/experimental/browser/locator.d.ts +194 -0
- k6/experimental/browser/mouse.d.ts +43 -0
- k6/experimental/browser/page.d.ts +1524 -0
- k6/experimental/browser/request.d.ts +101 -0
- k6/experimental/browser/response.d.ts +115 -0
- k6/experimental/browser/touchscreen.d.ts +13 -0
- k6/experimental/browser/worker.d.ts +13 -0
- k6/experimental/tracing.d.ts +10 -10
- k6/experimental/webcrypto.d.ts +22 -25
- k6/experimental/websockets.d.ts +4 -4
- k6/http.d.ts +25 -25
- k6/options.d.ts +25 -17
- k6/package.json +2 -2
- k6/ws.d.ts +1 -1
- k6/experimental/browser.d.ts +0 -1573
k6/http.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { Selection } from './html';
|
|
|
12
12
|
export function del<RT extends ResponseType | undefined>(
|
|
13
13
|
url: string | HttpURL,
|
|
14
14
|
body?: RequestBody | null,
|
|
15
|
-
params?: RefinedParams<RT> | null
|
|
15
|
+
params?: RefinedParams<RT> | null,
|
|
16
16
|
): RefinedResponse<RT>;
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -24,9 +24,9 @@ export function del<RT extends ResponseType | undefined>(
|
|
|
24
24
|
* @example
|
|
25
25
|
* http.head('https://test.k6.io')
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
export function head<RT extends ResponseType | undefined>(
|
|
28
28
|
url: string | HttpURL,
|
|
29
|
-
params?: RefinedParams<RT> | null
|
|
29
|
+
params?: RefinedParams<RT> | null,
|
|
30
30
|
): RefinedResponse<RT>;
|
|
31
31
|
|
|
32
32
|
/**
|
|
@@ -40,7 +40,7 @@ export function del<RT extends ResponseType | undefined>(
|
|
|
40
40
|
*/
|
|
41
41
|
export function get<RT extends ResponseType | undefined>(
|
|
42
42
|
url: string | HttpURL,
|
|
43
|
-
params?: RefinedParams<RT> | null
|
|
43
|
+
params?: RefinedParams<RT> | null,
|
|
44
44
|
): RefinedResponse<RT>;
|
|
45
45
|
|
|
46
46
|
/**
|
|
@@ -54,7 +54,7 @@ export function get<RT extends ResponseType | undefined>(
|
|
|
54
54
|
export function options<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
|
/**
|
|
@@ -68,7 +68,7 @@ export function options<RT extends ResponseType | undefined>(
|
|
|
68
68
|
export function patch<RT extends ResponseType | undefined>(
|
|
69
69
|
url: string | HttpURL,
|
|
70
70
|
body?: RequestBody | null,
|
|
71
|
-
params?: RefinedParams<RT> | null
|
|
71
|
+
params?: RefinedParams<RT> | null,
|
|
72
72
|
): RefinedResponse<RT>;
|
|
73
73
|
|
|
74
74
|
/**
|
|
@@ -86,7 +86,7 @@ export function patch<RT extends ResponseType | undefined>(
|
|
|
86
86
|
export function post<RT extends ResponseType | undefined>(
|
|
87
87
|
url: string | HttpURL,
|
|
88
88
|
body?: RequestBody | null,
|
|
89
|
-
params?: RefinedParams<RT> | null
|
|
89
|
+
params?: RefinedParams<RT> | null,
|
|
90
90
|
): RefinedResponse<RT>;
|
|
91
91
|
|
|
92
92
|
/**
|
|
@@ -100,7 +100,7 @@ export function post<RT extends ResponseType | undefined>(
|
|
|
100
100
|
export function put<RT extends ResponseType | undefined>(
|
|
101
101
|
url: string | HttpURL,
|
|
102
102
|
body?: RequestBody | null,
|
|
103
|
-
params?: RefinedParams<RT> | null
|
|
103
|
+
params?: RefinedParams<RT> | null,
|
|
104
104
|
): RefinedResponse<RT>;
|
|
105
105
|
|
|
106
106
|
/**
|
|
@@ -120,7 +120,7 @@ export function request<RT extends ResponseType | undefined>(
|
|
|
120
120
|
method: string,
|
|
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
|
/**
|
|
@@ -140,7 +140,7 @@ export function asyncRequest<RT extends ResponseType | undefined>(
|
|
|
140
140
|
method: string,
|
|
141
141
|
url: string | HttpURL,
|
|
142
142
|
body?: RequestBody | null,
|
|
143
|
-
params?: RefinedParams<RT> | null
|
|
143
|
+
params?: RefinedParams<RT> | null,
|
|
144
144
|
): Promise<RefinedResponse<RT>>;
|
|
145
145
|
|
|
146
146
|
/**
|
|
@@ -346,7 +346,7 @@ export type BatchRequest = string | HttpURL | ArrayBatchRequest | ObjectBatchReq
|
|
|
346
346
|
/**
|
|
347
347
|
* Array form batch request specification.
|
|
348
348
|
*/
|
|
349
|
-
export type ArrayBatchRequest = [
|
|
349
|
+
export type ArrayBatchRequest = [string, string | HttpURL, (RequestBody | null)?, (Params | null)?];
|
|
350
350
|
|
|
351
351
|
/**
|
|
352
352
|
* Object form batch request specification.
|
|
@@ -388,9 +388,9 @@ export type RefinedBatchRequest<RT extends ResponseType | undefined> =
|
|
|
388
388
|
*/
|
|
389
389
|
export type ArrayRefinedBatchRequest<RT extends ResponseType | undefined> = [
|
|
390
390
|
string,
|
|
391
|
-
string | HttpURL
|
|
391
|
+
string | HttpURL,
|
|
392
392
|
(RequestBody | null)?,
|
|
393
|
-
(RefinedParams<RT> | null)
|
|
393
|
+
(RefinedParams<RT> | null)?,
|
|
394
394
|
];
|
|
395
395
|
|
|
396
396
|
/**
|
|
@@ -792,8 +792,8 @@ export interface ExpectedStatusesObject {
|
|
|
792
792
|
/**
|
|
793
793
|
* Returned value from http.url method.
|
|
794
794
|
*/
|
|
795
|
-
|
|
796
|
-
|
|
795
|
+
interface HttpURL {
|
|
796
|
+
__brand: 'http-url';
|
|
797
797
|
}
|
|
798
798
|
|
|
799
799
|
/**
|
|
@@ -812,7 +812,7 @@ declare namespace http {
|
|
|
812
812
|
function del<RT extends ResponseType | undefined>(
|
|
813
813
|
url: string | HttpURL,
|
|
814
814
|
body?: RequestBody | null,
|
|
815
|
-
params?: RefinedParams<RT> | null
|
|
815
|
+
params?: RefinedParams<RT> | null,
|
|
816
816
|
): RefinedResponse<RT>;
|
|
817
817
|
|
|
818
818
|
/**
|
|
@@ -826,7 +826,7 @@ declare namespace http {
|
|
|
826
826
|
*/
|
|
827
827
|
function head<RT extends ResponseType | undefined>(
|
|
828
828
|
url: string | HttpURL,
|
|
829
|
-
params?: RefinedParams<RT> | null
|
|
829
|
+
params?: RefinedParams<RT> | null,
|
|
830
830
|
): RefinedResponse<RT>;
|
|
831
831
|
|
|
832
832
|
/**
|
|
@@ -840,7 +840,7 @@ declare namespace http {
|
|
|
840
840
|
*/
|
|
841
841
|
function get<RT extends ResponseType | undefined>(
|
|
842
842
|
url: string | HttpURL,
|
|
843
|
-
params?: RefinedParams<RT> | null
|
|
843
|
+
params?: RefinedParams<RT> | null,
|
|
844
844
|
): RefinedResponse<RT>;
|
|
845
845
|
|
|
846
846
|
/**
|
|
@@ -854,7 +854,7 @@ declare namespace http {
|
|
|
854
854
|
function options<RT extends ResponseType | undefined>(
|
|
855
855
|
url: string | HttpURL,
|
|
856
856
|
body?: RequestBody | null,
|
|
857
|
-
params?: RefinedParams<RT> | null
|
|
857
|
+
params?: RefinedParams<RT> | null,
|
|
858
858
|
): RefinedResponse<RT>;
|
|
859
859
|
|
|
860
860
|
/**
|
|
@@ -868,7 +868,7 @@ declare namespace http {
|
|
|
868
868
|
function patch<RT extends ResponseType | undefined>(
|
|
869
869
|
url: string | HttpURL,
|
|
870
870
|
body?: RequestBody | null,
|
|
871
|
-
params?: RefinedParams<RT> | null
|
|
871
|
+
params?: RefinedParams<RT> | null,
|
|
872
872
|
): RefinedResponse<RT>;
|
|
873
873
|
|
|
874
874
|
/**
|
|
@@ -886,7 +886,7 @@ declare namespace http {
|
|
|
886
886
|
function post<RT extends ResponseType | undefined>(
|
|
887
887
|
url: string | HttpURL,
|
|
888
888
|
body?: RequestBody | null,
|
|
889
|
-
params?: RefinedParams<RT> | null
|
|
889
|
+
params?: RefinedParams<RT> | null,
|
|
890
890
|
): RefinedResponse<RT>;
|
|
891
891
|
|
|
892
892
|
/**
|
|
@@ -900,7 +900,7 @@ declare namespace http {
|
|
|
900
900
|
function put<RT extends ResponseType | undefined>(
|
|
901
901
|
url: string | HttpURL,
|
|
902
902
|
body?: RequestBody | null,
|
|
903
|
-
params?: RefinedParams<RT> | null
|
|
903
|
+
params?: RefinedParams<RT> | null,
|
|
904
904
|
): RefinedResponse<RT>;
|
|
905
905
|
|
|
906
906
|
/**
|
|
@@ -920,7 +920,7 @@ declare namespace http {
|
|
|
920
920
|
method: string,
|
|
921
921
|
url: string | HttpURL,
|
|
922
922
|
body?: RequestBody | null,
|
|
923
|
-
params?: RefinedParams<RT> | null
|
|
923
|
+
params?: RefinedParams<RT> | null,
|
|
924
924
|
): RefinedResponse<RT>;
|
|
925
925
|
|
|
926
926
|
/**
|
|
@@ -940,7 +940,7 @@ declare namespace http {
|
|
|
940
940
|
method: string,
|
|
941
941
|
url: string | HttpURL,
|
|
942
942
|
body?: RequestBody | null,
|
|
943
|
-
params?: RefinedParams<RT> | null
|
|
943
|
+
params?: RefinedParams<RT> | null,
|
|
944
944
|
): Promise<RefinedResponse<RT>>;
|
|
945
945
|
|
|
946
946
|
/**
|
|
@@ -952,7 +952,7 @@ declare namespace http {
|
|
|
952
952
|
* @example
|
|
953
953
|
* http.get(http.url`http://example.com/posts/${id}`) // tags.name="http://example.com/posts/${}",
|
|
954
954
|
*/
|
|
955
|
-
|
|
955
|
+
function url(strings: TemplateStringsArray, ...args: Array<string | number | boolean>): HttpURL;
|
|
956
956
|
|
|
957
957
|
/**
|
|
958
958
|
* Batch multiple HTTP requests together,
|
k6/options.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export interface Options {
|
|
|
30
30
|
/** 0, inf, or any time duration(60s, 5m30s, 10m, 2h). */
|
|
31
31
|
ttl: string;
|
|
32
32
|
|
|
33
|
-
select: 'first' | 'random' |
|
|
33
|
+
select: 'first' | 'random' | 'roundRobin';
|
|
34
34
|
|
|
35
35
|
policy: 'preferIPv4' | 'preferIPv6' | 'onlyIPv4' | 'onlyIPv6' | 'any';
|
|
36
36
|
};
|
|
@@ -87,7 +87,7 @@ export interface Options {
|
|
|
87
87
|
rps?: number;
|
|
88
88
|
|
|
89
89
|
/** Scenario specifications. */
|
|
90
|
-
scenarios?: { [name: string]: Scenario};
|
|
90
|
+
scenarios?: { [name: string]: Scenario };
|
|
91
91
|
|
|
92
92
|
/** Setup function timeout. */
|
|
93
93
|
setupTimeout?: string;
|
|
@@ -188,7 +188,14 @@ export interface Certificate {
|
|
|
188
188
|
password?: string;
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
export type ExecutorOptions =
|
|
191
|
+
export type ExecutorOptions =
|
|
192
|
+
| 'shared-iterations'
|
|
193
|
+
| 'per-vu-iterations'
|
|
194
|
+
| 'constant-vus'
|
|
195
|
+
| 'ramping-vus'
|
|
196
|
+
| 'constant-arrival-rate'
|
|
197
|
+
| 'ramping-arrival-rate'
|
|
198
|
+
| 'externally-controlled';
|
|
192
199
|
|
|
193
200
|
/**
|
|
194
201
|
* BaseScenario.
|
|
@@ -243,7 +250,7 @@ export abstract class BaseScenario {
|
|
|
243
250
|
* https://k6.io/docs/using-k6/scenarios/executors/shared-iterations/
|
|
244
251
|
*/
|
|
245
252
|
export interface SharedIterationsScenario extends BaseScenario {
|
|
246
|
-
executor:
|
|
253
|
+
executor: 'shared-iterations';
|
|
247
254
|
/**
|
|
248
255
|
* Number of VUs to run concurrently.
|
|
249
256
|
*
|
|
@@ -272,7 +279,7 @@ export interface SharedIterationsScenario extends BaseScenario {
|
|
|
272
279
|
* https://k6.io/docs/using-k6/scenarios/executors/per-vu-iterations/
|
|
273
280
|
*/
|
|
274
281
|
export interface PerVUIterationsScenario extends BaseScenario {
|
|
275
|
-
executor:
|
|
282
|
+
executor: 'per-vu-iterations';
|
|
276
283
|
/**
|
|
277
284
|
* Number of VUs to run concurrently.
|
|
278
285
|
*
|
|
@@ -301,7 +308,7 @@ export interface PerVUIterationsScenario extends BaseScenario {
|
|
|
301
308
|
* https://k6.io/docs/using-k6/scenarios/executors/constant-vus/
|
|
302
309
|
*/
|
|
303
310
|
export interface ConstantVUsScenario extends BaseScenario {
|
|
304
|
-
executor:
|
|
311
|
+
executor: 'constant-vus';
|
|
305
312
|
|
|
306
313
|
/**
|
|
307
314
|
* Number of VUs to run concurrently.
|
|
@@ -322,7 +329,7 @@ export interface ConstantVUsScenario extends BaseScenario {
|
|
|
322
329
|
* https://k6.io/docs/using-k6/scenarios/executors/ramping-vus/
|
|
323
330
|
*/
|
|
324
331
|
export interface RampingVUsScenario extends BaseScenario {
|
|
325
|
-
executor:
|
|
332
|
+
executor: 'ramping-vus';
|
|
326
333
|
|
|
327
334
|
/** Array of objects that specify the number of VUs to ramp up or down to. */
|
|
328
335
|
stages: Stage[];
|
|
@@ -348,7 +355,7 @@ export interface RampingVUsScenario extends BaseScenario {
|
|
|
348
355
|
* https://k6.io/docs/using-k6/scenarios/executors/constant-arrival-rate/
|
|
349
356
|
*/
|
|
350
357
|
export interface ConstantArrivalRateScenario extends BaseScenario {
|
|
351
|
-
executor:
|
|
358
|
+
executor: 'constant-arrival-rate';
|
|
352
359
|
|
|
353
360
|
/** Total scenario duration (excluding `gracefulStop`) */
|
|
354
361
|
duration: string;
|
|
@@ -380,7 +387,7 @@ export interface ConstantArrivalRateScenario extends BaseScenario {
|
|
|
380
387
|
* https://k6.io/docs/using-k6/scenarios/executors/ramping-arrival-rate/
|
|
381
388
|
*/
|
|
382
389
|
export interface RampingArrivalRateScenario extends BaseScenario {
|
|
383
|
-
executor:
|
|
390
|
+
executor: 'ramping-arrival-rate';
|
|
384
391
|
|
|
385
392
|
/** Maximum number of VUs to allow during the test run. */
|
|
386
393
|
maxVUs?: number;
|
|
@@ -408,7 +415,7 @@ export interface RampingArrivalRateScenario extends BaseScenario {
|
|
|
408
415
|
* https://k6.io/docs/using-k6/scenarios/executors/externally-controlled/
|
|
409
416
|
*/
|
|
410
417
|
export interface ExternallyControlledScenario extends BaseScenario {
|
|
411
|
-
executor:
|
|
418
|
+
executor: 'externally-controlled';
|
|
412
419
|
|
|
413
420
|
/**
|
|
414
421
|
* Number of VUs to run concurrently.
|
|
@@ -424,10 +431,11 @@ export interface ExternallyControlledScenario extends BaseScenario {
|
|
|
424
431
|
maxVUs?: number;
|
|
425
432
|
}
|
|
426
433
|
|
|
427
|
-
export type Scenario =
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
+
export type Scenario =
|
|
435
|
+
| SharedIterationsScenario
|
|
436
|
+
| PerVUIterationsScenario
|
|
437
|
+
| ConstantVUsScenario
|
|
438
|
+
| RampingVUsScenario
|
|
439
|
+
| ConstantArrivalRateScenario
|
|
440
|
+
| RampingArrivalRateScenario
|
|
441
|
+
| ExternallyControlledScenario;
|
k6/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/k6",
|
|
3
|
-
"version": "0.44.
|
|
3
|
+
"version": "0.44.3",
|
|
4
4
|
"description": "TypeScript definitions for k6",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/k6",
|
|
6
6
|
"license": "MIT",
|
|
@@ -60,6 +60,6 @@
|
|
|
60
60
|
},
|
|
61
61
|
"scripts": {},
|
|
62
62
|
"dependencies": {},
|
|
63
|
-
"typesPublisherContentHash": "
|
|
63
|
+
"typesPublisherContentHash": "361534b19bc50893282724e8e2785b8c69f23e9233af269e95c9050d7957d763",
|
|
64
64
|
"typeScriptVersion": "4.3"
|
|
65
65
|
}
|
k6/ws.d.ts
CHANGED
|
@@ -248,7 +248,7 @@ export interface MessageEventHandler {
|
|
|
248
248
|
/**
|
|
249
249
|
* BinaryMessage event handler.
|
|
250
250
|
*/
|
|
251
|
-
|
|
251
|
+
export interface BinaryMessageEventHandler {
|
|
252
252
|
/** @param message - Message. */
|
|
253
253
|
(message: ArrayBuffer): void;
|
|
254
254
|
}
|