@types/node 22.7.0 → 22.7.1
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 +12 -5
- node/package.json +2 -2
node/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.
|
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/buffer.d.ts
CHANGED
@@ -261,6 +261,13 @@ declare module "buffer" {
|
|
261
261
|
| {
|
262
262
|
valueOf(): T;
|
263
263
|
};
|
264
|
+
// `WithArrayBufferLike` is a backwards-compatible workaround for the addition of a `TArrayBuffer` type parameter to
|
265
|
+
// `Uint8Array` to ensure that `Buffer` remains assignment-compatible with `Uint8Array`, but without the added
|
266
|
+
// complexity involved with making `Buffer` itself generic as that would require re-introducing `"typesVersions"` to
|
267
|
+
// the NodeJS types. It is likely this interface will become deprecated in the future once `Buffer` does become generic.
|
268
|
+
interface WithArrayBufferLike<TArrayBuffer extends ArrayBufferLike> {
|
269
|
+
readonly buffer: TArrayBuffer;
|
270
|
+
}
|
264
271
|
/**
|
265
272
|
* Raw data is stored in instances of the Buffer class.
|
266
273
|
* 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.
|
@@ -912,7 +919,7 @@ declare module "buffer" {
|
|
912
919
|
* @param [start=0] Where the new `Buffer` will start.
|
913
920
|
* @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
|
914
921
|
*/
|
915
|
-
slice(start?: number, end?: number): Buffer
|
922
|
+
slice(start?: number, end?: number): Buffer & WithArrayBufferLike<ArrayBuffer>;
|
916
923
|
/**
|
917
924
|
* Returns a new `Buffer` that references the same memory as the original, but
|
918
925
|
* offset and cropped by the `start` and `end` indices.
|
@@ -972,7 +979,7 @@ declare module "buffer" {
|
|
972
979
|
* @param [start=0] Where the new `Buffer` will start.
|
973
980
|
* @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
|
974
981
|
*/
|
975
|
-
subarray(start?: number, end?: number): Buffer
|
982
|
+
subarray(start?: number, end?: number): Buffer & WithArrayBufferLike<this["buffer"]>;
|
976
983
|
/**
|
977
984
|
* Writes `value` to `buf` at the specified `offset` as big-endian.
|
978
985
|
*
|
@@ -1630,7 +1637,7 @@ declare module "buffer" {
|
|
1630
1637
|
* @since v5.10.0
|
1631
1638
|
* @return A reference to `buf`.
|
1632
1639
|
*/
|
1633
|
-
swap16():
|
1640
|
+
swap16(): this;
|
1634
1641
|
/**
|
1635
1642
|
* Interprets `buf` as an array of unsigned 32-bit integers and swaps the
|
1636
1643
|
* byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4.
|
@@ -1656,7 +1663,7 @@ declare module "buffer" {
|
|
1656
1663
|
* @since v5.10.0
|
1657
1664
|
* @return A reference to `buf`.
|
1658
1665
|
*/
|
1659
|
-
swap32():
|
1666
|
+
swap32(): this;
|
1660
1667
|
/**
|
1661
1668
|
* Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_.
|
1662
1669
|
* Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8.
|
@@ -1682,7 +1689,7 @@ declare module "buffer" {
|
|
1682
1689
|
* @since v6.3.0
|
1683
1690
|
* @return A reference to `buf`.
|
1684
1691
|
*/
|
1685
|
-
swap64():
|
1692
|
+
swap64(): this;
|
1686
1693
|
/**
|
1687
1694
|
* Writes `value` to `buf` at the specified `offset`. `value` must be a
|
1688
1695
|
* valid unsigned 8-bit integer. Behavior is undefined when `value` is anything
|
node/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/node",
|
3
|
-
"version": "22.7.
|
3
|
+
"version": "22.7.1",
|
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": "6eac2c2113a7d5f58f871a8766de0fec4c086f9b704d46c70434588cb5f8b35d",
|
216
216
|
"typeScriptVersion": "4.8"
|
217
217
|
}
|