@svta/cml-utils 1.6.1 → 1.6.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.
package/dist/index.d.ts CHANGED
@@ -1,321 +1,321 @@
1
1
  //#region src/arrayBufferToHex.d.ts
2
2
  /**
3
- * Encodes an ArrayBuffer as a hexadecimal string.
4
- *
5
- * @param buffer - The ArrayBuffer to encode.
6
- * @returns The hexadecimal string representation.
7
- *
8
- * @public
9
- *
10
- * @example
11
- * {@includeCode ../test/arrayBufferToHex.test.ts#example}
12
- */
13
- declare function arrayBufferToHex(buffer: ArrayBuffer): string;
3
+ * Encodes an ArrayBuffer as a hexadecimal string.
4
+ *
5
+ * @param buffer - The ArrayBuffer to encode.
6
+ * @returns The hexadecimal string representation.
7
+ *
8
+ * @public
9
+ *
10
+ * @example
11
+ * {@includeCode ../test/arrayBufferToHex.test.ts#example}
12
+ */
13
+ export declare function arrayBufferToHex(buffer: ArrayBuffer): string;
14
14
  //#endregion
15
15
  //#region src/arrayBufferToUuid.d.ts
16
16
  /**
17
- * Converts an ArrayBuffer to a UUID string.
18
- *
19
- * @param buffer - The ArrayBuffer to convert.
20
- * @returns The UUID string representation.
21
- *
22
- * @public
23
- *
24
- * @example
25
- * {@includeCode ../test/arrayBufferToUuid.test.ts#example}
26
- */
27
- declare function arrayBufferToUuid(buffer: ArrayBuffer): string;
17
+ * Converts an ArrayBuffer to a UUID string.
18
+ *
19
+ * @param buffer - The ArrayBuffer to convert.
20
+ * @returns The UUID string representation.
21
+ *
22
+ * @public
23
+ *
24
+ * @example
25
+ * {@includeCode ../test/arrayBufferToUuid.test.ts#example}
26
+ */
27
+ export declare function arrayBufferToUuid(buffer: ArrayBuffer): string;
28
28
  //#endregion
29
29
  //#region src/decodeBase64.d.ts
30
30
  /**
31
- * Decodes a base64 encoded string into binary data
32
- *
33
- * @param str - The base64 encoded string to decode
34
- * @returns The decoded binary data
35
- *
36
- * @public
37
- */
38
- declare function decodeBase64(str: string): Uint8Array;
31
+ * Decodes a base64 encoded string into binary data
32
+ *
33
+ * @param str - The base64 encoded string to decode
34
+ * @returns The decoded binary data
35
+ *
36
+ * @public
37
+ */
38
+ export declare function decodeBase64(str: string): Uint8Array;
39
39
  //#endregion
40
40
  //#region src/base64decode.d.ts
41
41
  /**
42
- * Decodes a base64 encoded string into binary data
43
- *
44
- * @param str - The base64 encoded string to decode
45
- * @returns The decoded binary data
46
- *
47
- * @public
48
- *
49
- * @deprecated Use {@link decodeBase64} instead.
50
- *
51
- * @see {@link decodeBase64}
52
- */
53
- declare const base64decode: typeof decodeBase64;
42
+ * Decodes a base64 encoded string into binary data
43
+ *
44
+ * @param str - The base64 encoded string to decode
45
+ * @returns The decoded binary data
46
+ *
47
+ * @public
48
+ *
49
+ * @deprecated Use {@link decodeBase64} instead.
50
+ *
51
+ * @see {@link decodeBase64}
52
+ */
53
+ export declare const base64decode: typeof decodeBase64;
54
54
  //#endregion
55
55
  //#region src/encodeBase64.d.ts
56
56
  /**
57
- * Encodes binary data to base64
58
- *
59
- * @param binary - The binary data to encode
60
- * @returns The base64 encoded string
61
- *
62
- * @public
63
- *
64
- * @example
65
- * {@includeCode ../test/encodeBase64.test.ts#example}
66
- */
67
- declare function encodeBase64(binary: Uint8Array): string;
57
+ * Encodes binary data to base64
58
+ *
59
+ * @param binary - The binary data to encode
60
+ * @returns The base64 encoded string
61
+ *
62
+ * @public
63
+ *
64
+ * @example
65
+ * {@includeCode ../test/encodeBase64.test.ts#example}
66
+ */
67
+ export declare function encodeBase64(binary: Uint8Array): string;
68
68
  //#endregion
69
69
  //#region src/base64encode.d.ts
70
70
  /**
71
- * Encodes binary data to base64
72
- *
73
- * @param binary - The binary data to encode
74
- * @returns The base64 encoded string
75
- *
76
- * @public
77
- *
78
- * @deprecated Use {@link encodeBase64} instead.
79
- *
80
- * @see {@link encodeBase64}
81
- */
82
- declare const base64encode: typeof encodeBase64;
71
+ * Encodes binary data to base64
72
+ *
73
+ * @param binary - The binary data to encode
74
+ * @returns The base64 encoded string
75
+ *
76
+ * @public
77
+ *
78
+ * @deprecated Use {@link encodeBase64} instead.
79
+ *
80
+ * @see {@link encodeBase64}
81
+ */
82
+ export declare const base64encode: typeof encodeBase64;
83
83
  //#endregion
84
84
  //#region src/convertUint8ToUint16.d.ts
85
85
  /**
86
- * Converts a Uint8Array to a Uint16Array by aligning its buffer.
87
- *
88
- * @param input - The Uint8Array to convert
89
- * @returns A properly aligned Uint16Array
90
- *
91
- * @public
92
- */
93
- declare function convertUint8ToUint16(input: Uint8Array): Uint16Array;
86
+ * Converts a Uint8Array to a Uint16Array by aligning its buffer.
87
+ *
88
+ * @param input - The Uint8Array to convert
89
+ * @returns A properly aligned Uint16Array
90
+ *
91
+ * @public
92
+ */
93
+ export declare function convertUint8ToUint16(input: Uint8Array): Uint16Array;
94
94
  //#endregion
95
95
  //#region src/UTF_16.d.ts
96
96
  /**
97
- * UTF-16 Encoding.
98
- *
99
- * @public
100
- */
101
- declare const UTF_16 = "utf-16";
97
+ * UTF-16 Encoding.
98
+ *
99
+ * @public
100
+ */
101
+ export declare const UTF_16 = "utf-16";
102
102
  //#endregion
103
103
  //#region src/UTF_16_BE.d.ts
104
104
  /**
105
- * UTF-16 Big Endian Encoding.
106
- *
107
- * @public
108
- */
109
- declare const UTF_16_BE = "utf-16be";
105
+ * UTF-16 Big Endian Encoding.
106
+ *
107
+ * @public
108
+ */
109
+ export declare const UTF_16_BE = "utf-16be";
110
110
  //#endregion
111
111
  //#region src/UTF_16_LE.d.ts
112
112
  /**
113
- * UTF-16 Little Endian Encoding.
114
- *
115
- * @public
116
- */
117
- declare const UTF_16_LE = "utf-16le";
113
+ * UTF-16 Little Endian Encoding.
114
+ *
115
+ * @public
116
+ */
117
+ export declare const UTF_16_LE = "utf-16le";
118
118
  //#endregion
119
119
  //#region src/UTF_8.d.ts
120
120
  /**
121
- * UTF-8 Encoding.
122
- *
123
- * @public
124
- */
125
- declare const UTF_8 = "utf-8";
121
+ * UTF-8 Encoding.
122
+ *
123
+ * @public
124
+ */
125
+ export declare const UTF_8 = "utf-8";
126
126
  //#endregion
127
127
  //#region src/ValueOf.d.ts
128
128
  /**
129
- * Utility type to get the value of a given object type.
130
- *
131
- * @public
132
- */
133
- type ValueOf<T> = T[keyof T];
129
+ * Utility type to get the value of a given object type.
130
+ *
131
+ * @public
132
+ */
133
+ export type ValueOf<T> = T[keyof T];
134
134
  //#endregion
135
135
  //#region src/Encoding.d.ts
136
136
  /**
137
- * Text encoding types.
138
- *
139
- * @public
140
- */
141
- declare const Encoding: {
137
+ * Text encoding types.
138
+ *
139
+ * @public
140
+ */
141
+ export declare const Encoding: {
142
142
  readonly UTF8: typeof UTF_8;
143
143
  readonly UTF16: typeof UTF_16;
144
144
  readonly UTF16BE: typeof UTF_16_BE;
145
145
  readonly UTF16LE: typeof UTF_16_LE;
146
146
  };
147
147
  /**
148
- * Text encoding types.
149
- *
150
- * @public
151
- */
152
- type Encoding = ValueOf<typeof Encoding>;
148
+ * Text encoding types.
149
+ *
150
+ * @public
151
+ */
152
+ export type Encoding = ValueOf<typeof Encoding>;
153
153
  //#endregion
154
154
  //#region src/DecodeTextOptions.d.ts
155
155
  /**
156
- * Options for the `decodeText` function.
157
- *
158
- * @public
159
- */
160
- type DecodeTextOptions = {
156
+ * Options for the `decodeText` function.
157
+ *
158
+ * @public
159
+ */
160
+ export type DecodeTextOptions = {
161
161
  /**
162
- * The encoding to use. If omitted, the function tries to detect the encoding from the BOM.
163
- */
162
+ * The encoding to use. If omitted, the function tries to detect the encoding from the BOM.
163
+ */
164
164
  encoding?: Encoding;
165
165
  };
166
166
  //#endregion
167
167
  //#region src/decodeText.d.ts
168
168
  /**
169
- * Converts an ArrayBuffer or ArrayBufferView to a string. The function works like
170
- * `TextDecoder.decode` and also supports environments without `TextDecoder`.
171
- *
172
- * @param data - The data to decode.
173
- * @param options - The options for the decoding.
174
- * @returns The string representation of the ArrayBuffer.
175
- *
176
- * @public
177
- *
178
- * @example
179
- * {@includeCode ../test/decodeText.test.ts#example}
180
- */
181
- declare function decodeText(data: ArrayBufferLike | ArrayBufferView, options?: DecodeTextOptions): string;
169
+ * Converts an ArrayBuffer or ArrayBufferView to a string. The function works like
170
+ * `TextDecoder.decode` and also supports environments without `TextDecoder`.
171
+ *
172
+ * @param data - The data to decode.
173
+ * @param options - The options for the decoding.
174
+ * @returns The string representation of the ArrayBuffer.
175
+ *
176
+ * @public
177
+ *
178
+ * @example
179
+ * {@includeCode ../test/decodeText.test.ts#example}
180
+ */
181
+ export declare function decodeText(data: ArrayBufferLike | ArrayBufferView, options?: DecodeTextOptions): string;
182
182
  //#endregion
183
183
  //#region src/DeepReadonly.d.ts
184
184
  /**
185
- * Utility type that marks every property of a given type as `readonly`,
186
- * recursively.
187
- *
188
- * `Readonly<T>` stops at the top level, so a nested object remains writable and
189
- * `value.nested.field = …` still compiles. `DeepReadonly` applies at every depth,
190
- * including through arrays.
191
- *
192
- * Functions keep their type, so callbacks on a value remain callable.
193
- * Primitives keep their type.
194
- *
195
- * @typeParam T - The type to make deeply readonly.
196
- *
197
- * @example
198
- * {@includeCode ../test/DeepReadonly.test.ts#example}
199
- *
200
- * @public
201
- */
202
- type DeepReadonly<T> = T extends ((...args: never[]) => unknown) ? T : T extends readonly (infer U)[] ? readonly DeepReadonly<U>[] : T extends object ? { readonly [P in keyof T]: DeepReadonly<T[P]> } : T;
185
+ * Utility type that marks every property of a given type as `readonly`,
186
+ * recursively.
187
+ *
188
+ * `Readonly<T>` stops at the top level, so a nested object remains writable and
189
+ * `value.nested.field = …` still compiles. `DeepReadonly` applies at every depth,
190
+ * including through arrays.
191
+ *
192
+ * Functions keep their type, so callbacks on a value remain callable.
193
+ * Primitives keep their type.
194
+ *
195
+ * @typeParam T - The type to make deeply readonly.
196
+ *
197
+ * @example
198
+ * {@includeCode ../test/DeepReadonly.test.ts#example}
199
+ *
200
+ * @public
201
+ */
202
+ type DeepReadonly<T> = T extends ((...args: never[]) => unknown) ? T : T extends readonly (infer U)[] ? readonly DeepReadonly<U>[] : T extends object ? { readonly [P in keyof T]: DeepReadonly<T[P]>; } : T;
203
203
  //#endregion
204
204
  //#region src/encodeText.d.ts
205
205
  /**
206
- * Converts a string to a Uint8Array. The function works like
207
- * `TextEncoder.encode` and also supports environments without `TextEncoder`.
208
- *
209
- * @param data - The string to encode.
210
- * @returns The Uint8Array representation of the string.
211
- *
212
- * @public
213
- *
214
- * @example
215
- * {@includeCode ../test/encodeText.test.ts#example}
216
- */
217
- declare function encodeText(data: string): Uint8Array;
206
+ * Converts a string to a Uint8Array. The function works like
207
+ * `TextEncoder.encode` and also supports environments without `TextEncoder`.
208
+ *
209
+ * @param data - The string to encode.
210
+ * @returns The Uint8Array representation of the string.
211
+ *
212
+ * @public
213
+ *
214
+ * @example
215
+ * {@includeCode ../test/encodeText.test.ts#example}
216
+ */
217
+ export declare function encodeText(data: string): Uint8Array;
218
218
  //#endregion
219
219
  //#region src/ExclusiveRecord.d.ts
220
220
  /**
221
- * A record that is exclusive to a given key.
222
- *
223
- * @public
224
- */
225
- type ExclusiveRecord<K extends PropertyKey, V> = { [P in K]: Record<P, V> & Partial<Record<Exclude<K, P>, never>> extends infer O ? { [Q in keyof O]: O[Q] } : never }[K];
221
+ * A record that is exclusive to a given key.
222
+ *
223
+ * @public
224
+ */
225
+ export type ExclusiveRecord<K extends PropertyKey, V> = { [P in K]: Record<P, V> & Partial<Record<Exclude<K, P>, never>> extends (infer O) ? { [Q in keyof O]: O[Q]; } : never; }[K];
226
226
  //#endregion
227
227
  //#region src/ResourceTiming.d.ts
228
228
  /**
229
- * A subset of the `PerformanceResourceTiming` interface.
230
- * https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming
231
- *
232
- * @public
233
- */
234
- type ResourceTiming = {
229
+ * A subset of the `PerformanceResourceTiming` interface.
230
+ * https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming
231
+ *
232
+ * @public
233
+ */
234
+ export type ResourceTiming = {
235
235
  /**
236
- * A `DOMHighResTimeStamp` for the time a resource fetch started.
237
- */
236
+ * A `DOMHighResTimeStamp` for the time a resource fetch started.
237
+ */
238
238
  startTime: number;
239
239
  /**
240
- * The size (in octets) of the payload body before removing any applied content encodings.
241
- */
240
+ * The size (in octets) of the payload body before removing any applied content encodings.
241
+ */
242
242
  encodedBodySize: number;
243
243
  /**
244
- * A `DOMHighResTimeStamp` immediately after the browser receives the first byte of the response from the server.
245
- */
244
+ * A `DOMHighResTimeStamp` immediately after the browser receives the first byte of the response from the server.
245
+ */
246
246
  responseStart?: number;
247
247
  /**
248
- * The difference (in milliseconds) between the `responseEnd` and the `startTime`.
249
- */
248
+ * The difference (in milliseconds) between the `responseEnd` and the `startTime`.
249
+ */
250
250
  duration: number;
251
251
  };
252
252
  //#endregion
253
253
  //#region src/getBandwidthBps.d.ts
254
254
  /**
255
- * Converts a ResourceTiming sample to bandwidth in bits per second.
256
- *
257
- * @param sample - A ResourceTiming sample
258
- * @returns The bandwidth in bits per second.
259
- *
260
- * @public
261
- */
262
- declare function getBandwidthBps(sample: ResourceTiming): number;
255
+ * Converts a ResourceTiming sample to bandwidth in bits per second.
256
+ *
257
+ * @param sample - A ResourceTiming sample
258
+ * @returns The bandwidth in bits per second.
259
+ *
260
+ * @public
261
+ */
262
+ export declare function getBandwidthBps(sample: ResourceTiming): number;
263
263
  //#endregion
264
264
  //#region src/getBaseUrl.d.ts
265
265
  /**
266
- * Gets the base URL from a full URL or a URL object.
267
- *
268
- * @param fullUrl - The full URL or URL object.
269
- * @returns The base URL.
270
- *
271
- * @public
272
- *
273
- * @example
274
- * {@includeCode ../test/getBaseUrl.test.ts#example}
275
- */
276
- declare function getBaseUrl(fullUrl: string | URL): string;
266
+ * Gets the base URL from a full URL or a URL object.
267
+ *
268
+ * @param fullUrl - The full URL or URL object.
269
+ * @returns The base URL.
270
+ *
271
+ * @public
272
+ *
273
+ * @example
274
+ * {@includeCode ../test/getBaseUrl.test.ts#example}
275
+ */
276
+ export declare function getBaseUrl(fullUrl: string | URL): string;
277
277
  //#endregion
278
278
  //#region src/hexToArrayBuffer.d.ts
279
279
  /**
280
- * Decodes a hexadecimal string into an ArrayBuffer.
281
- *
282
- * @param hex - The hexadecimal string to decode.
283
- * @returns The decoded ArrayBuffer.
284
- *
285
- * @public
286
- *
287
- * @example
288
- * {@includeCode ../test/hexToArrayBuffer.test.ts#example}
289
- */
290
- declare function hexToArrayBuffer(hex: string): ArrayBuffer;
280
+ * Decodes a hexadecimal string into an ArrayBuffer.
281
+ *
282
+ * @param hex - The hexadecimal string to decode.
283
+ * @returns The decoded ArrayBuffer.
284
+ *
285
+ * @public
286
+ *
287
+ * @example
288
+ * {@includeCode ../test/hexToArrayBuffer.test.ts#example}
289
+ */
290
+ export declare function hexToArrayBuffer(hex: string): ArrayBuffer;
291
291
  //#endregion
292
292
  //#region src/isArrayBufferLike.d.ts
293
293
  /**
294
- * Checks if the given value is `ArrayBufferLike`: an `ArrayBuffer` or a
295
- * `SharedArrayBuffer`.
296
- *
297
- * The function also works where `SharedArrayBuffer` is not defined, such as
298
- * browser contexts without cross-origin isolation.
299
- *
300
- * @param value - The value to check.
301
- * @returns `true` if the value is an `ArrayBuffer` or `SharedArrayBuffer`.
302
- *
303
- * @public
304
- *
305
- * @example
306
- * {@includeCode ../test/isArrayBufferLike.test.ts#example}
307
- */
308
- declare function isArrayBufferLike(value: unknown): value is ArrayBufferLike;
294
+ * Checks if the given value is `ArrayBufferLike`: an `ArrayBuffer` or a
295
+ * `SharedArrayBuffer`.
296
+ *
297
+ * The function also works where `SharedArrayBuffer` is not defined, such as
298
+ * browser contexts without cross-origin isolation.
299
+ *
300
+ * @param value - The value to check.
301
+ * @returns `true` if the value is an `ArrayBuffer` or `SharedArrayBuffer`.
302
+ *
303
+ * @public
304
+ *
305
+ * @example
306
+ * {@includeCode ../test/isArrayBufferLike.test.ts#example}
307
+ */
308
+ export declare function isArrayBufferLike(value: unknown): value is ArrayBufferLike;
309
309
  //#endregion
310
310
  //#region src/RequestResponseType.d.ts
311
311
  /**
312
- * The response type of the request.
313
- *
314
- * @enum
315
- *
316
- * @public
317
- */
318
- declare const RequestResponseType: {
312
+ * The response type of the request.
313
+ *
314
+ * @enum
315
+ *
316
+ * @public
317
+ */
318
+ export declare const RequestResponseType: {
319
319
  readonly TEXT: "text";
320
320
  readonly JSON: "json";
321
321
  readonly BLOB: "blob";
@@ -324,62 +324,62 @@ declare const RequestResponseType: {
324
324
  readonly STREAM: "stream";
325
325
  };
326
326
  /**
327
- * @public
328
- */
329
- type RequestResponseType = ValueOf<typeof RequestResponseType>;
327
+ * @public
328
+ */
329
+ export type RequestResponseType = ValueOf<typeof RequestResponseType>;
330
330
  //#endregion
331
331
  //#region src/HttpRequest.d.ts
332
332
  /**
333
- * Generic request API.
334
- *
335
- * @public
336
- */
337
- type HttpRequest<D = any> = {
333
+ * Generic request API.
334
+ *
335
+ * @public
336
+ */
337
+ export type HttpRequest<D = any> = {
338
338
  /**
339
- * The URL of the request.
340
- */
339
+ * The URL of the request.
340
+ */
341
341
  url: string;
342
342
  /**
343
- * The request's method (GET, POST, etc).
344
- */
343
+ * The request's method (GET, POST, etc).
344
+ */
345
345
  method?: string;
346
346
  /**
347
- * The body of the request.
348
- */
347
+ * The body of the request.
348
+ */
349
349
  body?: BodyInit;
350
350
  /**
351
- * The type that the response from the server must be compatible with.
352
- */
351
+ * The type that the response from the server must be compatible with.
352
+ */
353
353
  responseType?: RequestResponseType;
354
354
  /**
355
- * The headers object associated with the request.
356
- */
355
+ * The headers object associated with the request.
356
+ */
357
357
  headers?: Record<string, string>;
358
358
  /**
359
- * Whether the user agent should send or receive cookies from the other domain in cross-origin requests.
360
- */
359
+ * Whether the user agent should send or receive cookies from the other domain in cross-origin requests.
360
+ */
361
361
  credentials?: RequestCredentials;
362
362
  /**
363
- * The mode of the request, for example cors, no-cors, or same-origin.
364
- */
363
+ * The mode of the request, for example cors, no-cors, or same-origin.
364
+ */
365
365
  mode?: RequestMode;
366
366
  /**
367
- * The number of milliseconds the request may take before it is terminated.
368
- * If the value is undefined or 0, there is no timeout.
369
- */
367
+ * The number of milliseconds the request may take before it is terminated.
368
+ * If the value is undefined or 0, there is no timeout.
369
+ */
370
370
  timeout?: number;
371
371
  /**
372
- * Any custom data.
373
- */
372
+ * Any custom data.
373
+ */
374
374
  customData?: D;
375
375
  };
376
376
  //#endregion
377
377
  //#region src/XmlNode.d.ts
378
378
  /**
379
- * XML node
380
- *
381
- * @public
382
- */
379
+ * XML node
380
+ *
381
+ * @public
382
+ */
383
383
  type XmlNode = {
384
384
  nodeName: string;
385
385
  nodeValue: string | null;
@@ -392,169 +392,169 @@ type XmlNode = {
392
392
  //#endregion
393
393
  //#region src/ResponseTypeMap.d.ts
394
394
  /**
395
- * Maps a request's `responseType` to the corresponding data type.
396
- *
397
- * @public
398
- */
395
+ * Maps a request's `responseType` to the corresponding data type.
396
+ *
397
+ * @public
398
+ */
399
399
  type ResponseTypeMap<T extends string | undefined> = T extends "json" ? any : T extends "text" ? string : T extends "blob" ? Blob : T extends "arrayBuffer" ? ArrayBuffer : T extends "document" ? XmlNode : T extends "stream" ? ReadableStream : unknown;
400
400
  //#endregion
401
401
  //#region src/HttpResponse.d.ts
402
402
  /**
403
- * Generic response API.
404
- *
405
- * @public
406
- */
407
- type HttpResponse<R extends HttpRequest = HttpRequest> = {
403
+ * Generic response API.
404
+ *
405
+ * @public
406
+ */
407
+ export type HttpResponse<R extends HttpRequest = HttpRequest> = {
408
408
  /**
409
- * The origin request.
410
- */
409
+ * The origin request.
410
+ */
411
411
  request: R;
412
412
  /**
413
- * The final URL obtained after any redirects.
414
- */
413
+ * The final URL obtained after any redirects.
414
+ */
415
415
  url?: string;
416
416
  /**
417
- * Whether the request was redirected.
418
- */
417
+ * Whether the request was redirected.
418
+ */
419
419
  redirected?: boolean;
420
420
  /**
421
- * The HTTP status code of the response.
422
- */
421
+ * The HTTP status code of the response.
422
+ */
423
423
  status?: number;
424
424
  /**
425
- * The status message corresponding to the HTTP status code.
426
- */
425
+ * The status message corresponding to the HTTP status code.
426
+ */
427
427
  statusText?: string;
428
428
  /**
429
- * The type of the response.
430
- */
429
+ * The type of the response.
430
+ */
431
431
  type?: string;
432
432
  /**
433
- * The response headers.
434
- */
433
+ * The response headers.
434
+ */
435
435
  headers?: Record<string, string>;
436
436
  /**
437
- * The response data.
438
- */
437
+ * The response data.
438
+ */
439
439
  data?: ResponseTypeMap<R["responseType"]>;
440
440
  /**
441
- * The network timing of the request/response.
442
- */
441
+ * The network timing of the request/response.
442
+ */
443
443
  resourceTiming?: ResourceTiming;
444
444
  };
445
445
  //#endregion
446
446
  //#region src/Request.d.ts
447
447
  /**
448
- * Request API.
449
- *
450
- * @public
451
- * @deprecated Use {@link HttpRequest} instead.
452
- */
448
+ * Request API.
449
+ *
450
+ * @public
451
+ * @deprecated Use {@link HttpRequest} instead.
452
+ */
453
453
  type Request = HttpRequest;
454
454
  //#endregion
455
455
  //#region src/roundToEven.d.ts
456
456
  /**
457
- * Rounds a value with the procedure from step 2 of the "Serializing a Decimal" specification.
458
- * The style is known as "even rounding", "banker's rounding", or "commercial rounding".
459
- *
460
- * @param value - The value to round
461
- * @param precision - The number of decimal places to round to
462
- * @returns The rounded value
463
- *
464
- * @public
465
- */
466
- declare function roundToEven(value: number, precision: number): number;
457
+ * Rounds a value with the procedure from step 2 of the "Serializing a Decimal" specification.
458
+ * The style is known as "even rounding", "banker's rounding", or "commercial rounding".
459
+ *
460
+ * @param value - The value to round
461
+ * @param precision - The number of decimal places to round to
462
+ * @returns The rounded value
463
+ *
464
+ * @public
465
+ */
466
+ export declare function roundToEven(value: number, precision: number): number;
467
467
  //#endregion
468
468
  //#region src/stringToUint16.d.ts
469
469
  /**
470
- * Converts a string to a Uint16Array.
471
- *
472
- * @param str - The string to convert
473
- * @returns A Uint16Array representation of the string
474
- *
475
- * @public
476
- *
477
- * @example
478
- * {@includeCode ../test/stringToUint16.test.ts#example}
479
- */
480
- declare function stringToUint16(str: string): Uint16Array;
470
+ * Converts a string to a Uint16Array.
471
+ *
472
+ * @param str - The string to convert
473
+ * @returns A Uint16Array representation of the string
474
+ *
475
+ * @public
476
+ *
477
+ * @example
478
+ * {@includeCode ../test/stringToUint16.test.ts#example}
479
+ */
480
+ export declare function stringToUint16(str: string): Uint16Array;
481
481
  //#endregion
482
482
  //#region src/TypedResult.d.ts
483
483
  /**
484
- * Utility type to create a typed result.
485
- *
486
- * @public
487
- */
488
- type TypedResult<T, D> = {
484
+ * Utility type to create a typed result.
485
+ *
486
+ * @public
487
+ */
488
+ export type TypedResult<T, D> = {
489
489
  type: T;
490
490
  data: D;
491
491
  };
492
492
  //#endregion
493
493
  //#region src/unescapeHtml.d.ts
494
494
  /**
495
- * Unescapes HTML entities
496
- *
497
- * @param text - The text to unescape
498
- * @returns The unescaped text
499
- *
500
- * @public
501
- *
502
- * @example
503
- * {@includeCode ../test/unescapeHtml.test.ts#example}
504
- */
505
- declare function unescapeHtml(text: string): string;
495
+ * Unescapes HTML entities
496
+ *
497
+ * @param text - The text to unescape
498
+ * @returns The unescaped text
499
+ *
500
+ * @public
501
+ *
502
+ * @example
503
+ * {@includeCode ../test/unescapeHtml.test.ts#example}
504
+ */
505
+ export declare function unescapeHtml(text: string): string;
506
506
  //#endregion
507
507
  //#region src/urlToRelativePath.d.ts
508
508
  /**
509
- * Constructs a relative path from a URL.
510
- *
511
- * If `url` is already relative, or its origin differs from `base`, the function returns `url` unchanged.
512
- *
513
- * @param url - The destination URL
514
- * @param base - The base URL
515
- * @returns The relative path
516
- *
517
- * @public
518
- *
519
- * @example
520
- * {@includeCode ../test/urlToRelativePath.test.ts#example}
521
- */
522
- declare function urlToRelativePath(url: string, base: string): string;
509
+ * Constructs a relative path from a URL.
510
+ *
511
+ * If `url` is already relative, or its origin differs from `base`, the function returns `url` unchanged.
512
+ *
513
+ * @param url - The destination URL
514
+ * @param base - The base URL
515
+ * @returns The relative path
516
+ *
517
+ * @public
518
+ *
519
+ * @example
520
+ * {@includeCode ../test/urlToRelativePath.test.ts#example}
521
+ */
522
+ export declare function urlToRelativePath(url: string, base: string): string;
523
523
  //#endregion
524
524
  //#region src/uuid.d.ts
525
525
  /**
526
- * Generates a random v4 UUID
527
- *
528
- * @returns A random v4 UUID
529
- *
530
- * @public
531
- *
532
- * @example
533
- * {@includeCode ../test/uuid.test.ts#example}
534
- */
535
- declare function uuid(): string;
526
+ * Generates a random v4 UUID
527
+ *
528
+ * @returns A random v4 UUID
529
+ *
530
+ * @public
531
+ *
532
+ * @example
533
+ * {@includeCode ../test/uuid.test.ts#example}
534
+ */
535
+ export declare function uuid(): string;
536
536
  //#endregion
537
537
  //#region src/uuidToArrayBuffer.d.ts
538
538
  /**
539
- * Converts a UUID string to an ArrayBuffer.
540
- *
541
- * @param uuid - The UUID string to convert.
542
- * @returns The ArrayBuffer representation.
543
- *
544
- * @public
545
- *
546
- * @example
547
- * {@includeCode ../test/uuidToArrayBuffer.test.ts#example}
548
- */
549
- declare function uuidToArrayBuffer(uuid: string): ArrayBuffer;
539
+ * Converts a UUID string to an ArrayBuffer.
540
+ *
541
+ * @param uuid - The UUID string to convert.
542
+ * @returns The ArrayBuffer representation.
543
+ *
544
+ * @public
545
+ *
546
+ * @example
547
+ * {@includeCode ../test/uuidToArrayBuffer.test.ts#example}
548
+ */
549
+ export declare function uuidToArrayBuffer(uuid: string): ArrayBuffer;
550
550
  //#endregion
551
551
  //#region src/ValueOrArray.d.ts
552
552
  /**
553
- * A type that represents either a single value or an array of values.
554
- *
555
- * @public
556
- */
557
- type ValueOrArray<T> = T | T[];
553
+ * A type that represents either a single value or an array of values.
554
+ *
555
+ * @public
556
+ */
557
+ export type ValueOrArray<T> = T | T[];
558
558
  //#endregion
559
- export { DecodeTextOptions, DeepReadonly, Encoding, ExclusiveRecord, HttpRequest, HttpResponse, Request, RequestResponseType, ResourceTiming, ResponseTypeMap, TypedResult, UTF_16, UTF_16_BE, UTF_16_LE, UTF_8, ValueOf, ValueOrArray, XmlNode, arrayBufferToHex, arrayBufferToUuid, base64decode, base64encode, convertUint8ToUint16, decodeBase64, decodeText, encodeBase64, encodeText, getBandwidthBps, getBaseUrl, hexToArrayBuffer, isArrayBufferLike, roundToEven, stringToUint16, unescapeHtml, urlToRelativePath, uuid, uuidToArrayBuffer };
559
+ export type { DeepReadonly, Request, ResponseTypeMap, XmlNode };
560
560
  //# sourceMappingURL=index.d.ts.map