mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-10 18:04:18 -05:00
Add console into Node.d.ts
This commit is contained in:
31
src/lib/node.d.ts
vendored
31
src/lib/node.d.ts
vendored
@@ -138,12 +138,39 @@ declare var Buffer: {
|
||||
compare(buf1: NodeJS.Buffer, buf2: NodeJS.Buffer): number;
|
||||
};
|
||||
|
||||
declare namespace console {
|
||||
export function assert(value: boolean, message?: string, ...optionalParams: any[]): void;
|
||||
export function dir(obj: any, ...optionalParams: any[]): void;
|
||||
export function error(data?: any, ...optionalParams: any[]): void;
|
||||
export function info(data?: any, ...optionalParams: any[]): void;
|
||||
export function log(data?: any, ...optionalParams: any[]): void;
|
||||
export function time(label: string): void;
|
||||
export function timeEnd(label: string): void;
|
||||
export function trace(message: any, ...optionalParams: any[]): void;
|
||||
export function warn(data?: any, ...optionalParams: any[]): void;
|
||||
export var Console: {
|
||||
new(stdout: NodeJS.WritableStream, stderr? :NodeJS.WritableStream): NodeJS.Console;
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************
|
||||
* *
|
||||
* GLOBAL INTERFACES *
|
||||
* *
|
||||
************************************************/
|
||||
declare namespace NodeJS {
|
||||
export interface Console {
|
||||
assert(value: boolean, message?: string, ...optionalParams: any[]): void;
|
||||
dir(obj: any, ...optionalParams: any[]): void;
|
||||
error(data?: any, ...optionalParams: any[]): void;
|
||||
info(data?: any, ...optionalParams: any[]): void;
|
||||
log(data?: any, ...optionalParams: any[]): void;
|
||||
time(label: string): void;
|
||||
timeEnd(label: string): void;
|
||||
trace(message: any, ...optionalParams: any[]): void;
|
||||
warn(data?: any, ...optionalParams: any[]): void;
|
||||
}
|
||||
|
||||
export interface ErrnoException extends Error {
|
||||
errno?: number;
|
||||
code?: string;
|
||||
@@ -441,6 +468,10 @@ declare module "buffer" {
|
||||
export { BuffType as Buffer, SlowBuffType as SlowBuffer };
|
||||
}
|
||||
|
||||
declare module "console" {
|
||||
export = console;
|
||||
}
|
||||
|
||||
declare module "querystring" {
|
||||
export interface StringifyOptions {
|
||||
encodeURIComponent?: Function;
|
||||
|
||||
Reference in New Issue
Block a user