Clearer naming of interfaces

This commit is contained in:
Avi Vahl 2018-06-15 01:12:58 +03:00
parent ca65781132
commit adbf2a15f9

View File

@ -5,10 +5,10 @@
// Avi Vahl <https://github.com/AviVahl> // Avi Vahl <https://github.com/AviVahl>
// TypeScript Version: 2.9 // TypeScript Version: 2.9
export function parse(code: string, opts?: BabelParserOptions): import('@babel/types').File; export function parse(code: string, options?: ParserOptions): import('@babel/types').File;
export function parseExpression(input: string, options?: BabelParserOptions): import('@babel/types').Expression; export function parseExpression(input: string, options?: ParserOptions): import('@babel/types').Expression;
export interface BabelParserOptions { export interface ParserOptions {
/** /**
* By default, import and export declarations can only appear at a program's top level. * By default, import and export declarations can only appear at a program's top level.
* Setting this option to true allows them anywhere where a statement is allowed. * Setting this option to true allows them anywhere where a statement is allowed.
@ -54,7 +54,7 @@ export interface BabelParserOptions {
/** /**
* Array containing the plugins that you want to enable. * Array containing the plugins that you want to enable.
*/ */
plugins?: PluginName[]; plugins?: ParserPlugin[];
/** /**
* Should the parser work in strict mode. * Should the parser work in strict mode.
@ -73,7 +73,7 @@ export interface BabelParserOptions {
tokens?: boolean; tokens?: boolean;
} }
export type PluginName = export type ParserPlugin =
'estree' | 'estree' |
'jsx' | 'jsx' |
'flow' | 'flow' |