[Node] console.dir() options (#16961)

* [Node] console.dir() options

* [Node] v6 console.dir() options as InspectOptions

* [Node] v4 console.dir() options as InspectOptions

* [Node]  v0 console.dir() options as InspectOptions

Adds Console interface and its absent variable declaration
This commit is contained in:
hinell
2017-06-05 16:39:46 -07:00
committed by Mohamed Hegazy
parent 366b90184f
commit aba45c2c7f
4 changed files with 59 additions and 36 deletions
+12 -11
View File
@@ -17,7 +17,7 @@
interface Console {
Console: NodeJS.ConsoleConstructor;
assert(value: any, message?: string, ...optionalParams: any[]): void;
dir(obj: any, options?: {showHidden?: boolean, depth?: number, colors?: boolean}): void;
dir(obj: any, options?: NodeJS.InspectOptions): void;
error(message?: any, ...optionalParams: any[]): void;
info(message?: any, ...optionalParams: any[]): void;
log(message?: any, ...optionalParams: any[]): void;
@@ -262,6 +262,16 @@ declare var Buffer: {
* *
************************************************/
declare namespace NodeJS {
export interface InspectOptions {
showHidden?: boolean;
depth?: number | null;
colors?: boolean;
customInspect?: boolean;
showProxy?: boolean;
maxArrayLength?: number | null;
breakLength?: number;
}
export interface ConsoleConstructor {
prototype: Console;
new(stdout: WritableStream, stderr?: WritableStream): Console;
@@ -3779,16 +3789,7 @@ declare module "stream" {
}
declare module "util" {
export interface InspectOptions {
showHidden?: boolean;
depth?: number | null;
colors?: boolean;
customInspect?: boolean;
showProxy?: boolean;
maxArrayLength?: number | null;
breakLength?: number;
}
export interface InspectOptions extends NodeJS.InspectOptions {}
export function format(format: any, ...param: any[]): string;
export function debug(string: string): void;
export function error(...param: any[]): void;
+26 -7
View File
@@ -9,6 +9,24 @@
* *
************************************************/
interface Console {
Console: {
prototype: Console,
new(stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream): Console;
};
assert(value: any, message?: string, ...optionalParams: any[]): void;
dir(obj: any, options?: NodeJS.InspectOptions): void;
error(message?: any, ...optionalParams: any[]): void;
info(message?: any, ...optionalParams: any[]): void;
log(message?: any, ...optionalParams: any[]): void;
time(label: string): void;
timeEnd(label: string): void;
trace(message?: any, ...optionalParams: any[]): void;
warn(message?: any, ...optionalParams: any[]): void;
}
declare var console: Console;
interface Error {
stack?: string;
}
@@ -159,6 +177,13 @@ declare var Buffer: {
* *
************************************************/
declare namespace NodeJS {
export interface InspectOptions {
showHidden?: boolean;
depth?: number | null;
colors?: boolean;
customInspect?: boolean;
}
export interface ErrnoException extends Error {
errno?: number;
code?: string;
@@ -1791,13 +1816,7 @@ declare module "stream" {
}
declare module "util" {
export interface InspectOptions {
showHidden?: boolean;
depth?: number | null;
colors?: boolean;
customInspect?: boolean;
}
export interface InspectOptions extends NodeJS.InspectOptions {}
export function format(format: any, ...param: any[]): string;
export function debug(string: string): void;
export function error(...param: any[]): void;
+9 -7
View File
@@ -16,7 +16,7 @@ interface Console {
new(stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream): Console;
};
assert(value: any, message?: string, ...optionalParams: any[]): void;
dir(obj: any, options?: {showHidden?: boolean, depth?: number, colors?: boolean}): void;
dir(obj: any, options?: NodeJS.InspectOptions): void;
error(message?: any, ...optionalParams: any[]): void;
info(message?: any, ...optionalParams: any[]): void;
log(message?: any, ...optionalParams: any[]): void;
@@ -228,6 +228,13 @@ declare var Buffer: {
* *
************************************************/
declare namespace NodeJS {
export interface InspectOptions {
showHidden?: boolean;
depth?: number | null;
colors?: boolean;
customInspect?: boolean;
}
export interface ErrnoException extends Error {
errno?: number;
code?: string;
@@ -2237,13 +2244,8 @@ declare module "stream" {
}
declare module "util" {
export interface InspectOptions {
showHidden?: boolean;
depth?: number | null;
colors?: boolean;
customInspect?: boolean;
}
export interface InspectOptions extends NodeJS.InspectOptions {}
export function format(format: any, ...param: any[]): string;
export function debug(string: string): void;
export function error(...param: any[]): void;
+12 -11
View File
@@ -13,7 +13,7 @@
interface Console {
Console: typeof NodeJS.Console;
assert(value: any, message?: string, ...optionalParams: any[]): void;
dir(obj: any, options?: {showHidden?: boolean, depth?: number, colors?: boolean}): void;
dir(obj: any, options?: NodeJS.InspectOptions): void;
error(message?: any, ...optionalParams: any[]): void;
info(message?: any, ...optionalParams: any[]): void;
log(message?: any, ...optionalParams: any[]): void;
@@ -247,6 +247,16 @@ declare var Buffer: {
* *
************************************************/
declare namespace NodeJS {
export interface InspectOptions {
showHidden?: boolean;
depth?: number | null;
colors?: boolean;
customInspect?: boolean;
showProxy?: boolean;
maxArrayLength?: number | null;
breakLength?: number;
}
export var Console: {
prototype: Console;
new(stdout: WritableStream, stderr?: WritableStream): Console;
@@ -3632,16 +3642,7 @@ declare module "stream" {
}
declare module "util" {
export interface InspectOptions {
showHidden?: boolean;
depth?: number | null;
colors?: boolean;
customInspect?: boolean;
showProxy?: boolean;
maxArrayLength?: number | null;
breakLength?: number;
}
export interface InspectOptions extends NodeJS.InspectOptions {}
export function format(format: any, ...param: any[]): string;
export function debug(string: string): void;
export function error(...param: any[]): void;