@types/node 12.6.7 → 12.7.1

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/net.d.ts CHANGED
@@ -38,8 +38,8 @@ declare module "net" {
38
38
  constructor(options?: SocketConstructorOpts);
39
39
 
40
40
  // Extended base methods
41
- write(buffer: Buffer | Uint8Array | string, cb?: (err?: Error) => void): boolean;
42
- write(str: Buffer | Uint8Array | string, encoding?: string, cb?: (err?: Error) => void): boolean;
41
+ write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean;
42
+ write(str: Uint8Array | string, encoding?: string, cb?: (err?: Error) => void): boolean;
43
43
 
44
44
  connect(options: SocketConnectOpts, connectionListener?: () => void): this;
45
45
  connect(port: number, host: string, connectionListener?: () => void): this;
@@ -69,8 +69,8 @@ declare module "net" {
69
69
 
70
70
  // Extended base methods
71
71
  end(cb?: () => void): void;
72
- end(buffer: Buffer | Uint8Array | string, cb?: () => void): void;
73
- end(str: Buffer | Uint8Array | string, encoding?: string, cb?: () => void): void;
72
+ end(buffer: Uint8Array | string, cb?: () => void): void;
73
+ end(str: Uint8Array | string, encoding?: string, cb?: () => void): void;
74
74
 
75
75
  /**
76
76
  * events.EventEmitter
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "12.6.7",
3
+ "version": "12.7.1",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -183,6 +183,11 @@
183
183
  "name": "Thanik Bhongbhibhat",
184
184
  "url": "https://github.com/bhongy",
185
185
  "githubUsername": "bhongy"
186
+ },
187
+ {
188
+ "name": "Marcin Kopacz",
189
+ "url": "https://github.com/chyzwar",
190
+ "githubUsername": "chyzwar"
186
191
  }
187
192
  ],
188
193
  "main": "",
@@ -201,6 +206,6 @@
201
206
  },
202
207
  "scripts": {},
203
208
  "dependencies": {},
204
- "typesPublisherContentHash": "cbd326c2ce79b530e41b062082cbb24e641c716d725a896a6e53c22bbe46b9df",
209
+ "typesPublisherContentHash": "53a0cec8c0721eaaa04fde9376c826d08538cd9882d4104aeeeb774e0c17f552",
205
210
  "typeScriptVersion": "2.0"
206
211
  }
node/readline.d.ts CHANGED
@@ -127,10 +127,24 @@ declare module "readline" {
127
127
 
128
128
  function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface;
129
129
  function createInterface(options: ReadLineOptions): Interface;
130
-
131
- function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number): void;
132
130
  function emitKeypressEvents(stream: NodeJS.ReadableStream, interface?: Interface): void;
133
- function moveCursor(stream: NodeJS.WritableStream, dx: number | string, dy: number | string): void;
134
- function clearLine(stream: NodeJS.WritableStream, dir: number): void;
135
- function clearScreenDown(stream: NodeJS.WritableStream): void;
131
+
132
+ type Direction = -1 | 0 | 1;
133
+
134
+ /**
135
+ * Clears the current line of this WriteStream in a direction identified by `dir`.
136
+ */
137
+ function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean;
138
+ /**
139
+ * Clears this `WriteStream` from the current cursor down.
140
+ */
141
+ function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean;
142
+ /**
143
+ * Moves this WriteStream's cursor to the specified position.
144
+ */
145
+ function cursorTo(stream: NodeJS.WritableStream, x: number, y: number, callback?: () => void): boolean;
146
+ /**
147
+ * Moves this WriteStream's cursor relative to its current position.
148
+ */
149
+ function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean;
136
150
  }
node/string_decoder.d.ts CHANGED
@@ -1,9 +1,7 @@
1
1
  declare module "string_decoder" {
2
- interface NodeStringDecoder {
2
+ class StringDecoder {
3
+ constructor(encoding?: string);
3
4
  write(buffer: Buffer): string;
4
5
  end(buffer?: Buffer): string;
5
6
  }
6
- const StringDecoder: {
7
- new(encoding?: string): NodeStringDecoder;
8
- };
9
7
  }
node/tls.d.ts CHANGED
@@ -245,7 +245,7 @@ declare module "tls" {
245
245
  * An array of strings or a Buffer naming possible ALPN protocols.
246
246
  * (Protocols should be ordered by their priority.)
247
247
  */
248
- ALPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array;
248
+ ALPNProtocols?: string[] | Uint8Array[] | Uint8Array;
249
249
  /**
250
250
  * SNICallback(servername, cb) <Function> A function that will be
251
251
  * called if the client supports SNI TLS extension. Two arguments
@@ -262,7 +262,7 @@ declare module "tls" {
262
262
  * effect if requestCert is true.
263
263
  * @default true
264
264
  */
265
- rejectUnauthorized?: boolean; // Defaults to true
265
+ rejectUnauthorized?: boolean;
266
266
  }
267
267
 
268
268
  interface TlsOptions extends SecureContextOptions, CommonConnectionOptions {
node/tty.d.ts CHANGED
@@ -3,6 +3,7 @@ declare module "tty" {
3
3
 
4
4
  function isatty(fd: number): boolean;
5
5
  class ReadStream extends net.Socket {
6
+ constructor(fd: number, options?: net.SocketConstructorOpts);
6
7
  isRaw: boolean;
7
8
  setRawMode(mode: boolean): void;
8
9
  isTTY: boolean;
@@ -14,6 +15,7 @@ declare module "tty" {
14
15
  */
15
16
  type Direction = -1 | 0 | 1;
16
17
  class WriteStream extends net.Socket {
18
+ constructor(fd: number);
17
19
  addListener(event: string, listener: (...args: any[]) => void): this;
18
20
  addListener(event: "resize", listener: () => void): this;
19
21
 
@@ -32,9 +34,22 @@ declare module "tty" {
32
34
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
33
35
  prependOnceListener(event: "resize", listener: () => void): this;
34
36
 
35
- clearLine(dir: Direction): void;
36
- clearScreenDown(): void;
37
- cursorTo(x: number, y: number): void;
37
+ /**
38
+ * Clears the current line of this WriteStream in a direction identified by `dir`.
39
+ */
40
+ clearLine(dir: Direction, callback?: () => void): boolean;
41
+ /**
42
+ * Clears this `WriteStream` from the current cursor down.
43
+ */
44
+ clearScreenDown(callback?: () => void): boolean;
45
+ /**
46
+ * Moves this WriteStream's cursor to the specified position.
47
+ */
48
+ cursorTo(x: number, y: number, callback?: () => void): boolean;
49
+ /**
50
+ * Moves this WriteStream's cursor relative to its current position.
51
+ */
52
+ moveCursor(dx: number, dy: number, callback?: () => void): boolean;
38
53
  /**
39
54
  * @default `process.env`
40
55
  */
node/zlib.d.ts CHANGED
@@ -18,7 +18,7 @@ declare module "zlib" {
18
18
  level?: number; // compression only
19
19
  memLevel?: number; // compression only
20
20
  strategy?: number; // compression only
21
- dictionary?: Buffer | NodeJS.TypedArray | DataView | ArrayBuffer; // deflate/inflate only, empty dictionary by default
21
+ dictionary?: NodeJS.TypedArray | DataView | ArrayBuffer; // deflate/inflate only, empty dictionary by default
22
22
  }
23
23
 
24
24
  interface BrotliOptions {
@@ -79,7 +79,7 @@ declare module "zlib" {
79
79
  function createInflateRaw(options?: ZlibOptions): InflateRaw;
80
80
  function createUnzip(options?: ZlibOptions): Unzip;
81
81
 
82
- type InputType = string | Buffer | DataView | ArrayBuffer | NodeJS.TypedArray;
82
+ type InputType = string | DataView | ArrayBuffer | NodeJS.TypedArray;
83
83
 
84
84
  type CompressCallback = (error: Error | null, result: Buffer) => void;
85
85