mcpbrowser 0.2.1 → 0.2.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.
Files changed (134) hide show
  1. package/.mcpregistry_github_token +1 -0
  2. package/.mcpregistry_registry_token +1 -0
  3. package/README.md +50 -52
  4. package/extension/.vscodeignore +6 -0
  5. package/extension/LICENSE +21 -0
  6. package/extension/README.md +61 -0
  7. package/extension/icon.png +0 -0
  8. package/extension/icon.svg +35 -0
  9. package/extension/mcpbrowser-0.1.1.vsix +0 -0
  10. package/extension/mcpbrowser-0.1.2.vsix +0 -0
  11. package/extension/mcpbrowser-0.1.3.vsix +0 -0
  12. package/extension/mcpbrowser-0.1.4.vsix +0 -0
  13. package/extension/mcpbrowser-config-0.1.0.vsix +0 -0
  14. package/extension/node_modules/.package-lock.json +32 -0
  15. package/extension/node_modules/@types/node/LICENSE +21 -0
  16. package/extension/node_modules/@types/node/README.md +15 -0
  17. package/extension/node_modules/@types/node/assert/strict.d.ts +8 -0
  18. package/extension/node_modules/@types/node/assert.d.ts +1062 -0
  19. package/extension/node_modules/@types/node/async_hooks.d.ts +605 -0
  20. package/extension/node_modules/@types/node/buffer.buffer.d.ts +471 -0
  21. package/extension/node_modules/@types/node/buffer.d.ts +1936 -0
  22. package/extension/node_modules/@types/node/child_process.d.ts +1475 -0
  23. package/extension/node_modules/@types/node/cluster.d.ts +577 -0
  24. package/extension/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
  25. package/extension/node_modules/@types/node/compatibility/index.d.ts +9 -0
  26. package/extension/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
  27. package/extension/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  28. package/extension/node_modules/@types/node/console.d.ts +452 -0
  29. package/extension/node_modules/@types/node/constants.d.ts +21 -0
  30. package/extension/node_modules/@types/node/crypto.d.ts +4590 -0
  31. package/extension/node_modules/@types/node/dgram.d.ts +597 -0
  32. package/extension/node_modules/@types/node/diagnostics_channel.d.ts +578 -0
  33. package/extension/node_modules/@types/node/dns/promises.d.ts +479 -0
  34. package/extension/node_modules/@types/node/dns.d.ts +871 -0
  35. package/extension/node_modules/@types/node/domain.d.ts +170 -0
  36. package/extension/node_modules/@types/node/events.d.ts +977 -0
  37. package/extension/node_modules/@types/node/fs/promises.d.ts +1270 -0
  38. package/extension/node_modules/@types/node/fs.d.ts +4375 -0
  39. package/extension/node_modules/@types/node/globals.d.ts +172 -0
  40. package/extension/node_modules/@types/node/globals.typedarray.d.ts +38 -0
  41. package/extension/node_modules/@types/node/http.d.ts +2049 -0
  42. package/extension/node_modules/@types/node/http2.d.ts +2631 -0
  43. package/extension/node_modules/@types/node/https.d.ts +578 -0
  44. package/extension/node_modules/@types/node/index.d.ts +93 -0
  45. package/extension/node_modules/@types/node/inspector.generated.d.ts +3966 -0
  46. package/extension/node_modules/@types/node/module.d.ts +539 -0
  47. package/extension/node_modules/@types/node/net.d.ts +1012 -0
  48. package/extension/node_modules/@types/node/os.d.ts +506 -0
  49. package/extension/node_modules/@types/node/package.json +140 -0
  50. package/extension/node_modules/@types/node/path.d.ts +200 -0
  51. package/extension/node_modules/@types/node/perf_hooks.d.ts +961 -0
  52. package/extension/node_modules/@types/node/process.d.ts +1957 -0
  53. package/extension/node_modules/@types/node/punycode.d.ts +117 -0
  54. package/extension/node_modules/@types/node/querystring.d.ts +152 -0
  55. package/extension/node_modules/@types/node/readline/promises.d.ts +162 -0
  56. package/extension/node_modules/@types/node/readline.d.ts +589 -0
  57. package/extension/node_modules/@types/node/repl.d.ts +430 -0
  58. package/extension/node_modules/@types/node/sea.d.ts +153 -0
  59. package/extension/node_modules/@types/node/stream/consumers.d.ts +38 -0
  60. package/extension/node_modules/@types/node/stream/promises.d.ts +90 -0
  61. package/extension/node_modules/@types/node/stream/web.d.ts +533 -0
  62. package/extension/node_modules/@types/node/stream.d.ts +1675 -0
  63. package/extension/node_modules/@types/node/string_decoder.d.ts +67 -0
  64. package/extension/node_modules/@types/node/test.d.ts +1787 -0
  65. package/extension/node_modules/@types/node/timers/promises.d.ts +108 -0
  66. package/extension/node_modules/@types/node/timers.d.ts +286 -0
  67. package/extension/node_modules/@types/node/tls.d.ts +1255 -0
  68. package/extension/node_modules/@types/node/trace_events.d.ts +197 -0
  69. package/extension/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
  70. package/extension/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +34 -0
  71. package/extension/node_modules/@types/node/ts5.6/index.d.ts +93 -0
  72. package/extension/node_modules/@types/node/tty.d.ts +208 -0
  73. package/extension/node_modules/@types/node/url.d.ts +964 -0
  74. package/extension/node_modules/@types/node/util.d.ts +2331 -0
  75. package/extension/node_modules/@types/node/v8.d.ts +809 -0
  76. package/extension/node_modules/@types/node/vm.d.ts +1001 -0
  77. package/extension/node_modules/@types/node/wasi.d.ts +181 -0
  78. package/extension/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
  79. package/extension/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  80. package/extension/node_modules/@types/node/web-globals/events.d.ts +97 -0
  81. package/extension/node_modules/@types/node/web-globals/fetch.d.ts +46 -0
  82. package/extension/node_modules/@types/node/worker_threads.d.ts +715 -0
  83. package/extension/node_modules/@types/node/zlib.d.ts +540 -0
  84. package/extension/node_modules/@types/vscode/LICENSE +21 -0
  85. package/extension/node_modules/@types/vscode/README.md +15 -0
  86. package/extension/node_modules/@types/vscode/index.d.ts +21153 -0
  87. package/extension/node_modules/@types/vscode/package.json +26 -0
  88. package/extension/node_modules/undici-types/LICENSE +21 -0
  89. package/extension/node_modules/undici-types/README.md +6 -0
  90. package/extension/node_modules/undici-types/agent.d.ts +31 -0
  91. package/extension/node_modules/undici-types/api.d.ts +43 -0
  92. package/extension/node_modules/undici-types/balanced-pool.d.ts +29 -0
  93. package/extension/node_modules/undici-types/cache.d.ts +36 -0
  94. package/extension/node_modules/undici-types/client.d.ts +108 -0
  95. package/extension/node_modules/undici-types/connector.d.ts +34 -0
  96. package/extension/node_modules/undici-types/content-type.d.ts +21 -0
  97. package/extension/node_modules/undici-types/cookies.d.ts +28 -0
  98. package/extension/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
  99. package/extension/node_modules/undici-types/dispatcher.d.ts +256 -0
  100. package/extension/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
  101. package/extension/node_modules/undici-types/errors.d.ts +149 -0
  102. package/extension/node_modules/undici-types/eventsource.d.ts +61 -0
  103. package/extension/node_modules/undici-types/fetch.d.ts +209 -0
  104. package/extension/node_modules/undici-types/file.d.ts +39 -0
  105. package/extension/node_modules/undici-types/filereader.d.ts +54 -0
  106. package/extension/node_modules/undici-types/formdata.d.ts +108 -0
  107. package/extension/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  108. package/extension/node_modules/undici-types/global-origin.d.ts +7 -0
  109. package/extension/node_modules/undici-types/handlers.d.ts +15 -0
  110. package/extension/node_modules/undici-types/header.d.ts +4 -0
  111. package/extension/node_modules/undici-types/index.d.ts +71 -0
  112. package/extension/node_modules/undici-types/interceptors.d.ts +17 -0
  113. package/extension/node_modules/undici-types/mock-agent.d.ts +50 -0
  114. package/extension/node_modules/undici-types/mock-client.d.ts +25 -0
  115. package/extension/node_modules/undici-types/mock-errors.d.ts +12 -0
  116. package/extension/node_modules/undici-types/mock-interceptor.d.ts +93 -0
  117. package/extension/node_modules/undici-types/mock-pool.d.ts +25 -0
  118. package/extension/node_modules/undici-types/package.json +55 -0
  119. package/extension/node_modules/undici-types/patch.d.ts +33 -0
  120. package/extension/node_modules/undici-types/pool-stats.d.ts +19 -0
  121. package/extension/node_modules/undici-types/pool.d.ts +39 -0
  122. package/extension/node_modules/undici-types/proxy-agent.d.ts +28 -0
  123. package/extension/node_modules/undici-types/readable.d.ts +65 -0
  124. package/extension/node_modules/undici-types/retry-agent.d.ts +8 -0
  125. package/extension/node_modules/undici-types/retry-handler.d.ts +116 -0
  126. package/extension/node_modules/undici-types/util.d.ts +18 -0
  127. package/extension/node_modules/undici-types/webidl.d.ts +228 -0
  128. package/extension/node_modules/undici-types/websocket.d.ts +150 -0
  129. package/extension/package-lock.json +44 -0
  130. package/extension/package.json +55 -0
  131. package/extension/src/extension.js +257 -0
  132. package/package.json +1 -1
  133. package/server.json +3 -3
  134. package/src/mcp-browser.js +1 -1
@@ -0,0 +1,90 @@
1
+ declare module "stream/promises" {
2
+ import {
3
+ FinishedOptions as _FinishedOptions,
4
+ PipelineDestination,
5
+ PipelineOptions,
6
+ PipelinePromise,
7
+ PipelineSource,
8
+ PipelineTransform,
9
+ } from "node:stream";
10
+ interface FinishedOptions extends _FinishedOptions {
11
+ /**
12
+ * If true, removes the listeners registered by this function before the promise is fulfilled.
13
+ * @default false
14
+ */
15
+ cleanup?: boolean | undefined;
16
+ }
17
+ function finished(
18
+ stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream,
19
+ options?: FinishedOptions,
20
+ ): Promise<void>;
21
+ function pipeline<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(
22
+ source: A,
23
+ destination: B,
24
+ options?: PipelineOptions,
25
+ ): PipelinePromise<B>;
26
+ function pipeline<
27
+ A extends PipelineSource<any>,
28
+ T1 extends PipelineTransform<A, any>,
29
+ B extends PipelineDestination<T1, any>,
30
+ >(
31
+ source: A,
32
+ transform1: T1,
33
+ destination: B,
34
+ options?: PipelineOptions,
35
+ ): PipelinePromise<B>;
36
+ function pipeline<
37
+ A extends PipelineSource<any>,
38
+ T1 extends PipelineTransform<A, any>,
39
+ T2 extends PipelineTransform<T1, any>,
40
+ B extends PipelineDestination<T2, any>,
41
+ >(
42
+ source: A,
43
+ transform1: T1,
44
+ transform2: T2,
45
+ destination: B,
46
+ options?: PipelineOptions,
47
+ ): PipelinePromise<B>;
48
+ function pipeline<
49
+ A extends PipelineSource<any>,
50
+ T1 extends PipelineTransform<A, any>,
51
+ T2 extends PipelineTransform<T1, any>,
52
+ T3 extends PipelineTransform<T2, any>,
53
+ B extends PipelineDestination<T3, any>,
54
+ >(
55
+ source: A,
56
+ transform1: T1,
57
+ transform2: T2,
58
+ transform3: T3,
59
+ destination: B,
60
+ options?: PipelineOptions,
61
+ ): PipelinePromise<B>;
62
+ function pipeline<
63
+ A extends PipelineSource<any>,
64
+ T1 extends PipelineTransform<A, any>,
65
+ T2 extends PipelineTransform<T1, any>,
66
+ T3 extends PipelineTransform<T2, any>,
67
+ T4 extends PipelineTransform<T3, any>,
68
+ B extends PipelineDestination<T4, any>,
69
+ >(
70
+ source: A,
71
+ transform1: T1,
72
+ transform2: T2,
73
+ transform3: T3,
74
+ transform4: T4,
75
+ destination: B,
76
+ options?: PipelineOptions,
77
+ ): PipelinePromise<B>;
78
+ function pipeline(
79
+ streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>,
80
+ options?: PipelineOptions,
81
+ ): Promise<void>;
82
+ function pipeline(
83
+ stream1: NodeJS.ReadableStream,
84
+ stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
85
+ ...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream | PipelineOptions>
86
+ ): Promise<void>;
87
+ }
88
+ declare module "node:stream/promises" {
89
+ export * from "stream/promises";
90
+ }
@@ -0,0 +1,533 @@
1
+ type _ByteLengthQueuingStrategy = typeof globalThis extends { onmessage: any } ? {}
2
+ : import("stream/web").ByteLengthQueuingStrategy;
3
+ type _CompressionStream = typeof globalThis extends { onmessage: any; ReportingObserver: any } ? {}
4
+ : import("stream/web").CompressionStream;
5
+ type _CountQueuingStrategy = typeof globalThis extends { onmessage: any } ? {}
6
+ : import("stream/web").CountQueuingStrategy;
7
+ type _DecompressionStream = typeof globalThis extends { onmessage: any; ReportingObserver: any } ? {}
8
+ : import("stream/web").DecompressionStream;
9
+ type _QueuingStrategy<T = any> = typeof globalThis extends { onmessage: any } ? {}
10
+ : import("stream/web").QueuingStrategy<T>;
11
+ type _ReadableByteStreamController = typeof globalThis extends { onmessage: any } ? {}
12
+ : import("stream/web").ReadableByteStreamController;
13
+ type _ReadableStream<R = any> = typeof globalThis extends { onmessage: any } ? {}
14
+ : import("stream/web").ReadableStream<R>;
15
+ type _ReadableStreamBYOBReader = typeof globalThis extends { onmessage: any } ? {}
16
+ : import("stream/web").ReadableStreamBYOBReader;
17
+ type _ReadableStreamBYOBRequest = typeof globalThis extends { onmessage: any } ? {}
18
+ : import("stream/web").ReadableStreamBYOBRequest;
19
+ type _ReadableStreamDefaultController<R = any> = typeof globalThis extends { onmessage: any } ? {}
20
+ : import("stream/web").ReadableStreamDefaultController<R>;
21
+ type _ReadableStreamDefaultReader<R = any> = typeof globalThis extends { onmessage: any } ? {}
22
+ : import("stream/web").ReadableStreamDefaultReader<R>;
23
+ type _TextDecoderStream = typeof globalThis extends { onmessage: any } ? {}
24
+ : import("stream/web").TextDecoderStream;
25
+ type _TextEncoderStream = typeof globalThis extends { onmessage: any } ? {}
26
+ : import("stream/web").TextEncoderStream;
27
+ type _TransformStream<I = any, O = any> = typeof globalThis extends { onmessage: any } ? {}
28
+ : import("stream/web").TransformStream<I, O>;
29
+ type _TransformStreamDefaultController<O = any> = typeof globalThis extends { onmessage: any } ? {}
30
+ : import("stream/web").TransformStreamDefaultController<O>;
31
+ type _WritableStream<W = any> = typeof globalThis extends { onmessage: any } ? {}
32
+ : import("stream/web").WritableStream<W>;
33
+ type _WritableStreamDefaultController = typeof globalThis extends { onmessage: any } ? {}
34
+ : import("stream/web").WritableStreamDefaultController;
35
+ type _WritableStreamDefaultWriter<W = any> = typeof globalThis extends { onmessage: any } ? {}
36
+ : import("stream/web").WritableStreamDefaultWriter<W>;
37
+
38
+ declare module "stream/web" {
39
+ // stub module, pending copy&paste from .d.ts or manual impl
40
+ // copy from lib.dom.d.ts
41
+ interface ReadableWritablePair<R = any, W = any> {
42
+ readable: ReadableStream<R>;
43
+ /**
44
+ * Provides a convenient, chainable way of piping this readable stream
45
+ * through a transform stream (or any other { writable, readable }
46
+ * pair). It simply pipes the stream into the writable side of the
47
+ * supplied pair, and returns the readable side for further use.
48
+ *
49
+ * Piping a stream will lock it for the duration of the pipe, preventing
50
+ * any other consumer from acquiring a reader.
51
+ */
52
+ writable: WritableStream<W>;
53
+ }
54
+ interface StreamPipeOptions {
55
+ preventAbort?: boolean;
56
+ preventCancel?: boolean;
57
+ /**
58
+ * Pipes this readable stream to a given writable stream destination.
59
+ * The way in which the piping process behaves under various error
60
+ * conditions can be customized with a number of passed options. It
61
+ * returns a promise that fulfills when the piping process completes
62
+ * successfully, or rejects if any errors were encountered.
63
+ *
64
+ * Piping a stream will lock it for the duration of the pipe, preventing
65
+ * any other consumer from acquiring a reader.
66
+ *
67
+ * Errors and closures of the source and destination streams propagate
68
+ * as follows:
69
+ *
70
+ * An error in this source readable stream will abort destination,
71
+ * unless preventAbort is truthy. The returned promise will be rejected
72
+ * with the source's error, or with any error that occurs during
73
+ * aborting the destination.
74
+ *
75
+ * An error in destination will cancel this source readable stream,
76
+ * unless preventCancel is truthy. The returned promise will be rejected
77
+ * with the destination's error, or with any error that occurs during
78
+ * canceling the source.
79
+ *
80
+ * When this source readable stream closes, destination will be closed,
81
+ * unless preventClose is truthy. The returned promise will be fulfilled
82
+ * once this process completes, unless an error is encountered while
83
+ * closing the destination, in which case it will be rejected with that
84
+ * error.
85
+ *
86
+ * If destination starts out closed or closing, this source readable
87
+ * stream will be canceled, unless preventCancel is true. The returned
88
+ * promise will be rejected with an error indicating piping to a closed
89
+ * stream failed, or with any error that occurs during canceling the
90
+ * source.
91
+ *
92
+ * The signal option can be set to an AbortSignal to allow aborting an
93
+ * ongoing pipe operation via the corresponding AbortController. In this
94
+ * case, this source readable stream will be canceled, and destination
95
+ * aborted, unless the respective options preventCancel or preventAbort
96
+ * are set.
97
+ */
98
+ preventClose?: boolean;
99
+ signal?: AbortSignal;
100
+ }
101
+ interface ReadableStreamGenericReader {
102
+ readonly closed: Promise<void>;
103
+ cancel(reason?: any): Promise<void>;
104
+ }
105
+ type ReadableStreamController<T> = ReadableStreamDefaultController<T>;
106
+ interface ReadableStreamReadValueResult<T> {
107
+ done: false;
108
+ value: T;
109
+ }
110
+ interface ReadableStreamReadDoneResult<T> {
111
+ done: true;
112
+ value?: T;
113
+ }
114
+ type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult<T>;
115
+ interface ReadableByteStreamControllerCallback {
116
+ (controller: ReadableByteStreamController): void | PromiseLike<void>;
117
+ }
118
+ interface UnderlyingSinkAbortCallback {
119
+ (reason?: any): void | PromiseLike<void>;
120
+ }
121
+ interface UnderlyingSinkCloseCallback {
122
+ (): void | PromiseLike<void>;
123
+ }
124
+ interface UnderlyingSinkStartCallback {
125
+ (controller: WritableStreamDefaultController): any;
126
+ }
127
+ interface UnderlyingSinkWriteCallback<W> {
128
+ (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike<void>;
129
+ }
130
+ interface UnderlyingSourceCancelCallback {
131
+ (reason?: any): void | PromiseLike<void>;
132
+ }
133
+ interface UnderlyingSourcePullCallback<R> {
134
+ (controller: ReadableStreamController<R>): void | PromiseLike<void>;
135
+ }
136
+ interface UnderlyingSourceStartCallback<R> {
137
+ (controller: ReadableStreamController<R>): any;
138
+ }
139
+ interface TransformerFlushCallback<O> {
140
+ (controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
141
+ }
142
+ interface TransformerStartCallback<O> {
143
+ (controller: TransformStreamDefaultController<O>): any;
144
+ }
145
+ interface TransformerTransformCallback<I, O> {
146
+ (chunk: I, controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
147
+ }
148
+ interface UnderlyingByteSource {
149
+ autoAllocateChunkSize?: number;
150
+ cancel?: ReadableStreamErrorCallback;
151
+ pull?: ReadableByteStreamControllerCallback;
152
+ start?: ReadableByteStreamControllerCallback;
153
+ type: "bytes";
154
+ }
155
+ interface UnderlyingSource<R = any> {
156
+ cancel?: UnderlyingSourceCancelCallback;
157
+ pull?: UnderlyingSourcePullCallback<R>;
158
+ start?: UnderlyingSourceStartCallback<R>;
159
+ type?: undefined;
160
+ }
161
+ interface UnderlyingSink<W = any> {
162
+ abort?: UnderlyingSinkAbortCallback;
163
+ close?: UnderlyingSinkCloseCallback;
164
+ start?: UnderlyingSinkStartCallback;
165
+ type?: undefined;
166
+ write?: UnderlyingSinkWriteCallback<W>;
167
+ }
168
+ interface ReadableStreamErrorCallback {
169
+ (reason: any): void | PromiseLike<void>;
170
+ }
171
+ interface ReadableStreamAsyncIterator<T> extends NodeJS.AsyncIterator<T, NodeJS.BuiltinIteratorReturn, unknown> {
172
+ [Symbol.asyncIterator](): ReadableStreamAsyncIterator<T>;
173
+ }
174
+ /** This Streams API interface represents a readable stream of byte data. */
175
+ interface ReadableStream<R = any> {
176
+ readonly locked: boolean;
177
+ cancel(reason?: any): Promise<void>;
178
+ getReader(options: { mode: "byob" }): ReadableStreamBYOBReader;
179
+ getReader(): ReadableStreamDefaultReader<R>;
180
+ getReader(options?: ReadableStreamGetReaderOptions): ReadableStreamReader<R>;
181
+ pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
182
+ pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
183
+ tee(): [ReadableStream<R>, ReadableStream<R>];
184
+ values(options?: { preventCancel?: boolean }): ReadableStreamAsyncIterator<R>;
185
+ [Symbol.asyncIterator](): ReadableStreamAsyncIterator<R>;
186
+ }
187
+ const ReadableStream: {
188
+ prototype: ReadableStream;
189
+ from<T>(iterable: Iterable<T> | AsyncIterable<T>): ReadableStream<T>;
190
+ new(underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy<Uint8Array>): ReadableStream<Uint8Array>;
191
+ new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
192
+ };
193
+ type ReadableStreamReaderMode = "byob";
194
+ interface ReadableStreamGetReaderOptions {
195
+ /**
196
+ * Creates a ReadableStreamBYOBReader and locks the stream to the new reader.
197
+ *
198
+ * 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.
199
+ */
200
+ mode?: ReadableStreamReaderMode;
201
+ }
202
+ type ReadableStreamReader<T> = ReadableStreamDefaultReader<T> | ReadableStreamBYOBReader;
203
+ interface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader {
204
+ read(): Promise<ReadableStreamReadResult<R>>;
205
+ releaseLock(): void;
206
+ }
207
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */
208
+ interface ReadableStreamBYOBReader extends ReadableStreamGenericReader {
209
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
210
+ read<T extends ArrayBufferView>(
211
+ view: T,
212
+ options?: {
213
+ min?: number;
214
+ },
215
+ ): Promise<ReadableStreamReadResult<T>>;
216
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
217
+ releaseLock(): void;
218
+ }
219
+ const ReadableStreamDefaultReader: {
220
+ prototype: ReadableStreamDefaultReader;
221
+ new<R = any>(stream: ReadableStream<R>): ReadableStreamDefaultReader<R>;
222
+ };
223
+ const ReadableStreamBYOBReader: {
224
+ prototype: ReadableStreamBYOBReader;
225
+ new(stream: ReadableStream): ReadableStreamBYOBReader;
226
+ };
227
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
228
+ interface ReadableStreamBYOBRequest {
229
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
230
+ readonly view: ArrayBufferView | null;
231
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
232
+ respond(bytesWritten: number): void;
233
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
234
+ respondWithNewView(view: ArrayBufferView): void;
235
+ }
236
+ const ReadableStreamBYOBRequest: {
237
+ prototype: ReadableStreamBYOBRequest;
238
+ new(): ReadableStreamBYOBRequest;
239
+ };
240
+ interface ReadableByteStreamController {
241
+ readonly byobRequest: undefined;
242
+ readonly desiredSize: number | null;
243
+ close(): void;
244
+ enqueue(chunk: ArrayBufferView): void;
245
+ error(error?: any): void;
246
+ }
247
+ const ReadableByteStreamController: {
248
+ prototype: ReadableByteStreamController;
249
+ new(): ReadableByteStreamController;
250
+ };
251
+ interface ReadableStreamDefaultController<R = any> {
252
+ readonly desiredSize: number | null;
253
+ close(): void;
254
+ enqueue(chunk?: R): void;
255
+ error(e?: any): void;
256
+ }
257
+ const ReadableStreamDefaultController: {
258
+ prototype: ReadableStreamDefaultController;
259
+ new(): ReadableStreamDefaultController;
260
+ };
261
+ interface Transformer<I = any, O = any> {
262
+ flush?: TransformerFlushCallback<O>;
263
+ readableType?: undefined;
264
+ start?: TransformerStartCallback<O>;
265
+ transform?: TransformerTransformCallback<I, O>;
266
+ writableType?: undefined;
267
+ }
268
+ interface TransformStream<I = any, O = any> {
269
+ readonly readable: ReadableStream<O>;
270
+ readonly writable: WritableStream<I>;
271
+ }
272
+ const TransformStream: {
273
+ prototype: TransformStream;
274
+ new<I = any, O = any>(
275
+ transformer?: Transformer<I, O>,
276
+ writableStrategy?: QueuingStrategy<I>,
277
+ readableStrategy?: QueuingStrategy<O>,
278
+ ): TransformStream<I, O>;
279
+ };
280
+ interface TransformStreamDefaultController<O = any> {
281
+ readonly desiredSize: number | null;
282
+ enqueue(chunk?: O): void;
283
+ error(reason?: any): void;
284
+ terminate(): void;
285
+ }
286
+ const TransformStreamDefaultController: {
287
+ prototype: TransformStreamDefaultController;
288
+ new(): TransformStreamDefaultController;
289
+ };
290
+ /**
291
+ * This Streams API interface provides a standard abstraction for writing
292
+ * streaming data to a destination, known as a sink. This object comes with
293
+ * built-in back pressure and queuing.
294
+ */
295
+ interface WritableStream<W = any> {
296
+ readonly locked: boolean;
297
+ abort(reason?: any): Promise<void>;
298
+ close(): Promise<void>;
299
+ getWriter(): WritableStreamDefaultWriter<W>;
300
+ }
301
+ const WritableStream: {
302
+ prototype: WritableStream;
303
+ new<W = any>(underlyingSink?: UnderlyingSink<W>, strategy?: QueuingStrategy<W>): WritableStream<W>;
304
+ };
305
+ /**
306
+ * This Streams API interface is the object returned by
307
+ * WritableStream.getWriter() and once created locks the < writer to the
308
+ * WritableStream ensuring that no other streams can write to the underlying
309
+ * sink.
310
+ */
311
+ interface WritableStreamDefaultWriter<W = any> {
312
+ readonly closed: Promise<void>;
313
+ readonly desiredSize: number | null;
314
+ readonly ready: Promise<void>;
315
+ abort(reason?: any): Promise<void>;
316
+ close(): Promise<void>;
317
+ releaseLock(): void;
318
+ write(chunk?: W): Promise<void>;
319
+ }
320
+ const WritableStreamDefaultWriter: {
321
+ prototype: WritableStreamDefaultWriter;
322
+ new<W = any>(stream: WritableStream<W>): WritableStreamDefaultWriter<W>;
323
+ };
324
+ /**
325
+ * This Streams API interface represents a controller allowing control of a
326
+ * WritableStream's state. When constructing a WritableStream, the
327
+ * underlying sink is given a corresponding WritableStreamDefaultController
328
+ * instance to manipulate.
329
+ */
330
+ interface WritableStreamDefaultController {
331
+ error(e?: any): void;
332
+ }
333
+ const WritableStreamDefaultController: {
334
+ prototype: WritableStreamDefaultController;
335
+ new(): WritableStreamDefaultController;
336
+ };
337
+ interface QueuingStrategy<T = any> {
338
+ highWaterMark?: number;
339
+ size?: QueuingStrategySize<T>;
340
+ }
341
+ interface QueuingStrategySize<T = any> {
342
+ (chunk?: T): number;
343
+ }
344
+ interface QueuingStrategyInit {
345
+ /**
346
+ * Creates a new ByteLengthQueuingStrategy with the provided high water
347
+ * mark.
348
+ *
349
+ * Note that the provided high water mark will not be validated ahead of
350
+ * time. Instead, if it is negative, NaN, or not a number, the resulting
351
+ * ByteLengthQueuingStrategy will cause the corresponding stream
352
+ * constructor to throw.
353
+ */
354
+ highWaterMark: number;
355
+ }
356
+ /**
357
+ * This Streams API interface provides a built-in byte length queuing
358
+ * strategy that can be used when constructing streams.
359
+ */
360
+ interface ByteLengthQueuingStrategy extends QueuingStrategy<ArrayBufferView> {
361
+ readonly highWaterMark: number;
362
+ readonly size: QueuingStrategySize<ArrayBufferView>;
363
+ }
364
+ const ByteLengthQueuingStrategy: {
365
+ prototype: ByteLengthQueuingStrategy;
366
+ new(init: QueuingStrategyInit): ByteLengthQueuingStrategy;
367
+ };
368
+ /**
369
+ * This Streams API interface provides a built-in byte length queuing
370
+ * strategy that can be used when constructing streams.
371
+ */
372
+ interface CountQueuingStrategy extends QueuingStrategy {
373
+ readonly highWaterMark: number;
374
+ readonly size: QueuingStrategySize;
375
+ }
376
+ const CountQueuingStrategy: {
377
+ prototype: CountQueuingStrategy;
378
+ new(init: QueuingStrategyInit): CountQueuingStrategy;
379
+ };
380
+ interface TextEncoderStream {
381
+ /** Returns "utf-8". */
382
+ readonly encoding: "utf-8";
383
+ readonly readable: ReadableStream<Uint8Array>;
384
+ readonly writable: WritableStream<string>;
385
+ readonly [Symbol.toStringTag]: string;
386
+ }
387
+ const TextEncoderStream: {
388
+ prototype: TextEncoderStream;
389
+ new(): TextEncoderStream;
390
+ };
391
+ interface TextDecoderOptions {
392
+ fatal?: boolean;
393
+ ignoreBOM?: boolean;
394
+ }
395
+ type BufferSource = ArrayBufferView | ArrayBuffer;
396
+ interface TextDecoderStream {
397
+ /** Returns encoding's name, lower cased. */
398
+ readonly encoding: string;
399
+ /** Returns `true` if error mode is "fatal", and `false` otherwise. */
400
+ readonly fatal: boolean;
401
+ /** Returns `true` if ignore BOM flag is set, and `false` otherwise. */
402
+ readonly ignoreBOM: boolean;
403
+ readonly readable: ReadableStream<string>;
404
+ readonly writable: WritableStream<BufferSource>;
405
+ readonly [Symbol.toStringTag]: string;
406
+ }
407
+ const TextDecoderStream: {
408
+ prototype: TextDecoderStream;
409
+ new(encoding?: string, options?: TextDecoderOptions): TextDecoderStream;
410
+ };
411
+ interface CompressionStream {
412
+ readonly readable: ReadableStream;
413
+ readonly writable: WritableStream;
414
+ }
415
+ const CompressionStream: {
416
+ prototype: CompressionStream;
417
+ new(format: "deflate" | "deflate-raw" | "gzip"): CompressionStream;
418
+ };
419
+ interface DecompressionStream {
420
+ readonly writable: WritableStream;
421
+ readonly readable: ReadableStream;
422
+ }
423
+ const DecompressionStream: {
424
+ prototype: DecompressionStream;
425
+ new(format: "deflate" | "deflate-raw" | "gzip"): DecompressionStream;
426
+ };
427
+
428
+ global {
429
+ interface ByteLengthQueuingStrategy extends _ByteLengthQueuingStrategy {}
430
+ var ByteLengthQueuingStrategy: typeof globalThis extends { onmessage: any; ByteLengthQueuingStrategy: infer T }
431
+ ? T
432
+ : typeof import("stream/web").ByteLengthQueuingStrategy;
433
+
434
+ interface CompressionStream extends _CompressionStream {}
435
+ var CompressionStream: typeof globalThis extends {
436
+ onmessage: any;
437
+ // CompressionStream, DecompressionStream and ReportingObserver was introduced in the same commit.
438
+ // If ReportingObserver check is removed, the type here will form a circular reference in TS5.0+lib.dom.d.ts
439
+ ReportingObserver: any;
440
+ CompressionStream: infer T;
441
+ } ? T
442
+ // TS 4.8, 4.9, 5.0
443
+ : typeof globalThis extends { onmessage: any; TransformStream: { prototype: infer T } } ? {
444
+ prototype: T;
445
+ new(format: "deflate" | "deflate-raw" | "gzip"): T;
446
+ }
447
+ : typeof import("stream/web").CompressionStream;
448
+
449
+ interface CountQueuingStrategy extends _CountQueuingStrategy {}
450
+ var CountQueuingStrategy: typeof globalThis extends { onmessage: any; CountQueuingStrategy: infer T } ? T
451
+ : typeof import("stream/web").CountQueuingStrategy;
452
+
453
+ interface DecompressionStream extends _DecompressionStream {}
454
+ var DecompressionStream: typeof globalThis extends {
455
+ onmessage: any;
456
+ // CompressionStream, DecompressionStream and ReportingObserver was introduced in the same commit.
457
+ // If ReportingObserver check is removed, the type here will form a circular reference in TS5.0+lib.dom.d.ts
458
+ ReportingObserver: any;
459
+ DecompressionStream: infer T;
460
+ } ? T
461
+ // TS 4.8, 4.9, 5.0
462
+ : typeof globalThis extends { onmessage: any; TransformStream: { prototype: infer T } } ? {
463
+ prototype: T;
464
+ new(format: "deflate" | "deflate-raw" | "gzip"): T;
465
+ }
466
+ : typeof import("stream/web").DecompressionStream;
467
+
468
+ interface QueuingStrategy<T = any> extends _QueuingStrategy<T> {}
469
+
470
+ interface ReadableByteStreamController extends _ReadableByteStreamController {}
471
+ var ReadableByteStreamController: typeof globalThis extends
472
+ { onmessage: any; ReadableByteStreamController: infer T } ? T
473
+ : typeof import("stream/web").ReadableByteStreamController;
474
+
475
+ interface ReadableStream<R = any> extends _ReadableStream<R> {}
476
+ var ReadableStream: typeof globalThis extends { onmessage: any; ReadableStream: infer T } ? T
477
+ : typeof import("stream/web").ReadableStream;
478
+
479
+ interface ReadableStreamBYOBReader extends _ReadableStreamBYOBReader {}
480
+ var ReadableStreamBYOBReader: typeof globalThis extends { onmessage: any; ReadableStreamBYOBReader: infer T }
481
+ ? T
482
+ : typeof import("stream/web").ReadableStreamBYOBReader;
483
+
484
+ interface ReadableStreamBYOBRequest extends _ReadableStreamBYOBRequest {}
485
+ var ReadableStreamBYOBRequest: typeof globalThis extends { onmessage: any; ReadableStreamBYOBRequest: infer T }
486
+ ? T
487
+ : typeof import("stream/web").ReadableStreamBYOBRequest;
488
+
489
+ interface ReadableStreamDefaultController<R = any> extends _ReadableStreamDefaultController<R> {}
490
+ var ReadableStreamDefaultController: typeof globalThis extends
491
+ { onmessage: any; ReadableStreamDefaultController: infer T } ? T
492
+ : typeof import("stream/web").ReadableStreamDefaultController;
493
+
494
+ interface ReadableStreamDefaultReader<R = any> extends _ReadableStreamDefaultReader<R> {}
495
+ var ReadableStreamDefaultReader: typeof globalThis extends
496
+ { onmessage: any; ReadableStreamDefaultReader: infer T } ? T
497
+ : typeof import("stream/web").ReadableStreamDefaultReader;
498
+
499
+ interface TextDecoderStream extends _TextDecoderStream {}
500
+ var TextDecoderStream: typeof globalThis extends { onmessage: any; TextDecoderStream: infer T } ? T
501
+ : typeof import("stream/web").TextDecoderStream;
502
+
503
+ interface TextEncoderStream extends _TextEncoderStream {}
504
+ var TextEncoderStream: typeof globalThis extends { onmessage: any; TextEncoderStream: infer T } ? T
505
+ : typeof import("stream/web").TextEncoderStream;
506
+
507
+ interface TransformStream<I = any, O = any> extends _TransformStream<I, O> {}
508
+ var TransformStream: typeof globalThis extends { onmessage: any; TransformStream: infer T } ? T
509
+ : typeof import("stream/web").TransformStream;
510
+
511
+ interface TransformStreamDefaultController<O = any> extends _TransformStreamDefaultController<O> {}
512
+ var TransformStreamDefaultController: typeof globalThis extends
513
+ { onmessage: any; TransformStreamDefaultController: infer T } ? T
514
+ : typeof import("stream/web").TransformStreamDefaultController;
515
+
516
+ interface WritableStream<W = any> extends _WritableStream<W> {}
517
+ var WritableStream: typeof globalThis extends { onmessage: any; WritableStream: infer T } ? T
518
+ : typeof import("stream/web").WritableStream;
519
+
520
+ interface WritableStreamDefaultController extends _WritableStreamDefaultController {}
521
+ var WritableStreamDefaultController: typeof globalThis extends
522
+ { onmessage: any; WritableStreamDefaultController: infer T } ? T
523
+ : typeof import("stream/web").WritableStreamDefaultController;
524
+
525
+ interface WritableStreamDefaultWriter<W = any> extends _WritableStreamDefaultWriter<W> {}
526
+ var WritableStreamDefaultWriter: typeof globalThis extends
527
+ { onmessage: any; WritableStreamDefaultWriter: infer T } ? T
528
+ : typeof import("stream/web").WritableStreamDefaultWriter;
529
+ }
530
+ }
531
+ declare module "node:stream/web" {
532
+ export * from "stream/web";
533
+ }