@types/k6 2.0.0 → 2.2.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 CHANGED
@@ -8,8 +8,8 @@ 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 May 2026 09:45:28 GMT
11
+ * Last updated: Mon, 17 Aug 2026 08:49:14 GMT
12
12
  * Dependencies: none
13
13
 
14
14
  # Credits
15
- These definitions were written by [Mihail Stoykov](https://github.com/MStoykov), [Ivan](https://github.com/codebien), [Théo Crevon](https://github.com/oleiade), [Ankur Agarwal](https://github.com/ankur22), [İnanç Gümüş](https://github.com/inancgumus), [Joan López de la Franca Beltran](https://github.com/joanlopez), [Agnès Toulet](https://github.com/AgnesToulet), and [Iván Szkiba](https://github.com/szkiba).
15
+ These definitions were written by [Mihail Stoykov](https://github.com/MStoykov), [Ivan](https://github.com/codebien), [Théo Crevon](https://github.com/oleiade), [Ankur Agarwal](https://github.com/ankur22), [İnanç Gümüş](https://github.com/inancgumus), [Joan López de la Franca Beltran](https://github.com/joanlopez), [Agnès Toulet](https://github.com/AgnesToulet), [Iván Szkiba](https://github.com/szkiba), and [Jan Hildebrandt](https://github.com/janHildebrandt98).
k6/browser/index.d.ts CHANGED
@@ -728,6 +728,66 @@ export interface NewBrowserContextOptions {
728
728
  */
729
729
  export const browser: Browser;
730
730
 
731
+ /**
732
+ * The `chromium` named export allows attaching to an already running
733
+ * Chromium-based browser over the Chrome DevTools Protocol (CDP), instead of
734
+ * relying on the browser instance that k6 launches and manages for you.
735
+ */
736
+ export const chromium: BrowserType;
737
+
738
+ /**
739
+ * `BrowserType` is the entry point to connect to an existing Chromium-based
740
+ * browser.
741
+ */
742
+ export interface BrowserType {
743
+ /**
744
+ * Attaches to an already running Chromium-based browser over the Chrome
745
+ * DevTools Protocol (CDP), and returns the corresponding `Browser`
746
+ * instance.
747
+ *
748
+ * The returned `Browser` is closed automatically at the end of the
749
+ * iteration. Use {@link ConnectedBrowser.close | close} to release the
750
+ * connection earlier.
751
+ *
752
+ * **Usage**
753
+ *
754
+ * ```js
755
+ * const browser = await chromium.connectOverCDP('ws://localhost:9222/devtools/browser/<id>');
756
+ * const page = await browser.newPage();
757
+ *
758
+ * try {
759
+ * await page.goto('https://quickpizza.grafana.com/');
760
+ * } finally {
761
+ * await page.close();
762
+ * await browser.close();
763
+ * }
764
+ * ```
765
+ *
766
+ * @param wsEndpoint The WebSocket endpoint of the browser to attach to,
767
+ * e.g. 'ws://localhost:9222/devtools/browser/<id>'.
768
+ */
769
+ connectOverCDP(wsEndpoint: string): Promise<ConnectedBrowser>;
770
+ }
771
+
772
+ /**
773
+ * `ConnectedBrowser` represents a web browser instance that k6 attached to over
774
+ * the Chrome DevTools Protocol (CDP), rather than launched itself.
775
+ *
776
+ * On top of the `Browser` API, it exposes a `close` method, since the
777
+ * connection is user managed and can be released on demand.
778
+ */
779
+ export interface ConnectedBrowser extends Browser {
780
+ /**
781
+ * Closes the connection to the browser, and all of its `BrowserContext`s
782
+ * and `Page`s.
783
+ *
784
+ * Calling this method is optional: the connection is closed automatically
785
+ * at the end of the iteration. Closing an already closed `Browser` is a
786
+ * no-op.
787
+ */
788
+ close(): Promise<void>;
789
+ }
790
+
731
791
  /**
732
792
  * `Browser` represents the main web browser instance.
733
793
  */
k6/html/index.d.ts CHANGED
@@ -370,10 +370,10 @@ export interface FormValue {
370
370
  export interface Tester {
371
371
  /**
372
372
  * @param index - Current index.
373
- * @param element - Current element.
373
+ * @param element - Current selection.
374
374
  * @returns Whether element passes test.
375
375
  */
376
- (index: number, element: Element): boolean;
376
+ (index: number, element: Selection): boolean;
377
377
  }
378
378
 
379
379
  /**
k6/options/index.d.ts CHANGED
@@ -50,6 +50,9 @@ export interface Options {
50
50
  /** Cloud options */
51
51
  cloud?: CloudOptions;
52
52
 
53
+ /** handleSummary() function timeout. */
54
+ handleSummaryTimeout?: string;
55
+
53
56
  /** Static hostname mapping. */
54
57
  hosts?: { [name: string]: string };
55
58
 
k6/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/k6",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "TypeScript definitions for k6",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/k6",
6
6
  "license": "MIT",
@@ -44,6 +44,11 @@
44
44
  "name": "Iván Szkiba",
45
45
  "githubUsername": "szkiba",
46
46
  "url": "https://github.com/szkiba"
47
+ },
48
+ {
49
+ "name": "Jan Hildebrandt",
50
+ "githubUsername": "janHildebrandt98",
51
+ "url": "https://github.com/janHildebrandt98"
47
52
  }
48
53
  ],
49
54
  "type": "module",
@@ -78,6 +83,6 @@
78
83
  "scripts": {},
79
84
  "dependencies": {},
80
85
  "peerDependencies": {},
81
- "typesPublisherContentHash": "450206b456bef56f2950ef8cca69da4a20a010f6f951b100f17f9b79ad78bdc8",
82
- "typeScriptVersion": "5.3"
86
+ "typesPublisherContentHash": "dee60892c6be63b85f1d84c8a3320a68a9c41816d00ef077bc39d5c81eabb8a3",
87
+ "typeScriptVersion": "5.6"
83
88
  }