@shopify/ui-extensions-server-kit 5.2.0 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/ExtensionServerClient/ExtensionServerClient.cjs.js +1 -1
  3. package/dist/ExtensionServerClient/ExtensionServerClient.d.ts +1 -0
  4. package/dist/ExtensionServerClient/ExtensionServerClient.es.js +1 -1
  5. package/dist/ExtensionServerClient/ExtensionServerClient.test.d.ts +8 -0
  6. package/dist/ExtensionServerClient/server-types.d.ts +42 -0
  7. package/dist/context/constants.cjs.js +1 -1
  8. package/dist/context/constants.d.ts +0 -1
  9. package/dist/context/constants.es.js +0 -1
  10. package/dist/context/types.d.ts +1 -0
  11. package/dist/hooks/index.d.ts +0 -2
  12. package/dist/i18n.cjs.js +1 -1
  13. package/dist/i18n.d.ts +1 -20
  14. package/dist/i18n.es.js +0 -1
  15. package/dist/index.cjs.js +1 -1
  16. package/dist/index.es.js +40 -48
  17. package/dist/testing/extensions.cjs.js +1 -1
  18. package/dist/testing/extensions.es.js +2 -2
  19. package/dist/types.cjs.js +1 -1
  20. package/dist/types.d.ts +10 -4
  21. package/dist/types.es.js +2 -2
  22. package/dist/utilities/index.d.ts +0 -1
  23. package/node_modules/@shopify/ui-extensions-test-utils/dist/index.d.ts +3 -0
  24. package/node_modules/@shopify/ui-extensions-test-utils/dist/render.d.ts +2 -0
  25. package/node_modules/@shopify/ui-extensions-test-utils/dist/renderHook.d.ts +17 -0
  26. package/node_modules/@shopify/ui-extensions-test-utils/dist/withProviders.d.ts +9 -0
  27. package/node_modules/@shopify/ui-extensions-test-utils/dist/withProviders.js +1 -0
  28. package/node_modules/@shopify/ui-extensions-test-utils/package.json +2 -3
  29. package/package.json +7 -6
  30. package/project.json +0 -2
  31. package/src/ExtensionServerClient/ExtensionServerClient.test.ts +837 -330
  32. package/src/ExtensionServerClient/ExtensionServerClient.ts +10 -8
  33. package/src/ExtensionServerClient/server-types.ts +55 -0
  34. package/src/ExtensionServerClient/types.ts +2 -0
  35. package/src/context/ExtensionServerProvider.test.tsx +202 -39
  36. package/src/context/ExtensionServerProvider.tsx +1 -0
  37. package/src/context/constants.ts +3 -2
  38. package/src/context/types.ts +1 -0
  39. package/src/hooks/index.ts +0 -2
  40. package/src/i18n.ts +3 -3
  41. package/src/state/reducers/extensionServerReducer.test.ts +2 -2
  42. package/src/testing/extensions.ts +2 -2
  43. package/src/types.ts +10 -4
  44. package/src/utilities/index.ts +0 -1
  45. package/src/utilities/replaceUpdated.ts +1 -0
  46. package/src/utilities/set.ts +1 -0
  47. package/dist/hooks/useExtensionClient.cjs.js +0 -1
  48. package/dist/hooks/useExtensionClient.d.ts +0 -1
  49. package/dist/hooks/useExtensionClient.es.js +0 -8
  50. package/dist/hooks/useExtensionServerEvent.cjs.js +0 -1
  51. package/dist/hooks/useExtensionServerEvent.d.ts +0 -1
  52. package/dist/hooks/useExtensionServerEvent.es.js +0 -9
  53. package/dist/utilities/groupByKey.cjs.js +0 -1
  54. package/dist/utilities/groupByKey.d.ts +0 -3
  55. package/dist/utilities/groupByKey.es.js +0 -6
  56. package/node_modules/@types/node/LICENSE +0 -21
  57. package/node_modules/@types/node/README.md +0 -15
  58. package/node_modules/@types/node/assert/strict.d.ts +0 -8
  59. package/node_modules/@types/node/assert.d.ts +0 -985
  60. package/node_modules/@types/node/async_hooks.d.ts +0 -522
  61. package/node_modules/@types/node/buffer.d.ts +0 -2321
  62. package/node_modules/@types/node/child_process.d.ts +0 -1544
  63. package/node_modules/@types/node/cluster.d.ts +0 -432
  64. package/node_modules/@types/node/console.d.ts +0 -412
  65. package/node_modules/@types/node/constants.d.ts +0 -19
  66. package/node_modules/@types/node/crypto.d.ts +0 -4451
  67. package/node_modules/@types/node/dgram.d.ts +0 -586
  68. package/node_modules/@types/node/diagnostics_channel.d.ts +0 -192
  69. package/node_modules/@types/node/dns/promises.d.ts +0 -381
  70. package/node_modules/@types/node/dns.d.ts +0 -809
  71. package/node_modules/@types/node/dom-events.d.ts +0 -122
  72. package/node_modules/@types/node/domain.d.ts +0 -170
  73. package/node_modules/@types/node/events.d.ts +0 -803
  74. package/node_modules/@types/node/fs/promises.d.ts +0 -1205
  75. package/node_modules/@types/node/fs.d.ts +0 -4211
  76. package/node_modules/@types/node/globals.d.ts +0 -377
  77. package/node_modules/@types/node/globals.global.d.ts +0 -1
  78. package/node_modules/@types/node/http.d.ts +0 -1801
  79. package/node_modules/@types/node/http2.d.ts +0 -2386
  80. package/node_modules/@types/node/https.d.ts +0 -544
  81. package/node_modules/@types/node/index.d.ts +0 -88
  82. package/node_modules/@types/node/inspector.d.ts +0 -2739
  83. package/node_modules/@types/node/module.d.ts +0 -298
  84. package/node_modules/@types/node/net.d.ts +0 -913
  85. package/node_modules/@types/node/os.d.ts +0 -473
  86. package/node_modules/@types/node/package.json +0 -235
  87. package/node_modules/@types/node/path.d.ts +0 -191
  88. package/node_modules/@types/node/perf_hooks.d.ts +0 -626
  89. package/node_modules/@types/node/process.d.ts +0 -1531
  90. package/node_modules/@types/node/punycode.d.ts +0 -117
  91. package/node_modules/@types/node/querystring.d.ts +0 -141
  92. package/node_modules/@types/node/readline/promises.d.ts +0 -143
  93. package/node_modules/@types/node/readline.d.ts +0 -666
  94. package/node_modules/@types/node/repl.d.ts +0 -430
  95. package/node_modules/@types/node/stream/consumers.d.ts +0 -12
  96. package/node_modules/@types/node/stream/promises.d.ts +0 -83
  97. package/node_modules/@types/node/stream/web.d.ts +0 -336
  98. package/node_modules/@types/node/stream.d.ts +0 -1731
  99. package/node_modules/@types/node/string_decoder.d.ts +0 -67
  100. package/node_modules/@types/node/test.d.ts +0 -1113
  101. package/node_modules/@types/node/timers/promises.d.ts +0 -93
  102. package/node_modules/@types/node/timers.d.ts +0 -126
  103. package/node_modules/@types/node/tls.d.ts +0 -1203
  104. package/node_modules/@types/node/trace_events.d.ts +0 -171
  105. package/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
  106. package/node_modules/@types/node/ts4.8/assert.d.ts +0 -985
  107. package/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -522
  108. package/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2321
  109. package/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1544
  110. package/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
  111. package/node_modules/@types/node/ts4.8/console.d.ts +0 -412
  112. package/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
  113. package/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4450
  114. package/node_modules/@types/node/ts4.8/dgram.d.ts +0 -586
  115. package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -192
  116. package/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -381
  117. package/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
  118. package/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
  119. package/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
  120. package/node_modules/@types/node/ts4.8/events.d.ts +0 -754
  121. package/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1205
  122. package/node_modules/@types/node/ts4.8/fs.d.ts +0 -4211
  123. package/node_modules/@types/node/ts4.8/globals.d.ts +0 -377
  124. package/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
  125. package/node_modules/@types/node/ts4.8/http.d.ts +0 -1801
  126. package/node_modules/@types/node/ts4.8/http2.d.ts +0 -2386
  127. package/node_modules/@types/node/ts4.8/https.d.ts +0 -544
  128. package/node_modules/@types/node/ts4.8/index.d.ts +0 -88
  129. package/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2739
  130. package/node_modules/@types/node/ts4.8/module.d.ts +0 -298
  131. package/node_modules/@types/node/ts4.8/net.d.ts +0 -913
  132. package/node_modules/@types/node/ts4.8/os.d.ts +0 -473
  133. package/node_modules/@types/node/ts4.8/path.d.ts +0 -191
  134. package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -626
  135. package/node_modules/@types/node/ts4.8/process.d.ts +0 -1531
  136. package/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
  137. package/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
  138. package/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -143
  139. package/node_modules/@types/node/ts4.8/readline.d.ts +0 -666
  140. package/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
  141. package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
  142. package/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
  143. package/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -336
  144. package/node_modules/@types/node/ts4.8/stream.d.ts +0 -1731
  145. package/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
  146. package/node_modules/@types/node/ts4.8/test.d.ts +0 -1113
  147. package/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
  148. package/node_modules/@types/node/ts4.8/timers.d.ts +0 -126
  149. package/node_modules/@types/node/ts4.8/tls.d.ts +0 -1203
  150. package/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -171
  151. package/node_modules/@types/node/ts4.8/tty.d.ts +0 -206
  152. package/node_modules/@types/node/ts4.8/url.d.ts +0 -937
  153. package/node_modules/@types/node/ts4.8/util.d.ts +0 -2075
  154. package/node_modules/@types/node/ts4.8/v8.d.ts +0 -541
  155. package/node_modules/@types/node/ts4.8/vm.d.ts +0 -667
  156. package/node_modules/@types/node/ts4.8/wasi.d.ts +0 -158
  157. package/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -692
  158. package/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
  159. package/node_modules/@types/node/tty.d.ts +0 -206
  160. package/node_modules/@types/node/url.d.ts +0 -937
  161. package/node_modules/@types/node/util.d.ts +0 -2075
  162. package/node_modules/@types/node/v8.d.ts +0 -541
  163. package/node_modules/@types/node/vm.d.ts +0 -667
  164. package/node_modules/@types/node/wasi.d.ts +0 -158
  165. package/node_modules/@types/node/worker_threads.d.ts +0 -692
  166. package/node_modules/@types/node/zlib.d.ts +0 -517
  167. package/src/hooks/useExtensionClient.ts +0 -6
  168. package/src/hooks/useExtensionServerEvent.ts +0 -11
  169. 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
- }