@types/node 20.17.22 → 20.17.24

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.17/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: Sat, 01 Mar 2025 06:37:25 GMT
11
+ * Last updated: Sat, 08 Mar 2025 07:02:57 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
@@ -1,16 +1,18 @@
1
- /** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */
1
+ /**
2
+ * @deprecated The `node:constants` module is deprecated. When requiring access to constants
3
+ * relevant to specific Node.js builtin modules, developers should instead refer
4
+ * to the `constants` property exposed by the relevant module. For instance,
5
+ * `require('node:fs').constants` and `require('node:os').constants`.
6
+ */
2
7
  declare module "constants" {
3
- import { constants as osConstants, SignalConstants } from "node:os";
4
- import { constants as cryptoConstants } from "node:crypto";
5
- import { constants as fsConstants } from "node:fs";
6
-
7
- const exp:
8
- & typeof osConstants.errno
9
- & typeof osConstants.priority
10
- & SignalConstants
11
- & typeof cryptoConstants
12
- & typeof fsConstants;
13
- export = exp;
8
+ const constants:
9
+ & typeof import("node:os").constants.dlopen
10
+ & typeof import("node:os").constants.errno
11
+ & typeof import("node:os").constants.priority
12
+ & typeof import("node:os").constants.signals
13
+ & typeof import("node:fs").constants
14
+ & typeof import("node:crypto").constants;
15
+ export = constants;
14
16
  }
15
17
 
16
18
  declare module "node:constants" {
node v20.17/crypto.d.ts CHANGED
@@ -669,9 +669,10 @@ declare module "crypto" {
669
669
  */
670
670
  type: KeyObjectType;
671
671
  }
672
- type CipherCCMTypes = "aes-128-ccm" | "aes-192-ccm" | "aes-256-ccm" | "chacha20-poly1305";
672
+ type CipherCCMTypes = "aes-128-ccm" | "aes-192-ccm" | "aes-256-ccm";
673
673
  type CipherGCMTypes = "aes-128-gcm" | "aes-192-gcm" | "aes-256-gcm";
674
674
  type CipherOCBTypes = "aes-128-ocb" | "aes-192-ocb" | "aes-256-ocb";
675
+ type CipherChaCha20Poly1305Types = "chacha20-poly1305";
675
676
  type BinaryLike = string | NodeJS.ArrayBufferView;
676
677
  type CipherKey = BinaryLike | KeyObject;
677
678
  interface CipherCCMOptions extends stream.TransformOptions {
@@ -683,6 +684,10 @@ declare module "crypto" {
683
684
  interface CipherOCBOptions extends stream.TransformOptions {
684
685
  authTagLength: number;
685
686
  }
687
+ interface CipherChaCha20Poly1305Options extends stream.TransformOptions {
688
+ /** @default 16 */
689
+ authTagLength?: number | undefined;
690
+ }
686
691
  /**
687
692
  * Creates and returns a `Cipher` object that uses the given `algorithm` and `password`.
688
693
  *
@@ -724,6 +729,14 @@ declare module "crypto" {
724
729
  /** @deprecated since v10.0.0 use `createCipheriv()` */
725
730
  function createCipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): CipherGCM;
726
731
  /** @deprecated since v10.0.0 use `createCipheriv()` */
732
+ function createCipher(algorithm: CipherOCBTypes, password: BinaryLike, options: CipherOCBOptions): CipherOCB;
733
+ /** @deprecated since v10.0.0 use `createCipheriv()` */
734
+ function createCipher(
735
+ algorithm: CipherChaCha20Poly1305Types,
736
+ password: BinaryLike,
737
+ options?: CipherChaCha20Poly1305Options,
738
+ ): CipherChaCha20Poly1305;
739
+ /** @deprecated since v10.0.0 use `createCipheriv()` */
727
740
  function createCipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Cipher;
728
741
  /**
729
742
  * Creates and returns a `Cipher` object, with the given `algorithm`, `key` and
@@ -773,6 +786,12 @@ declare module "crypto" {
773
786
  iv: BinaryLike,
774
787
  options?: CipherGCMOptions,
775
788
  ): CipherGCM;
789
+ function createCipheriv(
790
+ algorithm: CipherChaCha20Poly1305Types,
791
+ key: CipherKey,
792
+ iv: BinaryLike,
793
+ options?: CipherChaCha20Poly1305Options,
794
+ ): CipherChaCha20Poly1305;
776
795
  function createCipheriv(
777
796
  algorithm: string,
778
797
  key: CipherKey,
@@ -972,6 +991,15 @@ declare module "crypto" {
972
991
  ): this;
973
992
  getAuthTag(): Buffer;
974
993
  }
994
+ interface CipherChaCha20Poly1305 extends Cipher {
995
+ setAAD(
996
+ buffer: NodeJS.ArrayBufferView,
997
+ options: {
998
+ plaintextLength: number;
999
+ },
1000
+ ): this;
1001
+ getAuthTag(): Buffer;
1002
+ }
975
1003
  /**
976
1004
  * Creates and returns a `Decipher` object that uses the given `algorithm` and `password` (key).
977
1005
  *
@@ -1002,6 +1030,14 @@ declare module "crypto" {
1002
1030
  /** @deprecated since v10.0.0 use `createDecipheriv()` */
1003
1031
  function createDecipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): DecipherGCM;
1004
1032
  /** @deprecated since v10.0.0 use `createDecipheriv()` */
1033
+ function createDecipher(algorithm: CipherOCBTypes, password: BinaryLike, options: CipherOCBOptions): DecipherOCB;
1034
+ /** @deprecated since v10.0.0 use `createDecipheriv()` */
1035
+ function createDecipher(
1036
+ algorithm: CipherChaCha20Poly1305Types,
1037
+ password: BinaryLike,
1038
+ options?: CipherChaCha20Poly1305Options,
1039
+ ): DecipherChaCha20Poly1305;
1040
+ /** @deprecated since v10.0.0 use `createDecipheriv()` */
1005
1041
  function createDecipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Decipher;
1006
1042
  /**
1007
1043
  * Creates and returns a `Decipher` object that uses the given `algorithm`, `key` and initialization vector (`iv`).
@@ -1050,6 +1086,12 @@ declare module "crypto" {
1050
1086
  iv: BinaryLike,
1051
1087
  options?: CipherGCMOptions,
1052
1088
  ): DecipherGCM;
1089
+ function createDecipheriv(
1090
+ algorithm: CipherChaCha20Poly1305Types,
1091
+ key: CipherKey,
1092
+ iv: BinaryLike,
1093
+ options?: CipherChaCha20Poly1305Options,
1094
+ ): DecipherChaCha20Poly1305;
1053
1095
  function createDecipheriv(
1054
1096
  algorithm: string,
1055
1097
  key: CipherKey,
@@ -1235,6 +1277,15 @@ declare module "crypto" {
1235
1277
  },
1236
1278
  ): this;
1237
1279
  }
1280
+ interface DecipherChaCha20Poly1305 extends Decipher {
1281
+ setAuthTag(buffer: NodeJS.ArrayBufferView): this;
1282
+ setAAD(
1283
+ buffer: NodeJS.ArrayBufferView,
1284
+ options: {
1285
+ plaintextLength: number;
1286
+ },
1287
+ ): this;
1288
+ }
1238
1289
  interface PrivateKeyInput {
1239
1290
  key: string | Buffer;
1240
1291
  format?: KeyFormat | undefined;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "20.17.22",
3
+ "version": "20.17.24",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -215,6 +215,6 @@
215
215
  "undici-types": "~6.19.2"
216
216
  },
217
217
  "peerDependencies": {},
218
- "typesPublisherContentHash": "0512e4162067df9d306d7bd666fcfccf5ddac25b3d097560266b1310f7825880",
218
+ "typesPublisherContentHash": "4e1dfd219cb4f1d8fcf2b3d9768fdb7f93877cc7f561d7b11dbf66cac9b37c5d",
219
219
  "typeScriptVersion": "5.0"
220
220
  }