1 | declare module 'buffer' {
|
2 | import { BinaryLike } from 'crypto';
|
3 |
|
4 | export const INSPECT_MAX_BYTES: number;
|
5 | export const kMaxLength: number;
|
6 | export const kStringMaxLength: number;
|
7 | export const constants: {
|
8 | MAX_LENGTH: number;
|
9 | MAX_STRING_LENGTH: number;
|
10 | };
|
11 | const BuffType: typeof Buffer;
|
12 |
|
13 | export type TranscodeEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "latin1" | "binary";
|
14 |
|
15 | export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
|
16 |
|
17 | export const SlowBuffer: {
|
18 |
|
19 | new(size: number): Buffer;
|
20 | prototype: Buffer;
|
21 | };
|
22 |
|
23 | export { BuffType as Buffer };
|
24 |
|
25 | |
26 |
|
27 |
|
28 | export interface BlobOptions {
|
29 | |
30 |
|
31 |
|
32 | encoding?: BufferEncoding;
|
33 |
|
34 | |
35 |
|
36 |
|
37 |
|
38 |
|
39 | type?: string;
|
40 | }
|
41 |
|
42 | |
43 |
|
44 |
|
45 | export class Blob {
|
46 | |
47 |
|
48 |
|
49 | readonly size: number;
|
50 |
|
51 | |
52 |
|
53 |
|
54 | readonly type: string;
|
55 |
|
56 | |
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 | constructor(sources: Array<(BinaryLike | Blob)>, options?: BlobOptions);
|
65 |
|
66 | arrayBuffer(): Promise<ArrayBuffer>;
|
67 |
|
68 | /**
|
69 | * @param start The starting index.
|
70 | * @param end The ending index.
|
71 | * @param type The content-type for the new `Blob`
|
72 | */
|
73 | slice(start?: number, end?: number, type?: string): Blob;
|
74 |
|
75 | /**
|
76 | * Returns a promise that resolves the contents of the `Blob` decoded as a UTF-8 string.
|
77 | */
|
78 | text(): Promise<string>;
|
79 | }
|
80 | }
|
81 |
|
82 | declare module 'node:buffer' {
|
83 | export * from 'buffer';
|
84 | }
|