@types/k6 0.47.3 → 0.48.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 +3 -3
- k6/crypto.d.ts +28 -28
- k6/data.d.ts +3 -3
- k6/encoding.d.ts +7 -7
- k6/execution.d.ts +2 -2
- k6/experimental/browser.d.ts +131 -21
- k6/experimental/fs.d.ts +102 -0
- k6/experimental/grpc.d.ts +2 -2
- k6/experimental/redis.d.ts +298 -90
- k6/experimental/tracing.d.ts +3 -3
- k6/experimental/webcrypto.d.ts +1 -1
- k6/experimental/websockets.d.ts +13 -13
- k6/global.d.ts +5 -5
- k6/html.d.ts +99 -99
- k6/http.d.ts +42 -42
- k6/index.d.ts +7 -6
- k6/metrics.d.ts +5 -5
- k6/net/grpc.d.ts +2 -2
- k6/options.d.ts +16 -16
- k6/package.json +8 -3
- k6/ws.d.ts +12 -12
k6/experimental/tracing.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* function calls with tracing information. It also exposes a `Client` class that can be used to
|
|
6
6
|
* instrument HTTP calls in a more fine-grained way.
|
|
7
7
|
*
|
|
8
|
-
* https://
|
|
8
|
+
* https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/tracing/
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { RefinedParams, RefinedResponse, RequestBody, ResponseType } from "../http";
|
|
@@ -30,7 +30,7 @@ export function instrumentHTTP(options: Options): void;
|
|
|
30
30
|
* so that tracing backends (such as Grafana Tempo) can incorporate
|
|
31
31
|
* their results.
|
|
32
32
|
*
|
|
33
|
-
* https://
|
|
33
|
+
* https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/tracing/client/
|
|
34
34
|
*/
|
|
35
35
|
export class Client {
|
|
36
36
|
protected __brand: never;
|
|
@@ -176,7 +176,7 @@ export class Client {
|
|
|
176
176
|
/**
|
|
177
177
|
* The Options object allows configuring the tracing instrumentation behavior.
|
|
178
178
|
*
|
|
179
|
-
* https://
|
|
179
|
+
* https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/tracing/options/
|
|
180
180
|
*/
|
|
181
181
|
export interface Options {
|
|
182
182
|
/**
|
k6/experimental/webcrypto.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* This module provides a subset of the Web Crypto API. It is an interface
|
|
3
3
|
* allowing a k6 script to use cryptographic primitives.
|
|
4
4
|
*
|
|
5
|
-
* https://
|
|
5
|
+
* https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/webcrypto/
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
export const crypto: Crypto;
|
k6/experimental/websockets.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { CookieJar } from "../http";
|
|
|
4
4
|
* This module provides an experimental implementation of the WebSocket API
|
|
5
5
|
* for k6.
|
|
6
6
|
*
|
|
7
|
-
* https://
|
|
7
|
+
* https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -41,7 +41,7 @@ export class WebSocket {
|
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* The Websocket constructor returns a newly created WebSocket object.
|
|
44
|
-
* https://
|
|
44
|
+
* https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/websocket/
|
|
45
45
|
*
|
|
46
46
|
* @param url - The URL to which to connect; this should be the URL to which the WebSocket server will respond.
|
|
47
47
|
* @param protocols - Either a single protocol string or an array of protocol strings. The param is reserved for future use and will be presently ignored.
|
|
@@ -51,7 +51,7 @@ export class WebSocket {
|
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* Enqueues data to be transmitted to the server over the WebSocket connection.
|
|
54
|
-
* https://
|
|
54
|
+
* https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/websocket/websocket-send/
|
|
55
55
|
*
|
|
56
56
|
* @param data - the data to send to the server
|
|
57
57
|
*/
|
|
@@ -60,7 +60,7 @@ export class WebSocket {
|
|
|
60
60
|
/**
|
|
61
61
|
* Bind event names to event handlers to be executed when their
|
|
62
62
|
* respective event is received by the server.
|
|
63
|
-
* https://
|
|
63
|
+
* https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/websocket/websocket-addeventlistener/
|
|
64
64
|
*
|
|
65
65
|
* @param event - the event to listen for
|
|
66
66
|
* @param listener - the callback to invoke when the event is emitted
|
|
@@ -69,7 +69,7 @@ export class WebSocket {
|
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
71
|
* Closes the WebSocket connection or connection attempt, if any.
|
|
72
|
-
* https://
|
|
72
|
+
* https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/websocket/websocket-close/
|
|
73
73
|
*
|
|
74
74
|
* @param code - An integer WebSocket connection close code value indicating a reason for closure.
|
|
75
75
|
* @param reason - A human-readable string WebSocket connection close reason. No longer than 123 bytes of UTF-8 text.
|
|
@@ -78,13 +78,13 @@ export class WebSocket {
|
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
80
|
* Sends a ping message over the WebSocket connection.
|
|
81
|
-
* https://
|
|
81
|
+
* https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/websocket/websocket-ping/
|
|
82
82
|
*/
|
|
83
83
|
ping(): void;
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
86
|
* Sets an event handler which is invoked when a message event happens.
|
|
87
|
-
* https://
|
|
87
|
+
* https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/websocket/websocket-onmessage/
|
|
88
88
|
*
|
|
89
89
|
* @param event - the message event
|
|
90
90
|
*/
|
|
@@ -92,19 +92,19 @@ export class WebSocket {
|
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
94
|
* Sets an event handler which is invoked when the WebSocket connection's opens.
|
|
95
|
-
* https://
|
|
95
|
+
* https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/websocket/websocket-onopen/
|
|
96
96
|
*/
|
|
97
97
|
onopen: () => void;
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
100
|
* Sets an event handler which is invoked when the WebSocket connection's closes.
|
|
101
|
-
* https://
|
|
101
|
+
* https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/websocket/websocket-onclose/
|
|
102
102
|
*/
|
|
103
103
|
onclose: () => void;
|
|
104
104
|
|
|
105
105
|
/**
|
|
106
106
|
* Sets an event handler which is invoked when errors occur.
|
|
107
|
-
* https://
|
|
107
|
+
* https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/websocket/websocket-onerror/
|
|
108
108
|
*
|
|
109
109
|
* @param event - the error event
|
|
110
110
|
*/
|
|
@@ -112,20 +112,20 @@ export class WebSocket {
|
|
|
112
112
|
|
|
113
113
|
/**
|
|
114
114
|
* Sets an event handler which is invoked when a ping message is received.
|
|
115
|
-
* https://
|
|
115
|
+
* https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/websocket/websocket-onping/
|
|
116
116
|
*/
|
|
117
117
|
onping: () => void;
|
|
118
118
|
|
|
119
119
|
/**
|
|
120
120
|
* Sets an event handler which is invoked when a pong message is received.
|
|
121
|
-
* https://
|
|
121
|
+
* https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/websocket/websocket-onpong/
|
|
122
122
|
*/
|
|
123
123
|
onpong: () => void;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
/**
|
|
127
127
|
* k6 specific WebSocket parameters.
|
|
128
|
-
* https://
|
|
128
|
+
* https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/websockets/params/
|
|
129
129
|
*/
|
|
130
130
|
export interface Params {
|
|
131
131
|
/** Request headers. */
|
k6/global.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ declare global {
|
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Opens a file, reading all its contents into memory.
|
|
20
|
-
* https://
|
|
20
|
+
* https://grafana.com/docs/k6/latest/javascript-api/init-context/open/
|
|
21
21
|
* @param filePath - Path to file.
|
|
22
22
|
* @returns File contents decoded as UTF-8.
|
|
23
23
|
* @example
|
|
@@ -35,7 +35,7 @@ declare global {
|
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* Opens a file, reading all its contents into memory.
|
|
38
|
-
* https://
|
|
38
|
+
* https://grafana.com/docs/k6/latest/javascript-api/init-context/open/
|
|
39
39
|
* @param filePath - Path to file.
|
|
40
40
|
* @returns Binary file contents.
|
|
41
41
|
* @example
|
|
@@ -56,7 +56,7 @@ declare global {
|
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
58
|
* Environment variables.
|
|
59
|
-
* https://
|
|
59
|
+
* https://grafana.com/docs/k6/latest/using-k6/environment-variables/
|
|
60
60
|
*/
|
|
61
61
|
const __ENV: { [name: string]: string };
|
|
62
62
|
|
|
@@ -65,13 +65,13 @@ declare global {
|
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
67
|
* Current VU number.
|
|
68
|
-
* https://
|
|
68
|
+
* https://grafana.com/docs/k6/latest/using-k6/execution-context-variables/
|
|
69
69
|
*/
|
|
70
70
|
const __VU: number;
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* Current iteration number.
|
|
74
|
-
* https://
|
|
74
|
+
* https://grafana.com/docs/k6/latest/using-k6/execution-context-variables/
|
|
75
75
|
*/
|
|
76
76
|
const __ITER: number;
|
|
77
77
|
}
|