@types/node 18.13.0 → 18.14.0

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, 07 Feb 2023 08:32:36 GMT
11
+ * Last updated: Fri, 17 Feb 2023 20:32:39 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
14
14
 
node/buffer.d.ts CHANGED
@@ -46,6 +46,7 @@
46
46
  declare module 'buffer' {
47
47
  import { BinaryLike } from 'node:crypto';
48
48
  import { ReadableStream as WebReadableStream } from 'node:stream/web';
49
+ export function isUtf8(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
49
50
  export const INSPECT_MAX_BYTES: number;
50
51
  export const kMaxLength: number;
51
52
  export const kStringMaxLength: number;
@@ -169,11 +170,21 @@ declare module 'buffer' {
169
170
  import { Blob as NodeBlob } from 'buffer';
170
171
  // This conditional type will be the existing global Blob in a browser, or
171
172
  // the copy below in a Node environment.
172
- type __Blob = typeof globalThis extends { onmessage: any, Blob: infer T }
173
- ? T : NodeBlob;
173
+ type __Blob = typeof globalThis extends { onmessage: any; Blob: infer T } ? T : NodeBlob;
174
174
  global {
175
175
  // Buffer class
176
- type BufferEncoding = 'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'base64url' | 'latin1' | 'binary' | 'hex';
176
+ type BufferEncoding =
177
+ | 'ascii'
178
+ | 'utf8'
179
+ | 'utf-8'
180
+ | 'utf16le'
181
+ | 'ucs2'
182
+ | 'ucs-2'
183
+ | 'base64'
184
+ | 'base64url'
185
+ | 'latin1'
186
+ | 'binary'
187
+ | 'hex';
177
188
  type WithImplicitCoercion<T> =
178
189
  | T
179
190
  | {
@@ -247,7 +258,11 @@ declare module 'buffer' {
247
258
  * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does.
248
259
  * @since v5.10.0
249
260
  */
250
- from(arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>, byteOffset?: number, length?: number): Buffer;
261
+ from(
262
+ arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>,
263
+ byteOffset?: number,
264
+ length?: number,
265
+ ): Buffer;
251
266
  /**
252
267
  * Creates a new Buffer using the passed {data}
253
268
  * @param data data to create a new Buffer
@@ -265,7 +280,7 @@ declare module 'buffer' {
265
280
  | {
266
281
  [Symbol.toPrimitive](hint: 'string'): string;
267
282
  },
268
- encoding?: BufferEncoding
283
+ encoding?: BufferEncoding,
269
284
  ): Buffer;
270
285
  /**
271
286
  * Creates a new Buffer using the passed {data}
@@ -339,7 +354,10 @@ declare module 'buffer' {
339
354
  * @param [encoding='utf8'] If `string` is a string, this is its encoding.
340
355
  * @return The number of bytes contained within `string`.
341
356
  */
342
- byteLength(string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer, encoding?: BufferEncoding): number;
357
+ byteLength(
358
+ string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
359
+ encoding?: BufferEncoding,
360
+ ): number;
343
361
  /**
344
362
  * Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together.
345
363
  *
@@ -710,7 +728,13 @@ declare module 'buffer' {
710
728
  * @param [sourceStart=0] The offset within `buf` at which to begin comparison.
711
729
  * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive).
712
730
  */
713
- compare(target: Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): -1 | 0 | 1;
731
+ compare(
732
+ target: Uint8Array,
733
+ targetStart?: number,
734
+ targetEnd?: number,
735
+ sourceStart?: number,
736
+ sourceEnd?: number,
737
+ ): -1 | 0 | 1;
714
738
  /**
715
739
  * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`.
716
740
  *
node/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for non-npm package Node.js 18.13
1
+ // Type definitions for non-npm package Node.js 18.14
2
2
  // Project: https://nodejs.org/
3
3
  // Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
4
4
  // DefinitelyTyped <https://github.com/DefinitelyTyped>
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "18.13.0",
3
+ "version": "18.14.0",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -232,6 +232,6 @@
232
232
  },
233
233
  "scripts": {},
234
234
  "dependencies": {},
235
- "typesPublisherContentHash": "6c5087993475c3d03552602e518e6747e3493f7e7dec65e81e1f206b013ad890",
235
+ "typesPublisherContentHash": "c162056afaa72720d23d051bc83320f677f9fe17ead37974cc874e1723ec3bf0",
236
236
  "typeScriptVersion": "4.2"
237
237
  }
node/ts4.8/buffer.d.ts CHANGED
@@ -46,6 +46,7 @@
46
46
  declare module 'buffer' {
47
47
  import { BinaryLike } from 'node:crypto';
48
48
  import { ReadableStream as WebReadableStream } from 'node:stream/web';
49
+ export function isUtf8(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
49
50
  export const INSPECT_MAX_BYTES: number;
50
51
  export const kMaxLength: number;
51
52
  export const kStringMaxLength: number;
@@ -169,12 +170,22 @@ declare module 'buffer' {
169
170
  import { Blob as NodeBlob } from 'buffer';
170
171
  // This conditional type will be the existing global Blob in a browser, or
171
172
  // the copy below in a Node environment.
172
- type __Blob = typeof globalThis extends { onmessage: any, Blob: any }
173
- ? {} : NodeBlob;
173
+ type __Blob = typeof globalThis extends { onmessage: any; Blob: any } ? {} : NodeBlob;
174
174
 
175
175
  global {
176
176
  // Buffer class
177
- type BufferEncoding = 'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'base64url' | 'latin1' | 'binary' | 'hex';
177
+ type BufferEncoding =
178
+ | 'ascii'
179
+ | 'utf8'
180
+ | 'utf-8'
181
+ | 'utf16le'
182
+ | 'ucs2'
183
+ | 'ucs-2'
184
+ | 'base64'
185
+ | 'base64url'
186
+ | 'latin1'
187
+ | 'binary'
188
+ | 'hex';
178
189
  type WithImplicitCoercion<T> =
179
190
  | T
180
191
  | {
@@ -248,7 +259,11 @@ declare module 'buffer' {
248
259
  * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does.
249
260
  * @since v5.10.0
250
261
  */
251
- from(arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>, byteOffset?: number, length?: number): Buffer;
262
+ from(
263
+ arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>,
264
+ byteOffset?: number,
265
+ length?: number,
266
+ ): Buffer;
252
267
  /**
253
268
  * Creates a new Buffer using the passed {data}
254
269
  * @param data data to create a new Buffer
@@ -266,7 +281,7 @@ declare module 'buffer' {
266
281
  | {
267
282
  [Symbol.toPrimitive](hint: 'string'): string;
268
283
  },
269
- encoding?: BufferEncoding
284
+ encoding?: BufferEncoding,
270
285
  ): Buffer;
271
286
  /**
272
287
  * Creates a new Buffer using the passed {data}
@@ -340,7 +355,10 @@ declare module 'buffer' {
340
355
  * @param [encoding='utf8'] If `string` is a string, this is its encoding.
341
356
  * @return The number of bytes contained within `string`.
342
357
  */
343
- byteLength(string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer, encoding?: BufferEncoding): number;
358
+ byteLength(
359
+ string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
360
+ encoding?: BufferEncoding,
361
+ ): number;
344
362
  /**
345
363
  * Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together.
346
364
  *
@@ -711,7 +729,13 @@ declare module 'buffer' {
711
729
  * @param [sourceStart=0] The offset within `buf` at which to begin comparison.
712
730
  * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive).
713
731
  */
714
- compare(target: Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): -1 | 0 | 1;
732
+ compare(
733
+ target: Uint8Array,
734
+ targetStart?: number,
735
+ targetEnd?: number,
736
+ sourceStart?: number,
737
+ sourceEnd?: number,
738
+ ): -1 | 0 | 1;
715
739
  /**
716
740
  * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`.
717
741
  *