@types/node 16.3.1 → 16.3.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.
- node/README.md +1 -1
- node/buffer.d.ts +24 -21
- node/package.json +2 -2
node/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (http://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Wed, 14 Jul 2021 00:01:20 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`
|
|
14
14
|
|
node/buffer.d.ts
CHANGED
|
@@ -91,7 +91,7 @@ declare module 'buffer' {
|
|
|
91
91
|
* A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
|
|
92
92
|
* Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
|
|
93
93
|
*/
|
|
94
|
-
|
|
94
|
+
interface BufferConstructor {
|
|
95
95
|
/**
|
|
96
96
|
* Allocates a new buffer containing the given {str}.
|
|
97
97
|
*
|
|
@@ -99,21 +99,21 @@ declare module 'buffer' {
|
|
|
99
99
|
* @param encoding encoding to use, optional. Default is 'utf8'
|
|
100
100
|
* @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead.
|
|
101
101
|
*/
|
|
102
|
-
|
|
102
|
+
new(str: string, encoding?: BufferEncoding): Buffer;
|
|
103
103
|
/**
|
|
104
104
|
* Allocates a new buffer of {size} octets.
|
|
105
105
|
*
|
|
106
106
|
* @param size count of octets to allocate.
|
|
107
107
|
* @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`).
|
|
108
108
|
*/
|
|
109
|
-
|
|
109
|
+
new(size: number): Buffer;
|
|
110
110
|
/**
|
|
111
111
|
* Allocates a new buffer containing the given {array} of octets.
|
|
112
112
|
*
|
|
113
113
|
* @param array The octets to store.
|
|
114
114
|
* @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
|
|
115
115
|
*/
|
|
116
|
-
|
|
116
|
+
new(array: Uint8Array): Buffer;
|
|
117
117
|
/**
|
|
118
118
|
* Produces a Buffer backed by the same allocated memory as
|
|
119
119
|
* the given {ArrayBuffer}/{SharedArrayBuffer}.
|
|
@@ -122,21 +122,21 @@ declare module 'buffer' {
|
|
|
122
122
|
* @param arrayBuffer The ArrayBuffer with which to share memory.
|
|
123
123
|
* @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead.
|
|
124
124
|
*/
|
|
125
|
-
|
|
125
|
+
new(arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer;
|
|
126
126
|
/**
|
|
127
127
|
* Allocates a new buffer containing the given {array} of octets.
|
|
128
128
|
*
|
|
129
129
|
* @param array The octets to store.
|
|
130
130
|
* @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
|
|
131
131
|
*/
|
|
132
|
-
|
|
132
|
+
new(array: ReadonlyArray<any>): Buffer;
|
|
133
133
|
/**
|
|
134
134
|
* Copies the passed {buffer} data onto a new {Buffer} instance.
|
|
135
135
|
*
|
|
136
136
|
* @param buffer The buffer to copy.
|
|
137
137
|
* @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead.
|
|
138
138
|
*/
|
|
139
|
-
|
|
139
|
+
new(buffer: Buffer): Buffer;
|
|
140
140
|
/**
|
|
141
141
|
* When passed a reference to the .buffer property of a TypedArray instance,
|
|
142
142
|
* the newly created Buffer will share the same allocated memory as the TypedArray.
|
|
@@ -145,37 +145,37 @@ declare module 'buffer' {
|
|
|
145
145
|
*
|
|
146
146
|
* @param arrayBuffer The .buffer property of any TypedArray or a new ArrayBuffer()
|
|
147
147
|
*/
|
|
148
|
-
|
|
148
|
+
from(arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>, byteOffset?: number, length?: number): Buffer;
|
|
149
149
|
/**
|
|
150
150
|
* Creates a new Buffer using the passed {data}
|
|
151
151
|
* @param data data to create a new Buffer
|
|
152
152
|
*/
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
from(data: Uint8Array | ReadonlyArray<number>): Buffer;
|
|
154
|
+
from(data: WithImplicitCoercion<Uint8Array | ReadonlyArray<number> | string>): Buffer;
|
|
155
155
|
/**
|
|
156
156
|
* Creates a new Buffer containing the given JavaScript string {str}.
|
|
157
157
|
* If provided, the {encoding} parameter identifies the character encoding.
|
|
158
158
|
* If not provided, {encoding} defaults to 'utf8'.
|
|
159
159
|
*/
|
|
160
|
-
|
|
160
|
+
from(str: WithImplicitCoercion<string> | { [Symbol.toPrimitive](hint: 'string'): string }, encoding?: BufferEncoding): Buffer;
|
|
161
161
|
/**
|
|
162
162
|
* Creates a new Buffer using the passed {data}
|
|
163
163
|
* @param values to create a new Buffer
|
|
164
164
|
*/
|
|
165
|
-
|
|
165
|
+
of(...items: number[]): Buffer;
|
|
166
166
|
/**
|
|
167
167
|
* Returns true if {obj} is a Buffer
|
|
168
168
|
*
|
|
169
169
|
* @param obj object to test.
|
|
170
170
|
*/
|
|
171
|
-
|
|
171
|
+
isBuffer(obj: any): obj is Buffer;
|
|
172
172
|
/**
|
|
173
173
|
* Returns true if {encoding} is a valid encoding argument.
|
|
174
174
|
* Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
|
|
175
175
|
*
|
|
176
176
|
* @param encoding string to test.
|
|
177
177
|
*/
|
|
178
|
-
|
|
178
|
+
isEncoding(encoding: string): encoding is BufferEncoding;
|
|
179
179
|
/**
|
|
180
180
|
* Gives the actual byte length of a string. encoding defaults to 'utf8'.
|
|
181
181
|
* This is not the same as String.prototype.length since that returns the number of characters in a string.
|
|
@@ -183,7 +183,7 @@ declare module 'buffer' {
|
|
|
183
183
|
* @param string string to test.
|
|
184
184
|
* @param encoding encoding used to evaluate (defaults to 'utf8')
|
|
185
185
|
*/
|
|
186
|
-
|
|
186
|
+
byteLength(
|
|
187
187
|
string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
|
|
188
188
|
encoding?: BufferEncoding
|
|
189
189
|
): number;
|
|
@@ -198,11 +198,11 @@ declare module 'buffer' {
|
|
|
198
198
|
* @param totalLength Total length of the buffers when concatenated.
|
|
199
199
|
* If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
|
|
200
200
|
*/
|
|
201
|
-
|
|
201
|
+
concat(list: ReadonlyArray<Uint8Array>, totalLength?: number): Buffer;
|
|
202
202
|
/**
|
|
203
203
|
* The same as buf1.compare(buf2).
|
|
204
204
|
*/
|
|
205
|
-
|
|
205
|
+
compare(buf1: Uint8Array, buf2: Uint8Array): number;
|
|
206
206
|
/**
|
|
207
207
|
* Allocates a new buffer of {size} octets.
|
|
208
208
|
*
|
|
@@ -211,26 +211,28 @@ declare module 'buffer' {
|
|
|
211
211
|
* If parameter is omitted, buffer will be filled with zeros.
|
|
212
212
|
* @param encoding encoding used for call to buf.fill while initalizing
|
|
213
213
|
*/
|
|
214
|
-
|
|
214
|
+
alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer;
|
|
215
215
|
/**
|
|
216
216
|
* Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
|
|
217
217
|
* of the newly created Buffer are unknown and may contain sensitive data.
|
|
218
218
|
*
|
|
219
219
|
* @param size count of octets to allocate
|
|
220
220
|
*/
|
|
221
|
-
|
|
221
|
+
allocUnsafe(size: number): Buffer;
|
|
222
222
|
/**
|
|
223
223
|
* Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
|
|
224
224
|
* of the newly created Buffer are unknown and may contain sensitive data.
|
|
225
225
|
*
|
|
226
226
|
* @param size count of octets to allocate
|
|
227
227
|
*/
|
|
228
|
-
|
|
228
|
+
allocUnsafeSlow(size: number): Buffer;
|
|
229
229
|
/**
|
|
230
230
|
* This is the number of bytes used to determine the size of pre-allocated, internal Buffer instances used for pooling. This value may be modified.
|
|
231
231
|
*/
|
|
232
|
-
|
|
232
|
+
poolSize: number;
|
|
233
|
+
}
|
|
233
234
|
|
|
235
|
+
interface Buffer extends Uint8Array {
|
|
234
236
|
write(string: string, encoding?: BufferEncoding): number;
|
|
235
237
|
write(string: string, offset: number, encoding?: BufferEncoding): number;
|
|
236
238
|
write(string: string, offset: number, length: number, encoding?: BufferEncoding): number;
|
|
@@ -321,6 +323,7 @@ declare module 'buffer' {
|
|
|
321
323
|
keys(): IterableIterator<number>;
|
|
322
324
|
values(): IterableIterator<number>;
|
|
323
325
|
}
|
|
326
|
+
var Buffer: BufferConstructor;
|
|
324
327
|
|
|
325
328
|
/**
|
|
326
329
|
* Decodes a string of Base64-encoded data into bytes, and encodes those bytes into a string using Latin-1 (ISO-8859-1).
|
node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "16.3.
|
|
3
|
+
"version": "16.3.2",
|
|
4
4
|
"description": "TypeScript definitions for Node.js",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -227,6 +227,6 @@
|
|
|
227
227
|
},
|
|
228
228
|
"scripts": {},
|
|
229
229
|
"dependencies": {},
|
|
230
|
-
"typesPublisherContentHash": "
|
|
230
|
+
"typesPublisherContentHash": "6d3b2fbef9e172f85e1d70e1c9b6dcd93b75d01f67a8c467634c8e99d55fdf74",
|
|
231
231
|
"typeScriptVersion": "3.6"
|
|
232
232
|
}
|