diff --git a/packages/babel-parser/typings/babel-parser.d.ts b/packages/babel-parser/typings/babel-parser.d.ts index 26907c0bc9..3f65949cee 100644 --- a/packages/babel-parser/typings/babel-parser.d.ts +++ b/packages/babel-parser/typings/babel-parser.d.ts @@ -11,7 +11,7 @@ export function parse( input: string, options?: ParserOptions -): import("@babel/types").File; +): ParseResult; /** * Parse the provided code as a single expression. @@ -19,7 +19,7 @@ export function parse( export function parseExpression( input: string, options?: ParserOptions -): import("@babel/types").Expression; +): ParseResult; export interface ParserOptions { /** @@ -180,3 +180,12 @@ export const tokTypes: { // todo(flow->ts) real token type [name: string]: any; }; + +export interface ParseError { + code: string; + reasonCode: string; +} + +type ParseResult = Result & { + errors: ParseError[]; +};