From e03e5ba01d711876ec68fc53375616d08c53e1ad Mon Sep 17 00:00:00 2001 From: Yifei Fu Date: Wed, 6 Feb 2019 01:03:54 -0800 Subject: [PATCH] Add TypeScript definitions for parser plugin options. (#9457) --- .../babel-parser/typings/babel-parser.d.ts | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/packages/babel-parser/typings/babel-parser.d.ts b/packages/babel-parser/typings/babel-parser.d.ts index 752fc365f0..b3f745f61a 100644 --- a/packages/babel-parser/typings/babel-parser.d.ts +++ b/packages/babel-parser/typings/babel-parser.d.ts @@ -106,4 +106,22 @@ export type ParserPlugin = 'optionalCatchBinding' | 'throwExpressions' | 'pipelineOperator' | - 'nullishCoalescingOperator'; + 'nullishCoalescingOperator' | + ParserPluginWithOptions; + +export type ParserPluginWithOptions = + ['decorators', DecoratorsPluginOptions] | + ['pipelineOperator', PipelineOperatorPluginOptions] | + ['flow', FlowPluginOptions]; + +export interface DecoratorsPluginOptions { + decoratorsBeforeExport?: boolean; +} + +export interface PipelineOperatorPluginOptions { + proposal: 'minimal' | 'smart'; +} + +export interface FlowPluginOptions { + all?: boolean; +}