mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-04 04:01:52 +00:00
Merge pull request #17559 from brianjleeofcl/master
[node] Add missing properties in util.promisify and util.inspect
This commit is contained in:
Vendored
+16
-3
@@ -3953,8 +3953,18 @@ declare module "util" {
|
||||
export function puts(...param: any[]): void;
|
||||
export function print(...param: any[]): void;
|
||||
export function log(string: string): void;
|
||||
export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string;
|
||||
export function inspect(object: any, options: InspectOptions): string;
|
||||
export var inspect: {
|
||||
(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string;
|
||||
(object: any, options: InspectOptions): string;
|
||||
colors: {
|
||||
[color: string]: [number, number]
|
||||
}
|
||||
styles: {
|
||||
[style: string]: string
|
||||
}
|
||||
defaultOptions: InspectOptions;
|
||||
custom: symbol;
|
||||
}
|
||||
export function isArray(object: any): object is any[];
|
||||
export function isRegExp(object: any): object is RegExp;
|
||||
export function isDate(object: any): object is Date;
|
||||
@@ -3973,7 +3983,10 @@ declare module "util" {
|
||||
export function isSymbol(object: any): object is symbol;
|
||||
export function isUndefined(object: any): object is undefined;
|
||||
export function deprecate(fn: Function, message: string): Function;
|
||||
export function promisify(fn: Function): Function;
|
||||
export var promisify: {
|
||||
(fn: Function): Function;
|
||||
custom: symbol
|
||||
}
|
||||
}
|
||||
|
||||
declare module "assert" {
|
||||
|
||||
@@ -556,6 +556,11 @@ namespace util_tests {
|
||||
maxArrayLength: null,
|
||||
breakLength: Infinity
|
||||
})
|
||||
assert(typeof util.inspect.custom === 'symbol')
|
||||
// util.promisify
|
||||
var readPromised = util.promisify(fs.readFile)
|
||||
var sampleRead: Promise<any> = readPromised(__filename).then((data: string): void => {}).catch((error: Error): void => {})
|
||||
assert(typeof util.promisify.custom === 'symbol')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user