@types/node 20.17.38 → 20.17.40

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: 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
@@ -265,7 +265,7 @@ declare module "cluster" {
265
265
  * @since v0.7.7
266
266
  * @return A reference to `worker`.
267
267
  */
268
- disconnect(): void;
268
+ disconnect(): this;
269
269
  /**
270
270
  * This function returns `true` if the worker is connected to its primary via its
271
271
  * 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 v20.17/fs.d.ts CHANGED
@@ -2317,6 +2317,20 @@ declare module "fs" {
2317
2317
  * @since v0.1.96
2318
2318
  */
2319
2319
  export function fsyncSync(fd: number): void;
2320
+ export interface WriteOptions {
2321
+ /**
2322
+ * @default 0
2323
+ */
2324
+ offset?: number | undefined;
2325
+ /**
2326
+ * @default `buffer.byteLength - offset`
2327
+ */
2328
+ length?: number | undefined;
2329
+ /**
2330
+ * @default null
2331
+ */
2332
+ position?: number | undefined | null;
2333
+ }
2320
2334
  /**
2321
2335
  * Write `buffer` to the file specified by `fd`.
2322
2336
  *
@@ -2385,6 +2399,20 @@ declare module "fs" {
2385
2399
  buffer: TBuffer,
2386
2400
  callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void,
2387
2401
  ): void;
2402
+ /**
2403
+ * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
2404
+ * @param fd A file descriptor.
2405
+ * @param options An object with the following properties:
2406
+ * * `offset` The part of the buffer to be written. If not supplied, defaults to `0`.
2407
+ * * `length` The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
2408
+ * * `position` The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
2409
+ */
2410
+ export function write<TBuffer extends NodeJS.ArrayBufferView>(
2411
+ fd: number,
2412
+ buffer: TBuffer,
2413
+ options: WriteOptions,
2414
+ callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void,
2415
+ ): void;
2388
2416
  /**
2389
2417
  * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
2390
2418
  * @param fd A file descriptor.
@@ -2439,6 +2467,22 @@ declare module "fs" {
2439
2467
  bytesWritten: number;
2440
2468
  buffer: TBuffer;
2441
2469
  }>;
2470
+ /**
2471
+ * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
2472
+ * @param fd A file descriptor.
2473
+ * @param options An object with the following properties:
2474
+ * * `offset` The part of the buffer to be written. If not supplied, defaults to `0`.
2475
+ * * `length` The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
2476
+ * * `position` The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
2477
+ */
2478
+ function __promisify__<TBuffer extends NodeJS.ArrayBufferView>(
2479
+ fd: number,
2480
+ buffer?: TBuffer,
2481
+ options?: WriteOptions,
2482
+ ): Promise<{
2483
+ bytesWritten: number;
2484
+ buffer: TBuffer;
2485
+ }>;
2442
2486
  /**
2443
2487
  * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
2444
2488
  * @param fd A file descriptor.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "20.17.38",
3
+ "version": "20.17.40",
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": "6f979f756941527fd674ce3513f5ea0236e15ffc9cd36b65ed1be3f1aabfdcfa",
218
+ "typesPublisherContentHash": "c446d225ba395160537169319ad5d5dc21e62fe91a3075ffbe9971c6c4a7e325",
219
219
  "typeScriptVersion": "5.1"
220
220
  }