@tothalex/cloud 0.0.40 → 0.0.44

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.
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@tothalex/cloud",
3
- "version": "0.0.40",
3
+ "version": "0.0.44",
4
4
  "main": "",
5
5
  "types": "./src/index.d.ts",
6
6
  "files": [
7
- "src/*.d.ts"
7
+ "src/**/*.d.ts"
8
8
  ],
9
9
  "scripts": {
10
10
  "build": "tsc",
@@ -0,0 +1,12 @@
1
+ declare module 'cloud/cache' {
2
+ import { Buffer } from 'buffer'
3
+
4
+ type CacheValue = number | string | boolean | Buffer | Record<string, unknown>
5
+ type Cache = {
6
+ set: (key: string, value: CacheValue) => Promise<void>
7
+ get: (key: string) => Promise<CacheValue>
8
+ remove: (key: string) => Promise<void>
9
+ has: (key: string) => boolean
10
+ }
11
+ export const cache: Cache
12
+ }
@@ -0,0 +1,3 @@
1
+ declare module 'cloud/event' {
2
+ export function send(eventName: string, payload: unknown): Promise<void>
3
+ }
@@ -0,0 +1,64 @@
1
+ declare module 'cloud/got' {
2
+ export interface GotOptions {
3
+ /** Request timeout in milliseconds */
4
+ timeout?: number
5
+ /** HTTP headers */
6
+ headers?: Record<string, string>
7
+ /** HTTP method (GET, POST, PUT, DELETE, PATCH, HEAD) */
8
+ method?: string
9
+ /** JSON body (automatically sets Content-Type: application/json) */
10
+ json?: unknown
11
+ /** Raw body string */
12
+ body?: string
13
+ /** Response type: 'json' (default) or 'text' */
14
+ responseType?: 'json' | 'text'
15
+ }
16
+
17
+ export interface GotResponse {
18
+ body: string
19
+ statusCode: number
20
+ headers: Record<string, string>
21
+ }
22
+
23
+ /**
24
+ * Make a GET request and return parsed JSON
25
+ * @param url The URL to request
26
+ * @param options Request options
27
+ * @returns Parsed JSON response (when responseType is 'json') or GotResponse object
28
+ */
29
+ export function get<T = unknown>(url: string, options?: GotOptions): Promise<T>
30
+
31
+ /**
32
+ * Make a POST request and return parsed JSON
33
+ * @param url The URL to request
34
+ * @param options Request options
35
+ * @returns Parsed JSON response (when responseType is 'json') or GotResponse object
36
+ */
37
+ export function post<T = unknown>(url: string, options?: GotOptions): Promise<T>
38
+
39
+ /**
40
+ * Make a PUT request and return parsed JSON
41
+ * @param url The URL to request
42
+ * @param options Request options
43
+ * @returns Parsed JSON response (when responseType is 'json') or GotResponse object
44
+ */
45
+ export function put<T = unknown>(url: string, options?: GotOptions): Promise<T>
46
+
47
+ /**
48
+ * Make a DELETE request and return parsed JSON
49
+ * @param url The URL to request
50
+ * @param options Request options
51
+ * @returns Parsed JSON response (when responseType is 'json') or GotResponse object
52
+ */
53
+ function _delete<T = unknown>(url: string, options?: GotOptions): Promise<T>
54
+ export { _delete as delete }
55
+
56
+ const got: {
57
+ get: typeof get
58
+ post: typeof post
59
+ put: typeof put
60
+ delete: typeof _delete
61
+ }
62
+
63
+ export default got
64
+ }
@@ -0,0 +1,10 @@
1
+ declare module 'cloud' {
2
+ export type HttpRequest<T = string> = {
3
+ id?: string
4
+ path: string
5
+ headers: Record<string, string>
6
+ query_params: Record<string, string>
7
+ params: Record<string, string>
8
+ body: T
9
+ }
10
+ }
@@ -0,0 +1,27 @@
1
+ declare module 'cloud/postgres' {
2
+ export type SQLTag = <T = unknown>(
3
+ strings: TemplateStringsArray,
4
+ ...values: unknown[]
5
+ ) => Promise<Array<T>>
6
+ export type DatabaseTransaction = {
7
+ sql: SQLTag
8
+ }
9
+ export type DatabaseQueryBuilder = {
10
+ push: (value: string) => DatabaseQueryBuilder
11
+ pushBind: (value: unknown) => DatabaseQueryBuilder
12
+ build: () => string
13
+ fetchAll: <T = unknown>() => Promise<Array<T>>
14
+ fetchOne: <T = unknown>() => Promise<T>
15
+ execute: () => Promise<number>
16
+ getQuery: () => string
17
+ }
18
+ export type Database = {
19
+ sql: SQLTag
20
+ fetchAll: <T = unknown>(query: string, values: unknown[]) => Promise<Array<T>>
21
+ fetchOne: <T = unknown>(query: string, values: unknown[]) => Promise<T>
22
+ execute: (query: string, values: unknown[]) => Promise<number>
23
+ query: (query: string) => DatabaseQueryBuilder
24
+ transaction: <T = void>(tx: (transaction: DatabaseTransaction) => Promise<T>) => Promise<T>
25
+ }
26
+ export function pg(url: string): Promise<Database>
27
+ }
@@ -0,0 +1,15 @@
1
+ declare module 'cloud/secret' {
2
+ type Secret = {
3
+ store: (key: string, value: string) => Promise<void>
4
+ get: (key: string) => Promise<string>
5
+ hash: (value: string) => string
6
+ verify_hash: (plain: string, hashed: string) => boolean
7
+ }
8
+ export const secret: Secret
9
+
10
+ type JWT = {
11
+ sign: (claims: Record<string, string>) => Promise<string>
12
+ verify: (token: string) => Promise<Record<string, string>>
13
+ }
14
+ export const jwt: JWT
15
+ }
@@ -0,0 +1,6 @@
1
+ declare module 'cloud/uuid' {
2
+ type UUID = {
3
+ toString(): string
4
+ }
5
+ export function uuid(id?: string): UUID
6
+ }
File without changes
package/src/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  /// <reference types="./cloud/cache.d.ts" />
2
2
  /// <reference types="./cloud/event.d.ts" />
3
+ /// <reference types="./cloud/got.d.ts" />
3
4
  /// <reference types="./cloud/index.d.ts" />
4
5
  /// <reference types="./cloud/postgres.d.ts" />
5
6
  /// <reference types="./cloud/secret.d.ts" />
@@ -0,0 +1,526 @@
1
+ type _ByteLengthQueuingStrategy = typeof globalThis extends { onmessage: any }
2
+ ? {}
3
+ : import("stream/web").ByteLengthQueuingStrategy;
4
+ type _CountQueuingStrategy = typeof globalThis extends { onmessage: any }
5
+ ? {}
6
+ : import("stream/web").CountQueuingStrategy;
7
+ type _ReadableByteStreamController = typeof globalThis extends {
8
+ onmessage: any;
9
+ }
10
+ ? {}
11
+ : import("stream/web").ReadableByteStreamController;
12
+ type _ReadableStream<R = any> = typeof globalThis extends { onmessage: any }
13
+ ? {}
14
+ : import("stream/web").ReadableStream<R>;
15
+ type _ReadableStreamBYOBReader = typeof globalThis extends { onmessage: any }
16
+ ? {}
17
+ : import("stream/web").ReadableStreamBYOBReader;
18
+ type _ReadableStreamBYOBRequest = typeof globalThis extends { onmessage: any }
19
+ ? {}
20
+ : import("stream/web").ReadableStreamBYOBRequest;
21
+ type _ReadableStreamDefaultController<R = any> = typeof globalThis extends {
22
+ onmessage: any;
23
+ }
24
+ ? {}
25
+ : import("stream/web").ReadableStreamDefaultController<R>;
26
+ type _ReadableStreamDefaultReader<R = any> = typeof globalThis extends {
27
+ onmessage: any;
28
+ }
29
+ ? {}
30
+ : import("stream/web").ReadableStreamDefaultReader<R>;
31
+ type _WritableStream<W = any> = typeof globalThis extends { onmessage: any }
32
+ ? {}
33
+ : import("stream/web").WritableStream<W>;
34
+ type _WritableStreamDefaultController = typeof globalThis extends {
35
+ onmessage: any;
36
+ }
37
+ ? {}
38
+ : import("stream/web").WritableStreamDefaultController;
39
+ type _WritableStreamDefaultWriter<W = any> = typeof globalThis extends {
40
+ onmessage: any;
41
+ }
42
+ ? {}
43
+ : import("stream/web").WritableStreamDefaultWriter<W>;
44
+
45
+ declare module "stream/web" {
46
+ // stub module, pending copy&paste from .d.ts or manual impl
47
+ // copy from lib.dom.d.ts
48
+ interface ReadableWritablePair<R = any, W = any> {
49
+ readable: ReadableStream<R>;
50
+ /**
51
+ * Provides a convenient, chainable way of piping this readable stream
52
+ * through a transform stream (or any other { writable, readable }
53
+ * pair). It simply pipes the stream into the writable side of the
54
+ * supplied pair, and returns the readable side for further use.
55
+ *
56
+ * Piping a stream will lock it for the duration of the pipe, preventing
57
+ * any other consumer from acquiring a reader.
58
+ */
59
+ writable: WritableStream<W>;
60
+ }
61
+ interface StreamPipeOptions {
62
+ preventAbort?: boolean;
63
+ preventCancel?: boolean;
64
+ /**
65
+ * Pipes this readable stream to a given writable stream destination.
66
+ * The way in which the piping process behaves under various error
67
+ * conditions can be customized with a number of passed options. It
68
+ * returns a promise that fulfills when the piping process completes
69
+ * successfully, or rejects if any errors were encountered.
70
+ *
71
+ * Piping a stream will lock it for the duration of the pipe, preventing
72
+ * any other consumer from acquiring a reader.
73
+ *
74
+ * Errors and closures of the source and destination streams propagate
75
+ * as follows:
76
+ *
77
+ * An error in this source readable stream will abort destination,
78
+ * unless preventAbort is truthy. The returned promise will be rejected
79
+ * with the source's error, or with any error that occurs during
80
+ * aborting the destination.
81
+ *
82
+ * An error in destination will cancel this source readable stream,
83
+ * unless preventCancel is truthy. The returned promise will be rejected
84
+ * with the destination's error, or with any error that occurs during
85
+ * canceling the source.
86
+ *
87
+ * When this source readable stream closes, destination will be closed,
88
+ * unless preventClose is truthy. The returned promise will be fulfilled
89
+ * once this process completes, unless an error is encountered while
90
+ * closing the destination, in which case it will be rejected with that
91
+ * error.
92
+ *
93
+ * If destination starts out closed or closing, this source readable
94
+ * stream will be canceled, unless preventCancel is true. The returned
95
+ * promise will be rejected with an error indicating piping to a closed
96
+ * stream failed, or with any error that occurs during canceling the
97
+ * source.
98
+ *
99
+ * The signal option can be set to an AbortSignal to allow aborting an
100
+ * ongoing pipe operation via the corresponding AbortController. In this
101
+ * case, this source readable stream will be canceled, and destination
102
+ * aborted, unless the respective options preventCancel or preventAbort
103
+ * are set.
104
+ */
105
+ preventClose?: boolean;
106
+ signal?: AbortSignal;
107
+ }
108
+ interface ReadableStreamGenericReader {
109
+ readonly closed: Promise<undefined>;
110
+ cancel(reason?: any): Promise<void>;
111
+ }
112
+ type ReadableStreamController<T> = ReadableStreamDefaultController<T>;
113
+ interface ReadableStreamReadValueResult<T> {
114
+ done: false;
115
+ value: T;
116
+ }
117
+ interface ReadableStreamReadDoneResult<T> {
118
+ done: true;
119
+ value?: T;
120
+ }
121
+ type ReadableStreamReadResult<T> =
122
+ | ReadableStreamReadValueResult<T>
123
+ | ReadableStreamReadDoneResult<T>;
124
+ interface ReadableByteStreamControllerCallback {
125
+ (controller: ReadableByteStreamController): void | PromiseLike<void>;
126
+ }
127
+ interface UnderlyingSinkAbortCallback {
128
+ (reason?: any): void | PromiseLike<void>;
129
+ }
130
+ interface UnderlyingSinkCloseCallback {
131
+ (): void | PromiseLike<void>;
132
+ }
133
+ interface UnderlyingSinkStartCallback {
134
+ (controller: WritableStreamDefaultController): any;
135
+ }
136
+ interface UnderlyingSinkWriteCallback<W> {
137
+ (
138
+ chunk: W,
139
+ controller: WritableStreamDefaultController
140
+ ): void | PromiseLike<void>;
141
+ }
142
+ interface UnderlyingSourceCancelCallback {
143
+ (reason?: any): void | PromiseLike<void>;
144
+ }
145
+ interface UnderlyingSourcePullCallback<R> {
146
+ (controller: ReadableStreamController<R>): void | PromiseLike<void>;
147
+ }
148
+ interface UnderlyingSourceStartCallback<R> {
149
+ (controller: ReadableStreamController<R>): any;
150
+ }
151
+ interface UnderlyingByteSource {
152
+ autoAllocateChunkSize?: number;
153
+ cancel?: ReadableStreamErrorCallback;
154
+ pull?: ReadableByteStreamControllerCallback;
155
+ start?: ReadableByteStreamControllerCallback;
156
+ type: "bytes";
157
+ }
158
+ interface UnderlyingSource<R = any> {
159
+ cancel?: UnderlyingSourceCancelCallback;
160
+ pull?: UnderlyingSourcePullCallback<R>;
161
+ start?: UnderlyingSourceStartCallback<R>;
162
+ type?: undefined;
163
+ }
164
+ interface UnderlyingSink<W = any> {
165
+ abort?: UnderlyingSinkAbortCallback;
166
+ close?: UnderlyingSinkCloseCallback;
167
+ start?: UnderlyingSinkStartCallback;
168
+ type?: undefined;
169
+ write?: UnderlyingSinkWriteCallback<W>;
170
+ }
171
+ interface ReadableStreamErrorCallback {
172
+ (reason: any): void | PromiseLike<void>;
173
+ }
174
+ interface ReadableStreamAsyncIterator<T> extends AsyncIterableIterator<T> {
175
+ [Symbol.asyncIterator](): ReadableStreamAsyncIterator<T>;
176
+ }
177
+ /** This Streams API interface represents a readable stream of byte data. */
178
+ interface ReadableStream<R = any> {
179
+ readonly locked: boolean;
180
+ cancel(reason?: any): Promise<void>;
181
+ getReader(options: { mode: "byob" }): ReadableStreamBYOBReader;
182
+ getReader(): ReadableStreamDefaultReader<R>;
183
+ getReader(
184
+ options?: ReadableStreamGetReaderOptions
185
+ ): ReadableStreamReader<R>;
186
+ pipeThrough<T>(
187
+ transform: ReadableWritablePair<T, R>,
188
+ options?: StreamPipeOptions
189
+ ): ReadableStream<T>;
190
+ pipeTo(
191
+ destination: WritableStream<R>,
192
+ options?: StreamPipeOptions
193
+ ): Promise<void>;
194
+ tee(): [ReadableStream<R>, ReadableStream<R>];
195
+ values(options?: {
196
+ preventCancel?: boolean;
197
+ }): ReadableStreamAsyncIterator<R>;
198
+ [Symbol.asyncIterator](): ReadableStreamAsyncIterator<R>;
199
+ }
200
+ const ReadableStream: {
201
+ prototype: ReadableStream;
202
+ from<T>(iterable: Iterable<T> | AsyncIterable<T>): ReadableStream<T>;
203
+ new (
204
+ underlyingSource: UnderlyingByteSource,
205
+ strategy?: QueuingStrategy<Uint8Array>
206
+ ): ReadableStream<Uint8Array>;
207
+ new <R = any>(
208
+ underlyingSource?: UnderlyingSource<R>,
209
+ strategy?: QueuingStrategy<R>
210
+ ): ReadableStream<R>;
211
+ };
212
+ type ReadableStreamReaderMode = "byob";
213
+ interface ReadableStreamGetReaderOptions {
214
+ /**
215
+ * Creates a ReadableStreamBYOBReader and locks the stream to the new reader.
216
+ *
217
+ * This call behaves the same way as the no-argument variant, except that it only works on readable byte streams, i.e. streams which were constructed specifically with the ability to handle "bring your own buffer" reading. The returned BYOB reader provides the ability to directly read individual chunks from the stream via its read() method, into developer-supplied buffers, allowing more precise control over allocation.
218
+ */
219
+ mode?: ReadableStreamReaderMode;
220
+ }
221
+ type ReadableStreamReader<T> =
222
+ | ReadableStreamDefaultReader<T>
223
+ | ReadableStreamBYOBReader;
224
+ interface ReadableStreamDefaultReader<R = any>
225
+ extends ReadableStreamGenericReader {
226
+ read(): Promise<ReadableStreamReadResult<R>>;
227
+ releaseLock(): void;
228
+ }
229
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */
230
+ interface ReadableStreamBYOBReader extends ReadableStreamGenericReader {
231
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
232
+ read<T extends ArrayBufferView>(
233
+ view: T
234
+ ): Promise<ReadableStreamReadResult<T>>;
235
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
236
+ releaseLock(): void;
237
+ }
238
+ const ReadableStreamDefaultReader: {
239
+ prototype: ReadableStreamDefaultReader;
240
+ new <R = any>(stream: ReadableStream<R>): ReadableStreamDefaultReader<R>;
241
+ };
242
+ const ReadableStreamBYOBReader: {
243
+ prototype: ReadableStreamBYOBReader;
244
+ new (stream: ReadableStream): ReadableStreamBYOBReader;
245
+ };
246
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
247
+ interface ReadableStreamBYOBRequest {
248
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
249
+ readonly view: ArrayBufferView | null;
250
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
251
+ respond(bytesWritten: number): void;
252
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
253
+ respondWithNewView(view: ArrayBufferView): void;
254
+ }
255
+ const ReadableStreamBYOBRequest: {
256
+ prototype: ReadableStreamBYOBRequest;
257
+ new (): ReadableStreamBYOBRequest;
258
+ };
259
+ interface ReadableByteStreamController {
260
+ readonly byobRequest: undefined;
261
+ readonly desiredSize: number | null;
262
+ close(): void;
263
+ enqueue(chunk: ArrayBufferView): void;
264
+ error(error?: any): void;
265
+ }
266
+ const ReadableByteStreamController: {
267
+ prototype: ReadableByteStreamController;
268
+ new (): ReadableByteStreamController;
269
+ };
270
+ interface ReadableStreamDefaultController<R = any> {
271
+ readonly desiredSize: number | null;
272
+ close(): void;
273
+ enqueue(chunk?: R): void;
274
+ error(e?: any): void;
275
+ }
276
+ const ReadableStreamDefaultController: {
277
+ prototype: ReadableStreamDefaultController;
278
+ new (): ReadableStreamDefaultController;
279
+ };
280
+ /**
281
+ * This Streams API interface provides a standard abstraction for writing
282
+ * streaming data to a destination, known as a sink. This object comes with
283
+ * built-in back pressure and queuing.
284
+ */
285
+ interface WritableStream<W = any> {
286
+ readonly locked: boolean;
287
+ abort(reason?: any): Promise<void>;
288
+ close(): Promise<void>;
289
+ getWriter(): WritableStreamDefaultWriter<W>;
290
+ }
291
+ const WritableStream: {
292
+ prototype: WritableStream;
293
+ new <W = any>(
294
+ underlyingSink?: UnderlyingSink<W>,
295
+ strategy?: QueuingStrategy<W>
296
+ ): WritableStream<W>;
297
+ };
298
+ /**
299
+ * This Streams API interface is the object returned by
300
+ * WritableStream.getWriter() and once created locks the < writer to the
301
+ * WritableStream ensuring that no other streams can write to the underlying
302
+ * sink.
303
+ */
304
+ interface WritableStreamDefaultWriter<W = any> {
305
+ readonly closed: Promise<undefined>;
306
+ readonly desiredSize: number | null;
307
+ readonly ready: Promise<undefined>;
308
+ abort(reason?: any): Promise<void>;
309
+ close(): Promise<void>;
310
+ releaseLock(): void;
311
+ write(chunk?: W): Promise<void>;
312
+ }
313
+ const WritableStreamDefaultWriter: {
314
+ prototype: WritableStreamDefaultWriter;
315
+ new <W = any>(stream: WritableStream<W>): WritableStreamDefaultWriter<W>;
316
+ };
317
+ /**
318
+ * This Streams API interface represents a controller allowing control of a
319
+ * WritableStream's state. When constructing a WritableStream, the
320
+ * underlying sink is given a corresponding WritableStreamDefaultController
321
+ * instance to manipulate.
322
+ */
323
+ interface WritableStreamDefaultController {
324
+ error(e?: any): void;
325
+ }
326
+ const WritableStreamDefaultController: {
327
+ prototype: WritableStreamDefaultController;
328
+ new (): WritableStreamDefaultController;
329
+ };
330
+ interface QueuingStrategy<T = any> {
331
+ highWaterMark?: number;
332
+ size?: QueuingStrategySize<T>;
333
+ }
334
+ interface QueuingStrategySize<T = any> {
335
+ (chunk?: T): number;
336
+ }
337
+ interface QueuingStrategyInit {
338
+ /**
339
+ * Creates a new ByteLengthQueuingStrategy with the provided high water
340
+ * mark.
341
+ *
342
+ * Note that the provided high water mark will not be validated ahead of
343
+ * time. Instead, if it is negative, NaN, or not a number, the resulting
344
+ * ByteLengthQueuingStrategy will cause the corresponding stream
345
+ * constructor to throw.
346
+ */
347
+ highWaterMark: number;
348
+ }
349
+ /**
350
+ * This Streams API interface provides a built-in byte length queuing
351
+ * strategy that can be used when constructing streams.
352
+ */
353
+ interface ByteLengthQueuingStrategy extends QueuingStrategy<ArrayBufferView> {
354
+ readonly highWaterMark: number;
355
+ readonly size: QueuingStrategySize<ArrayBufferView>;
356
+ }
357
+ const ByteLengthQueuingStrategy: {
358
+ prototype: ByteLengthQueuingStrategy;
359
+ new (init: QueuingStrategyInit): ByteLengthQueuingStrategy;
360
+ };
361
+ /**
362
+ * This Streams API interface provides a built-in byte length queuing
363
+ * strategy that can be used when constructing streams.
364
+ */
365
+ interface CountQueuingStrategy extends QueuingStrategy {
366
+ readonly highWaterMark: number;
367
+ readonly size: QueuingStrategySize;
368
+ }
369
+ const CountQueuingStrategy: {
370
+ prototype: CountQueuingStrategy;
371
+ new (init: QueuingStrategyInit): CountQueuingStrategy;
372
+ };
373
+
374
+ global {
375
+ interface ByteLengthQueuingStrategy extends _ByteLengthQueuingStrategy {}
376
+ /**
377
+ * `ByteLengthQueuingStrategy` class is a global reference for `import { ByteLengthQueuingStrategy } from 'node:stream/web'`.
378
+ * https://nodejs.org/api/globals.html#class-bytelengthqueuingstrategy
379
+ * @since v18.0.0
380
+ */
381
+ var ByteLengthQueuingStrategy: typeof globalThis extends {
382
+ onmessage: any;
383
+ ByteLengthQueuingStrategy: infer T;
384
+ }
385
+ ? T
386
+ : typeof import("stream/web").ByteLengthQueuingStrategy;
387
+
388
+ interface CountQueuingStrategy extends _CountQueuingStrategy {}
389
+ /**
390
+ * `CountQueuingStrategy` class is a global reference for `import { CountQueuingStrategy } from 'node:stream/web'`.
391
+ * https://nodejs.org/api/globals.html#class-countqueuingstrategy
392
+ * @since v18.0.0
393
+ */
394
+ var CountQueuingStrategy: typeof globalThis extends {
395
+ onmessage: any;
396
+ CountQueuingStrategy: infer T;
397
+ }
398
+ ? T
399
+ : typeof import("stream/web").CountQueuingStrategy;
400
+
401
+ interface ReadableByteStreamController
402
+ extends _ReadableByteStreamController {}
403
+ /**
404
+ * `ReadableByteStreamController` class is a global reference for `import { ReadableByteStreamController } from 'node:stream/web'`.
405
+ * https://nodejs.org/api/globals.html#class-readablebytestreamcontroller
406
+ * @since v18.0.0
407
+ */
408
+ var ReadableByteStreamController: typeof globalThis extends {
409
+ onmessage: any;
410
+ ReadableByteStreamController: infer T;
411
+ }
412
+ ? T
413
+ : typeof import("stream/web").ReadableByteStreamController;
414
+
415
+ interface ReadableStream<R = any> extends _ReadableStream<R> {}
416
+ /**
417
+ * `ReadableStream` class is a global reference for `import { ReadableStream } from 'node:stream/web'`.
418
+ * https://nodejs.org/api/globals.html#class-readablestream
419
+ * @since v18.0.0
420
+ */
421
+ var ReadableStream: typeof globalThis extends {
422
+ onmessage: any;
423
+ ReadableStream: infer T;
424
+ }
425
+ ? T
426
+ : typeof import("stream/web").ReadableStream;
427
+
428
+ interface ReadableStreamBYOBReader extends _ReadableStreamBYOBReader {}
429
+ /**
430
+ * `ReadableStreamBYOBReader` class is a global reference for `import { ReadableStreamBYOBReader } from 'node:stream/web'`.
431
+ * https://nodejs.org/api/globals.html#class-readablestreambyobreader
432
+ * @since v18.0.0
433
+ */
434
+ var ReadableStreamBYOBReader: typeof globalThis extends {
435
+ onmessage: any;
436
+ ReadableStreamBYOBReader: infer T;
437
+ }
438
+ ? T
439
+ : typeof import("stream/web").ReadableStreamBYOBReader;
440
+
441
+ interface ReadableStreamBYOBRequest extends _ReadableStreamBYOBRequest {}
442
+ /**
443
+ * `ReadableStreamBYOBRequest` class is a global reference for `import { ReadableStreamBYOBRequest } from 'node:stream/web'`.
444
+ * https://nodejs.org/api/globals.html#class-readablestreambyobrequest
445
+ * @since v18.0.0
446
+ */
447
+ var ReadableStreamBYOBRequest: typeof globalThis extends {
448
+ onmessage: any;
449
+ ReadableStreamBYOBRequest: infer T;
450
+ }
451
+ ? T
452
+ : typeof import("stream/web").ReadableStreamBYOBRequest;
453
+
454
+ interface ReadableStreamDefaultController<R = any>
455
+ extends _ReadableStreamDefaultController<R> {}
456
+ /**
457
+ * `ReadableStreamDefaultController` class is a global reference for `import { ReadableStreamDefaultController } from 'node:stream/web'`.
458
+ * https://nodejs.org/api/globals.html#class-readablestreamdefaultcontroller
459
+ * @since v18.0.0
460
+ */
461
+ var ReadableStreamDefaultController: typeof globalThis extends {
462
+ onmessage: any;
463
+ ReadableStreamDefaultController: infer T;
464
+ }
465
+ ? T
466
+ : typeof import("stream/web").ReadableStreamDefaultController;
467
+
468
+ interface ReadableStreamDefaultReader<R = any>
469
+ extends _ReadableStreamDefaultReader<R> {}
470
+ /**
471
+ * `ReadableStreamDefaultReader` class is a global reference for `import { ReadableStreamDefaultReader } from 'node:stream/web'`.
472
+ * https://nodejs.org/api/globals.html#class-readablestreamdefaultreader
473
+ * @since v18.0.0
474
+ */
475
+ var ReadableStreamDefaultReader: typeof globalThis extends {
476
+ onmessage: any;
477
+ ReadableStreamDefaultReader: infer T;
478
+ }
479
+ ? T
480
+ : typeof import("stream/web").ReadableStreamDefaultReader;
481
+
482
+ interface WritableStream<W = any> extends _WritableStream<W> {}
483
+ /**
484
+ * `WritableStream` class is a global reference for `import { WritableStream } from 'node:stream/web'`.
485
+ * https://nodejs.org/api/globals.html#class-writablestream
486
+ * @since v18.0.0
487
+ */
488
+ var WritableStream: typeof globalThis extends {
489
+ onmessage: any;
490
+ WritableStream: infer T;
491
+ }
492
+ ? T
493
+ : typeof import("stream/web").WritableStream;
494
+
495
+ interface WritableStreamDefaultController
496
+ extends _WritableStreamDefaultController {}
497
+ /**
498
+ * `WritableStreamDefaultController` class is a global reference for `import { WritableStreamDefaultController } from 'node:stream/web'`.
499
+ * https://nodejs.org/api/globals.html#class-writablestreamdefaultcontroller
500
+ * @since v18.0.0
501
+ */
502
+ var WritableStreamDefaultController: typeof globalThis extends {
503
+ onmessage: any;
504
+ WritableStreamDefaultController: infer T;
505
+ }
506
+ ? T
507
+ : typeof import("stream/web").WritableStreamDefaultController;
508
+
509
+ interface WritableStreamDefaultWriter<W = any>
510
+ extends _WritableStreamDefaultWriter<W> {}
511
+ /**
512
+ * `WritableStreamDefaultWriter` class is a global reference for `import { WritableStreamDefaultWriter } from 'node:stream/web'`.
513
+ * https://nodejs.org/api/globals.html#class-writablestreamdefaultwriter
514
+ * @since v18.0.0
515
+ */
516
+ var WritableStreamDefaultWriter: typeof globalThis extends {
517
+ onmessage: any;
518
+ WritableStreamDefaultWriter: infer T;
519
+ }
520
+ ? T
521
+ : typeof import("stream/web").WritableStreamDefaultWriter;
522
+ }
523
+ }
524
+ declare module "node:stream/web" {
525
+ export * from "stream/web";
526
+ }