@types/k6 0.46.2 → 0.47.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.
@@ -17,7 +17,6 @@ export interface Crypto extends SubtleCrypto {
17
17
  /**
18
18
  * Fills the passed TypedArray with cryptographically sound random values.
19
19
  *
20
- *
21
20
  * @param typedArray - The TypedArray to fill with random values.
22
21
  * @throws {QuotaExceededError} - thrown if the `byteLength` of `typedArray` exceeds 65536.
23
22
  * @returns The typedArray argument.
@@ -99,7 +98,7 @@ export interface SubtleCrypto {
99
98
  * @throws {TypeError} - when trying to use an invalid format.
100
99
  * @returns A promise that resolves with the exported key.
101
100
  */
102
- exportKey(format: 'raw', key: CryptoKey): Promise<ArrayBuffer>;
101
+ exportKey(format: "raw", key: CryptoKey): Promise<ArrayBuffer>;
103
102
 
104
103
  /**
105
104
  * Use the `generateKey()` method to generate a new key (for symmetric
@@ -114,7 +113,7 @@ export interface SubtleCrypto {
114
113
  generateKey(
115
114
  algorithm: AesKeyGenParams | HmacKeyGenParams,
116
115
  extractable: boolean,
117
- keyUsages: Array<'encrypt' | 'decrypt' | 'sign' | 'verify'>,
116
+ keyUsages: Array<"encrypt" | "decrypt" | "sign" | "verify">,
118
117
  ): Promise<CryptoKey>;
119
118
 
120
119
  /**
@@ -132,11 +131,11 @@ export interface SubtleCrypto {
132
131
  * @returns A promise that resolves with the imported `CryptoKey`.
133
132
  */
134
133
  importKey(
135
- format: 'raw',
134
+ format: "raw",
136
135
  keyData: ArrayBuffer | ArrayBufferView | DataView,
137
- algorithm: 'AES-CBC' | 'AES-CTR' | 'AES-GCM' | Algorithm<'AES-CBC' | 'AES-CTR' | 'AES-GCM'> | HmacImportParams,
136
+ algorithm: "AES-CBC" | "AES-CTR" | "AES-GCM" | Algorithm<"AES-CBC" | "AES-CTR" | "AES-GCM"> | HmacImportParams,
138
137
  extractable: boolean,
139
- keyUsages: Array<'encrypt' | 'decrypt' | 'sign' | 'verify'>,
138
+ keyUsages: Array<"encrypt" | "decrypt" | "sign" | "verify">,
140
139
  ): Promise<CryptoKey>;
141
140
 
142
141
  /**
@@ -152,7 +151,7 @@ export interface SubtleCrypto {
152
151
  * @returns A promise that resolves with the signature.
153
152
  */
154
153
  sign(
155
- algorithm: 'HMAC' | Algorithm<'HMAC'>,
154
+ algorithm: "HMAC" | Algorithm<"HMAC">,
156
155
  key: CryptoKey,
157
156
  data: ArrayBuffer | ArrayBufferView | DataView,
158
157
  ): Promise<ArrayBuffer>;
@@ -168,7 +167,7 @@ export interface SubtleCrypto {
168
167
  * @returns A promise that resolves with a boolean indicating whether the signature is valid.
169
168
  */
170
169
  verify(
171
- algorithm: 'HMAC' | Algorithm<'HMAC'>,
170
+ algorithm: "HMAC" | Algorithm<"HMAC">,
172
171
  key: CryptoKey,
173
172
  signature: ArrayBuffer | ArrayBufferView | DataView,
174
173
  data: ArrayBuffer | ArrayBufferView | DataView,
@@ -179,7 +178,7 @@ export interface CryptoKey {
179
178
  /**
180
179
  * The type of key the object represents.
181
180
  */
182
- readonly type: 'secret' | 'private' | 'public';
181
+ readonly type: "secret" | "private" | "public";
183
182
 
184
183
  /**
185
184
  * A boolean value indicating whether or not the
@@ -197,7 +196,7 @@ export interface CryptoKey {
197
196
  /**
198
197
  * An array of strings, indicating what can be done with the key.
199
198
  */
200
- readonly usages: Array<'encrypt' | 'decrypt' | 'sign' | 'verify'>;
199
+ readonly usages: Array<"encrypt" | "decrypt" | "sign" | "verify">;
201
200
  }
202
201
 
203
202
  /**
@@ -222,7 +221,7 @@ export type AlgorithmIdentifier = string;
222
221
  * The `HashAlgorithmIdentifier` type of the Web Crypto API represents
223
222
  * the name of a hash algorithm.
224
223
  */
225
- export type HashAlgorithmIdentifier = 'SHA-1' | 'SHA-256' | 'SHA-384' | 'SHA-512';
224
+ export type HashAlgorithmIdentifier = "SHA-1" | "SHA-256" | "SHA-384" | "SHA-512";
226
225
 
227
226
  /**
228
227
  * The `AesKeyGenParams` dictionary of the Web Crypto API represents the
@@ -233,7 +232,7 @@ export interface AesKeyGenParams extends Algorithm<AlgorithmIdentifier> {
233
232
  /**
234
233
  * The name of the algorithm to use.
235
234
  */
236
- name: 'AES-GCM' | 'AES-CBC' | 'AES-CTR' | 'AES-CFB' | 'AES-KW';
235
+ name: "AES-GCM" | "AES-CBC" | "AES-CTR" | "AES-CFB" | "AES-KW";
237
236
 
238
237
  /**
239
238
  * The length of the key, in bits.
@@ -251,7 +250,7 @@ export interface AesCtrParams extends Algorithm<AlgorithmIdentifier> {
251
250
  /**
252
251
  * The name of the algorithm to use.
253
252
  */
254
- name: 'AES-CTR';
253
+ name: "AES-CTR";
255
254
 
256
255
  /**
257
256
  * The initial value of the counter block. This must be 16-byte
@@ -280,7 +279,7 @@ export interface AesCbcParams extends Algorithm<AlgorithmIdentifier> {
280
279
  /**
281
280
  * The name of the algorithm to use.
282
281
  */
283
- name: 'AES-CBC';
282
+ name: "AES-CBC";
284
283
 
285
284
  /**
286
285
  * The initialization vector to use for the operation.
@@ -301,7 +300,7 @@ export interface AesGcmParams extends Algorithm<AlgorithmIdentifier> {
301
300
  /**
302
301
  * The name of the algorithm to use.
303
302
  */
304
- name: 'AES-GCM';
303
+ name: "AES-GCM";
305
304
 
306
305
  /**
307
306
  * The initialization vector to use for the operation.
@@ -338,12 +337,12 @@ export interface HmacKeyGenParams extends Algorithm<AlgorithmIdentifier> {
338
337
  /**
339
338
  * The name of the algorithm to use.
340
339
  */
341
- name: 'HMAC';
340
+ name: "HMAC";
342
341
 
343
342
  /**
344
343
  * A string representing the name of the digest function to use.
345
344
  */
346
- hash: 'SHA-1' | 'SHA-256' | 'SHA-384' | 'SHA-512';
345
+ hash: "SHA-1" | "SHA-256" | "SHA-384" | "SHA-512";
347
346
 
348
347
  /**
349
348
  * The length of the key, in bits. If the length is not specified,
@@ -363,7 +362,7 @@ export interface HmacImportParams extends Algorithm<AlgorithmIdentifier> {
363
362
  /**
364
363
  * The name of the algorithm to use.
365
364
  */
366
- name: 'HMAC';
365
+ name: "HMAC";
367
366
 
368
367
  /**
369
368
  * The name of the digest function to use.
@@ -1,4 +1,4 @@
1
- import { CookieJar } from '../http';
1
+ import { CookieJar } from "../http";
2
2
 
3
3
  /**
4
4
  * This module provides an experimental implementation of the WebSocket API
@@ -180,7 +180,7 @@ 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
  /**
@@ -191,32 +191,32 @@ export enum EventName {
191
191
  /**
192
192
  * Event fired when the connection is opened and ready to communicate.
193
193
  */
194
- Open = 'open',
194
+ Open = "open",
195
195
 
196
196
  /**
197
197
  * Event fired when the connection has been closed.
198
198
  */
199
- Close = 'close',
199
+ Close = "close",
200
200
 
201
201
  /**
202
202
  * Event fired when a connection has been closed due to an error.
203
203
  */
204
- Error = 'error',
204
+ Error = "error",
205
205
 
206
206
  /**
207
207
  * Event fired when a message has been received from the server.
208
208
  */
209
- Message = 'message',
209
+ Message = "message",
210
210
 
211
211
  /**
212
212
  * Event fired when a ping message has been received from the server.
213
213
  */
214
- Ping = 'ping',
214
+ Ping = "ping",
215
215
 
216
216
  /**
217
217
  * Event fired when a pong message has been received from the server.
218
218
  */
219
- Pong = 'pong',
219
+ Pong = "pong",
220
220
  }
221
221
 
222
222
  /**
@@ -301,5 +301,5 @@ export enum CompressionAlgorithm {
301
301
  * Deflate compression algorithm.
302
302
  * k6 supports only this compression algorithm.
303
303
  */
304
- Deflate = 'deflate',
304
+ Deflate = "deflate",
305
305
  }
k6/global.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  * others in both contexts. Comments note availability.
7
7
  */
8
8
 
9
- import { bytes } from '.';
9
+ import { bytes } from ".";
10
10
 
11
11
  export {};
12
12
 
@@ -49,7 +49,7 @@ declare global {
49
49
  * sleep(3);
50
50
  * }
51
51
  */
52
- function open(filePath: string, mode: 'b'): ArrayBuffer;
52
+ function open(filePath: string, mode: "b"): ArrayBuffer;
53
53
 
54
54
  // === Init context and VU logic ===
55
55
  // ---------------------------------
k6/html.d.ts CHANGED
File without changes
k6/http.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { bytes, JSONValue } from '.';
2
- import { Selection } from './html';
1
+ import { bytes, JSONValue } from ".";
2
+ import { Selection } from "./html";
3
3
 
4
4
  /**
5
5
  * Make DELETE request.
@@ -212,49 +212,49 @@ export function setResponseCallback(responseCallback: ExpectedStatusesCallback):
212
212
  // === SSL/TLS versions ===
213
213
  // ------------------------
214
214
 
215
- export const SSL_3_0 = 'ssl3.0';
215
+ export const SSL_3_0 = "ssl3.0";
216
216
 
217
- export const TLS_1_0 = 'tls1.0';
217
+ export const TLS_1_0 = "tls1.0";
218
218
 
219
- export const TLS_1_1 = 'tls1.1';
219
+ export const TLS_1_1 = "tls1.1";
220
220
 
221
- export const TLS_1_2 = 'tls1.2';
221
+ export const TLS_1_2 = "tls1.2";
222
222
 
223
- export const TLS_1_3 = 'tls1.3';
223
+ export const TLS_1_3 = "tls1.3";
224
224
 
225
225
  // === OCSP statuses ===
226
226
  // ---------------------
227
227
 
228
- export const OCSP_STATUS_GOOD = 'good';
228
+ export const OCSP_STATUS_GOOD = "good";
229
229
 
230
- export const OCSP_STATUS_REVOKED = 'revoked';
230
+ export const OCSP_STATUS_REVOKED = "revoked";
231
231
 
232
- export const OCSP_STATUS_SERVER_FAILED = 'server_failed';
232
+ export const OCSP_STATUS_SERVER_FAILED = "server_failed";
233
233
 
234
- export const OCSP_STATUS_UNKNOWN = 'unknown';
234
+ export const OCSP_STATUS_UNKNOWN = "unknown";
235
235
 
236
236
  // === OCSP revocation reasons ===
237
237
  // -------------------------------
238
238
 
239
- export const OCSP_REASON_AA_COMPROMISE = 'aa_compromise';
239
+ export const OCSP_REASON_AA_COMPROMISE = "aa_compromise";
240
240
 
241
- export const OCSP_REASON_AFFILIATION_CHANGED = 'affiliation_changed';
241
+ export const OCSP_REASON_AFFILIATION_CHANGED = "affiliation_changed";
242
242
 
243
- export const OCSP_REASON_CA_COMPROMISE = 'ca_compromise';
243
+ export const OCSP_REASON_CA_COMPROMISE = "ca_compromise";
244
244
 
245
- export const OCSP_REASON_CERTIFICATE_HOLD = 'certificate_hold';
245
+ export const OCSP_REASON_CERTIFICATE_HOLD = "certificate_hold";
246
246
 
247
- export const OCSP_REASON_CESSATION_OF_OPERATION = 'cessation_of_operation';
247
+ export const OCSP_REASON_CESSATION_OF_OPERATION = "cessation_of_operation";
248
248
 
249
- export const OCSP_REASON_KEY_COMPROMISE = 'key_compromise';
249
+ export const OCSP_REASON_KEY_COMPROMISE = "key_compromise";
250
250
 
251
- export const OCSP_REASON_PRIVILEGE_WITHDRAWN = 'privilege_withdrawn';
251
+ export const OCSP_REASON_PRIVILEGE_WITHDRAWN = "privilege_withdrawn";
252
252
 
253
- export const OCSP_REASON_REMOVE_FROM_CRL = 'remove_from_crl';
253
+ export const OCSP_REASON_REMOVE_FROM_CRL = "remove_from_crl";
254
254
 
255
- export const OCSP_REASON_SUPERSEDED = 'superseded';
255
+ export const OCSP_REASON_SUPERSEDED = "superseded";
256
256
 
257
- export const OCSP_REASON_UNSPECIFIED = 'unspecified';
257
+ export const OCSP_REASON_UNSPECIFIED = "unspecified";
258
258
 
259
259
  // === Params ===
260
260
  // --------------
@@ -306,12 +306,12 @@ export interface RefinedParams<RT extends ResponseType | undefined> extends Para
306
306
  /**
307
307
  * Request authentication method.
308
308
  */
309
- export type AuthMethod = 'basic' | 'digest' | 'ntlm';
309
+ export type AuthMethod = "basic" | "digest" | "ntlm";
310
310
 
311
311
  /**
312
312
  * Response type.
313
313
  */
314
- export type ResponseType = 'binary' | 'none' | 'text';
314
+ export type ResponseType = "binary" | "none" | "text";
315
315
 
316
316
  /**
317
317
  * Cookie value in request parameters.
@@ -577,37 +577,37 @@ export interface Response {
577
577
  /**
578
578
  * HTTP protocol.
579
579
  */
580
- export type Protocol = 'HTTP/1.0' | 'HTTP/1.1' | 'HTTP/2.0';
580
+ export type Protocol = "HTTP/1.0" | "HTTP/1.1" | "HTTP/2.0";
581
581
 
582
582
  /**
583
583
  * TLS cipher suite.
584
584
  */
585
585
  export type CipherSuite =
586
- | 'TLS_RSA_WITH_RC4_128_SHA'
587
- | 'TLS_RSA_WITH_3DES_EDE_CBC_SHA'
588
- | 'TLS_RSA_WITH_AES_128_CBC_SHA'
589
- | 'TLS_RSA_WITH_AES_128_CBC_SHA256'
590
- | 'TLS_RSA_WITH_AES_256_CBC_SHA'
591
- | 'TLS_RSA_WITH_AES_128_GCM_SHA256'
592
- | 'TLS_RSA_WITH_AES_256_GCM_SHA384'
593
- | 'TLS_ECDHE_RSA_WITH_RC4_128_SHA'
594
- | 'TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA'
595
- | 'TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA'
596
- | 'TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256'
597
- | 'TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA'
598
- | 'TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256'
599
- | 'TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384'
600
- | 'TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305'
601
- | 'TLS_ECDHE_ECDSA_WITH_RC4_128_SHA'
602
- | 'TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA'
603
- | 'TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256'
604
- | 'TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA'
605
- | 'TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256'
606
- | 'TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384'
607
- | 'TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305'
608
- | 'TLS_AES_128_GCM_SHA256'
609
- | 'TLS_AES_256_GCM_SHA384'
610
- | 'TLS_CHACHA20_POLY1305_SHA256';
586
+ | "TLS_RSA_WITH_RC4_128_SHA"
587
+ | "TLS_RSA_WITH_3DES_EDE_CBC_SHA"
588
+ | "TLS_RSA_WITH_AES_128_CBC_SHA"
589
+ | "TLS_RSA_WITH_AES_128_CBC_SHA256"
590
+ | "TLS_RSA_WITH_AES_256_CBC_SHA"
591
+ | "TLS_RSA_WITH_AES_128_GCM_SHA256"
592
+ | "TLS_RSA_WITH_AES_256_GCM_SHA384"
593
+ | "TLS_ECDHE_RSA_WITH_RC4_128_SHA"
594
+ | "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA"
595
+ | "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA"
596
+ | "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256"
597
+ | "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA"
598
+ | "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"
599
+ | "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"
600
+ | "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305"
601
+ | "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA"
602
+ | "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA"
603
+ | "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256"
604
+ | "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA"
605
+ | "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"
606
+ | "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"
607
+ | "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305"
608
+ | "TLS_AES_128_GCM_SHA256"
609
+ | "TLS_AES_256_GCM_SHA384"
610
+ | "TLS_CHACHA20_POLY1305_SHA256";
611
611
 
612
612
  /**
613
613
  * Refined response.
@@ -628,14 +628,10 @@ export type ResponseBody = string | bytes | null;
628
628
  * @template RT - `Params.responseType` value.
629
629
  * @privateRemarks Default type is a union due to depending on program options.
630
630
  */
631
- export type RefinedResponseBody<RT extends ResponseType | undefined> = RT extends 'binary'
632
- ? bytes
633
- : RT extends 'none'
634
- ? null
635
- : RT extends 'text'
636
- ? string
637
- : RT extends undefined
638
- ? string | null
631
+ export type RefinedResponseBody<RT extends ResponseType | undefined> = RT extends "binary" ? bytes
632
+ : RT extends "none" ? null
633
+ : RT extends "text" ? string
634
+ : RT extends undefined ? string | null
639
635
  : never;
640
636
 
641
637
  /**
@@ -793,7 +789,7 @@ export interface ExpectedStatusesObject {
793
789
  * Returned value from http.url method.
794
790
  */
795
791
  interface HttpURL {
796
- __brand: 'http-url';
792
+ __brand: "http-url";
797
793
  }
798
794
 
799
795
  /**
k6/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for k6 0.46
1
+ // Type definitions for k6 0.47
2
2
  // Project: https://k6.io/docs/
3
3
  // Definitions by: Mihail Stoykov <https://github.com/MStoykov>
4
4
  // Ivan <https://github.com/codebien>
@@ -31,26 +31,26 @@
31
31
  * @packageDocumentation
32
32
  */
33
33
 
34
- import './global'; // Type global environment
34
+ import "./global"; // Type global environment
35
35
 
36
36
  // Expose everything to autoimport
37
- import './crypto';
38
- import './data';
39
- import './encoding';
40
- import './execution';
41
- import './html';
42
- import './http';
43
- import './metrics';
44
- import './options';
45
- import './experimental/browser';
46
- import './experimental/redis';
47
- import './experimental/timers';
48
- import './experimental/tracing';
49
- import './experimental/webcrypto';
50
- import './experimental/websockets';
51
- import './experimental/grpc';
52
- import './ws';
53
- import './net/grpc';
37
+ import "./crypto";
38
+ import "./data";
39
+ import "./encoding";
40
+ import "./execution";
41
+ import "./html";
42
+ import "./http";
43
+ import "./metrics";
44
+ import "./options";
45
+ import "./experimental/browser";
46
+ import "./experimental/redis";
47
+ import "./experimental/timers";
48
+ import "./experimental/tracing";
49
+ import "./experimental/webcrypto";
50
+ import "./experimental/websockets";
51
+ import "./experimental/grpc";
52
+ import "./ws";
53
+ import "./net/grpc";
54
54
 
55
55
  // === Main ===
56
56
  // ------------
k6/metrics.d.ts CHANGED
File without changes
k6/net/grpc.d.ts CHANGED
@@ -28,6 +28,11 @@ export interface ConnectParams {
28
28
  */
29
29
  reflect?: boolean;
30
30
 
31
+ /**
32
+ * Metadata to send with reflection request.
33
+ */
34
+ reflectMetadata?: object;
35
+
31
36
  /**
32
37
  * Connection timeout to use.
33
38
  */
k6/options.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * https://k6.io/docs/using-k6/options/
4
4
  */
5
5
 
6
- import { CipherSuite } from './http';
6
+ import { CipherSuite } from "./http";
7
7
 
8
8
  /**
9
9
  * Program options.
@@ -30,9 +30,9 @@ 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' | 'roundRobin';
33
+ select: "first" | "random" | "roundRobin";
34
34
 
35
- policy: 'preferIPv4' | 'preferIPv6' | 'onlyIPv4' | 'onlyIPv6' | 'any';
35
+ policy: "preferIPv4" | "preferIPv6" | "onlyIPv4" | "onlyIPv6" | "any";
36
36
  };
37
37
 
38
38
  /** Test duration. */
@@ -189,13 +189,13 @@ export interface Certificate {
189
189
  }
190
190
 
191
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
+ | "shared-iterations"
193
+ | "per-vu-iterations"
194
+ | "constant-vus"
195
+ | "ramping-vus"
196
+ | "constant-arrival-rate"
197
+ | "ramping-arrival-rate"
198
+ | "externally-controlled";
199
199
 
200
200
  /**
201
201
  * BaseScenario.
@@ -253,7 +253,7 @@ export abstract class BaseScenario {
253
253
  * https://k6.io/docs/using-k6/scenarios/executors/shared-iterations/
254
254
  */
255
255
  export interface SharedIterationsScenario extends BaseScenario {
256
- executor: 'shared-iterations';
256
+ executor: "shared-iterations";
257
257
  /**
258
258
  * Number of VUs to run concurrently.
259
259
  *
@@ -282,7 +282,7 @@ export interface SharedIterationsScenario extends BaseScenario {
282
282
  * https://k6.io/docs/using-k6/scenarios/executors/per-vu-iterations/
283
283
  */
284
284
  export interface PerVUIterationsScenario extends BaseScenario {
285
- executor: 'per-vu-iterations';
285
+ executor: "per-vu-iterations";
286
286
  /**
287
287
  * Number of VUs to run concurrently.
288
288
  *
@@ -311,7 +311,7 @@ export interface PerVUIterationsScenario extends BaseScenario {
311
311
  * https://k6.io/docs/using-k6/scenarios/executors/constant-vus/
312
312
  */
313
313
  export interface ConstantVUsScenario extends BaseScenario {
314
- executor: 'constant-vus';
314
+ executor: "constant-vus";
315
315
 
316
316
  /**
317
317
  * Number of VUs to run concurrently.
@@ -332,7 +332,7 @@ export interface ConstantVUsScenario extends BaseScenario {
332
332
  * https://k6.io/docs/using-k6/scenarios/executors/ramping-vus/
333
333
  */
334
334
  export interface RampingVUsScenario extends BaseScenario {
335
- executor: 'ramping-vus';
335
+ executor: "ramping-vus";
336
336
 
337
337
  /** Array of objects that specify the number of VUs to ramp up or down to. */
338
338
  stages: Stage[];
@@ -358,7 +358,7 @@ export interface RampingVUsScenario extends BaseScenario {
358
358
  * https://k6.io/docs/using-k6/scenarios/executors/constant-arrival-rate/
359
359
  */
360
360
  export interface ConstantArrivalRateScenario extends BaseScenario {
361
- executor: 'constant-arrival-rate';
361
+ executor: "constant-arrival-rate";
362
362
 
363
363
  /** Total scenario duration (excluding `gracefulStop`) */
364
364
  duration: string;
@@ -390,7 +390,7 @@ export interface ConstantArrivalRateScenario extends BaseScenario {
390
390
  * https://k6.io/docs/using-k6/scenarios/executors/ramping-arrival-rate/
391
391
  */
392
392
  export interface RampingArrivalRateScenario extends BaseScenario {
393
- executor: 'ramping-arrival-rate';
393
+ executor: "ramping-arrival-rate";
394
394
 
395
395
  /** Maximum number of VUs to allow during the test run. */
396
396
  maxVUs?: number;
@@ -418,7 +418,7 @@ export interface RampingArrivalRateScenario extends BaseScenario {
418
418
  * https://k6.io/docs/using-k6/scenarios/executors/externally-controlled/
419
419
  */
420
420
  export interface ExternallyControlledScenario extends BaseScenario {
421
- executor: 'externally-controlled';
421
+ executor: "externally-controlled";
422
422
 
423
423
  /**
424
424
  * Number of VUs to run concurrently.
k6/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/k6",
3
- "version": "0.46.2",
3
+ "version": "0.47.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": "b7636c8ff8ec7685076562d9226af5caab0553c1115277e81d3bbc597bdc4b13",
64
- "typeScriptVersion": "4.3"
63
+ "typesPublisherContentHash": "b079f39833a2ebca3ed4f12e4348669f4051f51b63a4eaff08300e42a0ee50c7",
64
+ "typeScriptVersion": "4.5"
65
65
  }
k6/ws.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { CookieJar } from './http';
1
+ import { CookieJar } from "./http";
2
2
 
3
3
  /**
4
4
  * Open WebSocket connection.
@@ -190,7 +190,7 @@ export abstract class Socket {
190
190
  /**
191
191
  * Event type.
192
192
  */
193
- export type EventType = 'close' | 'error' | 'message' | 'open' | 'ping' | 'pong' | 'binaryMessage';
193
+ export type EventType = "close" | "error" | "message" | "open" | "ping" | "pong" | "binaryMessage";
194
194
 
195
195
  /**
196
196
  * Timer handler.
@@ -205,20 +205,13 @@ export interface TimerHandler {
205
205
  /**
206
206
  * Event handler. Signature varies with event type.
207
207
  */
208
- export type EventHandler<ET extends EventType> = ET extends 'close'
209
- ? CloseEventHandler
210
- : ET extends 'error'
211
- ? ErrorEventHandler
212
- : ET extends 'message'
213
- ? MessageEventHandler
214
- : ET extends 'binaryMessage'
215
- ? BinaryMessageEventHandler
216
- : ET extends 'open'
217
- ? OpenEventHandler
218
- : ET extends 'ping'
219
- ? PingEventHandler
220
- : ET extends 'pong'
221
- ? PongEventHandler
208
+ export type EventHandler<ET extends EventType> = ET extends "close" ? CloseEventHandler
209
+ : ET extends "error" ? ErrorEventHandler
210
+ : ET extends "message" ? MessageEventHandler
211
+ : ET extends "binaryMessage" ? BinaryMessageEventHandler
212
+ : ET extends "open" ? OpenEventHandler
213
+ : ET extends "ping" ? PingEventHandler
214
+ : ET extends "pong" ? PongEventHandler
222
215
  : never;
223
216
 
224
217
  /**