mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-16 11:02:11 +08:00
Fix babel-traverse buildCodeFrameError signature (#11654)
The Error argument is not an error instance, instead it is a constructor function that returns an error instance. Additionally, the constructor function is optional, by default SyntaxError is used
This commit is contained in:
committed by
Masahiro Wakame
parent
f3bafd505e
commit
e41b464073
2
babel-traverse/babel-traverse.d.ts
vendored
2
babel-traverse/babel-traverse.d.ts
vendored
@@ -346,7 +346,7 @@ declare module "babel-traverse" {
|
||||
|
||||
getData(key: string, def?: any): any;
|
||||
|
||||
buildCodeFrameError(msg: string, Error: Error): Error;
|
||||
buildCodeFrameError<TError extends Error>(msg: string, Error?: new (msg: string) => TError): TError;
|
||||
|
||||
traverse(visitor: Visitor, state?: any): void;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user