@types/k6 0.44.2 → 0.45.0
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/execution.d.ts +12 -1
- k6/experimental/browser/element_handle.d.ts +206 -202
- k6/experimental/browser/frame.d.ts +363 -353
- k6/experimental/browser/index.d.ts +280 -262
- k6/experimental/browser/js_handle.d.ts +40 -40
- k6/experimental/browser/keyboard.d.ts +34 -34
- k6/experimental/browser/locator.d.ts +169 -166
- k6/experimental/browser/mouse.d.ts +33 -33
- k6/experimental/browser/page.d.ts +1410 -1318
- k6/experimental/browser/request.d.ts +82 -82
- k6/experimental/browser/response.d.ts +108 -108
- k6/experimental/browser/touchscreen.d.ts +6 -6
- k6/experimental/browser/worker.d.ts +7 -7
- k6/experimental/grpc.d.ts +154 -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/index.d.ts +2 -1
- k6/options.d.ts +33 -17
- k6/package.json +2 -2
- k6/ws.d.ts +1 -1
k6/experimental/tracing.d.ts
CHANGED
|
@@ -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:
|
|
205
|
+
__brand: 'http-url';
|
|
206
206
|
}
|
k6/experimental/webcrypto.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export interface SubtleCrypto {
|
|
|
46
46
|
decrypt(
|
|
47
47
|
algorithm: AesCtrParams | AesCbcParams | AesGcmParams,
|
|
48
48
|
key: CryptoKey,
|
|
49
|
-
data: ArrayBuffer | ArrayBufferView | DataView
|
|
49
|
+
data: ArrayBuffer | ArrayBufferView | DataView,
|
|
50
50
|
): Promise<ArrayBuffer>;
|
|
51
51
|
|
|
52
52
|
/**
|
|
@@ -67,7 +67,7 @@ export interface SubtleCrypto {
|
|
|
67
67
|
*/
|
|
68
68
|
digest(
|
|
69
69
|
algorithm: HashAlgorithmIdentifier | Algorithm<HashAlgorithmIdentifier>,
|
|
70
|
-
data: ArrayBuffer | ArrayBufferView | DataView
|
|
70
|
+
data: ArrayBuffer | ArrayBufferView | DataView,
|
|
71
71
|
): Promise<ArrayBuffer>;
|
|
72
72
|
|
|
73
73
|
/**
|
|
@@ -83,7 +83,7 @@ export interface SubtleCrypto {
|
|
|
83
83
|
encrypt(
|
|
84
84
|
algorithm: AesCtrParams | AesCbcParams | AesGcmParams,
|
|
85
85
|
key: CryptoKey,
|
|
86
|
-
data: ArrayBuffer | ArrayBufferView | DataView
|
|
86
|
+
data: ArrayBuffer | ArrayBufferView | DataView,
|
|
87
87
|
): Promise<ArrayBuffer>;
|
|
88
88
|
|
|
89
89
|
/**
|
|
@@ -99,10 +99,7 @@ export interface SubtleCrypto {
|
|
|
99
99
|
* @throws {TypeError} - when trying to use an invalid format.
|
|
100
100
|
* @returns A promise that resolves with the exported key.
|
|
101
101
|
*/
|
|
102
|
-
exportKey(
|
|
103
|
-
format: "raw",
|
|
104
|
-
key: CryptoKey
|
|
105
|
-
): Promise<ArrayBuffer>;
|
|
102
|
+
exportKey(format: 'raw', key: CryptoKey): Promise<ArrayBuffer>;
|
|
106
103
|
|
|
107
104
|
/**
|
|
108
105
|
* Use the `generateKey()` method to generate a new key (for symmetric
|
|
@@ -117,7 +114,7 @@ export interface SubtleCrypto {
|
|
|
117
114
|
generateKey(
|
|
118
115
|
algorithm: AesKeyGenParams | HmacKeyGenParams,
|
|
119
116
|
extractable: boolean,
|
|
120
|
-
keyUsages: Array<
|
|
117
|
+
keyUsages: Array<'encrypt' | 'decrypt' | 'sign' | 'verify'>,
|
|
121
118
|
): Promise<CryptoKey>;
|
|
122
119
|
|
|
123
120
|
/**
|
|
@@ -135,11 +132,11 @@ export interface SubtleCrypto {
|
|
|
135
132
|
* @returns A promise that resolves with the imported `CryptoKey`.
|
|
136
133
|
*/
|
|
137
134
|
importKey(
|
|
138
|
-
format:
|
|
135
|
+
format: 'raw',
|
|
139
136
|
keyData: ArrayBuffer | ArrayBufferView | DataView,
|
|
140
|
-
algorithm:
|
|
137
|
+
algorithm: 'AES-CBC' | 'AES-CTR' | 'AES-GCM' | Algorithm<'AES-CBC' | 'AES-CTR' | 'AES-GCM'> | HmacImportParams,
|
|
141
138
|
extractable: boolean,
|
|
142
|
-
keyUsages: Array<
|
|
139
|
+
keyUsages: Array<'encrypt' | 'decrypt' | 'sign' | 'verify'>,
|
|
143
140
|
): Promise<CryptoKey>;
|
|
144
141
|
|
|
145
142
|
/**
|
|
@@ -155,9 +152,9 @@ export interface SubtleCrypto {
|
|
|
155
152
|
* @returns A promise that resolves with the signature.
|
|
156
153
|
*/
|
|
157
154
|
sign(
|
|
158
|
-
algorithm:
|
|
155
|
+
algorithm: 'HMAC' | Algorithm<'HMAC'>,
|
|
159
156
|
key: CryptoKey,
|
|
160
|
-
data: ArrayBuffer | ArrayBufferView | DataView
|
|
157
|
+
data: ArrayBuffer | ArrayBufferView | DataView,
|
|
161
158
|
): Promise<ArrayBuffer>;
|
|
162
159
|
|
|
163
160
|
/**
|
|
@@ -171,10 +168,10 @@ export interface SubtleCrypto {
|
|
|
171
168
|
* @returns A promise that resolves with a boolean indicating whether the signature is valid.
|
|
172
169
|
*/
|
|
173
170
|
verify(
|
|
174
|
-
algorithm:
|
|
171
|
+
algorithm: 'HMAC' | Algorithm<'HMAC'>,
|
|
175
172
|
key: CryptoKey,
|
|
176
173
|
signature: ArrayBuffer | ArrayBufferView | DataView,
|
|
177
|
-
data: ArrayBuffer | ArrayBufferView | DataView
|
|
174
|
+
data: ArrayBuffer | ArrayBufferView | DataView,
|
|
178
175
|
): Promise<boolean>;
|
|
179
176
|
}
|
|
180
177
|
|
|
@@ -182,7 +179,7 @@ export interface CryptoKey {
|
|
|
182
179
|
/**
|
|
183
180
|
* The type of key the object represents.
|
|
184
181
|
*/
|
|
185
|
-
readonly type:
|
|
182
|
+
readonly type: 'secret' | 'private' | 'public';
|
|
186
183
|
|
|
187
184
|
/**
|
|
188
185
|
* A boolean value indicating whether or not the
|
|
@@ -200,7 +197,7 @@ export interface CryptoKey {
|
|
|
200
197
|
/**
|
|
201
198
|
* An array of strings, indicating what can be done with the key.
|
|
202
199
|
*/
|
|
203
|
-
readonly usages: Array<
|
|
200
|
+
readonly usages: Array<'encrypt' | 'decrypt' | 'sign' | 'verify'>;
|
|
204
201
|
}
|
|
205
202
|
|
|
206
203
|
/**
|
|
@@ -225,7 +222,7 @@ export type AlgorithmIdentifier = string;
|
|
|
225
222
|
* The `HashAlgorithmIdentifier` type of the Web Crypto API represents
|
|
226
223
|
* the name of a hash algorithm.
|
|
227
224
|
*/
|
|
228
|
-
export type HashAlgorithmIdentifier =
|
|
225
|
+
export type HashAlgorithmIdentifier = 'SHA-1' | 'SHA-256' | 'SHA-384' | 'SHA-512';
|
|
229
226
|
|
|
230
227
|
/**
|
|
231
228
|
* The `AesKeyGenParams` dictionary of the Web Crypto API represents the
|
|
@@ -236,7 +233,7 @@ export interface AesKeyGenParams extends Algorithm<AlgorithmIdentifier> {
|
|
|
236
233
|
/**
|
|
237
234
|
* The name of the algorithm to use.
|
|
238
235
|
*/
|
|
239
|
-
name:
|
|
236
|
+
name: 'AES-GCM' | 'AES-CBC' | 'AES-CTR' | 'AES-CFB' | 'AES-KW';
|
|
240
237
|
|
|
241
238
|
/**
|
|
242
239
|
* The length of the key, in bits.
|
|
@@ -254,7 +251,7 @@ export interface AesCtrParams extends Algorithm<AlgorithmIdentifier> {
|
|
|
254
251
|
/**
|
|
255
252
|
* The name of the algorithm to use.
|
|
256
253
|
*/
|
|
257
|
-
name:
|
|
254
|
+
name: 'AES-CTR';
|
|
258
255
|
|
|
259
256
|
/**
|
|
260
257
|
* The initial value of the counter block. This must be 16-byte
|
|
@@ -283,7 +280,7 @@ export interface AesCbcParams extends Algorithm<AlgorithmIdentifier> {
|
|
|
283
280
|
/**
|
|
284
281
|
* The name of the algorithm to use.
|
|
285
282
|
*/
|
|
286
|
-
name:
|
|
283
|
+
name: 'AES-CBC';
|
|
287
284
|
|
|
288
285
|
/**
|
|
289
286
|
* The initialization vector to use for the operation.
|
|
@@ -304,7 +301,7 @@ export interface AesGcmParams extends Algorithm<AlgorithmIdentifier> {
|
|
|
304
301
|
/**
|
|
305
302
|
* The name of the algorithm to use.
|
|
306
303
|
*/
|
|
307
|
-
name:
|
|
304
|
+
name: 'AES-GCM';
|
|
308
305
|
|
|
309
306
|
/**
|
|
310
307
|
* The initialization vector to use for the operation.
|
|
@@ -341,12 +338,12 @@ export interface HmacKeyGenParams extends Algorithm<AlgorithmIdentifier> {
|
|
|
341
338
|
/**
|
|
342
339
|
* The name of the algorithm to use.
|
|
343
340
|
*/
|
|
344
|
-
name:
|
|
341
|
+
name: 'HMAC';
|
|
345
342
|
|
|
346
343
|
/**
|
|
347
344
|
* A string representing the name of the digest function to use.
|
|
348
345
|
*/
|
|
349
|
-
hash:
|
|
346
|
+
hash: 'SHA-1' | 'SHA-256' | 'SHA-384' | 'SHA-512';
|
|
350
347
|
|
|
351
348
|
/**
|
|
352
349
|
* The length of the key, in bits. If the length is not specified,
|
|
@@ -366,7 +363,7 @@ export interface HmacImportParams extends Algorithm<AlgorithmIdentifier> {
|
|
|
366
363
|
/**
|
|
367
364
|
* The name of the algorithm to use.
|
|
368
365
|
*/
|
|
369
|
-
name:
|
|
366
|
+
name: 'HMAC';
|
|
370
367
|
|
|
371
368
|
/**
|
|
372
369
|
* The name of the digest function to use.
|
k6/experimental/websockets.d.ts
CHANGED
|
@@ -176,11 +176,11 @@ export enum ReadyState {
|
|
|
176
176
|
* BinaryType describes the possible types of binary data that can be
|
|
177
177
|
* transmitted over a Websocket connection.
|
|
178
178
|
*/
|
|
179
|
-
export enum BinaryType
|
|
179
|
+
export enum BinaryType {
|
|
180
180
|
/**
|
|
181
181
|
* Binary data is returned in ArrayBuffer form. k6 supports only this type.
|
|
182
182
|
*/
|
|
183
|
-
ArrayBuffer = 'ArrayBuffer'
|
|
183
|
+
ArrayBuffer = 'ArrayBuffer',
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
/**
|
|
@@ -296,10 +296,10 @@ export interface ErrorEvent {
|
|
|
296
296
|
/**
|
|
297
297
|
* CompressionAlgorithm describes the possible compression algorithms.
|
|
298
298
|
*/
|
|
299
|
-
export enum CompressionAlgorithm
|
|
299
|
+
export enum CompressionAlgorithm {
|
|
300
300
|
/**
|
|
301
301
|
* Deflate compression algorithm.
|
|
302
302
|
* k6 supports only this compression algorithm.
|
|
303
303
|
*/
|
|
304
|
-
Deflate = 'deflate'
|
|
304
|
+
Deflate = 'deflate',
|
|
305
305
|
}
|
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/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for k6 0.
|
|
1
|
+
// Type definitions for k6 0.45
|
|
2
2
|
// Project: https://k6.io/docs/
|
|
3
3
|
// Definitions by: na-- <https://github.com/na-->
|
|
4
4
|
// Mihail Stoykov <https://github.com/MStoykov>
|
|
@@ -48,6 +48,7 @@ import './experimental/timers';
|
|
|
48
48
|
import './experimental/tracing';
|
|
49
49
|
import './experimental/webcrypto';
|
|
50
50
|
import './experimental/websockets';
|
|
51
|
+
import './experimental/grpc';
|
|
51
52
|
import './ws';
|
|
52
53
|
import './net/grpc';
|
|
53
54
|
|
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.
|
|
@@ -235,6 +242,9 @@ export abstract class BaseScenario {
|
|
|
235
242
|
|
|
236
243
|
/** Tags specific to this scenario. */
|
|
237
244
|
tags?: { [name: string]: string };
|
|
245
|
+
|
|
246
|
+
/** Additional options for each scenario */
|
|
247
|
+
options?: ScenarioOptions;
|
|
238
248
|
}
|
|
239
249
|
|
|
240
250
|
/**
|
|
@@ -243,7 +253,7 @@ export abstract class BaseScenario {
|
|
|
243
253
|
* https://k6.io/docs/using-k6/scenarios/executors/shared-iterations/
|
|
244
254
|
*/
|
|
245
255
|
export interface SharedIterationsScenario extends BaseScenario {
|
|
246
|
-
executor:
|
|
256
|
+
executor: 'shared-iterations';
|
|
247
257
|
/**
|
|
248
258
|
* Number of VUs to run concurrently.
|
|
249
259
|
*
|
|
@@ -272,7 +282,7 @@ export interface SharedIterationsScenario extends BaseScenario {
|
|
|
272
282
|
* https://k6.io/docs/using-k6/scenarios/executors/per-vu-iterations/
|
|
273
283
|
*/
|
|
274
284
|
export interface PerVUIterationsScenario extends BaseScenario {
|
|
275
|
-
executor:
|
|
285
|
+
executor: 'per-vu-iterations';
|
|
276
286
|
/**
|
|
277
287
|
* Number of VUs to run concurrently.
|
|
278
288
|
*
|
|
@@ -301,7 +311,7 @@ export interface PerVUIterationsScenario extends BaseScenario {
|
|
|
301
311
|
* https://k6.io/docs/using-k6/scenarios/executors/constant-vus/
|
|
302
312
|
*/
|
|
303
313
|
export interface ConstantVUsScenario extends BaseScenario {
|
|
304
|
-
executor:
|
|
314
|
+
executor: 'constant-vus';
|
|
305
315
|
|
|
306
316
|
/**
|
|
307
317
|
* Number of VUs to run concurrently.
|
|
@@ -322,7 +332,7 @@ export interface ConstantVUsScenario extends BaseScenario {
|
|
|
322
332
|
* https://k6.io/docs/using-k6/scenarios/executors/ramping-vus/
|
|
323
333
|
*/
|
|
324
334
|
export interface RampingVUsScenario extends BaseScenario {
|
|
325
|
-
executor:
|
|
335
|
+
executor: 'ramping-vus';
|
|
326
336
|
|
|
327
337
|
/** Array of objects that specify the number of VUs to ramp up or down to. */
|
|
328
338
|
stages: Stage[];
|
|
@@ -348,7 +358,7 @@ export interface RampingVUsScenario extends BaseScenario {
|
|
|
348
358
|
* https://k6.io/docs/using-k6/scenarios/executors/constant-arrival-rate/
|
|
349
359
|
*/
|
|
350
360
|
export interface ConstantArrivalRateScenario extends BaseScenario {
|
|
351
|
-
executor:
|
|
361
|
+
executor: 'constant-arrival-rate';
|
|
352
362
|
|
|
353
363
|
/** Total scenario duration (excluding `gracefulStop`) */
|
|
354
364
|
duration: string;
|
|
@@ -380,7 +390,7 @@ export interface ConstantArrivalRateScenario extends BaseScenario {
|
|
|
380
390
|
* https://k6.io/docs/using-k6/scenarios/executors/ramping-arrival-rate/
|
|
381
391
|
*/
|
|
382
392
|
export interface RampingArrivalRateScenario extends BaseScenario {
|
|
383
|
-
executor:
|
|
393
|
+
executor: 'ramping-arrival-rate';
|
|
384
394
|
|
|
385
395
|
/** Maximum number of VUs to allow during the test run. */
|
|
386
396
|
maxVUs?: number;
|
|
@@ -408,7 +418,7 @@ export interface RampingArrivalRateScenario extends BaseScenario {
|
|
|
408
418
|
* https://k6.io/docs/using-k6/scenarios/executors/externally-controlled/
|
|
409
419
|
*/
|
|
410
420
|
export interface ExternallyControlledScenario extends BaseScenario {
|
|
411
|
-
executor:
|
|
421
|
+
executor: 'externally-controlled';
|
|
412
422
|
|
|
413
423
|
/**
|
|
414
424
|
* Number of VUs to run concurrently.
|
|
@@ -424,10 +434,16 @@ export interface ExternallyControlledScenario extends BaseScenario {
|
|
|
424
434
|
maxVUs?: number;
|
|
425
435
|
}
|
|
426
436
|
|
|
427
|
-
export type Scenario =
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
437
|
+
export type Scenario =
|
|
438
|
+
| SharedIterationsScenario
|
|
439
|
+
| PerVUIterationsScenario
|
|
440
|
+
| ConstantVUsScenario
|
|
441
|
+
| RampingVUsScenario
|
|
442
|
+
| ConstantArrivalRateScenario
|
|
443
|
+
| RampingArrivalRateScenario
|
|
444
|
+
| ExternallyControlledScenario;
|
|
445
|
+
|
|
446
|
+
export interface ScenarioOptions {
|
|
447
|
+
/** Browser specific options */
|
|
448
|
+
browser?: any;
|
|
449
|
+
}
|
k6/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/k6",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.45.0",
|
|
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": "5b2bbba096263f0ef2834ce4ad15719492ad469e1ad3df1e19ecbd1a8bc532f9",
|
|
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
|
}
|