@types/k6 0.48.0 → 0.49.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 +41 -67
- k6/experimental/grpc.d.ts +6 -0
- k6/net/grpc.d.ts +58 -0
- k6/package.json +2 -2
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:
|
|
11
|
+
* Last updated: Mon, 29 Jan 2024 10:07:04 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
|
|
14
14
|
# Credits
|
k6/experimental/browser.d.ts
CHANGED
|
@@ -1469,7 +1469,7 @@ export interface Frame {
|
|
|
1469
1469
|
* @param options The options to use.
|
|
1470
1470
|
* @returns `true` if the element is hidden, `false` otherwise.
|
|
1471
1471
|
*/
|
|
1472
|
-
isHidden(selector: string, options?:
|
|
1472
|
+
isHidden(selector: string, options?: StrictnessOptions): boolean;
|
|
1473
1473
|
|
|
1474
1474
|
/**
|
|
1475
1475
|
* Get whether the first element found that matches the selector is visible or not.
|
|
@@ -1477,7 +1477,7 @@ export interface Frame {
|
|
|
1477
1477
|
* @param options The options to use.
|
|
1478
1478
|
* @returns `true` if the element is visible, `false` otherwise.
|
|
1479
1479
|
*/
|
|
1480
|
-
isVisible(selector: string, options?:
|
|
1480
|
+
isVisible(selector: string, options?: StrictnessOptions): boolean;
|
|
1481
1481
|
|
|
1482
1482
|
/**
|
|
1483
1483
|
* Wait for the given function to return a truthy value.
|
|
@@ -1624,37 +1624,51 @@ export interface Keyboard {
|
|
|
1624
1624
|
* React, Vue, etc.
|
|
1625
1625
|
*/
|
|
1626
1626
|
export interface Locator {
|
|
1627
|
+
/**
|
|
1628
|
+
* Clears text boxes and input fields of any existing values.
|
|
1629
|
+
*
|
|
1630
|
+
* **Usage**
|
|
1631
|
+
*
|
|
1632
|
+
* ```js
|
|
1633
|
+
* // Clears the input field matching the selector.
|
|
1634
|
+
* page.locator('input[name="login"]').clear();
|
|
1635
|
+
* ```
|
|
1636
|
+
*
|
|
1637
|
+
* @param options Options to use.
|
|
1638
|
+
*/
|
|
1639
|
+
clear(options?: ElementHandleOptions): void;
|
|
1640
|
+
|
|
1627
1641
|
/**
|
|
1628
1642
|
* Mouse click on the chosen element.
|
|
1629
1643
|
* @param options Options to use.
|
|
1630
1644
|
* @returns Promise which resolves when the element is successfully clicked.
|
|
1631
1645
|
*/
|
|
1632
|
-
click(options?: MouseMoveOptions & MouseMultiClickOptions
|
|
1646
|
+
click(options?: MouseMoveOptions & MouseMultiClickOptions): Promise<void>;
|
|
1633
1647
|
|
|
1634
1648
|
/**
|
|
1635
1649
|
* Mouse double click on the chosen element.
|
|
1636
1650
|
* @param options Options to use.
|
|
1637
1651
|
*/
|
|
1638
|
-
dblclick(options?: MouseMoveOptions & MouseMultiClickOptions
|
|
1652
|
+
dblclick(options?: MouseMoveOptions & MouseMultiClickOptions): void;
|
|
1639
1653
|
|
|
1640
1654
|
/**
|
|
1641
1655
|
* Use this method to select an `input type="checkbox"`.
|
|
1642
1656
|
* @param options Options to use.
|
|
1643
1657
|
*/
|
|
1644
|
-
check(options?: ElementClickOptions
|
|
1658
|
+
check(options?: ElementClickOptions): void;
|
|
1645
1659
|
|
|
1646
1660
|
/**
|
|
1647
1661
|
* Use this method to unselect an `input type="checkbox"`.
|
|
1648
1662
|
* @param options Options to use.
|
|
1649
1663
|
*/
|
|
1650
|
-
uncheck(options?: ElementClickOptions
|
|
1664
|
+
uncheck(options?: ElementClickOptions): void;
|
|
1651
1665
|
|
|
1652
1666
|
/**
|
|
1653
1667
|
* Checks to see if the `input type="checkbox"` is selected or not.
|
|
1654
1668
|
* @param options Options to use.
|
|
1655
1669
|
* @returns `true` if the element is checked, `false` otherwise.
|
|
1656
1670
|
*/
|
|
1657
|
-
isChecked(options?: TimeoutOptions
|
|
1671
|
+
isChecked(options?: TimeoutOptions): boolean;
|
|
1658
1672
|
|
|
1659
1673
|
/**
|
|
1660
1674
|
* Checks if the element is editable.
|
|
@@ -1668,41 +1682,39 @@ export interface Locator {
|
|
|
1668
1682
|
* @param options Options to use.
|
|
1669
1683
|
* @returns `true` if the element is enabled, `false` otherwise.
|
|
1670
1684
|
*/
|
|
1671
|
-
isEnabled(options?: TimeoutOptions
|
|
1685
|
+
isEnabled(options?: TimeoutOptions): boolean;
|
|
1672
1686
|
|
|
1673
1687
|
/**
|
|
1674
1688
|
* Checks if the element is `disabled`.
|
|
1675
1689
|
* @param options Options to use.
|
|
1676
1690
|
* @returns `true` if the element is disabled, `false` otherwise.
|
|
1677
1691
|
*/
|
|
1678
|
-
isDisabled(options?: TimeoutOptions
|
|
1692
|
+
isDisabled(options?: TimeoutOptions): boolean;
|
|
1679
1693
|
|
|
1680
1694
|
/**
|
|
1681
1695
|
* Checks if the element is `visible`.
|
|
1682
|
-
* @param options Options to use.
|
|
1683
1696
|
* @returns `true` if the element is visible, `false` otherwise.
|
|
1684
1697
|
*/
|
|
1685
|
-
isVisible(
|
|
1698
|
+
isVisible(): boolean;
|
|
1686
1699
|
|
|
1687
1700
|
/**
|
|
1688
1701
|
* Checks if the element is `hidden`.
|
|
1689
|
-
* @param options Options to use.
|
|
1690
1702
|
* @returns `true` if the element is hidden, `false` otherwise.
|
|
1691
1703
|
*/
|
|
1692
|
-
isHidden(
|
|
1704
|
+
isHidden(): boolean;
|
|
1693
1705
|
|
|
1694
1706
|
/**
|
|
1695
1707
|
* Fill an `input`, `textarea` or `contenteditable` element with the provided value.
|
|
1696
1708
|
* @param value Value to fill for the `input` or `textarea` element.
|
|
1697
1709
|
* @param options Options to use.
|
|
1698
1710
|
*/
|
|
1699
|
-
fill(value: string, options?: ElementHandleOptions
|
|
1711
|
+
fill(value: string, options?: ElementHandleOptions): void;
|
|
1700
1712
|
|
|
1701
1713
|
/**
|
|
1702
1714
|
* Focuses the element using locator's selector.
|
|
1703
1715
|
* @param options Options to use.
|
|
1704
1716
|
*/
|
|
1705
|
-
focus(options?: TimeoutOptions
|
|
1717
|
+
focus(options?: TimeoutOptions): void;
|
|
1706
1718
|
|
|
1707
1719
|
/**
|
|
1708
1720
|
* Returns the element attribute value for the given attribute name.
|
|
@@ -1710,35 +1722,35 @@ export interface Locator {
|
|
|
1710
1722
|
* @param options Options to use.
|
|
1711
1723
|
* @returns Attribute value.
|
|
1712
1724
|
*/
|
|
1713
|
-
getAttribute(name: string, options?: TimeoutOptions
|
|
1725
|
+
getAttribute(name: string, options?: TimeoutOptions): string | null;
|
|
1714
1726
|
|
|
1715
1727
|
/**
|
|
1716
1728
|
* Returns the `element.innerHTML`.
|
|
1717
1729
|
* @param options Options to use.
|
|
1718
1730
|
* @returns Element's innerHTML.
|
|
1719
1731
|
*/
|
|
1720
|
-
innerHTML(options?: TimeoutOptions
|
|
1732
|
+
innerHTML(options?: TimeoutOptions): string;
|
|
1721
1733
|
|
|
1722
1734
|
/**
|
|
1723
1735
|
* Returns the `element.innerText`.
|
|
1724
1736
|
* @param options Options to use.
|
|
1725
1737
|
* @returns Element's innerText.
|
|
1726
1738
|
*/
|
|
1727
|
-
innerText(options?: TimeoutOptions
|
|
1739
|
+
innerText(options?: TimeoutOptions): string;
|
|
1728
1740
|
|
|
1729
1741
|
/**
|
|
1730
1742
|
* Returns the `element.textContent`.
|
|
1731
1743
|
* @param options Options to use.
|
|
1732
1744
|
* @returns Element's textContent.
|
|
1733
1745
|
*/
|
|
1734
|
-
textContent(options?: TimeoutOptions
|
|
1746
|
+
textContent(options?: TimeoutOptions): string;
|
|
1735
1747
|
|
|
1736
1748
|
/**
|
|
1737
1749
|
* Returns `input.value` for the selected `input`, `textarea` or `select` element.
|
|
1738
1750
|
* @param options Options to use.
|
|
1739
1751
|
* @returns The input value of the element.
|
|
1740
1752
|
*/
|
|
1741
|
-
inputValue(options?: TimeoutOptions
|
|
1753
|
+
inputValue(options?: TimeoutOptions): string;
|
|
1742
1754
|
|
|
1743
1755
|
/**
|
|
1744
1756
|
* Select one or more options which match the values. If the select has the multiple attribute, all matching options are selected,
|
|
@@ -1749,7 +1761,7 @@ export interface Locator {
|
|
|
1749
1761
|
*/
|
|
1750
1762
|
selectOption(
|
|
1751
1763
|
values: string | string[] | { value?: string; label?: string; index?: number },
|
|
1752
|
-
options?: ElementHandleOptions
|
|
1764
|
+
options?: ElementHandleOptions,
|
|
1753
1765
|
): string[];
|
|
1754
1766
|
|
|
1755
1767
|
/**
|
|
@@ -1771,13 +1783,13 @@ export interface Locator {
|
|
|
1771
1783
|
* Hover over the element.
|
|
1772
1784
|
* @param options Options to use.
|
|
1773
1785
|
*/
|
|
1774
|
-
hover(options?: MouseMoveOptions
|
|
1786
|
+
hover(options?: MouseMoveOptions): void;
|
|
1775
1787
|
|
|
1776
1788
|
/**
|
|
1777
1789
|
* Tap on the chosen element.
|
|
1778
1790
|
* @param options Options to use.
|
|
1779
1791
|
*/
|
|
1780
|
-
tap(options?: MouseMoveOptions
|
|
1792
|
+
tap(options?: MouseMoveOptions): void;
|
|
1781
1793
|
|
|
1782
1794
|
/**
|
|
1783
1795
|
* Dispatches HTML DOM event types e.g. `click`.
|
|
@@ -1785,13 +1797,13 @@ export interface Locator {
|
|
|
1785
1797
|
* @param eventInit Event-specific properties.
|
|
1786
1798
|
* @param options Options to use.
|
|
1787
1799
|
*/
|
|
1788
|
-
dispatchEvent(type: string, eventInit?: EvaluationArgument, options?: TimeoutOptions
|
|
1800
|
+
dispatchEvent(type: string, eventInit?: EvaluationArgument, options?: TimeoutOptions): void;
|
|
1789
1801
|
|
|
1790
1802
|
/**
|
|
1791
1803
|
* Wait for the element to be in a particular state e.g. `visible`.
|
|
1792
1804
|
* @param options Wait options.
|
|
1793
1805
|
*/
|
|
1794
|
-
waitFor(options?: { state?: ElementState } & TimeoutOptions
|
|
1806
|
+
waitFor(options?: { state?: ElementState } & TimeoutOptions): void;
|
|
1795
1807
|
}
|
|
1796
1808
|
|
|
1797
1809
|
/**
|
|
@@ -2581,7 +2593,7 @@ export interface Page {
|
|
|
2581
2593
|
): boolean;
|
|
2582
2594
|
|
|
2583
2595
|
/**
|
|
2584
|
-
* **NOTE** Use locator-based locator.isHidden(
|
|
2596
|
+
* **NOTE** Use locator-based locator.isHidden() instead.
|
|
2585
2597
|
*
|
|
2586
2598
|
* Returns whether the element is hidden.
|
|
2587
2599
|
*
|
|
@@ -2589,29 +2601,10 @@ export interface Page {
|
|
|
2589
2601
|
* elements satisfying the selector, the first will be used.
|
|
2590
2602
|
* @param options
|
|
2591
2603
|
*/
|
|
2592
|
-
isHidden(
|
|
2593
|
-
selector: string,
|
|
2594
|
-
options?: {
|
|
2595
|
-
/**
|
|
2596
|
-
* When `true`, the call requires selector to resolve to a single element.
|
|
2597
|
-
* If given selector resolves to more than one element, the call throws
|
|
2598
|
-
* an exception. Defaults to `false`.
|
|
2599
|
-
*/
|
|
2600
|
-
strict?: boolean;
|
|
2601
|
-
|
|
2602
|
-
/**
|
|
2603
|
-
* Maximum time in milliseconds. Defaults to `30` seconds. Default is
|
|
2604
|
-
* overridden by the `setDefaultTimeout` option on `BrowserContext` or
|
|
2605
|
-
* `page` methods.
|
|
2606
|
-
*
|
|
2607
|
-
* Setting the value to `0` will disable the timeout.
|
|
2608
|
-
*/
|
|
2609
|
-
timeout?: number;
|
|
2610
|
-
},
|
|
2611
|
-
): boolean;
|
|
2604
|
+
isHidden(selector: string, options?: StrictnessOptions): boolean;
|
|
2612
2605
|
|
|
2613
2606
|
/**
|
|
2614
|
-
* **NOTE** Use locator-based locator.isVisible(
|
|
2607
|
+
* **NOTE** Use locator-based locator.isVisible() instead.
|
|
2615
2608
|
*
|
|
2616
2609
|
* Returns whether the element is visible.
|
|
2617
2610
|
*
|
|
@@ -2619,26 +2612,7 @@ export interface Page {
|
|
|
2619
2612
|
* elements satisfying the selector, the first will be used.
|
|
2620
2613
|
* @param options
|
|
2621
2614
|
*/
|
|
2622
|
-
isVisible(
|
|
2623
|
-
selector: string,
|
|
2624
|
-
options?: {
|
|
2625
|
-
/**
|
|
2626
|
-
* When `true`, the call requires selector to resolve to a single element.
|
|
2627
|
-
* If given selector resolves to more than one element, the call throws
|
|
2628
|
-
* an exception. Defaults to `false`.
|
|
2629
|
-
*/
|
|
2630
|
-
strict?: boolean;
|
|
2631
|
-
|
|
2632
|
-
/**
|
|
2633
|
-
* Maximum time in milliseconds. Defaults to `30` seconds. Default is
|
|
2634
|
-
* overridden by the `setDefaultTimeout` option on `BrowserContext` or
|
|
2635
|
-
* `page` methods.
|
|
2636
|
-
*
|
|
2637
|
-
* Setting the value to `0` will disable the timeout.
|
|
2638
|
-
*/
|
|
2639
|
-
timeout?: number;
|
|
2640
|
-
},
|
|
2641
|
-
): boolean;
|
|
2615
|
+
isVisible(selector: string, options?: StrictnessOptions): boolean;
|
|
2642
2616
|
|
|
2643
2617
|
/**
|
|
2644
2618
|
* Returns the keyboard instance to interact with a virtual keyboard on the
|
k6/experimental/grpc.d.ts
CHANGED
|
@@ -98,11 +98,15 @@ export interface GrpcError {
|
|
|
98
98
|
/**
|
|
99
99
|
* This module provides classes for Remote Procedure Calls over HTTP/2.
|
|
100
100
|
* https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/grpc/
|
|
101
|
+
*
|
|
102
|
+
* @deprecated Use the `k6/net/grpc` module instead.
|
|
101
103
|
*/
|
|
102
104
|
declare namespace grpc {
|
|
103
105
|
/**
|
|
104
106
|
* gRPC client to interact with a gRPC server.
|
|
105
107
|
* https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/grpc/client/
|
|
108
|
+
*
|
|
109
|
+
* @deprecated Use the `k6/net/grpc` module instead.
|
|
106
110
|
*/
|
|
107
111
|
class Client {
|
|
108
112
|
protected __brand: never;
|
|
@@ -145,6 +149,8 @@ declare namespace grpc {
|
|
|
145
149
|
|
|
146
150
|
/**
|
|
147
151
|
* Stream allows you to use streaming RPCs.
|
|
152
|
+
*
|
|
153
|
+
* @deprecated Use the `k6/net/grpc` module instead.
|
|
148
154
|
*/
|
|
149
155
|
class Stream {
|
|
150
156
|
/**
|
k6/net/grpc.d.ts
CHANGED
|
@@ -89,6 +89,12 @@ export interface Params {
|
|
|
89
89
|
timeout?: string | number;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
export interface GrpcError {
|
|
93
|
+
code: number;
|
|
94
|
+
details: string[] | object[];
|
|
95
|
+
message: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
92
98
|
/**
|
|
93
99
|
* This module provides a gRPC client for Remote Procedure Calls over HTTP/2.
|
|
94
100
|
* https://grafana.com/docs/k6/latest/javascript-api/k6-net-grpc/
|
|
@@ -119,6 +125,58 @@ declare namespace grpc {
|
|
|
119
125
|
close(): void;
|
|
120
126
|
}
|
|
121
127
|
|
|
128
|
+
/**
|
|
129
|
+
* StreamEvent describes the possible events that can be emitted
|
|
130
|
+
* by a gRPC stream.
|
|
131
|
+
*/
|
|
132
|
+
type StreamEvent =
|
|
133
|
+
/**
|
|
134
|
+
* Event fired when data has been received from the server.
|
|
135
|
+
*/
|
|
136
|
+
| "data"
|
|
137
|
+
/**
|
|
138
|
+
* Event fired when a stream has been closed due to an error.
|
|
139
|
+
*/
|
|
140
|
+
| "error"
|
|
141
|
+
/**
|
|
142
|
+
* Event fired when the stream closes.
|
|
143
|
+
*/
|
|
144
|
+
| "end";
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Stream allows you to use streaming RPCs.
|
|
148
|
+
*/
|
|
149
|
+
class Stream {
|
|
150
|
+
/**
|
|
151
|
+
* The gRPC stream constructor, representing a single gRPC stream.
|
|
152
|
+
*
|
|
153
|
+
* @param client - the gRPC client to use, it must be connected.
|
|
154
|
+
* @param url - the RPC method to call.
|
|
155
|
+
* @param params - the parameters to use for the RPC call.
|
|
156
|
+
*/
|
|
157
|
+
constructor(client: Client, url: string, params?: Params);
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Set up handler functions for various events on the gRPC stream.
|
|
161
|
+
*
|
|
162
|
+
* @param event - the event to listen for
|
|
163
|
+
* @param listener - the callback to invoke when the event is emitted
|
|
164
|
+
*/
|
|
165
|
+
on(event: StreamEvent, listener: (data: object | GrpcError | undefined) => void): void;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Writes a request to the stream.
|
|
169
|
+
*
|
|
170
|
+
* @param request - the request (message) to send to the server
|
|
171
|
+
*/
|
|
172
|
+
write(request: object): void;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Signals to the server that the client has finished sending messages.
|
|
176
|
+
*/
|
|
177
|
+
end(): void;
|
|
178
|
+
}
|
|
179
|
+
|
|
122
180
|
const StatusOK: number;
|
|
123
181
|
const StatusCanceled: number;
|
|
124
182
|
const StatusUnknown: number;
|
k6/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/k6",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.49.0",
|
|
4
4
|
"description": "TypeScript definitions for k6",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/k6",
|
|
6
6
|
"license": "MIT",
|
|
@@ -65,6 +65,6 @@
|
|
|
65
65
|
},
|
|
66
66
|
"scripts": {},
|
|
67
67
|
"dependencies": {},
|
|
68
|
-
"typesPublisherContentHash": "
|
|
68
|
+
"typesPublisherContentHash": "0d8d2b1f53185323eb5e05154ba6e59b216bf4cb81d3074f93b14aa093219244",
|
|
69
69
|
"typeScriptVersion": "4.6"
|
|
70
70
|
}
|