Skip to content

Commit

Permalink
add types
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxingbaoyu committed Jul 3, 2023
1 parent a179ce9 commit 3d7ebd5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/babel-parser/data/schema.json
Expand Up @@ -69,7 +69,7 @@
"type": "boolean"
},
"createImportExpression": {
"description": "By default, `import(foo)` is parsed as `CallExpression(Import, [Identifier(foo)])`.\nSet this to true to parse it as an ImportExpression node",
"description": "By default, `import(foo)` is parsed as `CallExpression(Import, [Identifier(foo)])`.\nSet this to true to parse it as an `ImportExpression` node.",
"type": "boolean",
"default": false
},
Expand Down
6 changes: 6 additions & 0 deletions packages/babel-parser/typings/babel-parser.d.ts
Expand Up @@ -219,6 +219,12 @@ interface ParserOptions {
* AST nodes instead of using the `extra` property.
*/
createParenthesizedExpressions?: boolean;

/**
* By default, `import(foo)` is parsed as `CallExpression(Import, [Identifier(foo)])`.
* Set this to true to parse it as an `ImportExpression` node.
*/
createImportExpression?: boolean;
}

type ParserPlugin = PluginConfig;
Expand Down
6 changes: 6 additions & 0 deletions packages/babel-parser/typings/babel-parser.source.d.ts
Expand Up @@ -135,6 +135,12 @@ export interface ParserOptions {
* AST nodes instead of using the `extra` property.
*/
createParenthesizedExpressions?: boolean;

/**
* By default, `import(foo)` is parsed as `CallExpression(Import, [Identifier(foo)])`.
* Set this to true to parse it as an `ImportExpression` node.
*/
createImportExpression?: boolean;
}

export type ParserPlugin = import("../src/typings").PluginConfig;
Expand Down

0 comments on commit 3d7ebd5

Please sign in to comment.