@types/node 17.0.36 → 17.0.39
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 +1 -1
- node/fs/promises.d.ts +25 -1
- node/fs.d.ts +9 -2
- node/package.json +2 -2
- node/timers.d.ts +2 -2
node/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (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:
|
|
11
|
+
* Last updated: Fri, 03 Jun 2022 13:01:31 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
|
|
14
14
|
|
node/fs/promises.d.ts
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
declare module 'fs/promises' {
|
|
12
12
|
import { Abortable } from 'node:events';
|
|
13
13
|
import { Stream } from 'node:stream';
|
|
14
|
+
import { ReadableStream } from 'node:stream/web';
|
|
14
15
|
import {
|
|
15
16
|
Stats,
|
|
16
17
|
BigIntStats,
|
|
@@ -209,6 +210,29 @@ declare module 'fs/promises' {
|
|
|
209
210
|
*/
|
|
210
211
|
read<T extends NodeJS.ArrayBufferView>(buffer: T, offset?: number | null, length?: number | null, position?: number | null): Promise<FileReadResult<T>>;
|
|
211
212
|
read<T extends NodeJS.ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>;
|
|
213
|
+
/**
|
|
214
|
+
* Returns a `ReadableStream` that may be used to read the files data.
|
|
215
|
+
*
|
|
216
|
+
* An error will be thrown if this method is called more than once or is called after the `FileHandle` is closed
|
|
217
|
+
* or closing.
|
|
218
|
+
*
|
|
219
|
+
* ```js
|
|
220
|
+
* import { open } from 'node:fs/promises';
|
|
221
|
+
*
|
|
222
|
+
* const file = await open('./some/file/to/read');
|
|
223
|
+
*
|
|
224
|
+
* for await (const chunk of file.readableWebStream())
|
|
225
|
+
* console.log(chunk);
|
|
226
|
+
*
|
|
227
|
+
* await file.close();
|
|
228
|
+
* ```
|
|
229
|
+
*
|
|
230
|
+
* While the `ReadableStream` will read the file to completion, it will not close the `FileHandle` automatically. User code must still call the `fileHandle.close()` method.
|
|
231
|
+
*
|
|
232
|
+
* @since v17.0.0
|
|
233
|
+
* @experimental
|
|
234
|
+
*/
|
|
235
|
+
readableWebStream(): ReadableStream;
|
|
212
236
|
/**
|
|
213
237
|
* Asynchronously reads the entire contents of a file.
|
|
214
238
|
*
|
|
@@ -487,7 +511,7 @@ declare module 'fs/promises' {
|
|
|
487
511
|
* @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created.
|
|
488
512
|
* @return Fulfills with a {FileHandle} object.
|
|
489
513
|
*/
|
|
490
|
-
function open(path: PathLike, flags
|
|
514
|
+
function open(path: PathLike, flags?: string | number, mode?: Mode): Promise<FileHandle>;
|
|
491
515
|
/**
|
|
492
516
|
* Renames `oldPath` to `newPath`.
|
|
493
517
|
* @since v10.0.0
|
node/fs.d.ts
CHANGED
|
@@ -1998,12 +1998,19 @@ declare module 'fs' {
|
|
|
1998
1998
|
* @param [flags='r'] See `support of file system `flags``.
|
|
1999
1999
|
* @param [mode=0o666]
|
|
2000
2000
|
*/
|
|
2001
|
-
export function open(path: PathLike, flags: OpenMode, mode: Mode | undefined | null, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
|
|
2001
|
+
export function open(path: PathLike, flags: OpenMode | undefined, mode: Mode | undefined | null, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
|
|
2002
|
+
/**
|
|
2003
|
+
* Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`.
|
|
2004
|
+
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2005
|
+
* @param [flags='r'] See `support of file system `flags``.
|
|
2006
|
+
*/
|
|
2007
|
+
export function open(path: PathLike, flags: OpenMode | undefined, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
|
|
2002
2008
|
/**
|
|
2003
2009
|
* Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`.
|
|
2004
2010
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2005
2011
|
*/
|
|
2006
|
-
export function open(path: PathLike,
|
|
2012
|
+
export function open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
|
|
2013
|
+
|
|
2007
2014
|
export namespace open {
|
|
2008
2015
|
/**
|
|
2009
2016
|
* Asynchronous open(2) - open and possibly create a file.
|
node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "17.0.
|
|
3
|
+
"version": "17.0.39",
|
|
4
4
|
"description": "TypeScript definitions for Node.js",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -220,6 +220,6 @@
|
|
|
220
220
|
},
|
|
221
221
|
"scripts": {},
|
|
222
222
|
"dependencies": {},
|
|
223
|
-
"typesPublisherContentHash": "
|
|
223
|
+
"typesPublisherContentHash": "00f1dfb6e5a94cedae70d7698ad5bc42913c4de9bbe4415de9fe047fcdb25971",
|
|
224
224
|
"typeScriptVersion": "3.9"
|
|
225
225
|
}
|
node/timers.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ declare module 'timers' {
|
|
|
69
69
|
namespace setTimeout {
|
|
70
70
|
const __promisify__: typeof setTimeoutPromise;
|
|
71
71
|
}
|
|
72
|
-
function clearTimeout(timeoutId: NodeJS.Timeout | undefined): void;
|
|
72
|
+
function clearTimeout(timeoutId: NodeJS.Timeout | string | number | undefined): void;
|
|
73
73
|
function setInterval<TArgs extends any[]>(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timer;
|
|
74
74
|
// util.promisify no rest args compability
|
|
75
75
|
// tslint:disable-next-line void-return
|
|
@@ -77,7 +77,7 @@ declare module 'timers' {
|
|
|
77
77
|
namespace setInterval {
|
|
78
78
|
const __promisify__: typeof setIntervalPromise;
|
|
79
79
|
}
|
|
80
|
-
function clearInterval(intervalId: NodeJS.Timeout | undefined): void;
|
|
80
|
+
function clearInterval(intervalId: NodeJS.Timeout | string | number | undefined): void;
|
|
81
81
|
function setImmediate<TArgs extends any[]>(callback: (...args: TArgs) => void, ...args: TArgs): NodeJS.Immediate;
|
|
82
82
|
// util.promisify no rest args compability
|
|
83
83
|
// tslint:disable-next-line void-return
|