@types/k6 0.53.1 → 0.53.2

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/net/grpc.d.ts DELETED
@@ -1,202 +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 a gRPC client for Remote Procedure Calls over HTTP/2.
100
- * https://grafana.com/docs/k6/latest/javascript-api/k6-net-grpc/
101
- */
102
- declare namespace grpc {
103
- /**
104
- * gRPC client to interact with a gRPC server.
105
- * https://grafana.com/docs/k6/latest/javascript-api/k6-net-grpc/client/
106
- */
107
- class Client {
108
- protected __brand: never;
109
-
110
- constructor();
111
-
112
- /** Opens a connection to a gRPC server. */
113
- connect(address: string, params?: ConnectParams): void;
114
-
115
- /** Loads and parses the protocol buffer descriptors. */
116
- load(importPaths: string[], ...protoFiles: string[]): void;
117
-
118
- /** Loads a protoset and parses the protocol buffer descriptors */
119
- loadProtoset(protosetPath: string): void;
120
-
121
- /** Invokes an unary RPC request. */
122
- invoke(url: string, request: object, params?: Params): Response;
123
-
124
- /** Asynchronously invokes an unary RPC request. */
125
- asyncInvoke(url: string, request: object, params?: Params): Promise<Response>;
126
-
127
- /** Close the connection. */
128
- close(): void;
129
- }
130
-
131
- /**
132
- * StreamEvent describes the possible events that can be emitted
133
- * by a gRPC stream.
134
- */
135
- type StreamEvent =
136
- /**
137
- * Event fired when data has been received from the server.
138
- */
139
- | "data"
140
- /**
141
- * Event fired when a stream has been closed due to an error.
142
- */
143
- | "error"
144
- /**
145
- * Event fired when the stream closes.
146
- */
147
- | "end";
148
-
149
- /**
150
- * Stream allows you to use streaming RPCs.
151
- */
152
- class Stream {
153
- /**
154
- * The gRPC stream constructor, representing a single gRPC stream.
155
- *
156
- * @param client - the gRPC client to use, it must be connected.
157
- * @param url - the RPC method to call.
158
- * @param params - the parameters to use for the RPC call.
159
- */
160
- constructor(client: Client, url: string, params?: Params);
161
-
162
- /**
163
- * Set up handler functions for various events on the gRPC stream.
164
- *
165
- * @param event - the event to listen for
166
- * @param listener - the callback to invoke when the event is emitted
167
- */
168
- on(event: StreamEvent, listener: (data: object | GrpcError | undefined) => void): void;
169
-
170
- /**
171
- * Writes a request to the stream.
172
- *
173
- * @param request - the request (message) to send to the server
174
- */
175
- write(request: object): void;
176
-
177
- /**
178
- * Signals to the server that the client has finished sending messages.
179
- */
180
- end(): void;
181
- }
182
-
183
- const StatusOK: number;
184
- const StatusCanceled: number;
185
- const StatusUnknown: number;
186
- const StatusInvalidArgument: number;
187
- const StatusDeadlineExceeded: number;
188
- const StatusNotFound: number;
189
- const StatusAlreadyExists: number;
190
- const StatusPermissionDenied: number;
191
- const StatusResourceExhausted: number;
192
- const StatusFailedPrecondition: number;
193
- const StatusAborted: number;
194
- const StatusOutOfRange: number;
195
- const StatusUnimplemented: number;
196
- const StatusInternal: number;
197
- const StatusUnavailable: number;
198
- const StatusDataLoss: number;
199
- const StatusUnauthenticated: number;
200
- }
201
-
202
- export default grpc;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes