@types/node 11.13.0 → 11.13.4
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/crypto.d.ts +9 -6
- node/globals.d.ts +13 -13
- node/package.json +2 -2
- node/querystring.d.ts +8 -1
- node/url.d.ts +2 -2
node/README.md
CHANGED
|
@@ -8,7 +8,7 @@ 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:
|
|
11
|
+
* Last updated: Wed, 10 Apr 2019 17:39:58 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: Buffer, NodeJS, Symbol, __dirname, __filename, clearImmediate, clearInterval, clearTimeout, console, exports, global, module, process, queueMicrotask, require, setImmediate, setInterval, setTimeout
|
|
14
14
|
|
node/crypto.d.ts
CHANGED
|
@@ -135,15 +135,18 @@ declare module "crypto" {
|
|
|
135
135
|
|
|
136
136
|
export type KeyObjectType = 'secret' | 'public' | 'private';
|
|
137
137
|
|
|
138
|
+
interface KeyExportOptions<T extends KeyFormat> {
|
|
139
|
+
type: 'pkcs1' | 'spki' | 'pkcs8' | 'sec1';
|
|
140
|
+
format: T;
|
|
141
|
+
cipher?: string;
|
|
142
|
+
passphrase?: string | Buffer;
|
|
143
|
+
}
|
|
144
|
+
|
|
138
145
|
class KeyObject {
|
|
139
146
|
private constructor();
|
|
140
147
|
asymmetricKeyType?: KeyType;
|
|
141
|
-
export(options
|
|
142
|
-
|
|
143
|
-
format: KeyFormat,
|
|
144
|
-
cipher?: string,
|
|
145
|
-
passphrase?: string | Buffer
|
|
146
|
-
}): string | Buffer;
|
|
148
|
+
export(options: KeyExportOptions<'pem'>): string | Buffer;
|
|
149
|
+
export(options?: KeyExportOptions<'der'>): Buffer;
|
|
147
150
|
symmetricSize?: number;
|
|
148
151
|
type: KeyObjectType;
|
|
149
152
|
}
|
node/globals.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ interface Console {
|
|
|
45
45
|
/**
|
|
46
46
|
* The `console.groupCollapsed()` function is an alias for {@link console.group()}.
|
|
47
47
|
*/
|
|
48
|
-
groupCollapsed(): void;
|
|
48
|
+
groupCollapsed(...label: any[]): void;
|
|
49
49
|
/**
|
|
50
50
|
* Decreases indentation of subsequent lines by two spaces.
|
|
51
51
|
*/
|
|
@@ -233,12 +233,12 @@ declare var module: NodeModule;
|
|
|
233
233
|
declare var exports: any;
|
|
234
234
|
|
|
235
235
|
// Buffer class
|
|
236
|
-
type BufferEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "base64" | "latin1" | "binary" | "hex";
|
|
236
|
+
type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex";
|
|
237
237
|
interface Buffer extends Uint8Array {
|
|
238
238
|
constructor: typeof Buffer;
|
|
239
|
-
write(string: string, encoding?:
|
|
240
|
-
write(string: string, offset: number, encoding?:
|
|
241
|
-
write(string: string, offset: number, length: number, encoding?:
|
|
239
|
+
write(string: string, encoding?: BufferEncoding): number;
|
|
240
|
+
write(string: string, offset: number, encoding?: BufferEncoding): number;
|
|
241
|
+
write(string: string, offset: number, length: number, encoding?: BufferEncoding): number;
|
|
242
242
|
toString(encoding?: string, start?: number, end?: number): string;
|
|
243
243
|
toJSON(): { type: 'Buffer', data: number[] };
|
|
244
244
|
equals(otherBuffer: Uint8Array): boolean;
|
|
@@ -287,10 +287,10 @@ interface Buffer extends Uint8Array {
|
|
|
287
287
|
writeDoubleLE(value: number, offset: number): number;
|
|
288
288
|
writeDoubleBE(value: number, offset: number): number;
|
|
289
289
|
fill(value: any, offset?: number, end?: number): this;
|
|
290
|
-
indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?:
|
|
291
|
-
lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?:
|
|
290
|
+
indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
|
|
291
|
+
lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
|
|
292
292
|
entries(): IterableIterator<[number, number]>;
|
|
293
|
-
includes(value: string | number | Buffer, byteOffset?: number, encoding?:
|
|
293
|
+
includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean;
|
|
294
294
|
keys(): IterableIterator<number>;
|
|
295
295
|
values(): IterableIterator<number>;
|
|
296
296
|
}
|
|
@@ -308,7 +308,7 @@ declare const Buffer: {
|
|
|
308
308
|
* @param encoding encoding to use, optional. Default is 'utf8'
|
|
309
309
|
* @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead.
|
|
310
310
|
*/
|
|
311
|
-
new(str: string, encoding?:
|
|
311
|
+
new(str: string, encoding?: BufferEncoding): Buffer;
|
|
312
312
|
/**
|
|
313
313
|
* Allocates a new buffer of {size} octets.
|
|
314
314
|
*
|
|
@@ -367,7 +367,7 @@ declare const Buffer: {
|
|
|
367
367
|
* If provided, the {encoding} parameter identifies the character encoding.
|
|
368
368
|
* If not provided, {encoding} defaults to 'utf8'.
|
|
369
369
|
*/
|
|
370
|
-
from(str: string, encoding?:
|
|
370
|
+
from(str: string, encoding?: BufferEncoding): Buffer;
|
|
371
371
|
/**
|
|
372
372
|
* Creates a new Buffer using the passed {data}
|
|
373
373
|
* @param values to create a new Buffer
|
|
@@ -385,7 +385,7 @@ declare const Buffer: {
|
|
|
385
385
|
*
|
|
386
386
|
* @param encoding string to test.
|
|
387
387
|
*/
|
|
388
|
-
isEncoding(encoding: string):
|
|
388
|
+
isEncoding(encoding: string): encoding is BufferEncoding
|
|
389
389
|
/**
|
|
390
390
|
* Gives the actual byte length of a string. encoding defaults to 'utf8'.
|
|
391
391
|
* This is not the same as String.prototype.length since that returns the number of characters in a string.
|
|
@@ -393,7 +393,7 @@ declare const Buffer: {
|
|
|
393
393
|
* @param string string to test.
|
|
394
394
|
* @param encoding encoding used to evaluate (defaults to 'utf8')
|
|
395
395
|
*/
|
|
396
|
-
byteLength(string: string | NodeJS.TypedArray | DataView | ArrayBuffer | SharedArrayBuffer, encoding?:
|
|
396
|
+
byteLength(string: string | NodeJS.TypedArray | DataView | ArrayBuffer | SharedArrayBuffer, encoding?: BufferEncoding): number;
|
|
397
397
|
/**
|
|
398
398
|
* Returns a buffer which is the result of concatenating all the buffers in the list together.
|
|
399
399
|
*
|
|
@@ -418,7 +418,7 @@ declare const Buffer: {
|
|
|
418
418
|
* If parameter is omitted, buffer will be filled with zeros.
|
|
419
419
|
* @param encoding encoding used for call to buf.fill while initalizing
|
|
420
420
|
*/
|
|
421
|
-
alloc(size: number, fill?: string | Buffer | number, encoding?:
|
|
421
|
+
alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer;
|
|
422
422
|
/**
|
|
423
423
|
* Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
|
|
424
424
|
* of the newly created Buffer are unknown and may contain sensitive data.
|
node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "11.13.
|
|
3
|
+
"version": "11.13.4",
|
|
4
4
|
"description": "TypeScript definitions for Node.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"contributors": [
|
|
@@ -206,6 +206,6 @@
|
|
|
206
206
|
},
|
|
207
207
|
"scripts": {},
|
|
208
208
|
"dependencies": {},
|
|
209
|
-
"typesPublisherContentHash": "
|
|
209
|
+
"typesPublisherContentHash": "65764fe7ac3d472c68db335bc5a4ededefe76e9f1c2d7176dca805fba7084a52",
|
|
210
210
|
"typeScriptVersion": "2.0"
|
|
211
211
|
}
|
node/querystring.d.ts
CHANGED
|
@@ -10,7 +10,14 @@ declare module "querystring" {
|
|
|
10
10
|
|
|
11
11
|
interface ParsedUrlQuery { [key: string]: string | string[]; }
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
interface ParsedUrlQueryInput {
|
|
14
|
+
[key: string]:
|
|
15
|
+
// The value type here is a "poor man's `unknown`". When these types support TypeScript
|
|
16
|
+
// 3.0+, we can replace this with `unknown`.
|
|
17
|
+
{} | null | undefined;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string;
|
|
14
21
|
function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery;
|
|
15
22
|
function escape(str: string): string;
|
|
16
23
|
function unescape(str: string): string;
|
node/url.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare module "url" {
|
|
2
|
-
import { ParsedUrlQuery } from 'querystring';
|
|
2
|
+
import { ParsedUrlQuery, ParsedUrlQueryInput } from 'querystring';
|
|
3
3
|
|
|
4
4
|
interface UrlObjectCommon {
|
|
5
5
|
auth?: string;
|
|
@@ -17,7 +17,7 @@ declare module "url" {
|
|
|
17
17
|
// Input to `url.format`
|
|
18
18
|
interface UrlObject extends UrlObjectCommon {
|
|
19
19
|
port?: string | number;
|
|
20
|
-
query?: string | null |
|
|
20
|
+
query?: string | null | ParsedUrlQueryInput;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// Output of `url.parse`
|