@types/node 13.5.2 → 13.7.2

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,9 +8,9 @@ This package contains type definitions for Node.js (http://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: Wed, 29 Jan 2020 21:49:45 GMT
11
+ * Last updated: Tue, 18 Feb 2020 20:53:22 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `Buffer`, `Symbol`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
14
14
 
15
15
  # Credits
16
- These definitions were written by Microsoft TypeScript (https://github.com/Microsoft), DefinitelyTyped (https://github.com/DefinitelyTyped), Alberto Schiabel (https://github.com/jkomyno), Alexander T. (https://github.com/a-tarasyuk), Alvis HT Tang (https://github.com/alvis), Andrew Makarov (https://github.com/r3nya), Benjamin Toueg (https://github.com/btoueg), Bruno Scheufler (https://github.com/brunoscheufler), Chigozirim C. (https://github.com/smac89), Christian Vaagland Tellnes (https://github.com/tellnes), David Junger (https://github.com/touffy), Deividas Bakanas (https://github.com/DeividasBakanas), Eugene Y. Q. Shen (https://github.com/eyqs), Flarna (https://github.com/Flarna), Hannes Magnusson (https://github.com/Hannes-Magnusson-CK), Hoàng Văn Khải (https://github.com/KSXGitHub), Huw (https://github.com/hoo29), Kelvin Jin (https://github.com/kjin), Klaus Meinhardt (https://github.com/ajafff), Lishude (https://github.com/islishude), Mariusz Wiktorczyk (https://github.com/mwiktorczyk), Mohsen Azimi (https://github.com/mohsen1), Nicolas Even (https://github.com/n-e), Nicolas Voigt (https://github.com/octo-sniffle), Nikita Galkin (https://github.com/galkin), Parambir Singh (https://github.com/parambirs), Sebastian Silbermann (https://github.com/eps1lon), Simon Schick (https://github.com/SimonSchick), Thomas den Hollander (https://github.com/ThomasdenH), Wilco Bakker (https://github.com/WilcoBakker), wwwy3y3 (https://github.com/wwwy3y3), Zane Hannan AU (https://github.com/ZaneHannanAU), Samuel Ainsworth (https://github.com/samuela), Kyle Uehlein (https://github.com/kuehlein), Jordi Oliveras Rovira (https://github.com/j-oliveras), Thanik Bhongbhibhat (https://github.com/bhongy), Marcin Kopacz (https://github.com/chyzwar), Trivikram Kamat (https://github.com/trivikr), Minh Son Nguyen (https://github.com/nguymin4), Junxiao Shi (https://github.com/yoursunny), and Ilia Baryshnikov (https://github.com/qwelias).
16
+ These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alexander T.](https://github.com/a-tarasyuk), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Bruno Scheufler](https://github.com/brunoscheufler), [Chigozirim C.](https://github.com/smac89), [Christian Vaagland Tellnes](https://github.com/tellnes), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Flarna](https://github.com/Flarna), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Hoàng Văn Khải](https://github.com/KSXGitHub), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nicolas Voigt](https://github.com/octo-sniffle), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Zane Hannan AU](https://github.com/ZaneHannanAU), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Jordi Oliveras Rovira](https://github.com/j-oliveras), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Minh Son Nguyen](https://github.com/nguymin4), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), and [Surasak Chaisurin](https://github.com/Ryan-Willpower).
node/globals.d.ts CHANGED
@@ -239,6 +239,12 @@ declare class Buffer extends Uint8Array {
239
239
  */
240
240
  static from(data: number[]): Buffer;
241
241
  static from(data: Uint8Array): Buffer;
242
+ /**
243
+ * Creates a new buffer containing the coerced value of an object
244
+ * A `TypeError` will be thrown if {obj} has not mentioned methods or is not of other type appropriate for `Buffer.from()` variants.
245
+ * @param obj An object supporting `Symbol.toPrimitive` or `valueOf()`.
246
+ */
247
+ static from(obj: { valueOf(): string | object } | { [Symbol.toPrimitive](hint: 'string'): string }, byteOffset?: number, length?: number): Buffer;
242
248
  /**
243
249
  * Creates a new Buffer containing the given JavaScript string {str}.
244
250
  * If provided, the {encoding} parameter identifies the character encoding.
node/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for non-npm package Node.js 13.5
1
+ // Type definitions for non-npm package Node.js 13.7
2
2
  // Project: http://nodejs.org/
3
3
  // Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
4
4
  // DefinitelyTyped <https://github.com/DefinitelyTyped>
@@ -41,6 +41,7 @@
41
41
  // Minh Son Nguyen <https://github.com/nguymin4>
42
42
  // Junxiao Shi <https://github.com/yoursunny>
43
43
  // Ilia Baryshnikov <https://github.com/qwelias>
44
+ // Surasak Chaisurin <https://github.com/Ryan-Willpower>
44
45
  // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
45
46
 
46
47
  // NOTE: These definitions support NodeJS and TypeScript 3.5.
node/module.d.ts CHANGED
@@ -1,6 +1,43 @@
1
1
  declare module "module" {
2
2
  import { URL } from "url";
3
- namespace Module {}
3
+ namespace Module {
4
+ /**
5
+ * Updates all the live bindings for builtin ES Modules to match the properties of the CommonJS exports.
6
+ * It does not add or remove exported names from the ES Modules.
7
+ */
8
+ function syncBuiltinESMExports(): void;
9
+
10
+ /**
11
+ * @experimental
12
+ */
13
+ function findSourceMap(path: string, error?: Error): SourceMap;
14
+ interface SourceMapPayload {
15
+ file: string;
16
+ version: number;
17
+ sources: string[];
18
+ sourcesContent: string[];
19
+ names: string[];
20
+ mappings: string;
21
+ sourceRoot: string;
22
+ }
23
+
24
+ interface SourceMapping {
25
+ generatedLine: number;
26
+ generatedColumn: number;
27
+ originalSource: string;
28
+ originalLine: number;
29
+ originalColumn: number;
30
+ }
31
+
32
+ /**
33
+ * @experimental
34
+ */
35
+ class SourceMap {
36
+ readonly payload: SourceMapPayload;
37
+ constructor(payload: SourceMapPayload);
38
+ findEntry(line: number, column: number): SourceMapping;
39
+ }
40
+ }
4
41
  interface Module extends NodeModule {}
5
42
  class Module {
6
43
  static runMain(): void;
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "13.5.2",
3
+ "version": "13.7.2",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -208,6 +208,11 @@
208
208
  "name": "Ilia Baryshnikov",
209
209
  "url": "https://github.com/qwelias",
210
210
  "githubUsername": "qwelias"
211
+ },
212
+ {
213
+ "name": "Surasak Chaisurin",
214
+ "url": "https://github.com/Ryan-Willpower",
215
+ "githubUsername": "Ryan-Willpower"
211
216
  }
212
217
  ],
213
218
  "main": "",
@@ -226,6 +231,6 @@
226
231
  },
227
232
  "scripts": {},
228
233
  "dependencies": {},
229
- "typesPublisherContentHash": "cc848be7ea21fa9fd04c27963d8c2e14f4e50327d346e930a797d2027779f492",
234
+ "typesPublisherContentHash": "6c91c5301eb56e6c7e691b1663c42a0e3518137ec16542cb5bc9c3dc4e1ce390",
230
235
  "typeScriptVersion": "2.8"
231
236
  }
node/perf_hooks.d.ts CHANGED
@@ -1,5 +1,7 @@
1
- declare module "perf_hooks" {
2
- import { AsyncResource } from "async_hooks";
1
+ declare module 'perf_hooks' {
2
+ import { AsyncResource } from 'async_hooks';
3
+
4
+ type EntryType = 'node' | 'mark' | 'measure' | 'gc' | 'function' | 'http2' | 'http';
3
5
 
4
6
  interface PerformanceEntry {
5
7
  /**
@@ -22,7 +24,7 @@ declare module "perf_hooks" {
22
24
  * The type of the performance entry.
23
25
  * Currently it may be one of: 'node', 'mark', 'measure', 'gc', or 'function'.
24
26
  */
25
- readonly entryType: string;
27
+ readonly entryType: EntryType;
26
28
 
27
29
  /**
28
30
  * When performanceEntry.entryType is equal to 'gc', the performance.kind property identifies
@@ -133,7 +135,7 @@ declare module "perf_hooks" {
133
135
  * @param type
134
136
  * @return list of all PerformanceEntry objects
135
137
  */
136
- getEntriesByName(name: string, type?: string): PerformanceEntry[];
138
+ getEntriesByName(name: string, type?: EntryType): PerformanceEntry[];
137
139
 
138
140
  /**
139
141
  * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime
@@ -141,7 +143,7 @@ declare module "perf_hooks" {
141
143
  * @param type
142
144
  * @return list of all PerformanceEntry objects
143
145
  */
144
- getEntriesByType(type: string): PerformanceEntry[];
146
+ getEntriesByType(type: EntryType): PerformanceEntry[];
145
147
 
146
148
  /**
147
149
  * Creates a new PerformanceMark entry in the Performance Timeline.
@@ -202,13 +204,13 @@ declare module "perf_hooks" {
202
204
  * @return a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime
203
205
  * whose performanceEntry.name is equal to name, and optionally, whose performanceEntry.entryType is equal to type.
204
206
  */
205
- getEntriesByName(name: string, type?: string): PerformanceEntry[];
207
+ getEntriesByName(name: string, type?: EntryType): PerformanceEntry[];
206
208
 
207
209
  /**
208
210
  * @return Returns a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime
209
211
  * whose performanceEntry.entryType is equal to type.
210
212
  */
211
- getEntriesByType(type: string): PerformanceEntry[];
213
+ getEntriesByType(type: EntryType): PerformanceEntry[];
212
214
  }
213
215
 
214
216
  type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void;
@@ -227,7 +229,7 @@ declare module "perf_hooks" {
227
229
  * Property buffered defaults to false.
228
230
  * @param options
229
231
  */
230
- observe(options: { entryTypes: string[], buffered?: boolean }): void;
232
+ observe(options: { entryTypes: EntryType[]; buffered?: boolean }): void;
231
233
  }
232
234
 
233
235
  namespace constants {
node/stream.d.ts CHANGED
@@ -267,9 +267,15 @@ declare module "stream" {
267
267
 
268
268
  class PassThrough extends Transform { }
269
269
 
270
+ interface FinishedOptions {
271
+ error?: boolean;
272
+ readable?: boolean;
273
+ writable?: boolean;
274
+ }
275
+ function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options: FinishedOptions, callback: (err?: NodeJS.ErrnoException | null) => void): () => void;
270
276
  function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, callback: (err?: NodeJS.ErrnoException | null) => void): () => void;
271
277
  namespace finished {
272
- function __promisify__(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream): Promise<void>;
278
+ function __promisify__(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise<void>;
273
279
  }
274
280
 
275
281
  function pipeline<T extends NodeJS.WritableStream>(stream1: NodeJS.ReadableStream, stream2: T, callback?: (err: NodeJS.ErrnoException | null) => void): T;