@idlebox/stripe-node-types 24.0.14-patch.0 → 24.0.15
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/README.md +1 -1
- package/assert/strict.d.ts +113 -1
- package/assert.d.ts +162 -248
- package/async_hooks.d.ts +20 -5
- package/buffer.buffer.d.ts +24 -6
- package/buffer.d.ts +63 -168
- package/child_process.d.ts +117 -223
- package/cluster.d.ts +251 -329
- package/compatibility/iterators.d.ts +15 -0
- package/console.d.ts +60 -346
- package/constants.d.ts +15 -1
- package/crypto.d.ts +713 -1149
- package/dgram.d.ts +30 -50
- package/diagnostics_channel.d.ts +16 -3
- package/dns/promises.d.ts +15 -0
- package/dns.d.ts +150 -131
- package/domain.d.ts +25 -14
- package/events.d.ts +858 -719
- package/fs/promises.d.ts +117 -53
- package/fs.d.ts +729 -484
- package/globals.d.ts +142 -344
- package/globals.typedarray.d.ts +94 -0
- package/http.d.ts +358 -246
- package/http2.d.ts +578 -711
- package/https.d.ts +85 -216
- package/index.d.ts +39 -3
- package/inspector/promises.d.ts +54 -0
- package/inspector.d.ts +180 -3936
- package/inspector.generated.d.ts +4242 -0
- package/module.d.ts +60 -95
- package/my-shim.d.ts +15 -0
- package/net.d.ts +102 -186
- package/os.d.ts +32 -6
- package/package.json +3 -8
- package/path/posix.d.ts +20 -0
- package/path/win32.d.ts +20 -0
- package/path.d.ts +132 -122
- package/perf_hooks.d.ts +310 -644
- package/process.d.ts +192 -138
- package/punycode.d.ts +17 -2
- package/querystring.d.ts +16 -1
- package/quic.d.ts +926 -0
- package/readline/promises.d.ts +16 -1
- package/readline.d.ts +80 -118
- package/repl.d.ts +98 -96
- package/sea.d.ts +25 -1
- package/sqlite.d.ts +277 -13
- package/stream/consumers.d.ts +22 -7
- package/stream/promises.d.ts +148 -12
- package/stream/web.d.ts +187 -494
- package/stream.d.ts +608 -490
- package/string_decoder.d.ts +18 -3
- package/test/reporters.d.ts +112 -0
- package/test.d.ts +238 -199
- package/timers/promises.d.ts +16 -1
- package/timers.d.ts +16 -129
- package/tls.d.ts +163 -163
- package/trace_events.d.ts +21 -6
- package/ts5.6/buffer.buffer.d.ts +25 -8
- package/ts5.6/compatibility/float16array.d.ts +15 -0
- package/ts5.6/globals.typedarray.d.ts +31 -0
- package/ts5.6/index.d.ts +39 -3
- package/ts5.7/compatibility/float16array.d.ts +15 -0
- package/ts5.7/index.d.ts +39 -3
- package/tty.d.ts +70 -13
- package/undici-types/agent.d.ts +20 -4
- package/undici-types/api.d.ts +15 -0
- package/undici-types/balanced-pool.d.ts +15 -0
- package/undici-types/cache-interceptor.d.ts +15 -0
- package/undici-types/cache.d.ts +15 -0
- package/undici-types/client-stats.d.ts +31 -0
- package/undici-types/client.d.ts +21 -5
- package/undici-types/connector.d.ts +15 -0
- package/undici-types/content-type.d.ts +15 -0
- package/undici-types/cookies.d.ts +15 -0
- package/undici-types/diagnostics-channel.d.ts +24 -1
- package/undici-types/dispatcher.d.ts +18 -8
- package/undici-types/env-http-proxy-agent.d.ts +17 -1
- package/undici-types/errors.d.ts +20 -15
- package/undici-types/eventsource.d.ts +24 -4
- package/undici-types/fetch.d.ts +16 -0
- package/undici-types/formdata.d.ts +15 -0
- package/undici-types/global-dispatcher.d.ts +15 -0
- package/undici-types/global-origin.d.ts +15 -0
- package/undici-types/h2c-client.d.ts +15 -2
- package/undici-types/handlers.d.ts +16 -1
- package/undici-types/header.d.ts +15 -0
- package/undici-types/index.d.ts +21 -1
- package/undici-types/interceptors.d.ts +20 -0
- package/undici-types/mock-agent.d.ts +18 -0
- package/undici-types/mock-call-history.d.ts +15 -0
- package/undici-types/mock-client.d.ts +17 -0
- package/undici-types/mock-errors.d.ts +15 -0
- package/undici-types/mock-interceptor.d.ts +17 -1
- package/undici-types/mock-pool.d.ts +17 -0
- package/undici-types/package.json +1 -1
- package/undici-types/patch.d.ts +15 -0
- package/undici-types/pool-stats.d.ts +15 -0
- package/undici-types/pool.d.ts +17 -0
- package/undici-types/proxy-agent.d.ts +16 -0
- package/undici-types/readable.d.ts +15 -0
- package/undici-types/retry-agent.d.ts +15 -0
- package/undici-types/retry-handler.d.ts +24 -0
- package/undici-types/snapshot-agent.d.ts +125 -0
- package/undici-types/util.d.ts +15 -0
- package/undici-types/utility.d.ts +15 -0
- package/undici-types/webidl.d.ts +126 -36
- package/undici-types/websocket.d.ts +18 -1
- package/url.d.ts +107 -587
- package/util/types.d.ts +571 -0
- package/util.d.ts +158 -792
- package/v8.d.ts +82 -7
- package/vm.d.ts +267 -108
- package/wasi.d.ts +38 -2
- package/web-globals/abortcontroller.d.ts +75 -0
- package/web-globals/blob.d.ts +39 -0
- package/web-globals/console.d.ts +25 -0
- package/web-globals/crypto.d.ts +55 -0
- package/web-globals/domexception.d.ts +84 -0
- package/web-globals/encoding.d.ts +27 -0
- package/{dom-events.d.ts → web-globals/events.d.ts} +72 -50
- package/web-globals/fetch.d.ts +70 -0
- package/web-globals/importmeta.d.ts +29 -0
- package/web-globals/messaging.d.ts +39 -0
- package/web-globals/navigator.d.ts +41 -0
- package/web-globals/performance.d.ts +61 -0
- package/web-globals/storage.d.ts +40 -0
- package/web-globals/streams.d.ts +131 -0
- package/web-globals/timers.d.ts +60 -0
- package/web-globals/url.d.ts +40 -0
- package/worker_threads.d.ts +306 -349
- package/zlib.d.ts +59 -94
- package/ts5.1/compatibility/disposable.d.ts +0 -13
- package/ts5.1/index.d.ts +0 -100
package/async_hooks.d.ts
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
|
+
// biome-ignore-all lint: generated file
|
|
2
|
+
// biome-ignore-all assist: generated file
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
|
|
6
|
+
/******************************************************************************
|
|
7
|
+
* GENERATED FILE, DO NOT MODIFY
|
|
8
|
+
* 这是生成的文件,千万不要修改
|
|
9
|
+
*
|
|
10
|
+
* @build-script/codegen - The Simple Code Generater
|
|
11
|
+
* https://github.com/GongT/baobao
|
|
12
|
+
*
|
|
13
|
+
******************************************************************************/
|
|
14
|
+
|
|
15
|
+
|
|
1
16
|
/**
|
|
2
17
|
* We strongly discourage the use of the `async_hooks` API.
|
|
3
18
|
* Other APIs that can cover most of its use cases include:
|
|
4
19
|
*
|
|
5
|
-
* * [`AsyncLocalStorage`](https://nodejs.org/docs/latest-
|
|
6
|
-
* * [`process.getActiveResourcesInfo()`](https://nodejs.org/docs/latest-
|
|
20
|
+
* * [`AsyncLocalStorage`](https://nodejs.org/docs/latest-v25.x/api/async_context.html#class-asynclocalstorage) tracks async context
|
|
21
|
+
* * [`process.getActiveResourcesInfo()`](https://nodejs.org/docs/latest-v25.x/api/process.html#processgetactiveresourcesinfo) tracks active resources
|
|
7
22
|
*
|
|
8
23
|
* The `node:async_hooks` module provides an API to track asynchronous resources.
|
|
9
24
|
* It can be accessed using:
|
|
@@ -12,7 +27,7 @@
|
|
|
12
27
|
* import async_hooks from 'node:async_hooks';
|
|
13
28
|
* ```
|
|
14
29
|
* @experimental
|
|
15
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
30
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/async_hooks.js)
|
|
16
31
|
*/
|
|
17
32
|
|
|
18
33
|
declare module "node:async_hooks" {
|
|
@@ -45,7 +60,7 @@ declare module "node:async_hooks" {
|
|
|
45
60
|
* ```
|
|
46
61
|
*
|
|
47
62
|
* Promise contexts may not get precise `executionAsyncIds` by default.
|
|
48
|
-
* See the section on [promise execution tracking](https://nodejs.org/docs/latest-
|
|
63
|
+
* See the section on [promise execution tracking](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html#promise-execution-tracking).
|
|
49
64
|
* @since v8.1.0
|
|
50
65
|
* @return The `asyncId` of the current execution context. Useful to track when something calls.
|
|
51
66
|
*/
|
|
@@ -118,7 +133,7 @@ declare module "node:async_hooks" {
|
|
|
118
133
|
* ```
|
|
119
134
|
*
|
|
120
135
|
* Promise contexts may not get valid `triggerAsyncId`s by default. See
|
|
121
|
-
* the section on [promise execution tracking](https://nodejs.org/docs/latest-
|
|
136
|
+
* the section on [promise execution tracking](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html#promise-execution-tracking).
|
|
122
137
|
* @return The ID of the resource responsible for calling the callback that is currently being executed.
|
|
123
138
|
*/
|
|
124
139
|
function triggerAsyncId(): number;
|
package/buffer.buffer.d.ts
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
// biome-ignore-all lint: generated file
|
|
2
|
+
// biome-ignore-all assist: generated file
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
|
|
6
|
+
/******************************************************************************
|
|
7
|
+
* GENERATED FILE, DO NOT MODIFY
|
|
8
|
+
* 这是生成的文件,千万不要修改
|
|
9
|
+
*
|
|
10
|
+
* @build-script/codegen - The Simple Code Generater
|
|
11
|
+
* https://github.com/GongT/baobao
|
|
12
|
+
*
|
|
13
|
+
******************************************************************************/
|
|
14
|
+
|
|
15
|
+
|
|
1
16
|
|
|
2
17
|
declare module "node:buffer" {
|
|
3
18
|
type ImplicitArrayBuffer<T extends WithImplicitCoercion<ArrayBufferLike>> = T extends
|
|
@@ -452,13 +467,16 @@ declare module "node:buffer" {
|
|
|
452
467
|
*/
|
|
453
468
|
subarray(start?: number, end?: number): Buffer<TArrayBuffer>;
|
|
454
469
|
}
|
|
470
|
+
// TODO: remove globals in future version
|
|
471
|
+
/**
|
|
472
|
+
* @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
|
|
473
|
+
* TypeScript versions earlier than 5.7.
|
|
474
|
+
*/
|
|
455
475
|
type NonSharedBuffer = Buffer<ArrayBuffer>;
|
|
476
|
+
/**
|
|
477
|
+
* @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
|
|
478
|
+
* TypeScript versions earlier than 5.7.
|
|
479
|
+
*/
|
|
456
480
|
type AllowSharedBuffer = Buffer<ArrayBufferLike>;
|
|
457
481
|
}
|
|
458
|
-
/** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
|
|
459
|
-
var SlowBuffer: {
|
|
460
|
-
/** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
|
|
461
|
-
new(size: number): Buffer<ArrayBuffer>;
|
|
462
|
-
prototype: Buffer;
|
|
463
|
-
};
|
|
464
482
|
}
|
package/buffer.d.ts
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
// biome-ignore-all lint: generated file
|
|
2
|
+
// biome-ignore-all assist: generated file
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
|
|
6
|
+
/******************************************************************************
|
|
7
|
+
* GENERATED FILE, DO NOT MODIFY
|
|
8
|
+
* 这是生成的文件,千万不要修改
|
|
9
|
+
*
|
|
10
|
+
* @build-script/codegen - The Simple Code Generater
|
|
11
|
+
* https://github.com/GongT/baobao
|
|
12
|
+
*
|
|
13
|
+
******************************************************************************/
|
|
14
|
+
|
|
5
15
|
|
|
6
16
|
/**
|
|
7
17
|
* `Buffer` objects are used to represent a fixed-length sequence of bytes. Many
|
|
@@ -46,12 +56,11 @@ type _File = typeof globalThis extends { onmessage: any; File: any } ? {} : impo
|
|
|
46
56
|
* // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74].
|
|
47
57
|
* const buf7 = Buffer.from('tést', 'latin1');
|
|
48
58
|
* ```
|
|
49
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
59
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/buffer.js)
|
|
50
60
|
*/
|
|
51
61
|
|
|
52
62
|
declare module "node:buffer" {
|
|
53
|
-
import {
|
|
54
|
-
import { ReadableStream as WebReadableStream } from 'node:stream/web';
|
|
63
|
+
import { ReadableStream } from 'node:stream/web';
|
|
55
64
|
/**
|
|
56
65
|
* This function returns `true` if `input` contains only valid UTF-8-encoded data,
|
|
57
66
|
* including the case in which `input` is empty.
|
|
@@ -60,7 +69,7 @@ declare module "node:buffer" {
|
|
|
60
69
|
* @since v19.4.0, v18.14.0
|
|
61
70
|
* @param input The input to validate.
|
|
62
71
|
*/
|
|
63
|
-
export function isUtf8(input:
|
|
72
|
+
export function isUtf8(input: ArrayBuffer | NodeJS.TypedArray): boolean;
|
|
64
73
|
/**
|
|
65
74
|
* This function returns `true` if `input` contains only valid ASCII-encoded data,
|
|
66
75
|
* including the case in which `input` is empty.
|
|
@@ -69,7 +78,7 @@ declare module "node:buffer" {
|
|
|
69
78
|
* @since v19.6.0, v18.15.0
|
|
70
79
|
* @param input The input to validate.
|
|
71
80
|
*/
|
|
72
|
-
export function isAscii(input:
|
|
81
|
+
export function isAscii(input: ArrayBuffer | NodeJS.TypedArray): boolean;
|
|
73
82
|
export let INSPECT_MAX_BYTES: number;
|
|
74
83
|
export const kMaxLength: number;
|
|
75
84
|
export const kStringMaxLength: number;
|
|
@@ -114,7 +123,11 @@ declare module "node:buffer" {
|
|
|
114
123
|
* @param fromEnc The current encoding.
|
|
115
124
|
* @param toEnc To target encoding.
|
|
116
125
|
*/
|
|
117
|
-
export function transcode(
|
|
126
|
+
export function transcode(
|
|
127
|
+
source: Uint8Array,
|
|
128
|
+
fromEnc: TranscodeEncoding,
|
|
129
|
+
toEnc: TranscodeEncoding,
|
|
130
|
+
): NonSharedBuffer;
|
|
118
131
|
/**
|
|
119
132
|
* Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using
|
|
120
133
|
* a prior call to `URL.createObjectURL()`.
|
|
@@ -123,115 +136,11 @@ declare module "node:buffer" {
|
|
|
123
136
|
*/
|
|
124
137
|
export function resolveObjectURL(id: string): Blob | undefined;
|
|
125
138
|
export { type AllowSharedBuffer, Buffer, type NonSharedBuffer };
|
|
126
|
-
/**
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
* One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts
|
|
132
|
-
* will be converted to the platform native line-ending as specified by `import { EOL } from 'node:os'`.
|
|
133
|
-
*/
|
|
134
|
-
endings?: "transparent" | "native";
|
|
135
|
-
/**
|
|
136
|
-
* The Blob content-type. The intent is for `type` to convey
|
|
137
|
-
* the MIME media type of the data, however no validation of the type format
|
|
138
|
-
* is performed.
|
|
139
|
-
*/
|
|
140
|
-
type?: string | undefined;
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* A [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) encapsulates immutable, raw data that can be safely shared across
|
|
144
|
-
* multiple worker threads.
|
|
145
|
-
* @since v15.7.0, v14.18.0
|
|
146
|
-
*/
|
|
147
|
-
export class Blob {
|
|
148
|
-
/**
|
|
149
|
-
* The total size of the `Blob` in bytes.
|
|
150
|
-
* @since v15.7.0, v14.18.0
|
|
151
|
-
*/
|
|
152
|
-
readonly size: number;
|
|
153
|
-
/**
|
|
154
|
-
* The content-type of the `Blob`.
|
|
155
|
-
* @since v15.7.0, v14.18.0
|
|
156
|
-
*/
|
|
157
|
-
readonly type: string;
|
|
158
|
-
/**
|
|
159
|
-
* Creates a new `Blob` object containing a concatenation of the given sources.
|
|
160
|
-
*
|
|
161
|
-
* {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into
|
|
162
|
-
* the 'Blob' and can therefore be safely modified after the 'Blob' is created.
|
|
163
|
-
*
|
|
164
|
-
* String sources are also copied into the `Blob`.
|
|
165
|
-
*/
|
|
166
|
-
constructor(sources: Array<ArrayBuffer | BinaryLike | Blob>, options?: BlobOptions);
|
|
167
|
-
/**
|
|
168
|
-
* Returns a promise that fulfills with an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of
|
|
169
|
-
* the `Blob` data.
|
|
170
|
-
* @since v15.7.0, v14.18.0
|
|
171
|
-
*/
|
|
172
|
-
arrayBuffer(): Promise<ArrayBuffer>;
|
|
173
|
-
/**
|
|
174
|
-
* The `blob.bytes()` method returns the byte of the `Blob` object as a `Promise<Uint8Array>`.
|
|
175
|
-
*
|
|
176
|
-
* ```js
|
|
177
|
-
* const blob = new Blob(['hello']);
|
|
178
|
-
* blob.bytes().then((bytes) => {
|
|
179
|
-
* console.log(bytes); // Outputs: Uint8Array(5) [ 104, 101, 108, 108, 111 ]
|
|
180
|
-
* });
|
|
181
|
-
* ```
|
|
182
|
-
*/
|
|
183
|
-
bytes(): Promise<Uint8Array>;
|
|
184
|
-
/**
|
|
185
|
-
* Creates and returns a new `Blob` containing a subset of this `Blob` objects
|
|
186
|
-
* data. The original `Blob` is not altered.
|
|
187
|
-
* @since v15.7.0, v14.18.0
|
|
188
|
-
* @param start The starting index.
|
|
189
|
-
* @param end The ending index.
|
|
190
|
-
* @param type The content-type for the new `Blob`
|
|
191
|
-
*/
|
|
192
|
-
slice(start?: number, end?: number, type?: string): Blob;
|
|
193
|
-
/**
|
|
194
|
-
* Returns a promise that fulfills with the contents of the `Blob` decoded as a
|
|
195
|
-
* UTF-8 string.
|
|
196
|
-
* @since v15.7.0, v14.18.0
|
|
197
|
-
*/
|
|
198
|
-
text(): Promise<string>;
|
|
199
|
-
/**
|
|
200
|
-
* Returns a new `ReadableStream` that allows the content of the `Blob` to be read.
|
|
201
|
-
* @since v16.7.0
|
|
202
|
-
*/
|
|
203
|
-
stream(): WebReadableStream;
|
|
204
|
-
}
|
|
205
|
-
export interface FileOptions {
|
|
206
|
-
/**
|
|
207
|
-
* One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be
|
|
208
|
-
* converted to the platform native line-ending as specified by `import { EOL } from 'node:os'`.
|
|
209
|
-
*/
|
|
210
|
-
endings?: "native" | "transparent";
|
|
211
|
-
/** The File content-type. */
|
|
212
|
-
type?: string;
|
|
213
|
-
/** The last modified date of the file. `Default`: Date.now(). */
|
|
214
|
-
lastModified?: number;
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) provides information about files.
|
|
218
|
-
* @since v19.2.0, v18.13.0
|
|
219
|
-
*/
|
|
220
|
-
export class File extends Blob {
|
|
221
|
-
constructor(sources: Array<BinaryLike | Blob>, fileName: string, options?: FileOptions);
|
|
222
|
-
/**
|
|
223
|
-
* The name of the `File`.
|
|
224
|
-
* @since v19.2.0, v18.13.0
|
|
225
|
-
*/
|
|
226
|
-
readonly name: string;
|
|
227
|
-
/**
|
|
228
|
-
* The last modified date of the `File`.
|
|
229
|
-
* @since v19.2.0, v18.13.0
|
|
230
|
-
*/
|
|
231
|
-
readonly lastModified: number;
|
|
232
|
-
}
|
|
233
|
-
export import atob = globalThis.atob;
|
|
234
|
-
export import btoa = globalThis.btoa;
|
|
139
|
+
/** @deprecated This alias will be removed in a future version. Use the canonical `BlobPropertyBag` instead. */
|
|
140
|
+
// TODO: remove in future major
|
|
141
|
+
export interface BlobOptions extends BlobPropertyBag {}
|
|
142
|
+
/** @deprecated This alias will be removed in a future version. Use the canonical `FilePropertyBag` instead. */
|
|
143
|
+
export interface FileOptions extends FilePropertyBag {}
|
|
235
144
|
export type WithImplicitCoercion<T> =
|
|
236
145
|
| T
|
|
237
146
|
| { valueOf(): T }
|
|
@@ -331,7 +240,7 @@ declare module "node:buffer" {
|
|
|
331
240
|
* @return The number of bytes contained within `string`.
|
|
332
241
|
*/
|
|
333
242
|
byteLength(
|
|
334
|
-
string: string |
|
|
243
|
+
string: string | NodeJS.ArrayBufferView | ArrayBufferLike,
|
|
335
244
|
encoding?: BufferEncoding,
|
|
336
245
|
): number;
|
|
337
246
|
/**
|
|
@@ -1876,53 +1785,39 @@ declare module "node:buffer" {
|
|
|
1876
1785
|
includes(value: string | number | Buffer, encoding: BufferEncoding): boolean;
|
|
1877
1786
|
}
|
|
1878
1787
|
var Buffer: BufferConstructor;
|
|
1879
|
-
/**
|
|
1880
|
-
* Decodes a string of Base64-encoded data into bytes, and encodes those bytes
|
|
1881
|
-
* into a string using Latin-1 (ISO-8859-1).
|
|
1882
|
-
*
|
|
1883
|
-
* The `data` may be any JavaScript-value that can be coerced into a string.
|
|
1884
|
-
*
|
|
1885
|
-
* **This function is only provided for compatibility with legacy web platform APIs**
|
|
1886
|
-
* **and should never be used in new code, because they use strings to represent**
|
|
1887
|
-
* **binary data and predate the introduction of typed arrays in JavaScript.**
|
|
1888
|
-
* **For code running using Node.js APIs, converting between base64-encoded strings**
|
|
1889
|
-
* **and binary data should be performed using `Buffer.from(str, 'base64')` and `buf.toString('base64')`.**
|
|
1890
|
-
* @since v15.13.0, v14.17.0
|
|
1891
|
-
* @legacy Use `Buffer.from(data, 'base64')` instead.
|
|
1892
|
-
* @param data The Base64-encoded input string.
|
|
1893
|
-
*/
|
|
1894
|
-
function atob(data: string): string;
|
|
1895
|
-
/**
|
|
1896
|
-
* Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes
|
|
1897
|
-
* into a string using Base64.
|
|
1898
|
-
*
|
|
1899
|
-
* The `data` may be any JavaScript-value that can be coerced into a string.
|
|
1900
|
-
*
|
|
1901
|
-
* **This function is only provided for compatibility with legacy web platform APIs**
|
|
1902
|
-
* **and should never be used in new code, because they use strings to represent**
|
|
1903
|
-
* **binary data and predate the introduction of typed arrays in JavaScript.**
|
|
1904
|
-
* **For code running using Node.js APIs, converting between base64-encoded strings**
|
|
1905
|
-
* **and binary data should be performed using `Buffer.from(str, 'base64')` and `buf.toString('base64')`.**
|
|
1906
|
-
* @since v15.13.0, v14.17.0
|
|
1907
|
-
* @legacy Use `buf.toString('base64')` instead.
|
|
1908
|
-
* @param data An ASCII (Latin1) string.
|
|
1909
|
-
*/
|
|
1910
|
-
function btoa(data: string): string;
|
|
1911
|
-
interface Blob extends _Blob {}
|
|
1912
|
-
/**
|
|
1913
|
-
* `Blob` class is a global reference for `import { Blob } from 'node:buffer'`
|
|
1914
|
-
* https://nodejs.org/api/buffer.html#class-blob
|
|
1915
|
-
* @since v18.0.0
|
|
1916
|
-
*/
|
|
1917
|
-
var Blob: typeof globalThis extends { onmessage: any; Blob: infer T } ? T
|
|
1918
|
-
: typeof import('node:buffer').Blob;
|
|
1919
|
-
interface File extends _File {}
|
|
1920
|
-
/**
|
|
1921
|
-
* `File` class is a global reference for `import { File } from 'node:buffer'`
|
|
1922
|
-
* https://nodejs.org/api/buffer.html#class-file
|
|
1923
|
-
* @since v20.0.0
|
|
1924
|
-
*/
|
|
1925
|
-
var File: typeof globalThis extends { onmessage: any; File: infer T } ? T
|
|
1926
|
-
: typeof import('node:buffer').File;
|
|
1927
1788
|
}
|
|
1789
|
+
// #region web types
|
|
1790
|
+
export type BlobPart = NodeJS.BufferSource | Blob | string;
|
|
1791
|
+
export interface BlobPropertyBag {
|
|
1792
|
+
endings?: "native" | "transparent";
|
|
1793
|
+
type?: string;
|
|
1794
|
+
}
|
|
1795
|
+
export interface FilePropertyBag extends BlobPropertyBag {
|
|
1796
|
+
lastModified?: number;
|
|
1797
|
+
}
|
|
1798
|
+
export interface Blob {
|
|
1799
|
+
readonly size: number;
|
|
1800
|
+
readonly type: string;
|
|
1801
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
1802
|
+
bytes(): Promise<NodeJS.NonSharedUint8Array>;
|
|
1803
|
+
slice(start?: number, end?: number, contentType?: string): Blob;
|
|
1804
|
+
stream(): ReadableStream<NodeJS.NonSharedUint8Array>;
|
|
1805
|
+
text(): Promise<string>;
|
|
1806
|
+
}
|
|
1807
|
+
export var Blob: {
|
|
1808
|
+
prototype: Blob;
|
|
1809
|
+
new(blobParts?: BlobPart[], options?: BlobPropertyBag): Blob;
|
|
1810
|
+
};
|
|
1811
|
+
export interface File extends Blob {
|
|
1812
|
+
readonly lastModified: number;
|
|
1813
|
+
readonly name: string;
|
|
1814
|
+
readonly webkitRelativePath: string;
|
|
1815
|
+
}
|
|
1816
|
+
export var File: {
|
|
1817
|
+
prototype: File;
|
|
1818
|
+
new(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File;
|
|
1819
|
+
};
|
|
1820
|
+
export import atob = globalThis.atob;
|
|
1821
|
+
export import btoa = globalThis.btoa;
|
|
1822
|
+
// #endregion
|
|
1928
1823
|
}
|