Installation
npm install --save @types/babylon
Summary
This package contains type definitions for babylon (https://github.com/babel/babylon).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babylon.
import { File, Expression } from 'babel-types';
export function parse(code: string, opts?: BabylonOptions): File;
export function parseExpression(input: string, options?: BabylonOptions): Expression;
export interface BabylonOptions {
allowImportExportEverywhere?: boolean | undefined;
allowReturnOutsideFunction?: boolean | undefined;
allowSuperOutsideMethod?: boolean | undefined;
sourceType?: 'script' | 'module' | undefined;
sourceFilename?: string | undefined;
plugins?: PluginName[] | undefined;
}
export type PluginName =
'estree' |
'jsx' |
'flow' |
'typescript' |
'classConstructorCall' |
'doExpressions' |
'objectRestSpread' |
'decorators' |
'classProperties' |
'exportExtensions' |
'asyncGenerators' |
'functionBind' |
'functionSent' |
'dynamicImport';
Additional Details
- Last updated: Tue, 06 Jul 2021 18:05:41 GMT
- Dependencies: @types/babel-types
- Global values: none
Credits
These definitions were written by Troy Gerwien, and Marvin Hagemeister.