@types/k6 0.46.3 → 0.47.1
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 -2
- k6/experimental/browser.d.ts +201 -35
- k6/experimental/grpc.d.ts +5 -0
- k6/index.d.ts +0 -14
- k6/net/grpc.d.ts +5 -0
- k6/package.json +20 -20
k6/README.md
CHANGED
|
@@ -8,9 +8,8 @@ This package contains type definitions for k6 (https://k6.io/docs/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/k6.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Wed, 18 Oct 2023 05:47:07 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
|
-
* Global values: none
|
|
14
13
|
|
|
15
14
|
# Credits
|
|
16
15
|
These definitions were written by [Mihail Stoykov](https://github.com/MStoykov), [Ivan](https://github.com/codebien), [Théo Crevon](https://github.com/oleiade), [Oleg Bespalov](https://github.com/olegbespalov), [Pepe Cano](https://github.com/ppcano), [Nicole van der Hoeven](https://github.com/nicolevanderhoeven), [Ankur Agarwal](https://github.com/ankur22), [İnanç Gümüş](https://github.com/inancgumus), and [Daniel Jiménez](https://github.com/ka3de).
|
k6/experimental/browser.d.ts
CHANGED
|
@@ -603,47 +603,52 @@ export interface BrowserContext {
|
|
|
603
603
|
browser(): Browser;
|
|
604
604
|
|
|
605
605
|
/**
|
|
606
|
-
* Adds cookies into
|
|
606
|
+
* Adds {@link Cookie | cookies} into this {@link BrowserContext}.
|
|
607
|
+
*
|
|
608
|
+
* @param cookies The {@link Cookie | cookies} to add to this {@link BrowserContext}.
|
|
609
|
+
* @example
|
|
610
|
+
* ```js
|
|
611
|
+
* context.addCookies([
|
|
612
|
+
* { name: 'foo', value: 'foovalue', sameSite: 'Lax', url: 'https://k6.io' },
|
|
613
|
+
* { name: 'bar', value: 'barvalue', sameSite: 'Strict', domain: 'test.k6.io', path: '/bar' },
|
|
614
|
+
* ]);
|
|
615
|
+
* ```
|
|
607
616
|
*/
|
|
608
|
-
addCookies(
|
|
609
|
-
cookies: Array<{
|
|
610
|
-
name: string;
|
|
611
|
-
|
|
612
|
-
value: string;
|
|
613
|
-
|
|
614
|
-
/**
|
|
615
|
-
* either url or domain / path are required.
|
|
616
|
-
*/
|
|
617
|
-
url?: string;
|
|
618
|
-
|
|
619
|
-
/**
|
|
620
|
-
* either url or domain / path are required.
|
|
621
|
-
*/
|
|
622
|
-
domain?: string;
|
|
623
|
-
|
|
624
|
-
/**
|
|
625
|
-
* either url or domain / path are required.
|
|
626
|
-
*/
|
|
627
|
-
path?: string;
|
|
628
|
-
|
|
629
|
-
/**
|
|
630
|
-
* Unix time in seconds.
|
|
631
|
-
*/
|
|
632
|
-
expires?: number;
|
|
633
|
-
|
|
634
|
-
httpOnly?: boolean;
|
|
635
|
-
|
|
636
|
-
secure?: boolean;
|
|
637
|
-
|
|
638
|
-
sameSite?: "Strict" | "Lax" | "None";
|
|
639
|
-
}>,
|
|
640
|
-
): void;
|
|
617
|
+
addCookies(cookies: Cookie[]): void;
|
|
641
618
|
|
|
642
619
|
/**
|
|
643
|
-
*
|
|
620
|
+
* Clears the {@link Cookie | cookies} in this {@link BrowserContext}.
|
|
621
|
+
*
|
|
622
|
+
* @example
|
|
623
|
+
* ```js
|
|
624
|
+
* context.addCookies([{ name: 'foo', value: 'bar', url: 'https://k6.io' }]);
|
|
625
|
+
* context.cookies().length; // 1
|
|
626
|
+
* context.clearCookies();
|
|
627
|
+
* context.cookies().length; // 0
|
|
628
|
+
* ```
|
|
644
629
|
*/
|
|
645
630
|
clearCookies(): void;
|
|
646
631
|
|
|
632
|
+
/**
|
|
633
|
+
* Retrieves the {@link Cookie | cookies} in this {@link BrowserContext} filtered by provided URLs,
|
|
634
|
+
* or all {@link Cookie | cookies} if no URLs are provided.
|
|
635
|
+
*
|
|
636
|
+
* @param urls URLs to filter {@link Cookie | cookies} by.
|
|
637
|
+
* @returns An array of {@link Cookie | cookies}.
|
|
638
|
+
* @example
|
|
639
|
+
* ```js
|
|
640
|
+
* // Get all cookies in the browser context
|
|
641
|
+
* const cookies = context.cookies();
|
|
642
|
+
*
|
|
643
|
+
* // Get all cookies for the specified URLs
|
|
644
|
+
* const cookies = context.cookies('https://k6.io', 'https://test.k6.io');
|
|
645
|
+
*
|
|
646
|
+
* // Get all cookies for the specified URLs and filter by name
|
|
647
|
+
* const cookies = context.cookies('https://k6.io', 'https://test.k6.io').filter(c => c.name === 'foo');
|
|
648
|
+
* ```
|
|
649
|
+
*/
|
|
650
|
+
cookies(...urls: string[]): Cookie[];
|
|
651
|
+
|
|
647
652
|
/**
|
|
648
653
|
* Clears all permission overrides for the `BrowserContext`.
|
|
649
654
|
*/
|
|
@@ -772,6 +777,145 @@ export interface BrowserContext {
|
|
|
772
777
|
): Page | null;
|
|
773
778
|
}
|
|
774
779
|
|
|
780
|
+
/**
|
|
781
|
+
* {@link ConsoleMessage} objects are dispatched by page via the
|
|
782
|
+
* `page.on('console')` event. For each console message logged in the page,
|
|
783
|
+
* k6 browser delivers it to the registered handlers.
|
|
784
|
+
*
|
|
785
|
+
* ```js
|
|
786
|
+
* // Listen for all console log messages in the browser page and output them
|
|
787
|
+
* // in the test logs
|
|
788
|
+
* page.on('console', msg => console.log(msg.text()));
|
|
789
|
+
*
|
|
790
|
+
* // Listen for all console events and handle errors
|
|
791
|
+
* page.on('console', msg => {
|
|
792
|
+
* if (msg.type() === 'error')
|
|
793
|
+
* console.log(`Error text: "${msg.text()}"`);
|
|
794
|
+
* });
|
|
795
|
+
*
|
|
796
|
+
* // Deconstruct console log arguments
|
|
797
|
+
* await msg.args()[0].jsonValue(); // hello
|
|
798
|
+
* await msg.args()[1].jsonValue(); // 42
|
|
799
|
+
* ```
|
|
800
|
+
*/
|
|
801
|
+
export interface ConsoleMessage {
|
|
802
|
+
/**
|
|
803
|
+
* List of arguments passed to a `console` function call. See also
|
|
804
|
+
* `page.on('console')`.
|
|
805
|
+
*/
|
|
806
|
+
args(): JSHandle[];
|
|
807
|
+
|
|
808
|
+
/**
|
|
809
|
+
* The page that produced this console message, if any.
|
|
810
|
+
*/
|
|
811
|
+
page(): null | Page;
|
|
812
|
+
|
|
813
|
+
/**
|
|
814
|
+
* The text of the console message.
|
|
815
|
+
*/
|
|
816
|
+
text(): string;
|
|
817
|
+
|
|
818
|
+
/**
|
|
819
|
+
* One of the following values: `'log'`, `'debug'`, `'info'`, `'error'`,
|
|
820
|
+
* `'warning'`, `'dir'`, `'dirxml'`, `'table'`, `'trace'`, `'clear'`,
|
|
821
|
+
* `'startGroup'`, `'startGroupCollapsed'`, `'endGroup'`, `'assert'`,
|
|
822
|
+
* `'profile'`, `'profileEnd'`, `'count'`, `'timeEnd'`.
|
|
823
|
+
*/
|
|
824
|
+
type(): string;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
/**
|
|
828
|
+
* {@link Cookie} represents a cookie in a {@link BrowserContext}.
|
|
829
|
+
*
|
|
830
|
+
* @see
|
|
831
|
+
* {@link BrowserContext} has methods to {@link BrowserContext.addCookies | add}, {@link BrowserContext.cookies | query} and {@link BrowserContext.clearCookies | clear} cookies.
|
|
832
|
+
*/
|
|
833
|
+
export interface Cookie {
|
|
834
|
+
/**
|
|
835
|
+
* The {@link Cookie | cookie}'s name.
|
|
836
|
+
*
|
|
837
|
+
* @defaultValue
|
|
838
|
+
* The default is `''`.
|
|
839
|
+
*/
|
|
840
|
+
name: string;
|
|
841
|
+
|
|
842
|
+
/**
|
|
843
|
+
* The {@link Cookie | cookie}'s value.
|
|
844
|
+
*
|
|
845
|
+
* @defaultValue
|
|
846
|
+
* The default is `''`.
|
|
847
|
+
*/
|
|
848
|
+
value: string;
|
|
849
|
+
|
|
850
|
+
/**
|
|
851
|
+
* The {@link Cookie | cookie}'s URL.
|
|
852
|
+
*
|
|
853
|
+
* Required unless one of {@link Cookie.domain | domain} or {@link Cookie.path | path} are specified.
|
|
854
|
+
*/
|
|
855
|
+
url?: string;
|
|
856
|
+
|
|
857
|
+
/**
|
|
858
|
+
* The {@link Cookie | cookie}'s domain.
|
|
859
|
+
*
|
|
860
|
+
* Required unless one of {@link Cookie.url | url} or {@link Cookie.path | path} are specified.
|
|
861
|
+
*/
|
|
862
|
+
domain?: string;
|
|
863
|
+
|
|
864
|
+
/**
|
|
865
|
+
* The {@link Cookie | cookie}'s path.
|
|
866
|
+
*
|
|
867
|
+
* Required unless one of {@link Cookie.url | url} or {@link Cookie.domain | domain} are specified.
|
|
868
|
+
*
|
|
869
|
+
* @defaultValue
|
|
870
|
+
* The default is `'/'`.
|
|
871
|
+
*/
|
|
872
|
+
path?: string;
|
|
873
|
+
|
|
874
|
+
/**
|
|
875
|
+
* The {@link Cookie | cookie}'s expiration date as the number of seconds since the UNIX epoch.
|
|
876
|
+
*
|
|
877
|
+
* If omitted, the {@link Cookie | cookie} becomes a session cookie.
|
|
878
|
+
*
|
|
879
|
+
* @defaultValue
|
|
880
|
+
* The default is `-1`, meaning a session cookie.
|
|
881
|
+
*/
|
|
882
|
+
expires?: number;
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* Whether the {@link Cookie | cookie} is http-only.
|
|
886
|
+
*
|
|
887
|
+
* @defaultValue
|
|
888
|
+
* The default is `false`.
|
|
889
|
+
*/
|
|
890
|
+
httpOnly?: boolean;
|
|
891
|
+
|
|
892
|
+
/**
|
|
893
|
+
* Whether the {@link Cookie | cookie} is secure.
|
|
894
|
+
*
|
|
895
|
+
* @defaultValue
|
|
896
|
+
* The default is `false`.
|
|
897
|
+
*/
|
|
898
|
+
secure?: boolean;
|
|
899
|
+
|
|
900
|
+
/**
|
|
901
|
+
* The {@link Cookie | cookie}'s same-site status.
|
|
902
|
+
*
|
|
903
|
+
* It can be one of `'Strict'`, `'Lax'`, or `'None'`.
|
|
904
|
+
*
|
|
905
|
+
* @defaultValue
|
|
906
|
+
* The default is `'Lax'`.
|
|
907
|
+
*/
|
|
908
|
+
sameSite?: CookieSameSite;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
/**
|
|
912
|
+
* CookieSameSite represents the same-site status of a {@link Cookie | cookie}.
|
|
913
|
+
*
|
|
914
|
+
* @defaultValue
|
|
915
|
+
* The default is `'Lax'`.
|
|
916
|
+
*/
|
|
917
|
+
export type CookieSameSite = "Strict" | "Lax" | "None";
|
|
918
|
+
|
|
775
919
|
/**
|
|
776
920
|
* ElementHandle represents an in-page DOM element.
|
|
777
921
|
*/
|
|
@@ -2461,6 +2605,28 @@ export interface Page {
|
|
|
2461
2605
|
*/
|
|
2462
2606
|
mouse: Mouse;
|
|
2463
2607
|
|
|
2608
|
+
/**
|
|
2609
|
+
* Emitted when JavaScript within the page calls one of console API methods
|
|
2610
|
+
* , e.g. `console.log` or `console.dir`. Also emitted if the page throws
|
|
2611
|
+
* an error or a warning.
|
|
2612
|
+
*
|
|
2613
|
+
* The arguments passed into `console.log` are available on the
|
|
2614
|
+
* {@link ConsoleMessage} event handler argument.
|
|
2615
|
+
*
|
|
2616
|
+
* **Usage**
|
|
2617
|
+
*
|
|
2618
|
+
* ```js
|
|
2619
|
+
* page.on('console', msg => {
|
|
2620
|
+
* const values = [];
|
|
2621
|
+
* for (const arg of msg.args())
|
|
2622
|
+
* values.push(arg.jsonValue());
|
|
2623
|
+
* console.log(...values);
|
|
2624
|
+
* });
|
|
2625
|
+
* page.evaluate(() => console.log('hello', 5, { foo: 'bar' }));
|
|
2626
|
+
* ```
|
|
2627
|
+
*/
|
|
2628
|
+
on(event: "console", listener: (consoleMessage: ConsoleMessage) => void): void;
|
|
2629
|
+
|
|
2464
2630
|
/**
|
|
2465
2631
|
* Returns the page that opened the current page. The first page that is
|
|
2466
2632
|
* navigated to will have a null opener.
|
k6/experimental/grpc.d.ts
CHANGED
k6/index.d.ts
CHANGED
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
// Type definitions for k6 0.46
|
|
2
|
-
// Project: https://k6.io/docs/
|
|
3
|
-
// Definitions by: Mihail Stoykov <https://github.com/MStoykov>
|
|
4
|
-
// Ivan <https://github.com/codebien>
|
|
5
|
-
// Théo Crevon <https://github.com/oleiade>
|
|
6
|
-
// Oleg Bespalov <https://github.com/olegbespalov>
|
|
7
|
-
// Pepe Cano <https://github.com/ppcano>
|
|
8
|
-
// Nicole van der Hoeven <https://github.com/nicolevanderhoeven>
|
|
9
|
-
// Ankur Agarwal <https://github.com/ankur22>
|
|
10
|
-
// İnanç Gümüş <https://github.com/inancgumus>
|
|
11
|
-
// Daniel Jiménez <https://github.com/ka3de>
|
|
12
|
-
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
13
|
-
// TypeScript Version: 3.9
|
|
14
|
-
|
|
15
1
|
/**
|
|
16
2
|
* k6 JavaScript API.
|
|
17
3
|
* https://k6.io/docs/
|
k6/net/grpc.d.ts
CHANGED
k6/package.json
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/k6",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.47.1",
|
|
4
4
|
"description": "TypeScript definitions for k6",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/k6",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"contributors": [
|
|
8
8
|
{
|
|
9
9
|
"name": "Mihail Stoykov",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
10
|
+
"githubUsername": "MStoykov",
|
|
11
|
+
"url": "https://github.com/MStoykov"
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
"name": "Ivan",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
15
|
+
"githubUsername": "codebien",
|
|
16
|
+
"url": "https://github.com/codebien"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
"name": "Théo Crevon",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
20
|
+
"githubUsername": "oleiade",
|
|
21
|
+
"url": "https://github.com/oleiade"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
"name": "Oleg Bespalov",
|
|
25
|
-
"
|
|
26
|
-
"
|
|
25
|
+
"githubUsername": "olegbespalov",
|
|
26
|
+
"url": "https://github.com/olegbespalov"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"name": "Pepe Cano",
|
|
30
|
-
"
|
|
31
|
-
"
|
|
30
|
+
"githubUsername": "ppcano",
|
|
31
|
+
"url": "https://github.com/ppcano"
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
"name": "Nicole van der Hoeven",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
35
|
+
"githubUsername": "nicolevanderhoeven",
|
|
36
|
+
"url": "https://github.com/nicolevanderhoeven"
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
"name": "Ankur Agarwal",
|
|
40
|
-
"
|
|
41
|
-
"
|
|
40
|
+
"githubUsername": "ankur22",
|
|
41
|
+
"url": "https://github.com/ankur22"
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
"name": "İnanç Gümüş",
|
|
45
|
-
"
|
|
46
|
-
"
|
|
45
|
+
"githubUsername": "inancgumus",
|
|
46
|
+
"url": "https://github.com/inancgumus"
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
"name": "Daniel Jiménez",
|
|
50
|
-
"
|
|
51
|
-
"
|
|
50
|
+
"githubUsername": "ka3de",
|
|
51
|
+
"url": "https://github.com/ka3de"
|
|
52
52
|
}
|
|
53
53
|
],
|
|
54
54
|
"main": "",
|
|
@@ -60,6 +60,6 @@
|
|
|
60
60
|
},
|
|
61
61
|
"scripts": {},
|
|
62
62
|
"dependencies": {},
|
|
63
|
-
"typesPublisherContentHash": "
|
|
63
|
+
"typesPublisherContentHash": "27f9ef43a07c3f7280e203d0fcb560f617a9b7ca3224d7033bac4f69a70a5b17",
|
|
64
64
|
"typeScriptVersion": "4.5"
|
|
65
65
|
}
|