Add TypeScript definitions for parser plugin options. (#9457)

This commit is contained in:
Yifei Fu 2019-02-06 01:03:54 -08:00 committed by Nicolò Ribaudo
parent d896ce2b53
commit e03e5ba01d

View File

@ -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;
}