@shopify/ui-extensions-server-kit 5.2.1 → 5.3.1

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 (170) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +2 -2
  3. package/dist/ExtensionServerClient/ExtensionServerClient.cjs.js +1 -1
  4. package/dist/ExtensionServerClient/ExtensionServerClient.d.ts +1 -0
  5. package/dist/ExtensionServerClient/ExtensionServerClient.es.js +1 -1
  6. package/dist/ExtensionServerClient/ExtensionServerClient.test.d.ts +8 -0
  7. package/dist/ExtensionServerClient/server-types.d.ts +42 -0
  8. package/dist/context/constants.cjs.js +1 -1
  9. package/dist/context/constants.d.ts +0 -1
  10. package/dist/context/constants.es.js +0 -1
  11. package/dist/context/types.d.ts +1 -0
  12. package/dist/hooks/index.d.ts +0 -2
  13. package/dist/i18n.cjs.js +1 -1
  14. package/dist/i18n.d.ts +1 -20
  15. package/dist/i18n.es.js +0 -1
  16. package/dist/index.cjs.js +1 -1
  17. package/dist/index.es.js +40 -48
  18. package/dist/testing/extensions.cjs.js +1 -1
  19. package/dist/testing/extensions.es.js +2 -2
  20. package/dist/types.cjs.js +1 -1
  21. package/dist/types.d.ts +10 -4
  22. package/dist/types.es.js +2 -2
  23. package/dist/utilities/index.d.ts +0 -1
  24. package/node_modules/@shopify/ui-extensions-test-utils/dist/index.d.ts +3 -0
  25. package/node_modules/@shopify/ui-extensions-test-utils/dist/render.d.ts +2 -0
  26. package/node_modules/@shopify/ui-extensions-test-utils/dist/renderHook.d.ts +17 -0
  27. package/node_modules/@shopify/ui-extensions-test-utils/dist/withProviders.d.ts +9 -0
  28. package/node_modules/@shopify/ui-extensions-test-utils/dist/withProviders.js +1 -0
  29. package/node_modules/@shopify/ui-extensions-test-utils/package.json +2 -3
  30. package/package.json +8 -7
  31. package/project.json +0 -16
  32. package/src/ExtensionServerClient/ExtensionServerClient.test.ts +837 -330
  33. package/src/ExtensionServerClient/ExtensionServerClient.ts +10 -8
  34. package/src/ExtensionServerClient/server-types.ts +55 -0
  35. package/src/ExtensionServerClient/types.ts +2 -0
  36. package/src/context/ExtensionServerProvider.test.tsx +202 -39
  37. package/src/context/ExtensionServerProvider.tsx +1 -0
  38. package/src/context/constants.ts +3 -2
  39. package/src/context/types.ts +1 -0
  40. package/src/hooks/index.ts +0 -2
  41. package/src/i18n.ts +3 -3
  42. package/src/state/reducers/extensionServerReducer.test.ts +2 -2
  43. package/src/testing/extensions.ts +2 -2
  44. package/src/types.ts +9 -4
  45. package/src/utilities/index.ts +0 -1
  46. package/src/utilities/replaceUpdated.ts +1 -0
  47. package/src/utilities/set.ts +1 -0
  48. package/dist/hooks/useExtensionClient.cjs.js +0 -1
  49. package/dist/hooks/useExtensionClient.d.ts +0 -1
  50. package/dist/hooks/useExtensionClient.es.js +0 -8
  51. package/dist/hooks/useExtensionServerEvent.cjs.js +0 -1
  52. package/dist/hooks/useExtensionServerEvent.d.ts +0 -1
  53. package/dist/hooks/useExtensionServerEvent.es.js +0 -9
  54. package/dist/utilities/groupByKey.cjs.js +0 -1
  55. package/dist/utilities/groupByKey.d.ts +0 -3
  56. package/dist/utilities/groupByKey.es.js +0 -6
  57. package/node_modules/@types/node/LICENSE +0 -21
  58. package/node_modules/@types/node/README.md +0 -15
  59. package/node_modules/@types/node/assert/strict.d.ts +0 -8
  60. package/node_modules/@types/node/assert.d.ts +0 -985
  61. package/node_modules/@types/node/async_hooks.d.ts +0 -522
  62. package/node_modules/@types/node/buffer.d.ts +0 -2321
  63. package/node_modules/@types/node/child_process.d.ts +0 -1544
  64. package/node_modules/@types/node/cluster.d.ts +0 -432
  65. package/node_modules/@types/node/console.d.ts +0 -412
  66. package/node_modules/@types/node/constants.d.ts +0 -19
  67. package/node_modules/@types/node/crypto.d.ts +0 -4451
  68. package/node_modules/@types/node/dgram.d.ts +0 -586
  69. package/node_modules/@types/node/diagnostics_channel.d.ts +0 -192
  70. package/node_modules/@types/node/dns/promises.d.ts +0 -381
  71. package/node_modules/@types/node/dns.d.ts +0 -809
  72. package/node_modules/@types/node/dom-events.d.ts +0 -122
  73. package/node_modules/@types/node/domain.d.ts +0 -170
  74. package/node_modules/@types/node/events.d.ts +0 -803
  75. package/node_modules/@types/node/fs/promises.d.ts +0 -1205
  76. package/node_modules/@types/node/fs.d.ts +0 -4211
  77. package/node_modules/@types/node/globals.d.ts +0 -377
  78. package/node_modules/@types/node/globals.global.d.ts +0 -1
  79. package/node_modules/@types/node/http.d.ts +0 -1801
  80. package/node_modules/@types/node/http2.d.ts +0 -2386
  81. package/node_modules/@types/node/https.d.ts +0 -544
  82. package/node_modules/@types/node/index.d.ts +0 -88
  83. package/node_modules/@types/node/inspector.d.ts +0 -2739
  84. package/node_modules/@types/node/module.d.ts +0 -298
  85. package/node_modules/@types/node/net.d.ts +0 -913
  86. package/node_modules/@types/node/os.d.ts +0 -473
  87. package/node_modules/@types/node/package.json +0 -235
  88. package/node_modules/@types/node/path.d.ts +0 -191
  89. package/node_modules/@types/node/perf_hooks.d.ts +0 -626
  90. package/node_modules/@types/node/process.d.ts +0 -1531
  91. package/node_modules/@types/node/punycode.d.ts +0 -117
  92. package/node_modules/@types/node/querystring.d.ts +0 -141
  93. package/node_modules/@types/node/readline/promises.d.ts +0 -143
  94. package/node_modules/@types/node/readline.d.ts +0 -666
  95. package/node_modules/@types/node/repl.d.ts +0 -430
  96. package/node_modules/@types/node/stream/consumers.d.ts +0 -12
  97. package/node_modules/@types/node/stream/promises.d.ts +0 -83
  98. package/node_modules/@types/node/stream/web.d.ts +0 -336
  99. package/node_modules/@types/node/stream.d.ts +0 -1731
  100. package/node_modules/@types/node/string_decoder.d.ts +0 -67
  101. package/node_modules/@types/node/test.d.ts +0 -1113
  102. package/node_modules/@types/node/timers/promises.d.ts +0 -93
  103. package/node_modules/@types/node/timers.d.ts +0 -126
  104. package/node_modules/@types/node/tls.d.ts +0 -1203
  105. package/node_modules/@types/node/trace_events.d.ts +0 -171
  106. package/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
  107. package/node_modules/@types/node/ts4.8/assert.d.ts +0 -985
  108. package/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -522
  109. package/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2321
  110. package/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1544
  111. package/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
  112. package/node_modules/@types/node/ts4.8/console.d.ts +0 -412
  113. package/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
  114. package/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4450
  115. package/node_modules/@types/node/ts4.8/dgram.d.ts +0 -586
  116. package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -192
  117. package/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -381
  118. package/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
  119. package/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
  120. package/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
  121. package/node_modules/@types/node/ts4.8/events.d.ts +0 -754
  122. package/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1205
  123. package/node_modules/@types/node/ts4.8/fs.d.ts +0 -4211
  124. package/node_modules/@types/node/ts4.8/globals.d.ts +0 -377
  125. package/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
  126. package/node_modules/@types/node/ts4.8/http.d.ts +0 -1801
  127. package/node_modules/@types/node/ts4.8/http2.d.ts +0 -2386
  128. package/node_modules/@types/node/ts4.8/https.d.ts +0 -544
  129. package/node_modules/@types/node/ts4.8/index.d.ts +0 -88
  130. package/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2739
  131. package/node_modules/@types/node/ts4.8/module.d.ts +0 -298
  132. package/node_modules/@types/node/ts4.8/net.d.ts +0 -913
  133. package/node_modules/@types/node/ts4.8/os.d.ts +0 -473
  134. package/node_modules/@types/node/ts4.8/path.d.ts +0 -191
  135. package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -626
  136. package/node_modules/@types/node/ts4.8/process.d.ts +0 -1531
  137. package/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
  138. package/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
  139. package/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -143
  140. package/node_modules/@types/node/ts4.8/readline.d.ts +0 -666
  141. package/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
  142. package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
  143. package/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
  144. package/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -336
  145. package/node_modules/@types/node/ts4.8/stream.d.ts +0 -1731
  146. package/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
  147. package/node_modules/@types/node/ts4.8/test.d.ts +0 -1113
  148. package/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
  149. package/node_modules/@types/node/ts4.8/timers.d.ts +0 -126
  150. package/node_modules/@types/node/ts4.8/tls.d.ts +0 -1203
  151. package/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -171
  152. package/node_modules/@types/node/ts4.8/tty.d.ts +0 -206
  153. package/node_modules/@types/node/ts4.8/url.d.ts +0 -937
  154. package/node_modules/@types/node/ts4.8/util.d.ts +0 -2075
  155. package/node_modules/@types/node/ts4.8/v8.d.ts +0 -541
  156. package/node_modules/@types/node/ts4.8/vm.d.ts +0 -667
  157. package/node_modules/@types/node/ts4.8/wasi.d.ts +0 -158
  158. package/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -692
  159. package/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
  160. package/node_modules/@types/node/tty.d.ts +0 -206
  161. package/node_modules/@types/node/url.d.ts +0 -937
  162. package/node_modules/@types/node/util.d.ts +0 -2075
  163. package/node_modules/@types/node/v8.d.ts +0 -541
  164. package/node_modules/@types/node/vm.d.ts +0 -667
  165. package/node_modules/@types/node/wasi.d.ts +0 -158
  166. package/node_modules/@types/node/worker_threads.d.ts +0 -692
  167. package/node_modules/@types/node/zlib.d.ts +0 -517
  168. package/src/hooks/useExtensionClient.ts +0 -6
  169. package/src/hooks/useExtensionServerEvent.ts +0 -11
  170. package/src/utilities/groupByKey.ts +0 -3
@@ -1,336 +0,0 @@
1
- declare module "stream/web" {
2
- // stub module, pending copy&paste from .d.ts or manual impl
3
- // copy from lib.dom.d.ts
4
- interface ReadableWritablePair<R = any, W = any> {
5
- readable: ReadableStream<R>;
6
- /**
7
- * Provides a convenient, chainable way of piping this readable stream
8
- * through a transform stream (or any other { writable, readable }
9
- * pair). It simply pipes the stream into the writable side of the
10
- * supplied pair, and returns the readable side for further use.
11
- *
12
- * Piping a stream will lock it for the duration of the pipe, preventing
13
- * any other consumer from acquiring a reader.
14
- */
15
- writable: WritableStream<W>;
16
- }
17
- interface StreamPipeOptions {
18
- preventAbort?: boolean;
19
- preventCancel?: boolean;
20
- /**
21
- * Pipes this readable stream to a given writable stream destination.
22
- * The way in which the piping process behaves under various error
23
- * conditions can be customized with a number of passed options. It
24
- * returns a promise that fulfills when the piping process completes
25
- * successfully, or rejects if any errors were encountered.
26
- *
27
- * Piping a stream will lock it for the duration of the pipe, preventing
28
- * any other consumer from acquiring a reader.
29
- *
30
- * Errors and closures of the source and destination streams propagate
31
- * as follows:
32
- *
33
- * An error in this source readable stream will abort destination,
34
- * unless preventAbort is truthy. The returned promise will be rejected
35
- * with the source's error, or with any error that occurs during
36
- * aborting the destination.
37
- *
38
- * An error in destination will cancel this source readable stream,
39
- * unless preventCancel is truthy. The returned promise will be rejected
40
- * with the destination's error, or with any error that occurs during
41
- * canceling the source.
42
- *
43
- * When this source readable stream closes, destination will be closed,
44
- * unless preventClose is truthy. The returned promise will be fulfilled
45
- * once this process completes, unless an error is encountered while
46
- * closing the destination, in which case it will be rejected with that
47
- * error.
48
- *
49
- * If destination starts out closed or closing, this source readable
50
- * stream will be canceled, unless preventCancel is true. The returned
51
- * promise will be rejected with an error indicating piping to a closed
52
- * stream failed, or with any error that occurs during canceling the
53
- * source.
54
- *
55
- * The signal option can be set to an AbortSignal to allow aborting an
56
- * ongoing pipe operation via the corresponding AbortController. In this
57
- * case, this source readable stream will be canceled, and destination
58
- * aborted, unless the respective options preventCancel or preventAbort
59
- * are set.
60
- */
61
- preventClose?: boolean;
62
- signal?: AbortSignal;
63
- }
64
- interface ReadableStreamGenericReader {
65
- readonly closed: Promise<undefined>;
66
- cancel(reason?: any): Promise<void>;
67
- }
68
- interface ReadableStreamDefaultReadValueResult<T> {
69
- done: false;
70
- value: T;
71
- }
72
- interface ReadableStreamDefaultReadDoneResult {
73
- done: true;
74
- value?: undefined;
75
- }
76
- type ReadableStreamController<T> = ReadableStreamDefaultController<T>;
77
- type ReadableStreamDefaultReadResult<T> =
78
- | ReadableStreamDefaultReadValueResult<T>
79
- | ReadableStreamDefaultReadDoneResult;
80
- interface ReadableByteStreamControllerCallback {
81
- (controller: ReadableByteStreamController): void | PromiseLike<void>;
82
- }
83
- interface UnderlyingSinkAbortCallback {
84
- (reason?: any): void | PromiseLike<void>;
85
- }
86
- interface UnderlyingSinkCloseCallback {
87
- (): void | PromiseLike<void>;
88
- }
89
- interface UnderlyingSinkStartCallback {
90
- (controller: WritableStreamDefaultController): any;
91
- }
92
- interface UnderlyingSinkWriteCallback<W> {
93
- (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike<void>;
94
- }
95
- interface UnderlyingSourceCancelCallback {
96
- (reason?: any): void | PromiseLike<void>;
97
- }
98
- interface UnderlyingSourcePullCallback<R> {
99
- (controller: ReadableStreamController<R>): void | PromiseLike<void>;
100
- }
101
- interface UnderlyingSourceStartCallback<R> {
102
- (controller: ReadableStreamController<R>): any;
103
- }
104
- interface TransformerFlushCallback<O> {
105
- (controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
106
- }
107
- interface TransformerStartCallback<O> {
108
- (controller: TransformStreamDefaultController<O>): any;
109
- }
110
- interface TransformerTransformCallback<I, O> {
111
- (chunk: I, controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
112
- }
113
- interface UnderlyingByteSource {
114
- autoAllocateChunkSize?: number;
115
- cancel?: ReadableStreamErrorCallback;
116
- pull?: ReadableByteStreamControllerCallback;
117
- start?: ReadableByteStreamControllerCallback;
118
- type: "bytes";
119
- }
120
- interface UnderlyingSource<R = any> {
121
- cancel?: UnderlyingSourceCancelCallback;
122
- pull?: UnderlyingSourcePullCallback<R>;
123
- start?: UnderlyingSourceStartCallback<R>;
124
- type?: undefined;
125
- }
126
- interface UnderlyingSink<W = any> {
127
- abort?: UnderlyingSinkAbortCallback;
128
- close?: UnderlyingSinkCloseCallback;
129
- start?: UnderlyingSinkStartCallback;
130
- type?: undefined;
131
- write?: UnderlyingSinkWriteCallback<W>;
132
- }
133
- interface ReadableStreamErrorCallback {
134
- (reason: any): void | PromiseLike<void>;
135
- }
136
- /** This Streams API interface represents a readable stream of byte data. */
137
- interface ReadableStream<R = any> {
138
- readonly locked: boolean;
139
- cancel(reason?: any): Promise<void>;
140
- getReader(): ReadableStreamDefaultReader<R>;
141
- pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
142
- pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
143
- tee(): [ReadableStream<R>, ReadableStream<R>];
144
- values(options?: { preventCancel?: boolean }): AsyncIterableIterator<R>;
145
- [Symbol.asyncIterator](): AsyncIterableIterator<R>;
146
- }
147
- const ReadableStream: {
148
- prototype: ReadableStream;
149
- new(underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy<Uint8Array>): ReadableStream<Uint8Array>;
150
- new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
151
- };
152
- interface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader {
153
- read(): Promise<ReadableStreamDefaultReadResult<R>>;
154
- releaseLock(): void;
155
- }
156
- const ReadableStreamDefaultReader: {
157
- prototype: ReadableStreamDefaultReader;
158
- new<R = any>(stream: ReadableStream<R>): ReadableStreamDefaultReader<R>;
159
- };
160
- const ReadableStreamBYOBReader: any;
161
- const ReadableStreamBYOBRequest: any;
162
- interface ReadableByteStreamController {
163
- readonly byobRequest: undefined;
164
- readonly desiredSize: number | null;
165
- close(): void;
166
- enqueue(chunk: ArrayBufferView): void;
167
- error(error?: any): void;
168
- }
169
- const ReadableByteStreamController: {
170
- prototype: ReadableByteStreamController;
171
- new(): ReadableByteStreamController;
172
- };
173
- interface ReadableStreamDefaultController<R = any> {
174
- readonly desiredSize: number | null;
175
- close(): void;
176
- enqueue(chunk?: R): void;
177
- error(e?: any): void;
178
- }
179
- const ReadableStreamDefaultController: {
180
- prototype: ReadableStreamDefaultController;
181
- new(): ReadableStreamDefaultController;
182
- };
183
- interface Transformer<I = any, O = any> {
184
- flush?: TransformerFlushCallback<O>;
185
- readableType?: undefined;
186
- start?: TransformerStartCallback<O>;
187
- transform?: TransformerTransformCallback<I, O>;
188
- writableType?: undefined;
189
- }
190
- interface TransformStream<I = any, O = any> {
191
- readonly readable: ReadableStream<O>;
192
- readonly writable: WritableStream<I>;
193
- }
194
- const TransformStream: {
195
- prototype: TransformStream;
196
- new<I = any, O = any>(
197
- transformer?: Transformer<I, O>,
198
- writableStrategy?: QueuingStrategy<I>,
199
- readableStrategy?: QueuingStrategy<O>,
200
- ): TransformStream<I, O>;
201
- };
202
- interface TransformStreamDefaultController<O = any> {
203
- readonly desiredSize: number | null;
204
- enqueue(chunk?: O): void;
205
- error(reason?: any): void;
206
- terminate(): void;
207
- }
208
- const TransformStreamDefaultController: {
209
- prototype: TransformStreamDefaultController;
210
- new(): TransformStreamDefaultController;
211
- };
212
- /**
213
- * This Streams API interface provides a standard abstraction for writing
214
- * streaming data to a destination, known as a sink. This object comes with
215
- * built-in back pressure and queuing.
216
- */
217
- interface WritableStream<W = any> {
218
- readonly locked: boolean;
219
- abort(reason?: any): Promise<void>;
220
- close(): Promise<void>;
221
- getWriter(): WritableStreamDefaultWriter<W>;
222
- }
223
- const WritableStream: {
224
- prototype: WritableStream;
225
- new<W = any>(underlyingSink?: UnderlyingSink<W>, strategy?: QueuingStrategy<W>): WritableStream<W>;
226
- };
227
- /**
228
- * This Streams API interface is the object returned by
229
- * WritableStream.getWriter() and once created locks the < writer to the
230
- * WritableStream ensuring that no other streams can write to the underlying
231
- * sink.
232
- */
233
- interface WritableStreamDefaultWriter<W = any> {
234
- readonly closed: Promise<undefined>;
235
- readonly desiredSize: number | null;
236
- readonly ready: Promise<undefined>;
237
- abort(reason?: any): Promise<void>;
238
- close(): Promise<void>;
239
- releaseLock(): void;
240
- write(chunk?: W): Promise<void>;
241
- }
242
- const WritableStreamDefaultWriter: {
243
- prototype: WritableStreamDefaultWriter;
244
- new<W = any>(stream: WritableStream<W>): WritableStreamDefaultWriter<W>;
245
- };
246
- /**
247
- * This Streams API interface represents a controller allowing control of a
248
- * WritableStream's state. When constructing a WritableStream, the
249
- * underlying sink is given a corresponding WritableStreamDefaultController
250
- * instance to manipulate.
251
- */
252
- interface WritableStreamDefaultController {
253
- error(e?: any): void;
254
- }
255
- const WritableStreamDefaultController: {
256
- prototype: WritableStreamDefaultController;
257
- new(): WritableStreamDefaultController;
258
- };
259
- interface QueuingStrategy<T = any> {
260
- highWaterMark?: number;
261
- size?: QueuingStrategySize<T>;
262
- }
263
- interface QueuingStrategySize<T = any> {
264
- (chunk?: T): number;
265
- }
266
- interface QueuingStrategyInit {
267
- /**
268
- * Creates a new ByteLengthQueuingStrategy with the provided high water
269
- * mark.
270
- *
271
- * Note that the provided high water mark will not be validated ahead of
272
- * time. Instead, if it is negative, NaN, or not a number, the resulting
273
- * ByteLengthQueuingStrategy will cause the corresponding stream
274
- * constructor to throw.
275
- */
276
- highWaterMark: number;
277
- }
278
- /**
279
- * This Streams API interface provides a built-in byte length queuing
280
- * strategy that can be used when constructing streams.
281
- */
282
- interface ByteLengthQueuingStrategy extends QueuingStrategy<ArrayBufferView> {
283
- readonly highWaterMark: number;
284
- readonly size: QueuingStrategySize<ArrayBufferView>;
285
- }
286
- const ByteLengthQueuingStrategy: {
287
- prototype: ByteLengthQueuingStrategy;
288
- new(init: QueuingStrategyInit): ByteLengthQueuingStrategy;
289
- };
290
- /**
291
- * This Streams API interface provides a built-in byte length queuing
292
- * strategy that can be used when constructing streams.
293
- */
294
- interface CountQueuingStrategy extends QueuingStrategy {
295
- readonly highWaterMark: number;
296
- readonly size: QueuingStrategySize;
297
- }
298
- const CountQueuingStrategy: {
299
- prototype: CountQueuingStrategy;
300
- new(init: QueuingStrategyInit): CountQueuingStrategy;
301
- };
302
- interface TextEncoderStream {
303
- /** Returns "utf-8". */
304
- readonly encoding: "utf-8";
305
- readonly readable: ReadableStream<Uint8Array>;
306
- readonly writable: WritableStream<string>;
307
- readonly [Symbol.toStringTag]: string;
308
- }
309
- const TextEncoderStream: {
310
- prototype: TextEncoderStream;
311
- new(): TextEncoderStream;
312
- };
313
- interface TextDecoderOptions {
314
- fatal?: boolean;
315
- ignoreBOM?: boolean;
316
- }
317
- type BufferSource = ArrayBufferView | ArrayBuffer;
318
- interface TextDecoderStream {
319
- /** Returns encoding's name, lower cased. */
320
- readonly encoding: string;
321
- /** Returns `true` if error mode is "fatal", and `false` otherwise. */
322
- readonly fatal: boolean;
323
- /** Returns `true` if ignore BOM flag is set, and `false` otherwise. */
324
- readonly ignoreBOM: boolean;
325
- readonly readable: ReadableStream<string>;
326
- readonly writable: WritableStream<BufferSource>;
327
- readonly [Symbol.toStringTag]: string;
328
- }
329
- const TextDecoderStream: {
330
- prototype: TextDecoderStream;
331
- new(label?: string, options?: TextDecoderOptions): TextDecoderStream;
332
- };
333
- }
334
- declare module "node:stream/web" {
335
- export * from "stream/web";
336
- }