@types/node 14.14.11 → 14.14.12
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/globals.d.ts +6 -10
- 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: Thu, 10 Dec 2020 08:40:44 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
|
|
14
14
|
|
node/globals.d.ts
CHANGED
|
@@ -73,6 +73,8 @@ declare var exports: any;
|
|
|
73
73
|
// Buffer class
|
|
74
74
|
type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex";
|
|
75
75
|
|
|
76
|
+
type WithImplicitCoercion<T> = T | { valueOf(): T };
|
|
77
|
+
|
|
76
78
|
/**
|
|
77
79
|
* Raw data is stored in instances of the Buffer class.
|
|
78
80
|
* 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.
|
|
@@ -132,25 +134,19 @@ declare class Buffer extends Uint8Array {
|
|
|
132
134
|
*
|
|
133
135
|
* @param arrayBuffer The .buffer property of any TypedArray or a new ArrayBuffer()
|
|
134
136
|
*/
|
|
135
|
-
static from(arrayBuffer: ArrayBuffer | SharedArrayBuffer
|
|
137
|
+
static from(arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>, byteOffset?: number, length?: number): Buffer;
|
|
136
138
|
/**
|
|
137
139
|
* Creates a new Buffer using the passed {data}
|
|
138
140
|
* @param data data to create a new Buffer
|
|
139
141
|
*/
|
|
140
|
-
static from(data: ReadonlyArray<number>): Buffer;
|
|
141
|
-
static from(data: Uint8Array): Buffer;
|
|
142
|
-
/**
|
|
143
|
-
* Creates a new buffer containing the coerced value of an object
|
|
144
|
-
* A `TypeError` will be thrown if {obj} has not mentioned methods or is not of other type appropriate for `Buffer.from()` variants.
|
|
145
|
-
* @param obj An object supporting `Symbol.toPrimitive` or `valueOf()`.
|
|
146
|
-
*/
|
|
147
|
-
static from(obj: { valueOf(): string | object } | { [Symbol.toPrimitive](hint: 'string'): string }, byteOffset?: number, length?: number): Buffer;
|
|
142
|
+
static from(data: Uint8Array | ReadonlyArray<number>): Buffer;
|
|
143
|
+
static from(data: WithImplicitCoercion<Uint8Array | ReadonlyArray<number> | string>): Buffer;
|
|
148
144
|
/**
|
|
149
145
|
* Creates a new Buffer containing the given JavaScript string {str}.
|
|
150
146
|
* If provided, the {encoding} parameter identifies the character encoding.
|
|
151
147
|
* If not provided, {encoding} defaults to 'utf8'.
|
|
152
148
|
*/
|
|
153
|
-
static from(str: string, encoding?: BufferEncoding): Buffer;
|
|
149
|
+
static from(str: WithImplicitCoercion<string> | { [Symbol.toPrimitive](hint: 'string'): string }, encoding?: BufferEncoding): Buffer;
|
|
154
150
|
/**
|
|
155
151
|
* Creates a new Buffer using the passed {data}
|
|
156
152
|
* @param values to create a new Buffer
|
node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "14.14.
|
|
3
|
+
"version": "14.14.12",
|
|
4
4
|
"description": "TypeScript definitions for Node.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"contributors": [
|
|
@@ -246,6 +246,6 @@
|
|
|
246
246
|
},
|
|
247
247
|
"scripts": {},
|
|
248
248
|
"dependencies": {},
|
|
249
|
-
"typesPublisherContentHash": "
|
|
249
|
+
"typesPublisherContentHash": "2e2a48406ddc98c6044ee8e3edf314e027ba73c4466de68f466bd5fc823c0adf",
|
|
250
250
|
"typeScriptVersion": "3.3"
|
|
251
251
|
}
|