@types/node 20.16.7 → 20.16.8
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 v20.16/README.md +1 -1
- node v20.16/buffer.d.ts +12 -5
- node v20.16/package.json +2 -2
node v20.16/README.md
CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v20.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated: Wed, 25 Sep 2024
|
11
|
+
* Last updated: Wed, 25 Sep 2024 17:36:54 GMT
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
13
13
|
|
14
14
|
# Credits
|
node v20.16/buffer.d.ts
CHANGED
@@ -262,6 +262,13 @@ declare module "buffer" {
|
|
262
262
|
| {
|
263
263
|
valueOf(): T;
|
264
264
|
};
|
265
|
+
// `WithArrayBufferLike` is a backwards-compatible workaround for the addition of a `TArrayBuffer` type parameter to
|
266
|
+
// `Uint8Array` to ensure that `Buffer` remains assignment-compatible with `Uint8Array`, but without the added
|
267
|
+
// complexity involved with making `Buffer` itself generic as that would require re-introducing `"typesVersions"` to
|
268
|
+
// the NodeJS types. It is likely this interface will become deprecated in the future once `Buffer` does become generic.
|
269
|
+
interface WithArrayBufferLike<TArrayBuffer extends ArrayBufferLike> {
|
270
|
+
readonly buffer: TArrayBuffer;
|
271
|
+
}
|
265
272
|
/**
|
266
273
|
* Raw data is stored in instances of the Buffer class.
|
267
274
|
* 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.
|
@@ -913,7 +920,7 @@ declare module "buffer" {
|
|
913
920
|
* @param [start=0] Where the new `Buffer` will start.
|
914
921
|
* @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
|
915
922
|
*/
|
916
|
-
slice(start?: number, end?: number): Buffer
|
923
|
+
slice(start?: number, end?: number): Buffer & WithArrayBufferLike<this["buffer"]>;
|
917
924
|
/**
|
918
925
|
* Returns a new `Buffer` that references the same memory as the original, but
|
919
926
|
* offset and cropped by the `start` and `end` indices.
|
@@ -973,7 +980,7 @@ declare module "buffer" {
|
|
973
980
|
* @param [start=0] Where the new `Buffer` will start.
|
974
981
|
* @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
|
975
982
|
*/
|
976
|
-
subarray(start?: number, end?: number): Buffer
|
983
|
+
subarray(start?: number, end?: number): Buffer & WithArrayBufferLike<this["buffer"]>;
|
977
984
|
/**
|
978
985
|
* Writes `value` to `buf` at the specified `offset` as big-endian.
|
979
986
|
*
|
@@ -1631,7 +1638,7 @@ declare module "buffer" {
|
|
1631
1638
|
* @since v5.10.0
|
1632
1639
|
* @return A reference to `buf`.
|
1633
1640
|
*/
|
1634
|
-
swap16():
|
1641
|
+
swap16(): this;
|
1635
1642
|
/**
|
1636
1643
|
* Interprets `buf` as an array of unsigned 32-bit integers and swaps the
|
1637
1644
|
* byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4.
|
@@ -1657,7 +1664,7 @@ declare module "buffer" {
|
|
1657
1664
|
* @since v5.10.0
|
1658
1665
|
* @return A reference to `buf`.
|
1659
1666
|
*/
|
1660
|
-
swap32():
|
1667
|
+
swap32(): this;
|
1661
1668
|
/**
|
1662
1669
|
* Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_.
|
1663
1670
|
* Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8.
|
@@ -1683,7 +1690,7 @@ declare module "buffer" {
|
|
1683
1690
|
* @since v6.3.0
|
1684
1691
|
* @return A reference to `buf`.
|
1685
1692
|
*/
|
1686
|
-
swap64():
|
1693
|
+
swap64(): this;
|
1687
1694
|
/**
|
1688
1695
|
* Writes `value` to `buf` at the specified `offset`. `value` must be a
|
1689
1696
|
* valid unsigned 8-bit integer. Behavior is undefined when `value` is anything
|
node v20.16/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/node",
|
3
|
-
"version": "20.16.
|
3
|
+
"version": "20.16.8",
|
4
4
|
"description": "TypeScript definitions for node",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
6
6
|
"license": "MIT",
|
@@ -212,6 +212,6 @@
|
|
212
212
|
"dependencies": {
|
213
213
|
"undici-types": "~6.19.2"
|
214
214
|
},
|
215
|
-
"typesPublisherContentHash": "
|
215
|
+
"typesPublisherContentHash": "fadd0ba4a68bcdb592deff9b69f3319537c5647439cbbf1b6144f5881f92f523",
|
216
216
|
"typeScriptVersion": "4.8"
|
217
217
|
}
|