@types/node 22.15.9 → 22.15.10

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.
Files changed (3) hide show
  1. node/README.md +1 -1
  2. node/fs.d.ts +44 -0
  3. node/package.json +2 -2
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 01:29:57 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
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.10",
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": "bdc90bd0942261f84b89054e1e7e68c9bd68fe861b3efcf23413188a4d918b51",
224
224
  "typeScriptVersion": "5.1"
225
225
  }