From d683787c3ee4a2228672479a2b3951264704335c Mon Sep 17 00:00:00 2001 From: liuxingbaoyu <30521560+liuxingbaoyu@users.noreply.github.com> Date: Sun, 30 Oct 2022 20:55:09 +0800 Subject: [PATCH] improve --- packages/babel-parser/typings/babel-parser.d.ts | 13 ++++--------- .../babel-parser/typings/babel-parser.source.d.ts | 7 ++----- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/packages/babel-parser/typings/babel-parser.d.ts b/packages/babel-parser/typings/babel-parser.d.ts index 9f4cbcca9c6f..aedf2c5714bb 100644 --- a/packages/babel-parser/typings/babel-parser.d.ts +++ b/packages/babel-parser/typings/babel-parser.d.ts @@ -41,9 +41,9 @@ type Plugin = | "throwExpressions" | "topLevelAwait" | "v8intrinsic" - | ParserPluginWithOptions$1[0]; + | ParserPluginWithOptions[0]; -type ParserPluginWithOptions$1 = +type ParserPluginWithOptions = | ["decorators", DecoratorsPluginOptions] | ["estree", { classFeatures?: boolean }] // @deprecated @@ -53,7 +53,7 @@ type ParserPluginWithOptions$1 = | ["flow", FlowPluginOptions] | ["typescript", TypeScriptPluginOptions]; -type PluginConfig = Plugin | ParserPluginWithOptions$1; +type PluginConfig = Plugin | ParserPluginWithOptions; interface DecoratorsPluginOptions { decoratorsBeforeExport?: boolean; @@ -206,11 +206,6 @@ interface ParserOptions { createParenthesizedExpressions?: boolean; } -type ParserPluginWithOptions = - ParserPluginWithOptions$1; - -type ParserPlugin = PluginConfig; - declare const tokTypes: { // todo(flow->ts) real token type @@ -226,4 +221,4 @@ type ParseResult = Result & { errors: ParseError[]; }; -export { DecoratorsPluginOptions, FlowPluginOptions, ParseError, ParserOptions, ParserPlugin, ParserPluginWithOptions, PipelineOperatorPluginOptions, RecordAndTuplePluginOptions, TypeScriptPluginOptions, parse, parseExpression, tokTypes }; +export { DecoratorsPluginOptions, FlowPluginOptions, ParseError, ParserOptions, PluginConfig as ParserPlugin, ParserPluginWithOptions, PipelineOperatorPluginOptions, RecordAndTuplePluginOptions, TypeScriptPluginOptions, parse, parseExpression, tokTypes }; diff --git a/packages/babel-parser/typings/babel-parser.source.d.ts b/packages/babel-parser/typings/babel-parser.source.d.ts index fad98b6bd42c..025d77661306 100644 --- a/packages/babel-parser/typings/babel-parser.source.d.ts +++ b/packages/babel-parser/typings/babel-parser.source.d.ts @@ -125,12 +125,9 @@ export interface ParserOptions { createParenthesizedExpressions?: boolean; } -export type ParserPluginWithOptions = - import("../src/typings").ParserPluginWithOptions; - -export type ParserPlugin = import("../src/typings").PluginConfig; - export type { + PluginConfig as ParserPlugin, + ParserPluginWithOptions, DecoratorsPluginOptions, PipelineOperatorPluginOptions, RecordAndTuplePluginOptions,