diff --git a/types/node/test/util.ts b/types/node/test/util.ts index 4c34279af6..abf7c81025 100644 --- a/types/node/test/util.ts +++ b/types/node/test/util.ts @@ -127,8 +127,10 @@ import { readFile } from 'fs'; const foo = () => {}; // $ExpectType () => void util.deprecate(foo, 'foo() is deprecated, use bar() instead'); - // $ExpectType (fn: T, message: string) => T + // $ExpectType (fn: T, message: string, code?: string | undefined) => T util.deprecate(util.deprecate, 'deprecate() is deprecated, use bar() instead'); + // $ExpectType (fn: T, message: string, code?: string | undefined) => T + util.deprecate(util.deprecate, 'deprecate() is deprecated, use bar() instead', 'DEP0001'); // util.isDeepStrictEqual util.isDeepStrictEqual({foo: 'bar'}, {foo: 'bar'}); diff --git a/types/node/util.d.ts b/types/node/util.d.ts index 95131cb28d..2e7b157d63 100644 --- a/types/node/util.d.ts +++ b/types/node/util.d.ts @@ -51,7 +51,7 @@ declare module "util" { function isSymbol(object: any): object is symbol; /** @deprecated since v4.0.0 - use `value === undefined` instead. */ function isUndefined(object: any): object is undefined; - function deprecate(fn: T, message: string): T; + function deprecate(fn: T, message: string, code?: string): T; function isDeepStrictEqual(val1: any, val2: any): boolean; interface CustomPromisify extends Function { diff --git a/types/node/v10/node-tests.ts b/types/node/v10/node-tests.ts index b6b545819b..5b5a78bc41 100644 --- a/types/node/v10/node-tests.ts +++ b/types/node/v10/node-tests.ts @@ -946,8 +946,10 @@ function bufferTests() { const foo = () => {}; // $ExpectType () => void util.deprecate(foo, 'foo() is deprecated, use bar() instead'); - // $ExpectType (fn: T, message: string) => T + // $ExpectType (fn: T, message: string, code?: string) => T util.deprecate(util.deprecate, 'deprecate() is deprecated, use bar() instead'); + // $ExpectType (fn: T, message: string, code?: string) => T + util.deprecate(util.deprecate, 'deprecate() is deprecated, use bar() instead', 'DEP0001'); // util.isDeepStrictEqual util.isDeepStrictEqual({foo: 'bar'}, {foo: 'bar'}); diff --git a/types/node/v10/util.d.ts b/types/node/v10/util.d.ts index 067dc048c3..147338a786 100644 --- a/types/node/v10/util.d.ts +++ b/types/node/v10/util.d.ts @@ -55,7 +55,7 @@ declare module "util" { function isSymbol(object: any): object is symbol; /** @deprecated since v4.0.0 - use `value === undefined` instead. */ function isUndefined(object: any): object is undefined; - function deprecate(fn: T, message: string): T; + function deprecate(fn: T, message: string, code?: string): T; function isDeepStrictEqual(val1: any, val2: any): boolean; interface CustomPromisify extends Function { diff --git a/types/node/v8/base.d.ts b/types/node/v8/base.d.ts index 2c80ce48ab..cfc6b76217 100644 --- a/types/node/v8/base.d.ts +++ b/types/node/v8/base.d.ts @@ -5658,7 +5658,7 @@ declare module "util" { export function isString(object: any): object is string; export function isSymbol(object: any): object is symbol; export function isUndefined(object: any): object is undefined; - export function deprecate(fn: T, message: string): T; + export function deprecate(fn: T, message: string, code?: string): T; export interface CustomPromisify extends Function { __promisify__: TCustom; diff --git a/types/node/v8/node-tests.ts b/types/node/v8/node-tests.ts index a6b671550f..156d9f9180 100644 --- a/types/node/v8/node-tests.ts +++ b/types/node/v8/node-tests.ts @@ -843,8 +843,10 @@ namespace util_tests { const foo = () => {}; // $ExpectType () => void util.deprecate(foo, 'foo() is deprecated, use bar() instead'); - // $ExpectType (fn: T, message: string) => T + // $ExpectType (fn: T, message: string, code?: string) => T util.deprecate(util.deprecate, 'deprecate() is deprecated, use bar() instead'); + // $ExpectType (fn: T, message: string, code?: string) => T + util.deprecate(util.deprecate, 'deprecate() is deprecated, use bar() instead', 'DEP0001'); // util.TextDecoder() var td = new util.TextDecoder(); diff --git a/types/node/v8/ts3.2/node-tests.ts b/types/node/v8/ts3.2/node-tests.ts index 27040c939d..191469bb65 100644 --- a/types/node/v8/ts3.2/node-tests.ts +++ b/types/node/v8/ts3.2/node-tests.ts @@ -843,8 +843,10 @@ namespace util_tests { const foo = () => {}; // $ExpectType () => void util.deprecate(foo, 'foo() is deprecated, use bar() instead'); - // $ExpectType (fn: T, message: string) => T + // $ExpectType (fn: T, message: string, code?: string) => T util.deprecate(util.deprecate, 'deprecate() is deprecated, use bar() instead'); + // $ExpectType (fn: T, message: string, code?: string) => T + util.deprecate(util.deprecate, 'deprecate() is deprecated, use bar() instead', 'DEP0001'); // util.TextDecoder() var td = new util.TextDecoder();