@types/node 14.18.6 → 14.18.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.
node v14.18/README.md CHANGED
@@ -8,9 +8,9 @@ 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/v14.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Mon, 17 Jan 2022 09:01:29 GMT
11
+ * Last updated: Tue, 01 Feb 2022 08:31:31 GMT
12
12
  * Dependencies: none
13
- * Global values: `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
13
+ * Global values: `AbortController`, `AbortSignal`, `Buffer`, `__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), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [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), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Seth Westphal](https://github.com/westy92), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Surasak Chaisurin](https://github.com/Ryan-Willpower), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [Bond](https://github.com/bondz), and [Linus Unnebäck](https://github.com/LinusU).
16
+ These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [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), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Seth Westphal](https://github.com/westy92), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [Bond](https://github.com/bondz), and [Linus Unnebäck](https://github.com/LinusU).
node v14.18/buffer.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  declare module 'buffer' {
2
+ import { BinaryLike } from 'node:crypto';
2
3
  export const INSPECT_MAX_BYTES: number;
3
4
  export const kMaxLength: number;
4
5
  export const kStringMaxLength: number;
@@ -17,6 +18,69 @@ declare module 'buffer' {
17
18
  new(size: number): Buffer;
18
19
  prototype: Buffer;
19
20
  };
21
+ /**
22
+ * @experimental
23
+ */
24
+ export interface BlobOptions {
25
+ /**
26
+ * @default 'utf8'
27
+ */
28
+ encoding?: BufferEncoding | undefined;
29
+ /**
30
+ * The Blob content-type. The intent is for `type` to convey
31
+ * the MIME media type of the data, however no validation of the type format
32
+ * is performed.
33
+ */
34
+ type?: string | undefined;
35
+ }
36
+ /**
37
+ * A [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) encapsulates immutable, raw data that can be safely shared across
38
+ * multiple worker threads.
39
+ * @since v14.18.0
40
+ * @experimental
41
+ */
42
+ export class Blob {
43
+ /**
44
+ * The total size of the `Blob` in bytes.
45
+ * @since v14.18.0
46
+ */
47
+ readonly size: number;
48
+ /**
49
+ * The content-type of the `Blob`.
50
+ * @since v14.18.0
51
+ */
52
+ readonly type: string;
53
+ /**
54
+ * Creates a new `Blob` object containing a concatenation of the given sources.
55
+ *
56
+ * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into
57
+ * the 'Blob' and can therefore be safely modified after the 'Blob' is created.
58
+ *
59
+ * String sources are also copied into the `Blob`.
60
+ */
61
+ constructor(sources: Array<BinaryLike | Blob>, options?: BlobOptions);
62
+ /**
63
+ * Returns a promise that fulfills with an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of
64
+ * the `Blob` data.
65
+ * @since v14.18.0
66
+ */
67
+ arrayBuffer(): Promise<ArrayBuffer>;
68
+ /**
69
+ * Creates and returns a new `Blob` containing a subset of this `Blob` objects
70
+ * data. The original `Blob` is not altered.
71
+ * @since v14.18.0
72
+ * @param start The starting index.
73
+ * @param end The ending index.
74
+ * @param type The content-type for the new `Blob`
75
+ */
76
+ slice(start?: number, end?: number, type?: string): Blob;
77
+ /**
78
+ * Returns a promise that fulfills with the contents of the `Blob` decoded as a
79
+ * UTF-8 string.
80
+ * @since v14.18.0
81
+ */
82
+ text(): Promise<string>;
83
+ }
20
84
 
21
85
  export { BuffType as Buffer };
22
86
  }
@@ -75,6 +75,49 @@ type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2"
75
75
 
76
76
  type WithImplicitCoercion<T> = T | { valueOf(): T };
77
77
 
78
+ //#region borrowed
79
+ // from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib
80
+ /**
81
+ * A controller object that allows you to abort one or more DOM requests as and when desired.
82
+ * @since v14.7.0
83
+ */
84
+ interface AbortController {
85
+ /**
86
+ * Returns the AbortSignal object associated with this object.
87
+ * @since v14.7.0
88
+ */
89
+ readonly signal: AbortSignal;
90
+ /**
91
+ * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
92
+ * @since v14.7.0
93
+ */
94
+ abort(): void;
95
+ }
96
+
97
+ /**
98
+ * A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object.
99
+ * @since v14.7.0
100
+ */
101
+ interface AbortSignal {
102
+ /**
103
+ * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
104
+ * @since v14.7.0
105
+ */
106
+ readonly aborted: boolean;
107
+ }
108
+
109
+ declare var AbortController: {
110
+ prototype: AbortController;
111
+ new(): AbortController;
112
+ };
113
+
114
+ declare var AbortSignal: {
115
+ prototype: AbortSignal;
116
+ new(): AbortSignal;
117
+ // TODO: Add abort() static
118
+ };
119
+ //#endregion borrowed
120
+
78
121
  /**
79
122
  * Raw data is stored in instances of the Buffer class.
80
123
  * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
node v14.18/index.d.ts CHANGED
@@ -35,7 +35,6 @@
35
35
  // Junxiao Shi <https://github.com/yoursunny>
36
36
  // Ilia Baryshnikov <https://github.com/qwelias>
37
37
  // ExE Boss <https://github.com/ExE-Boss>
38
- // Surasak Chaisurin <https://github.com/Ryan-Willpower>
39
38
  // Piotr Błażejewicz <https://github.com/peterblazejewicz>
40
39
  // Anna Henningsen <https://github.com/addaleax>
41
40
  // Victor Perin <https://github.com/victorperin>
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "14.18.6",
3
+ "version": "14.18.10",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -180,11 +180,6 @@
180
180
  "url": "https://github.com/ExE-Boss",
181
181
  "githubUsername": "ExE-Boss"
182
182
  },
183
- {
184
- "name": "Surasak Chaisurin",
185
- "url": "https://github.com/Ryan-Willpower",
186
- "githubUsername": "Ryan-Willpower"
187
- },
188
183
  {
189
184
  "name": "Piotr Błażejewicz",
190
185
  "url": "https://github.com/peterblazejewicz",
@@ -225,6 +220,6 @@
225
220
  },
226
221
  "scripts": {},
227
222
  "dependencies": {},
228
- "typesPublisherContentHash": "a7bcc772985659539e879bf5f5df35c452cf6a69fd3cb641fb0529400a1e6e55",
223
+ "typesPublisherContentHash": "1484ce2e0999bb038b0993c28cc9673aa9832f0fd1fc87f496fe0b8297bda0c1",
229
224
  "typeScriptVersion": "3.8"
230
225
  }
node v14.18/url.d.ts CHANGED
@@ -102,7 +102,7 @@ declare module 'url' {
102
102
  append(name: string, value: string): void;
103
103
  delete(name: string): void;
104
104
  entries(): IterableIterator<[string, string]>;
105
- forEach(callback: (value: string, name: string, searchParams: this) => void): void;
105
+ forEach(callback: (value: string, name: string, searchParams: URLSearchParams) => void, thisArg?: any): void;
106
106
  get(name: string): string | null;
107
107
  getAll(name: string): string[];
108
108
  has(name: string): boolean;
@@ -113,6 +113,32 @@ declare module 'url' {
113
113
  values(): IterableIterator<string>;
114
114
  [Symbol.iterator](): IterableIterator<[string, string]>;
115
115
  }
116
+
117
+ import { URL as _URL, URLSearchParams as _URLSearchParams } from 'url';
118
+ global {
119
+ interface URLSearchParams extends _URLSearchParams {}
120
+ interface URL extends _URL {}
121
+ interface Global {
122
+ URL: typeof _URL;
123
+ URLSearchParams: typeof _URLSearchParams;
124
+ }
125
+ /**
126
+ * `URL` class is a global reference for `require('url').URL`
127
+ * https://nodejs.org/api/url.html#the-whatwg-url-api
128
+ * @since v10.0.0
129
+ */
130
+ var URL: typeof globalThis extends { webkitURL: infer URL } ? URL : typeof _URL;
131
+ /**
132
+ * `URLSearchParams` class is a global reference for `require('url').URLSearchParams`.
133
+ * https://nodejs.org/api/url.html#class-urlsearchparams
134
+ * @since v10.0.0
135
+ */
136
+ var URLSearchParams: {
137
+ prototype: URLSearchParams;
138
+ new(init?: string[][] | Record<string, string> | string | URLSearchParams): URLSearchParams;
139
+ toString(): string;
140
+ };
141
+ }
116
142
  }
117
143
  declare module 'node:url' {
118
144
  export * from 'url';