1
- // Type definitions for Node.js 8.5 .x
1
+ // Type definitions for Node.js 9.3 .x
2
2
// Project: http://nodejs.org/
3
3
// Definitions by: Microsoft TypeScript <http://typescriptlang.org>
4
4
// DefinitelyTyped <https://github.com/DefinitelyTyped/DefinitelyTyped>
20
20
// Klaus Meinhardt <https://github.com/ajafff>
21
21
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
22
22
23
- /************************************************
24
- * *
25
- * Node.js v8.5.x API *
26
- * *
27
- ************************************************/
28
-
29
23
/** inspector module types */
30
24
/// <reference path="./inspector.d.ts" />
31
25
@@ -34,6 +28,7 @@ interface Console {
34
28
Console : NodeJS . ConsoleConstructor ;
35
29
assert ( value : any , message ?: string , ...optionalParams : any [ ] ) : void ;
36
30
dir ( obj : any , options ?: NodeJS . InspectOptions ) : void ;
31
+ debug ( message ?: any , ...optionalParams : any [ ] ) : void ;
37
32
error ( message ?: any , ...optionalParams : any [ ] ) : void ;
38
33
info ( message ?: any , ...optionalParams : any [ ] ) : void ;
39
34
log ( message ?: any , ...optionalParams : any [ ] ) : void ;
@@ -457,7 +452,6 @@ declare namespace NodeJS {
457
452
remove ( emitter : Events ) : void ;
458
453
bind ( cb : ( err : Error , data : any ) => any ) : any ;
459
454
intercept ( cb : ( data : any ) => any ) : any ;
460
- dispose ( ) : void ;
461
455
462
456
addListener ( event : string , listener : ( ...args : any [ ] ) => void ) : this;
463
457
on ( event : string , listener : ( ...args : any [ ] ) => void ) : this;
@@ -512,7 +506,7 @@ declare namespace NodeJS {
512
506
type UnhandledRejectionListener = ( reason : any , promise : Promise < any > ) => void ;
513
507
type WarningListener = ( warning : Error ) => void ;
514
508
type MessageListener = ( message : any , sendHandle : any ) => void ;
515
- type SignalsListener = ( ) => void ;
509
+ type SignalsListener = ( signal : Signals ) => void ;
516
510
type NewListenerListener = ( type : string | symbol , listener : ( ...args : any [ ] ) => void ) => void ;
517
511
type RemoveListenerListener = ( type : string | symbol , listener : ( ...args : any [ ] ) => void ) => void ;
518
512
@@ -525,6 +519,7 @@ declare namespace NodeJS {
525
519
}
526
520
527
521
export interface WriteStream extends Socket {
522
+ readonly writableHighWaterMark : number ;
528
523
columns ?: number ;
529
524
rows ?: number ;
530
525
_write ( chunk : any , encoding : string , callback : Function ) : void ;
@@ -536,6 +531,7 @@ declare namespace NodeJS {
536
531
destroy ( error ?: Error ) : void ;
537
532
}
538
533
export interface ReadStream extends Socket {
534
+ readonly readableHighWaterMark : number ;
539
535
isRaw ?: boolean ;
540
536
setRawMode ?( mode : boolean ) : void ;
541
537
_read ( size : number ) : void ;
@@ -570,6 +566,8 @@ declare namespace NodeJS {
570
566
setegid ( id : number | string ) : void ;
571
567
getgroups ( ) : number [ ] ;
572
568
setgroups ( groups : Array < string | number > ) : void ;
569
+ setUncaughtExceptionCaptureCallback ( cb : ( ( err : Error ) => void ) | null ) : void ;
570
+ hasUncaughtExceptionCaptureCallback ( ) : boolean ;
573
571
version : string ;
574
572
versions : ProcessVersions ;
575
573
config : {
@@ -600,6 +598,7 @@ declare namespace NodeJS {
600
598
} ;
601
599
kill ( pid : number , signal ?: string | number ) : void ;
602
600
pid : number ;
601
+ ppid : number ;
603
602
title : string ;
604
603
arch : string ;
605
604
platform : Platform ;
@@ -790,6 +789,7 @@ declare namespace NodeJS {
790
789
class Module {
791
790
static runMain ( ) : void ;
792
791
static wrap ( code : string ) : string ;
792
+ static builtinModules : string [ ] ;
793
793
794
794
static Module : typeof Module ;
795
795
@@ -1725,7 +1725,7 @@ declare module "os" {
1725
1725
export function arch ( ) : string ;
1726
1726
export function platform ( ) : NodeJS . Platform ;
1727
1727
export function tmpdir ( ) : string ;
1728
- export var EOL : string ;
1728
+ export const EOL : string ;
1729
1729
export function endianness ( ) : "BE" | "LE" ;
1730
1730
}
1731
1731
@@ -3514,6 +3514,11 @@ declare module "fs" {
3514
3514
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
3515
3515
*/
3516
3516
export function __promisify__ ( path : PathLike , options ?: { encoding ?: string | null } | string | null ) : Promise < string | Buffer > ;
3517
+
3518
+ export function native ( path : PathLike , options : { encoding ?: BufferEncoding | null } | BufferEncoding | undefined | null , callback : ( err : NodeJS . ErrnoException , resolvedPath : string ) => void ) : void ;
3519
+ export function native ( path : PathLike , options : { encoding : "buffer" } | "buffer" , callback : ( err : NodeJS . ErrnoException , resolvedPath : Buffer ) => void ) : void ;
3520
+ export function native ( path : PathLike , options : { encoding ?: string | null } | string | undefined | null , callback : ( err : NodeJS . ErrnoException , resolvedPath : string | Buffer ) => void ) : void ;
3521
+ export function native ( path : PathLike , callback : ( err : NodeJS . ErrnoException , resolvedPath : string ) => void ) : void ;
3517
3522
}
3518
3523
3519
3524
/**
@@ -3537,6 +3542,12 @@ declare module "fs" {
3537
3542
*/
3538
3543
export function realpathSync ( path : PathLike , options ?: { encoding ?: string | null } | string | null ) : string | Buffer ;
3539
3544
3545
+ export namespace realpathSync {
3546
+ export function native ( path : PathLike , options ?: { encoding ?: BufferEncoding | null } | BufferEncoding | null ) : string ;
3547
+ export function native ( path : PathLike , options : { encoding : "buffer" } | "buffer" ) : Buffer ;
3548
+ export function native ( path : PathLike , options ?: { encoding ?: string | null } | string | null ) : string | Buffer ;
3549
+ }
3550
+
3540
3551
/**
3541
3552
* Asynchronous unlink(2) - delete a name and possibly the file it refers to.
3542
3553
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
@@ -5293,6 +5304,7 @@ declare module "stream" {
5293
5304
5294
5305
export class Readable extends Stream implements NodeJS . ReadableStream {
5295
5306
readable : boolean ;
5307
+ readableHighWaterMark : number ;
5296
5308
constructor ( opts ?: ReadableOptions ) ;
5297
5309
_read ( size : number ) : void ;
5298
5310
read ( size ?: number ) : any ;
@@ -5379,6 +5391,7 @@ declare module "stream" {
5379
5391
5380
5392
export class Writable extends Stream implements NodeJS . WritableStream {
5381
5393
writable : boolean ;
5394
+ readonly writableHighWaterMark : number ;
5382
5395
constructor ( opts ?: WritableOptions ) ;
5383
5396
_write ( chunk : any , encoding : string , callback : ( err ?: Error ) => void ) : void ;
5384
5397
_writev ?( chunks : Array < { chunk : any , encoding : string } > , callback : ( err ?: Error ) => void ) : void ;
@@ -5470,6 +5483,7 @@ declare module "stream" {
5470
5483
// Note: Duplex extends both Readable and Writable.
5471
5484
export class Duplex extends Readable implements Writable {
5472
5485
writable : boolean ;
5486
+ readonly writableHighWaterMark : number ;
5473
5487
constructor ( opts ?: DuplexOptions ) ;
5474
5488
_write ( chunk : any , encoding : string , callback : ( err ?: Error ) => void ) : void ;
5475
5489
_writev ?( chunks : Array < { chunk : any , encoding : string } > , callback : ( err ?: Error ) => void ) : void ;
@@ -5649,7 +5663,6 @@ declare module "domain" {
5649
5663
remove ( emitter : events . EventEmitter ) : void ;
5650
5664
bind ( cb : ( err : Error , data : any ) => any ) : any ;
5651
5665
intercept ( cb : ( data : any ) => any ) : any ;
5652
- dispose ( ) : void ;
5653
5666
members : any [ ] ;
5654
5667
enter ( ) : void ;
5655
5668
exit ( ) : void ;
0 commit comments