@types/node 17.0.38 → 17.0.41

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.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: Tue, 31 May 2022 20:31:33 GMT
11
+ * Last updated: Tue, 07 Jun 2022 19:01:35 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
  *
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "17.0.38",
3
+ "version": "17.0.41",
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": "e6da8ea46b47fb950c446ddfac1a5c4914096b3d7b6d11464340c48287032b98",
223
+ "typesPublisherContentHash": "9e1502e0553fb32bd0595c18b2baac4ef97c4aa2fae1006ead4e396591c10d6e",
224
224
  "typeScriptVersion": "3.9"
225
225
  }
node/process.d.ts CHANGED
@@ -642,7 +642,7 @@ declare module 'process' {
642
642
  * Android).
643
643
  * @since v0.1.31
644
644
  */
645
- getgid(): number;
645
+ getgid?: () => number;
646
646
  /**
647
647
  * The `process.setgid()` method sets the group identity of the process. (See [`setgid(2)`](http://man7.org/linux/man-pages/man2/setgid.2.html).) The `id` can be passed as either a
648
648
  * numeric ID or a group name
@@ -669,7 +669,7 @@ declare module 'process' {
669
669
  * @since v0.1.31
670
670
  * @param id The group name or ID
671
671
  */
672
- setgid(id: number | string): void;
672
+ setgid?: (id: number | string) => void;
673
673
  /**
674
674
  * The `process.getuid()` method returns the numeric user identity of the process.
675
675
  * (See [`getuid(2)`](http://man7.org/linux/man-pages/man2/getuid.2.html).)
@@ -686,7 +686,7 @@ declare module 'process' {
686
686
  * Android).
687
687
  * @since v0.1.28
688
688
  */
689
- getuid(): number;
689
+ getuid?: () => number;
690
690
  /**
691
691
  * The `process.setuid(id)` method sets the user identity of the process. (See [`setuid(2)`](http://man7.org/linux/man-pages/man2/setuid.2.html).) The `id` can be passed as either a
692
692
  * numeric ID or a username string.
@@ -712,7 +712,7 @@ declare module 'process' {
712
712
  * This feature is not available in `Worker` threads.
713
713
  * @since v0.1.28
714
714
  */
715
- setuid(id: number | string): void;
715
+ setuid?: (id: number | string) => void;
716
716
  /**
717
717
  * The `process.geteuid()` method returns the numerical effective user identity of
718
718
  * the process. (See [`geteuid(2)`](http://man7.org/linux/man-pages/man2/geteuid.2.html).)
@@ -729,7 +729,7 @@ declare module 'process' {
729
729
  * Android).
730
730
  * @since v2.0.0
731
731
  */
732
- geteuid(): number;
732
+ geteuid?: () => number;
733
733
  /**
734
734
  * The `process.seteuid()` method sets the effective user identity of the process.
735
735
  * (See [`seteuid(2)`](http://man7.org/linux/man-pages/man2/seteuid.2.html).) The `id` can be passed as either a numeric ID or a username
@@ -756,7 +756,7 @@ declare module 'process' {
756
756
  * @since v2.0.0
757
757
  * @param id A user name or ID
758
758
  */
759
- seteuid(id: number | string): void;
759
+ seteuid?: (id: number | string) => void;
760
760
  /**
761
761
  * The `process.getegid()` method returns the numerical effective group identity
762
762
  * of the Node.js process. (See [`getegid(2)`](http://man7.org/linux/man-pages/man2/getegid.2.html).)
@@ -773,7 +773,7 @@ declare module 'process' {
773
773
  * Android).
774
774
  * @since v2.0.0
775
775
  */
776
- getegid(): number;
776
+ getegid?: () => number;
777
777
  /**
778
778
  * The `process.setegid()` method sets the effective group identity of the process.
779
779
  * (See [`setegid(2)`](http://man7.org/linux/man-pages/man2/setegid.2.html).) The `id` can be passed as either a numeric ID or a group
@@ -800,7 +800,7 @@ declare module 'process' {
800
800
  * @since v2.0.0
801
801
  * @param id A group name or ID
802
802
  */
803
- setegid(id: number | string): void;
803
+ setegid?: (id: number | string) => void;
804
804
  /**
805
805
  * The `process.getgroups()` method returns an array with the supplementary group
806
806
  * IDs. POSIX leaves it unspecified if the effective group ID is included but
@@ -818,7 +818,7 @@ declare module 'process' {
818
818
  * Android).
819
819
  * @since v0.9.4
820
820
  */
821
- getgroups(): number[];
821
+ getgroups?: () => number[];
822
822
  /**
823
823
  * The `process.setgroups()` method sets the supplementary group IDs for the
824
824
  * Node.js process. This is a privileged operation that requires the Node.js
@@ -844,7 +844,7 @@ declare module 'process' {
844
844
  * This feature is not available in `Worker` threads.
845
845
  * @since v0.9.4
846
846
  */
847
- setgroups(groups: ReadonlyArray<string | number>): void;
847
+ setgroups?: (groups: ReadonlyArray<string | number>) => void;
848
848
  /**
849
849
  * The `process.setUncaughtExceptionCaptureCallback()` function sets a function
850
850
  * that will be invoked when an uncaught exception occurs, which will receive the
node/tls.d.ts CHANGED
@@ -158,7 +158,7 @@ declare module 'tls' {
158
158
  * Always returns `true`. This may be used to distinguish TLS sockets from regular`net.Socket` instances.
159
159
  * @since v0.11.4
160
160
  */
161
- encrypted: boolean;
161
+ encrypted: true;
162
162
  /**
163
163
  * String containing the selected ALPN protocol.
164
164
  * Before a handshake has completed, this value is always null.