@types/node 18.19.78 → 18.19.80

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 v18.19/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/v18.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Fri, 28 Feb 2025 22:02:14 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 v18.19/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
  *
@@ -720,6 +725,14 @@ declare module "crypto" {
720
725
  /** @deprecated since v10.0.0 use `createCipheriv()` */
721
726
  function createCipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): CipherGCM;
722
727
  /** @deprecated since v10.0.0 use `createCipheriv()` */
728
+ function createCipher(algorithm: CipherOCBTypes, password: BinaryLike, options: CipherOCBOptions): CipherOCB;
729
+ /** @deprecated since v10.0.0 use `createCipheriv()` */
730
+ function createCipher(
731
+ algorithm: CipherChaCha20Poly1305Types,
732
+ password: BinaryLike,
733
+ options?: CipherChaCha20Poly1305Options,
734
+ ): CipherChaCha20Poly1305;
735
+ /** @deprecated since v10.0.0 use `createCipheriv()` */
723
736
  function createCipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Cipher;
724
737
  /**
725
738
  * Creates and returns a `Cipher` object, with the given `algorithm`, `key` and
@@ -769,6 +782,12 @@ declare module "crypto" {
769
782
  iv: BinaryLike,
770
783
  options?: CipherGCMOptions,
771
784
  ): CipherGCM;
785
+ function createCipheriv(
786
+ algorithm: CipherChaCha20Poly1305Types,
787
+ key: CipherKey,
788
+ iv: BinaryLike,
789
+ options?: CipherChaCha20Poly1305Options,
790
+ ): CipherChaCha20Poly1305;
772
791
  function createCipheriv(
773
792
  algorithm: string,
774
793
  key: CipherKey,
@@ -968,6 +987,15 @@ declare module "crypto" {
968
987
  ): this;
969
988
  getAuthTag(): Buffer;
970
989
  }
990
+ interface CipherChaCha20Poly1305 extends Cipher {
991
+ setAAD(
992
+ buffer: NodeJS.ArrayBufferView,
993
+ options: {
994
+ plaintextLength: number;
995
+ },
996
+ ): this;
997
+ getAuthTag(): Buffer;
998
+ }
971
999
  /**
972
1000
  * Creates and returns a `Decipher` object that uses the given `algorithm` and `password` (key).
973
1001
  *
@@ -994,6 +1022,14 @@ declare module "crypto" {
994
1022
  /** @deprecated since v10.0.0 use `createDecipheriv()` */
995
1023
  function createDecipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): DecipherGCM;
996
1024
  /** @deprecated since v10.0.0 use `createDecipheriv()` */
1025
+ function createDecipher(algorithm: CipherOCBTypes, password: BinaryLike, options: CipherOCBOptions): DecipherOCB;
1026
+ /** @deprecated since v10.0.0 use `createDecipheriv()` */
1027
+ function createDecipher(
1028
+ algorithm: CipherChaCha20Poly1305Types,
1029
+ password: BinaryLike,
1030
+ options?: CipherChaCha20Poly1305Options,
1031
+ ): DecipherChaCha20Poly1305;
1032
+ /** @deprecated since v10.0.0 use `createDecipheriv()` */
997
1033
  function createDecipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Decipher;
998
1034
  /**
999
1035
  * Creates and returns a `Decipher` object that uses the given `algorithm`, `key` and initialization vector (`iv`).
@@ -1042,6 +1078,12 @@ declare module "crypto" {
1042
1078
  iv: BinaryLike,
1043
1079
  options?: CipherGCMOptions,
1044
1080
  ): DecipherGCM;
1081
+ function createDecipheriv(
1082
+ algorithm: CipherChaCha20Poly1305Types,
1083
+ key: CipherKey,
1084
+ iv: BinaryLike,
1085
+ options?: CipherChaCha20Poly1305Options,
1086
+ ): DecipherChaCha20Poly1305;
1045
1087
  function createDecipheriv(
1046
1088
  algorithm: string,
1047
1089
  key: CipherKey,
@@ -1226,6 +1268,15 @@ declare module "crypto" {
1226
1268
  },
1227
1269
  ): this;
1228
1270
  }
1271
+ interface DecipherChaCha20Poly1305 extends Decipher {
1272
+ setAuthTag(buffer: NodeJS.ArrayBufferView): this;
1273
+ setAAD(
1274
+ buffer: NodeJS.ArrayBufferView,
1275
+ options: {
1276
+ plaintextLength: number;
1277
+ },
1278
+ ): this;
1279
+ }
1229
1280
  interface PrivateKeyInput {
1230
1281
  key: string | Buffer;
1231
1282
  format?: KeyFormat | undefined;
node v18.19/os.d.ts CHANGED
@@ -382,6 +382,13 @@ declare module "os" {
382
382
  const WSA_E_CANCELLED: number;
383
383
  const WSAEREFUSED: number;
384
384
  }
385
+ namespace dlopen {
386
+ const RTLD_LAZY: number;
387
+ const RTLD_NOW: number;
388
+ const RTLD_GLOBAL: number;
389
+ const RTLD_LOCAL: number;
390
+ const RTLD_DEEPBIND: number;
391
+ }
385
392
  namespace priority {
386
393
  const PRIORITY_LOW: number;
387
394
  const PRIORITY_BELOW_NORMAL: number;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "18.19.78",
3
+ "version": "18.19.80",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -220,6 +220,6 @@
220
220
  "undici-types": "~5.26.4"
221
221
  },
222
222
  "peerDependencies": {},
223
- "typesPublisherContentHash": "53c96e56ee2759566e81a31cb23f4874fe03fa92030604a19231d864af73dbcf",
223
+ "typesPublisherContentHash": "cf2355d816bdd5dc52f4836db5e1e5423ca9a1770d2c74d03c51ce1dce8f9641",
224
224
  "typeScriptVersion": "5.0"
225
225
  }
@@ -509,6 +509,33 @@ declare module "process" {
509
509
  * @since v0.7.2
510
510
  */
511
511
  debugPort: number;
512
+ /**
513
+ * The `process.dlopen()` method allows dynamically loading shared objects. It is primarily used by `require()` to load C++ Addons, and
514
+ * should not be used directly, except in special cases. In other words, `require()` should be preferred over `process.dlopen()`
515
+ * unless there are specific reasons such as custom dlopen flags or loading from ES modules.
516
+ *
517
+ * The `flags` argument is an integer that allows to specify dlopen behavior. See the `[os.constants.dlopen](https://nodejs.org/docs/latest-v20.x/api/os.html#dlopen-constants)`
518
+ * documentation for details.
519
+ *
520
+ * An important requirement when calling `process.dlopen()` is that the `module` instance must be passed. Functions exported by the C++ Addon
521
+ * are then accessible via `module.exports`.
522
+ *
523
+ * The example below shows how to load a C++ Addon, named `local.node`, that exports a `foo` function. All the symbols are loaded before the call returns, by passing the `RTLD_NOW` constant.
524
+ * In this example the constant is assumed to be available.
525
+ *
526
+ * ```js
527
+ * import { dlopen } from 'node:process';
528
+ * import { constants } from 'node:os';
529
+ * import { fileURLToPath } from 'node:url';
530
+ *
531
+ * const module = { exports: {} };
532
+ * dlopen(module, fileURLToPath(new URL('local.node', import.meta.url)),
533
+ * constants.dlopen.RTLD_NOW);
534
+ * module.exports.foo();
535
+ * ```
536
+ * @since v0.1.16
537
+ */
538
+ dlopen(module: object, filename: string, flags?: number): void;
512
539
  /**
513
540
  * The `process.emitWarning()` method can be used to emit custom or application
514
541
  * specific process warnings. These can be listened for by adding a handler to the `'warning'` event.