@types/k6 0.50.0 → 0.51.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/experimental/browser.d.ts +162 -6
- k6/experimental/webcrypto.d.ts +140 -12
- k6/experimental/websockets.d.ts +1 -1
- k6/index.d.ts +0 -1
- k6/net/grpc.d.ts +3 -0
- k6/package.json +2 -2
- k6/experimental/grpc.d.ts +0 -205
k6/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for k6 (https://grafana.com/docs/k6/lates
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/k6.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated: Mon,
|
|
11
|
+
* Last updated: Mon, 13 May 2024 13:35:56 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
|
|
14
14
|
# Credits
|
k6/experimental/browser.d.ts
CHANGED
|
@@ -643,6 +643,11 @@ export interface Browser {
|
|
|
643
643
|
options?: NewBrowserContextOptions,
|
|
644
644
|
): Page;
|
|
645
645
|
|
|
646
|
+
/**
|
|
647
|
+
* Returns the browser application's user agent.
|
|
648
|
+
*/
|
|
649
|
+
userAgent(): string;
|
|
650
|
+
|
|
646
651
|
/**
|
|
647
652
|
* Returns the browser application's version.
|
|
648
653
|
*/
|
|
@@ -1045,12 +1050,163 @@ export interface ElementHandle extends JSHandle {
|
|
|
1045
1050
|
*/
|
|
1046
1051
|
boundingBox(): Rect;
|
|
1047
1052
|
|
|
1053
|
+
/**
|
|
1054
|
+
* Checks the checkbox element.
|
|
1055
|
+
* @param options The options to use.
|
|
1056
|
+
*/
|
|
1057
|
+
check(options?: ElementClickOptions & StrictnessOptions): void;
|
|
1058
|
+
|
|
1059
|
+
/**
|
|
1060
|
+
* Clicks the element.
|
|
1061
|
+
* @param options The options to use.
|
|
1062
|
+
* @returns A promise that resolves when the element is clicked.
|
|
1063
|
+
*/
|
|
1064
|
+
click(
|
|
1065
|
+
options?: {
|
|
1066
|
+
/**
|
|
1067
|
+
* The mouse button (`left`, `middle` or `right`) to use during the action.
|
|
1068
|
+
* Defaults to `left`.
|
|
1069
|
+
*/
|
|
1070
|
+
button?: MouseButton;
|
|
1071
|
+
|
|
1072
|
+
/**
|
|
1073
|
+
* The number of times the action is performed. Defaults to `1`.
|
|
1074
|
+
*/
|
|
1075
|
+
clickCount?: number;
|
|
1076
|
+
|
|
1077
|
+
/**
|
|
1078
|
+
* Milliseconds to wait between `mousedown` and `mouseup`. Defaults to `0`.
|
|
1079
|
+
*/
|
|
1080
|
+
delay?: number;
|
|
1081
|
+
|
|
1082
|
+
/**
|
|
1083
|
+
* Setting this to `true` will bypass the actionability checks (`visible`,
|
|
1084
|
+
* `stable`, `enabled`). Defaults to `false`.
|
|
1085
|
+
*/
|
|
1086
|
+
force?: boolean;
|
|
1087
|
+
|
|
1088
|
+
/**
|
|
1089
|
+
* `Alt`, `Control`, `Meta` or `Shift` modifiers keys pressed during the
|
|
1090
|
+
* action. If not specified, currently pressed modifiers are used,
|
|
1091
|
+
* otherwise defaults to `null`.
|
|
1092
|
+
*/
|
|
1093
|
+
modifiers?: KeyboardModifier[];
|
|
1094
|
+
|
|
1095
|
+
/**
|
|
1096
|
+
* If set to `true` and a navigation occurs from performing this action, it
|
|
1097
|
+
* will not wait for it to complete. Defaults to `false`.
|
|
1098
|
+
*/
|
|
1099
|
+
noWaitAfter?: boolean;
|
|
1100
|
+
|
|
1101
|
+
/**
|
|
1102
|
+
* A point to use relative to the top left corner of the element. If not
|
|
1103
|
+
* supplied, a visible point of the element is used.
|
|
1104
|
+
*/
|
|
1105
|
+
position?: {
|
|
1106
|
+
x: number;
|
|
1107
|
+
|
|
1108
|
+
y: number;
|
|
1109
|
+
};
|
|
1110
|
+
|
|
1111
|
+
/**
|
|
1112
|
+
* Maximum time in milliseconds. Defaults to `30` seconds. Default is
|
|
1113
|
+
* overridden by the `setDefaultTimeout` option on `BrowserContext` or
|
|
1114
|
+
* `page` methods.
|
|
1115
|
+
*
|
|
1116
|
+
* Setting the value to `0` will disable the timeout.
|
|
1117
|
+
*/
|
|
1118
|
+
timeout?: number;
|
|
1119
|
+
|
|
1120
|
+
/**
|
|
1121
|
+
* Setting this to `true` will perform the actionability checks without
|
|
1122
|
+
* performing the action. Useful to wait until the element is ready for the
|
|
1123
|
+
* action without performing it. Defaults to `false`.
|
|
1124
|
+
*/
|
|
1125
|
+
trial?: boolean;
|
|
1126
|
+
},
|
|
1127
|
+
): Promise<void>;
|
|
1128
|
+
|
|
1048
1129
|
/**
|
|
1049
1130
|
* Get the content frame for element handles.
|
|
1050
1131
|
* @returns The content frame handle of the element handle.
|
|
1051
1132
|
*/
|
|
1052
1133
|
contentFrame(): Frame;
|
|
1053
1134
|
|
|
1135
|
+
/**
|
|
1136
|
+
* Double clicks the element.
|
|
1137
|
+
* @param options The options to use.
|
|
1138
|
+
*/
|
|
1139
|
+
dblclick(
|
|
1140
|
+
options?: {
|
|
1141
|
+
/**
|
|
1142
|
+
* The mouse button (`left`, `middle` or `right`) to use during the action.
|
|
1143
|
+
* Defaults to `left`.
|
|
1144
|
+
*/
|
|
1145
|
+
button?: MouseButton;
|
|
1146
|
+
|
|
1147
|
+
/**
|
|
1148
|
+
* Milliseconds to wait between `mousedown` and `mouseup`. Defaults to `0`.
|
|
1149
|
+
*/
|
|
1150
|
+
delay?: number;
|
|
1151
|
+
|
|
1152
|
+
/**
|
|
1153
|
+
* Setting this to `true` will bypass the actionability checks (`visible`,
|
|
1154
|
+
* `stable`, `enabled`). Defaults to `false`.
|
|
1155
|
+
*/
|
|
1156
|
+
force?: boolean;
|
|
1157
|
+
|
|
1158
|
+
/**
|
|
1159
|
+
* `Alt`, `Control`, `Meta` or `Shift` modifiers keys pressed during the
|
|
1160
|
+
* action. If not specified, currently pressed modifiers are used,
|
|
1161
|
+
* otherwise defaults to `null`.
|
|
1162
|
+
*/
|
|
1163
|
+
modifiers?: KeyboardModifier[];
|
|
1164
|
+
|
|
1165
|
+
/**
|
|
1166
|
+
* If set to `true` and a navigation occurs from performing this action, it
|
|
1167
|
+
* will not wait for it to complete. Defaults to `false`.
|
|
1168
|
+
*/
|
|
1169
|
+
noWaitAfter?: boolean;
|
|
1170
|
+
|
|
1171
|
+
/**
|
|
1172
|
+
* A point to use relative to the top left corner of the element. If not
|
|
1173
|
+
* supplied, a visible point of the element is used.
|
|
1174
|
+
*/
|
|
1175
|
+
position?: {
|
|
1176
|
+
x: number;
|
|
1177
|
+
|
|
1178
|
+
y: number;
|
|
1179
|
+
};
|
|
1180
|
+
|
|
1181
|
+
/**
|
|
1182
|
+
* Maximum time in milliseconds. Defaults to `30` seconds. Default is
|
|
1183
|
+
* overridden by the `setDefaultTimeout` option on `BrowserContext` or
|
|
1184
|
+
* `page` methods.
|
|
1185
|
+
*
|
|
1186
|
+
* Setting the value to `0` will disable the timeout.
|
|
1187
|
+
*/
|
|
1188
|
+
timeout?: number;
|
|
1189
|
+
|
|
1190
|
+
/**
|
|
1191
|
+
* Setting this to `true` will perform the actionability checks without
|
|
1192
|
+
* performing the action. Useful to wait until the element is ready for the
|
|
1193
|
+
* action without performing it. Defaults to `false`.
|
|
1194
|
+
*/
|
|
1195
|
+
trial?: boolean;
|
|
1196
|
+
},
|
|
1197
|
+
): void;
|
|
1198
|
+
|
|
1199
|
+
/**
|
|
1200
|
+
* Dispatches a DOM event to the element.
|
|
1201
|
+
* @param type DOM event type: `"click"` etc.
|
|
1202
|
+
* @param eventInit Optional event-specific initialization properties.
|
|
1203
|
+
* @param options
|
|
1204
|
+
*/
|
|
1205
|
+
dispatchEvent(
|
|
1206
|
+
type: string,
|
|
1207
|
+
eventInit?: EvaluationArgument,
|
|
1208
|
+
): void;
|
|
1209
|
+
|
|
1054
1210
|
/**
|
|
1055
1211
|
* Fill the `input` or `textarea` element with the provided `value`.
|
|
1056
1212
|
* @param value Value to fill for the `input` or `textarea` element.
|
|
@@ -1207,7 +1363,7 @@ export interface ElementHandle extends JSHandle {
|
|
|
1207
1363
|
* or at the specified position.
|
|
1208
1364
|
* @param options Tap options.
|
|
1209
1365
|
*/
|
|
1210
|
-
tap(options?: MouseMoveOptions): void
|
|
1366
|
+
tap(options?: MouseMoveOptions): Promise<void>;
|
|
1211
1367
|
|
|
1212
1368
|
/**
|
|
1213
1369
|
* Returns the `node.textContent`.
|
|
@@ -1321,7 +1477,7 @@ export interface Frame {
|
|
|
1321
1477
|
* @param selector The selector to use.
|
|
1322
1478
|
* @param options The options to use.
|
|
1323
1479
|
*/
|
|
1324
|
-
tap(selector: string, options?: ElementClickOptions & KeyboardModifierOptions & StrictnessOptions): void
|
|
1480
|
+
tap(selector: string, options?: ElementClickOptions & KeyboardModifierOptions & StrictnessOptions): Promise<void>;
|
|
1325
1481
|
|
|
1326
1482
|
/**
|
|
1327
1483
|
* Press the given key for the first element found that matches the selector.
|
|
@@ -1660,7 +1816,7 @@ export interface JSHandle<T = any> {
|
|
|
1660
1816
|
evaluateHandle<R, Arg>(pageFunction: PageFunction<Arg, R>, arg?: Arg): JSHandle<R>;
|
|
1661
1817
|
|
|
1662
1818
|
/**
|
|
1663
|
-
*
|
|
1819
|
+
* Fetches a map with own property names of of the `JSHandle` with their values as
|
|
1664
1820
|
* `JSHandle` instances.
|
|
1665
1821
|
* @returns A map with property names as keys and `JSHandle` instances for the property values.
|
|
1666
1822
|
*/
|
|
@@ -1893,7 +2049,7 @@ export interface Locator {
|
|
|
1893
2049
|
* Tap on the chosen element.
|
|
1894
2050
|
* @param options Options to use.
|
|
1895
2051
|
*/
|
|
1896
|
-
tap(options?: MouseMoveOptions): void
|
|
2052
|
+
tap(options?: MouseMoveOptions): Promise<void>;
|
|
1897
2053
|
|
|
1898
2054
|
/**
|
|
1899
2055
|
* Dispatches HTML DOM event types e.g. `click`.
|
|
@@ -3129,7 +3285,7 @@ export interface Page {
|
|
|
3129
3285
|
*/
|
|
3130
3286
|
trial?: boolean;
|
|
3131
3287
|
},
|
|
3132
|
-
): void
|
|
3288
|
+
): Promise<void>;
|
|
3133
3289
|
|
|
3134
3290
|
/**
|
|
3135
3291
|
* **NOTE** Use locator-based locator.textContent([options]) instead.
|
|
@@ -3737,7 +3893,7 @@ export interface Touchscreen {
|
|
|
3737
3893
|
* @param x The x position.
|
|
3738
3894
|
* @param y The y position.
|
|
3739
3895
|
*/
|
|
3740
|
-
tap(x: number, y: number): void
|
|
3896
|
+
tap(x: number, y: number): Promise<void>;
|
|
3741
3897
|
}
|
|
3742
3898
|
|
|
3743
3899
|
/**
|
k6/experimental/webcrypto.d.ts
CHANGED
|
@@ -91,24 +91,23 @@ export interface SubtleCrypto {
|
|
|
91
91
|
*
|
|
92
92
|
* To export a key, the key must have `CryptoKey.extractable` set to `true`.
|
|
93
93
|
*
|
|
94
|
-
* @param format the format in which to export the key.
|
|
94
|
+
* @param format the format in which to export the key.
|
|
95
95
|
* @param key the key to export.
|
|
96
96
|
* @throws {InvalidAccessError} - if the key is not extractable.
|
|
97
97
|
* @throws {NotSupportedError} - if the format is not supported.
|
|
98
98
|
* @throws {TypeError} - when trying to use an invalid format.
|
|
99
99
|
* @returns A promise that resolves with the exported key.
|
|
100
100
|
*/
|
|
101
|
-
exportKey(format: "raw" | "jwk", key: CryptoKey): Promise<ArrayBuffer | JWK>;
|
|
101
|
+
exportKey(format: "raw" | "jwk" | "spki" | "pkcs8", key: CryptoKey): Promise<ArrayBuffer | JWK>;
|
|
102
102
|
|
|
103
103
|
/**
|
|
104
|
-
* Use the `generateKey()` method to generate a new key
|
|
105
|
-
* algorithms) or key pair (for public-key algorithms).
|
|
104
|
+
* Use the `generateKey()` method to generate a new key.
|
|
106
105
|
*
|
|
107
106
|
* @param algorithm defines the type of key to generate and providing extra algorithm-specific parameters.
|
|
108
107
|
* @param extractable indicates whether it will be possible to export the key using `SubtleCrypto.exportKey()` or `SubtleCrypto.wrapKey`.
|
|
109
108
|
* @param keyUsages indicates what can be done with the newly generated key.
|
|
110
109
|
* @throws {SyntaxError} - if the result is a `CryptoKey` of type `secret` or `private` but `keyUsages is empty.
|
|
111
|
-
* @returns A promise that resolves with the newly generated `CryptoKey
|
|
110
|
+
* @returns A promise that resolves with the newly generated `CryptoKey`.
|
|
112
111
|
*/
|
|
113
112
|
generateKey(
|
|
114
113
|
algorithm: AesKeyGenParams | HmacKeyGenParams,
|
|
@@ -116,12 +115,27 @@ export interface SubtleCrypto {
|
|
|
116
115
|
keyUsages: Array<"encrypt" | "decrypt" | "sign" | "verify">,
|
|
117
116
|
): Promise<CryptoKey>;
|
|
118
117
|
|
|
118
|
+
/**
|
|
119
|
+
* Use the `generateKey()` method to generate a new key pair for asymmetric algorithms.
|
|
120
|
+
*
|
|
121
|
+
* @param algorithm defines the type of key to generate and providing extra algorithm-specific parameters.
|
|
122
|
+
* @param extractable indicates whether it will be possible to export the key using `SubtleCrypto.exportKey()` or `SubtleCrypto.wrapKey`.
|
|
123
|
+
* @param keyUsages indicates what can be done with the newly generated key.
|
|
124
|
+
* @throws {SyntaxError} - if the result is a `CryptoKey` of type `secret` or `private` but `keyUsages is empty.
|
|
125
|
+
* @returns A promise that resolves with the newly generated CryptoKeyPair`.
|
|
126
|
+
*/
|
|
127
|
+
generateKey(
|
|
128
|
+
algorithm: EcKeyGenParams,
|
|
129
|
+
extractable: boolean,
|
|
130
|
+
keyUsages: Array<"sign" | "verify" | "deriveKey" | "deriveBits">,
|
|
131
|
+
): Promise<CryptoKeyPair>;
|
|
132
|
+
|
|
119
133
|
/**
|
|
120
134
|
* The `importKey()` method imports a key into a `CryptoKey` object.
|
|
121
135
|
* It takes as input a key in an external, portable format and gives you
|
|
122
136
|
* a `CryptoKey` object that can be used in the Web Crypto API.
|
|
123
137
|
*
|
|
124
|
-
* @param format the format of the key to import.
|
|
138
|
+
* @param format the format of the key to import.
|
|
125
139
|
* @param keyData the key data to import.
|
|
126
140
|
* @param algorithm defines the algorithm to use and any extra-parameters.
|
|
127
141
|
* @param extractable indicates whether it will be possible to export the key using `SubtleCrypto.exportKey()` or `SubtleCrypto.wrapKey`.
|
|
@@ -131,11 +145,17 @@ export interface SubtleCrypto {
|
|
|
131
145
|
* @returns A promise that resolves with the imported `CryptoKey`.
|
|
132
146
|
*/
|
|
133
147
|
importKey(
|
|
134
|
-
format: "raw" | "jwk",
|
|
148
|
+
format: "raw" | "jwk" | "spki" | "pkcs8",
|
|
135
149
|
keyData: ArrayBuffer | ArrayBufferView | DataView | JWK,
|
|
136
|
-
algorithm:
|
|
150
|
+
algorithm:
|
|
151
|
+
| "AES-CBC"
|
|
152
|
+
| "AES-CTR"
|
|
153
|
+
| "AES-GCM"
|
|
154
|
+
| Algorithm<"AES-CBC" | "AES-CTR" | "AES-GCM">
|
|
155
|
+
| HmacImportParams
|
|
156
|
+
| EcKeyImportParams,
|
|
137
157
|
extractable: boolean,
|
|
138
|
-
keyUsages: Array<"encrypt" | "decrypt" | "sign" | "verify">,
|
|
158
|
+
keyUsages: Array<"encrypt" | "decrypt" | "sign" | "verify" | "deriveKey" | "deriveBits">,
|
|
139
159
|
): Promise<CryptoKey>;
|
|
140
160
|
|
|
141
161
|
/**
|
|
@@ -151,7 +171,7 @@ export interface SubtleCrypto {
|
|
|
151
171
|
* @returns A promise that resolves with the signature.
|
|
152
172
|
*/
|
|
153
173
|
sign(
|
|
154
|
-
algorithm: "HMAC" | Algorithm<"HMAC"
|
|
174
|
+
algorithm: "HMAC" | Algorithm<"HMAC"> | EcdsaParams,
|
|
155
175
|
key: CryptoKey,
|
|
156
176
|
data: ArrayBuffer | ArrayBufferView | DataView,
|
|
157
177
|
): Promise<ArrayBuffer>;
|
|
@@ -167,11 +187,24 @@ export interface SubtleCrypto {
|
|
|
167
187
|
* @returns A promise that resolves with a boolean indicating whether the signature is valid.
|
|
168
188
|
*/
|
|
169
189
|
verify(
|
|
170
|
-
algorithm: "HMAC" | Algorithm<"HMAC"
|
|
190
|
+
algorithm: "HMAC" | Algorithm<"HMAC"> | EcdsaParams,
|
|
171
191
|
key: CryptoKey,
|
|
172
192
|
signature: ArrayBuffer | ArrayBufferView | DataView,
|
|
173
193
|
data: ArrayBuffer | ArrayBufferView | DataView,
|
|
174
194
|
): Promise<boolean>;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* The `deriveBits()` method derives an array of bits from a base key.
|
|
198
|
+
*
|
|
199
|
+
* @param algorithm defines the derivation algorithm to use.
|
|
200
|
+
* @param baseKey A `CryptoKey` representing the input to the derivation algorithm. Currently, only an ECDH private key is possible.
|
|
201
|
+
* @param length A number representing the number of bits to derive. Currently, the number should be a multiple of 8.
|
|
202
|
+
*/
|
|
203
|
+
deriveBits(
|
|
204
|
+
algorithm: EcdhKeyDeriveParams,
|
|
205
|
+
baseKey: CryptoKey,
|
|
206
|
+
length?: number,
|
|
207
|
+
): Promise<ArrayBuffer>;
|
|
175
208
|
}
|
|
176
209
|
|
|
177
210
|
export interface CryptoKey {
|
|
@@ -196,7 +229,27 @@ export interface CryptoKey {
|
|
|
196
229
|
/**
|
|
197
230
|
* An array of strings, indicating what can be done with the key.
|
|
198
231
|
*/
|
|
199
|
-
readonly usages: Array<"encrypt" | "decrypt" | "sign" | "verify">;
|
|
232
|
+
readonly usages: Array<"encrypt" | "decrypt" | "sign" | "verify" | "deriveKey" | "deriveBits">;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* The `CryptoKeyPair` dictionary represents a key pair
|
|
237
|
+
* for an asymmetric cryptography algorithm,
|
|
238
|
+
* also known as a public-key algorithm.
|
|
239
|
+
*/
|
|
240
|
+
export interface CryptoKeyPair {
|
|
241
|
+
/**
|
|
242
|
+
* A `CryptoKey` object representing the private key.
|
|
243
|
+
* For encryption and decryption algorithms, this key is used to decrypt.
|
|
244
|
+
* For signing and verification algorithms it is used to sign.
|
|
245
|
+
*/
|
|
246
|
+
readonly privateKey: CryptoKey;
|
|
247
|
+
/**
|
|
248
|
+
* A CryptoKey object representing the public key.
|
|
249
|
+
* For encryption and decryption algorithms, this key is used to encrypt.
|
|
250
|
+
* For signing and verification algorithms it is used to verify signatures.
|
|
251
|
+
*/
|
|
252
|
+
readonly publicKey: CryptoKey;
|
|
200
253
|
}
|
|
201
254
|
|
|
202
255
|
/**
|
|
@@ -353,6 +406,26 @@ export interface HmacKeyGenParams extends Algorithm<AlgorithmIdentifier> {
|
|
|
353
406
|
length?: number;
|
|
354
407
|
}
|
|
355
408
|
|
|
409
|
+
/**
|
|
410
|
+
* The EcKeyGenParams dictionary of the Web Crypto API represents the
|
|
411
|
+
* object that should be passed as the algorithm parameter into
|
|
412
|
+
* `SubtleCrypto.generateKey()`, when generating
|
|
413
|
+
* any elliptic-curve-based key pair:
|
|
414
|
+
* that is, when the algorithm is identified as either of ECDSA or ECDH.
|
|
415
|
+
*/
|
|
416
|
+
export interface EcKeyGenParams extends Algorithm<AlgorithmIdentifier> {
|
|
417
|
+
/**
|
|
418
|
+
* The name of the algorithm to use.
|
|
419
|
+
*/
|
|
420
|
+
name: "ECDSA" | "ECDH";
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* The name of the elliptic curve to use.
|
|
424
|
+
* This may be any of the following names for NIST-approved curves.
|
|
425
|
+
*/
|
|
426
|
+
namedCurve: "P-256" | "P-384" | "P-521";
|
|
427
|
+
}
|
|
428
|
+
|
|
356
429
|
/**
|
|
357
430
|
* The `HmacImportParams` dictionary of the Web Crypto API represents the
|
|
358
431
|
* object that should be passed as the `algorithm` parameter of the
|
|
@@ -378,6 +451,61 @@ export interface HmacImportParams extends Algorithm<AlgorithmIdentifier> {
|
|
|
378
451
|
length?: number;
|
|
379
452
|
}
|
|
380
453
|
|
|
454
|
+
/**
|
|
455
|
+
* The `EcKeyImportParams` dictionary of the Web Crypto API represents
|
|
456
|
+
* the object that should be passed as the algorithm parameter
|
|
457
|
+
* into SubtleCrypto.importKey() or SubtleCrypto.unwrapKey(),
|
|
458
|
+
* when generating any elliptic-curve-based key pair:
|
|
459
|
+
* that is, when the algorithm is identified as either of ECDSA or ECDH.
|
|
460
|
+
*/
|
|
461
|
+
export interface EcKeyImportParams extends Algorithm<AlgorithmIdentifier> {
|
|
462
|
+
/**
|
|
463
|
+
* The name of the algorithm to use.
|
|
464
|
+
*/
|
|
465
|
+
name: "ECDSA" | "ECDH";
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* The name of the elliptic curve to use.
|
|
469
|
+
* This may be any of the following names for NIST-approved curves.
|
|
470
|
+
*/
|
|
471
|
+
namedCurve: "P-256" | "P-384" | "P-521";
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* The `EcdsaParams` dictionary of the Web Crypto API represents
|
|
476
|
+
* the object that should be passed as the algorithm parameter
|
|
477
|
+
* into SubtleCrypto.sign() or SubtleCrypto.verify()
|
|
478
|
+
* when using the ECDSA algorithm.
|
|
479
|
+
*/
|
|
480
|
+
export interface EcdsaParams extends Algorithm<AlgorithmIdentifier> {
|
|
481
|
+
/**
|
|
482
|
+
* The name of the algorithm to use.
|
|
483
|
+
*/
|
|
484
|
+
name: "ECDSA";
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* An identifier for the digest algorithm to use.
|
|
488
|
+
*/
|
|
489
|
+
hash: "SHA-1" | "SHA-256" | "SHA-384" | "SHA-512";
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* The `EcdhKeyDeriveParams` dictionary of the Web Crypto API represents
|
|
494
|
+
* the object that should be passed as the algorithm parameter
|
|
495
|
+
* into `SubtleCrypto.deriveKey()`, when using the ECDH algorithm.
|
|
496
|
+
*/
|
|
497
|
+
export interface EcdhKeyDeriveParams extends Algorithm<AlgorithmIdentifier> {
|
|
498
|
+
/**
|
|
499
|
+
* The name of the algorithm to use. Only the "ECDH" value is possible.
|
|
500
|
+
*/
|
|
501
|
+
name: "ECDH";
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* A `CryptoKey` object representing the public key of the other entity.
|
|
505
|
+
*/
|
|
506
|
+
public: CryptoKey;
|
|
507
|
+
}
|
|
508
|
+
|
|
381
509
|
/**
|
|
382
510
|
* The TypedArray interface represents an array-like view of an underlying
|
|
383
511
|
* binary data buffer. It is used to represent a generic, fixed-length
|
k6/experimental/websockets.d.ts
CHANGED
k6/index.d.ts
CHANGED
k6/net/grpc.d.ts
CHANGED
|
@@ -121,6 +121,9 @@ declare namespace grpc {
|
|
|
121
121
|
/** Invokes an unary RPC request. */
|
|
122
122
|
invoke(url: string, request: object, params?: Params): Response;
|
|
123
123
|
|
|
124
|
+
/** Asynchronously invokes an unary RPC request. */
|
|
125
|
+
asyncInvoke(url: string, request: object, params?: Params): Promise<Response>;
|
|
126
|
+
|
|
124
127
|
/** Close the connection. */
|
|
125
128
|
close(): void;
|
|
126
129
|
}
|
k6/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/k6",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.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": "fd17fedc4161ea6cdb1d78db41100cc597d5c251769b71a824af1faaabbe4ff1",
|
|
64
64
|
"typeScriptVersion": "4.7"
|
|
65
65
|
}
|
k6/experimental/grpc.d.ts
DELETED
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
// === Response ===
|
|
2
|
-
// ----------------
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* gRPC response.
|
|
6
|
-
*/
|
|
7
|
-
export interface Response {
|
|
8
|
-
status: number;
|
|
9
|
-
|
|
10
|
-
message: object;
|
|
11
|
-
|
|
12
|
-
headers: object;
|
|
13
|
-
|
|
14
|
-
trailers: object;
|
|
15
|
-
|
|
16
|
-
error: object;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface ConnectParams {
|
|
20
|
-
/**
|
|
21
|
-
* If `true` will connect to the gRPC server using plaintext i.e. insecure.
|
|
22
|
-
*/
|
|
23
|
-
plaintext?: boolean;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* If `true` connection will try to use the gRPC server reflection protocol.
|
|
27
|
-
* https://github.com/grpc/grpc/blob/master/doc/server-reflection.md
|
|
28
|
-
*/
|
|
29
|
-
reflect?: boolean;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Metadata to send with reflection request.
|
|
33
|
-
*/
|
|
34
|
-
reflectMetadata?: object;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Connection timeout to use.
|
|
38
|
-
*/
|
|
39
|
-
timeout?: string | number;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Maximum message size in bytes the client can receive.
|
|
43
|
-
*/
|
|
44
|
-
maxReceiveSize?: number;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Maximum message size in bytes the client can send.
|
|
48
|
-
*/
|
|
49
|
-
maxSendSize?: number;
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* TLS settings of the connection.
|
|
53
|
-
*/
|
|
54
|
-
tls?: TLSParams;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface TLSParams {
|
|
58
|
-
/**
|
|
59
|
-
* PEM formatted client certificate.
|
|
60
|
-
*/
|
|
61
|
-
cert: string;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* PEM formatted client private key.
|
|
65
|
-
*/
|
|
66
|
-
key: string;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Password for decrypting the client's private key.
|
|
70
|
-
*/
|
|
71
|
-
password?: string;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* PEM formatted string/strings of the certificate authorities.
|
|
75
|
-
*/
|
|
76
|
-
cacerts?: string | string[];
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export interface Params {
|
|
80
|
-
/**
|
|
81
|
-
* @deprecated Use metadata instead.
|
|
82
|
-
*/
|
|
83
|
-
headers?: object;
|
|
84
|
-
|
|
85
|
-
metadata?: object;
|
|
86
|
-
|
|
87
|
-
tags?: object;
|
|
88
|
-
|
|
89
|
-
timeout?: string | number;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export interface GrpcError {
|
|
93
|
-
code: number;
|
|
94
|
-
details: string[] | object[];
|
|
95
|
-
message: string;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* This module provides classes for Remote Procedure Calls over HTTP/2.
|
|
100
|
-
* https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/grpc/
|
|
101
|
-
*
|
|
102
|
-
* @deprecated Use the `k6/net/grpc` module instead.
|
|
103
|
-
*/
|
|
104
|
-
declare namespace grpc {
|
|
105
|
-
/**
|
|
106
|
-
* gRPC client to interact with a gRPC server.
|
|
107
|
-
* https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/grpc/client/
|
|
108
|
-
*
|
|
109
|
-
* @deprecated Use the `k6/net/grpc` module instead.
|
|
110
|
-
*/
|
|
111
|
-
class Client {
|
|
112
|
-
protected __brand: never;
|
|
113
|
-
|
|
114
|
-
constructor();
|
|
115
|
-
|
|
116
|
-
/** Opens a connection to a gRPC server. */
|
|
117
|
-
connect(address: string, params?: ConnectParams): void;
|
|
118
|
-
|
|
119
|
-
/** Loads and parses the protocol buffer descriptors. */
|
|
120
|
-
load(importPaths: string[], ...protoFiles: string[]): void;
|
|
121
|
-
|
|
122
|
-
/** Loads a protoset and parses the protocol buffer descriptors */
|
|
123
|
-
loadProtoset(protosetPath: string): void;
|
|
124
|
-
|
|
125
|
-
/** Invokes an unary RPC request. */
|
|
126
|
-
invoke(url: string, request: object, params?: Params): Response;
|
|
127
|
-
|
|
128
|
-
/** Close the connection. */
|
|
129
|
-
close(): void;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* StreamEvent describes the possible events that can be emitted
|
|
134
|
-
* by a gRPC stream.
|
|
135
|
-
*/
|
|
136
|
-
type StreamEvent =
|
|
137
|
-
/**
|
|
138
|
-
* Event fired when data has been received from the server.
|
|
139
|
-
*/
|
|
140
|
-
| "data"
|
|
141
|
-
/**
|
|
142
|
-
* Event fired when a stream has been closed due to an error.
|
|
143
|
-
*/
|
|
144
|
-
| "error"
|
|
145
|
-
/**
|
|
146
|
-
* Event fired when the stream closes.
|
|
147
|
-
*/
|
|
148
|
-
| "end";
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Stream allows you to use streaming RPCs.
|
|
152
|
-
*
|
|
153
|
-
* @deprecated Use the `k6/net/grpc` module instead.
|
|
154
|
-
*/
|
|
155
|
-
class Stream {
|
|
156
|
-
/**
|
|
157
|
-
* The gRPC stream constructor, representing a single gRPC stream.
|
|
158
|
-
*
|
|
159
|
-
* @param client - the gRPC client to use, it must be connected.
|
|
160
|
-
* @param url - the RPC method to call.
|
|
161
|
-
* @param params - the parameters to use for the RPC call.
|
|
162
|
-
*/
|
|
163
|
-
constructor(client: Client, url: string, params?: Params);
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Set up handler functions for various events on the gRPC stream.
|
|
167
|
-
*
|
|
168
|
-
* @param event - the event to listen for
|
|
169
|
-
* @param listener - the callback to invoke when the event is emitted
|
|
170
|
-
*/
|
|
171
|
-
on(event: StreamEvent, listener: (data: object | GrpcError | undefined) => void): void;
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Writes a request to the stream.
|
|
175
|
-
*
|
|
176
|
-
* @param request - the request (message) to send to the server
|
|
177
|
-
*/
|
|
178
|
-
write(request: object): void;
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Signals to the server that the client has finished sending messages.
|
|
182
|
-
*/
|
|
183
|
-
end(): void;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
const StatusOK: number;
|
|
187
|
-
const StatusCanceled: number;
|
|
188
|
-
const StatusUnknown: number;
|
|
189
|
-
const StatusInvalidArgument: number;
|
|
190
|
-
const StatusDeadlineExceeded: number;
|
|
191
|
-
const StatusNotFound: number;
|
|
192
|
-
const StatusAlreadyExists: number;
|
|
193
|
-
const StatusPermissionDenied: number;
|
|
194
|
-
const StatusResourceExhausted: number;
|
|
195
|
-
const StatusFailedPrecondition: number;
|
|
196
|
-
const StatusAborted: number;
|
|
197
|
-
const StatusOutOfRange: number;
|
|
198
|
-
const StatusUnimplemented: number;
|
|
199
|
-
const StatusInternal: number;
|
|
200
|
-
const StatusUnavailable: number;
|
|
201
|
-
const StatusDataLoss: number;
|
|
202
|
-
const StatusUnauthenticated: number;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
export default grpc;
|