@types/node 18.19.79 → 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: Mon, 03 Mar 2025 18:02:26 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/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.79",
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": "4413da7f29f5e0b4c3cacc7710d6e31782ca3471ece6f3716fb0904e092fb4d3",
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.