Skip to content

Commit

Permalink
improve
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxingbaoyu committed Nov 1, 2022
1 parent c5a692d commit d683787
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
13 changes: 4 additions & 9 deletions packages/babel-parser/typings/babel-parser.d.ts
Expand Up @@ -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
Expand All @@ -53,7 +53,7 @@ type ParserPluginWithOptions$1 =
| ["flow", FlowPluginOptions]
| ["typescript", TypeScriptPluginOptions];

type PluginConfig = Plugin | ParserPluginWithOptions$1;
type PluginConfig = Plugin | ParserPluginWithOptions;

interface DecoratorsPluginOptions {
decoratorsBeforeExport?: boolean;
Expand Down Expand Up @@ -206,11 +206,6 @@ interface ParserOptions {
createParenthesizedExpressions?: boolean;
}

type ParserPluginWithOptions =
ParserPluginWithOptions$1;

type ParserPlugin = PluginConfig;


declare const tokTypes: {
// todo(flow->ts) real token type
Expand All @@ -226,4 +221,4 @@ type ParseResult<Result> = 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 };
7 changes: 2 additions & 5 deletions packages/babel-parser/typings/babel-parser.source.d.ts
Expand Up @@ -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,
Expand Down

0 comments on commit d683787

Please sign in to comment.