mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-12 19:59:02 +08:00
[node] improve util.deprecate() typings, fix tests in v4 & v6 for TS >=2.3 (#18903)
* [node] improve util.deprecate() typings, fix tests in v4 & v6 for TS >=2.3 * [react-measure, react-svg-pan-zoom] fix lint errors * [node] change deprecate() typings in v7, too
This commit is contained in:
committed by
Mohamed Hegazy
parent
8414ffb817
commit
5a3249593e
@@ -643,6 +643,12 @@ namespace util_tests {
|
||||
var readPromised = util.promisify(fs.readFile);
|
||||
var sampleRead: Promise<any> = readPromised(__filename).then((data: Buffer): void => { }).catch((error: Error): void => { });
|
||||
assert(typeof util.promisify.custom === 'symbol');
|
||||
// util.deprecate
|
||||
const foo = () => {};
|
||||
// $ExpectType () => void
|
||||
util.deprecate(foo, 'foo() is deprecated, use bar() instead');
|
||||
// $ExpectType <T extends Function>(fn: T, message: string) => T
|
||||
util.deprecate(util.deprecate, 'deprecate() is deprecated, use bar() instead');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user