@types/node 22.15.9 → 22.15.11

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 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: Mon, 05 May 2025 23:02:37 GMT
11
+ * Last updated: Tue, 06 May 2025 02:14:23 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
node/cluster.d.ts CHANGED
@@ -266,7 +266,7 @@ declare module "cluster" {
266
266
  * @since v0.7.7
267
267
  * @return A reference to `worker`.
268
268
  */
269
- disconnect(): void;
269
+ disconnect(): this;
270
270
  /**
271
271
  * This function returns `true` if the worker is connected to its primary via its
272
272
  * IPC channel, `false` otherwise. A worker is connected to its primary after it
@@ -547,6 +547,25 @@ declare module "diagnostics_channel" {
547
547
  thisArg?: any,
548
548
  ...args: Parameters<Fn>
549
549
  ): void;
550
+ /**
551
+ * `true` if any of the individual channels has a subscriber, `false` if not.
552
+ *
553
+ * This is a helper method available on a {@link TracingChannel} instance to check
554
+ * if any of the [TracingChannel Channels](https://nodejs.org/api/diagnostics_channel.html#tracingchannel-channels) have subscribers.
555
+ * A `true` is returned if any of them have at least one subscriber, a `false` is returned otherwise.
556
+ *
557
+ * ```js
558
+ * const diagnostics_channel = require('node:diagnostics_channel');
559
+ *
560
+ * const channels = diagnostics_channel.tracingChannel('my-channel');
561
+ *
562
+ * if (channels.hasSubscribers) {
563
+ * // Do something
564
+ * }
565
+ * ```
566
+ * @since v22.0.0, v20.13.0
567
+ */
568
+ readonly hasSubscribers: boolean;
550
569
  }
551
570
  }
552
571
  declare module "node:diagnostics_channel" {
node/fs.d.ts CHANGED
@@ -2319,6 +2319,20 @@ declare module "fs" {
2319
2319
  * @since v0.1.96
2320
2320
  */
2321
2321
  export function fsyncSync(fd: number): void;
2322
+ export interface WriteOptions {
2323
+ /**
2324
+ * @default 0
2325
+ */
2326
+ offset?: number | undefined;
2327
+ /**
2328
+ * @default `buffer.byteLength - offset`
2329
+ */
2330
+ length?: number | undefined;
2331
+ /**
2332
+ * @default null
2333
+ */
2334
+ position?: number | undefined | null;
2335
+ }
2322
2336
  /**
2323
2337
  * Write `buffer` to the file specified by `fd`.
2324
2338
  *
@@ -2387,6 +2401,20 @@ declare module "fs" {
2387
2401
  buffer: TBuffer,
2388
2402
  callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void,
2389
2403
  ): void;
2404
+ /**
2405
+ * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
2406
+ * @param fd A file descriptor.
2407
+ * @param options An object with the following properties:
2408
+ * * `offset` The part of the buffer to be written. If not supplied, defaults to `0`.
2409
+ * * `length` The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
2410
+ * * `position` The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
2411
+ */
2412
+ export function write<TBuffer extends NodeJS.ArrayBufferView>(
2413
+ fd: number,
2414
+ buffer: TBuffer,
2415
+ options: WriteOptions,
2416
+ callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void,
2417
+ ): void;
2390
2418
  /**
2391
2419
  * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
2392
2420
  * @param fd A file descriptor.
@@ -2441,6 +2469,22 @@ declare module "fs" {
2441
2469
  bytesWritten: number;
2442
2470
  buffer: TBuffer;
2443
2471
  }>;
2472
+ /**
2473
+ * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
2474
+ * @param fd A file descriptor.
2475
+ * @param options An object with the following properties:
2476
+ * * `offset` The part of the buffer to be written. If not supplied, defaults to `0`.
2477
+ * * `length` The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
2478
+ * * `position` The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
2479
+ */
2480
+ function __promisify__<TBuffer extends NodeJS.ArrayBufferView>(
2481
+ fd: number,
2482
+ buffer?: TBuffer,
2483
+ options?: WriteOptions,
2484
+ ): Promise<{
2485
+ bytesWritten: number;
2486
+ buffer: TBuffer;
2487
+ }>;
2444
2488
  /**
2445
2489
  * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
2446
2490
  * @param fd A file descriptor.
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "22.15.9",
3
+ "version": "22.15.11",
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": "~6.21.0"
221
221
  },
222
222
  "peerDependencies": {},
223
- "typesPublisherContentHash": "6720be548d81d07c3915ff0ebadbd30c285033cb6e37cad29fb87a1a782ae142",
223
+ "typesPublisherContentHash": "c2cae7f9ca3b55c597d98a0929b8bd669f671a0bb7eab698b0bcd3a51bdb020e",
224
224
  "typeScriptVersion": "5.1"
225
225
  }