@@ -3,18 +3,14 @@ import { parseExpression } from '@babel/parser';
33// @ts -expect-error no dts
44import typescript from '@babel/plugin-syntax-typescript' ;
55import {
6- type SFCScriptCompileOptions ,
76 type SimpleTypeResolveContext ,
7+ type SimpleTypeResolveOptions ,
88 extractRuntimeEmits ,
99 extractRuntimeProps ,
1010} from '@vue/compiler-sfc' ;
1111import { codeFrameColumns } from '@babel/code-frame' ;
1212import { addNamed } from '@babel/helper-module-imports' ;
1313
14- export interface Options {
15- compileOptions ?: SFCScriptCompileOptions ;
16- }
17-
1814function getTypeAnnotation ( node : BabelCore . types . Node ) {
1915 if (
2016 'typeAnnotation' in node &&
@@ -27,7 +23,7 @@ function getTypeAnnotation(node: BabelCore.types.Node) {
2723
2824export default ( {
2925 types : t ,
30- } : typeof BabelCore ) : BabelCore . PluginObj < Options > => {
26+ } : typeof BabelCore ) : BabelCore . PluginObj < SimpleTypeResolveOptions > => {
3127 let ctx : SimpleTypeResolveContext | undefined ;
3228 let helpers : Set < string > | undefined ;
3329
@@ -89,7 +85,7 @@ export default ({
8985 ctx = {
9086 filename : filename ,
9187 source : file . code ,
92- options : this . compileOptions || { } ,
88+ options : this || { } ,
9389 ast : file . ast . program . body ,
9490 error ( msg , node ) {
9591 throw new Error (
@@ -115,7 +111,6 @@ export default ({
115111 getString ( node ) {
116112 return file . code . slice ( node . start ! , node . end ! ) ;
117113 } ,
118- bindingMetadata : Object . create ( null ) ,
119114 propsTypeDecl : undefined ,
120115 propsRuntimeDefaults : undefined ,
121116 propsDestructuredBindings : { } ,
0 commit comments