import { BindingTypes, UNREF, isFunctionType, unwrapTSNode, walkIdentifiers, } from '@vue/compiler-dom' import { DEFAULT_FILENAME, type SFCDescriptor, type SFCScriptBlock, } from './parse' import type { ParserPlugin } from '@babel/parser' import { generateCodeFrame } from '@vue/shared' import type { ArrayPattern, CallExpression, Declaration, ExportSpecifier, Identifier, Node, ObjectPattern, Statement, } from '@babel/types' import { walk } from 'estree-walker' import type { RawSourceMap } from 'source-map-js' import { normalScriptDefaultVar, processNormalScript, } from './script/normalScript' import { CSS_VARS_HELPER, genCssVarsCode } from './style/cssVars' import { type SFCTemplateCompileOptions, compileTemplate, } from './compileTemplate' import { warnOnce } from './warn' import { transformDestructuredProps } from './script/definePropsDestructure' import { ScriptCompileContext } from './script/context' import { DEFINE_PROPS, WITH_DEFAULTS, genRuntimeProps, processDefineProps, } from './script/defineProps' import { DEFINE_EMITS, genRuntimeEmits, processDefineEmits, } from './script/defineEmits' import { DEFINE_EXPOSE, processDefineExpose } from './script/defineExpose' import { DEFINE_OPTIONS, processDefineOptions } from './script/defineOptions' import { processDefineSlots } from './script/defineSlots' import { DEFINE_MODEL, processDefineModel } from './script/defineModel' import { getImportedName, isCallOf, isLiteralNode } from './script/utils' import { analyzeScriptBindings } from './script/analyzeScriptBindings' import { isImportUsed } from './script/importUsageCheck' import { processAwait } from './script/topLevelAwait' export interface SFCScriptCompileOptions { /** * Scope ID for prefixing injected CSS variables. * This must be consistent with the `id` passed to `compileStyle`. */ id: string /** * Production mode. Used to determine whether to generate hashed CSS variables */ isProd?: boolean /** * Enable/disable source map. Defaults to true. */ sourceMap?: boolean /** * https://babeljs.io/docs/en/babel-parser#plugins */ babelParserPlugins?: ParserPlugin[] /** * A list of files to parse for global types to be made available for type * resolving in SFC macros. The list must be fully resolved file system paths. */ globalTypeFiles?: string[] /** * Compile the template and inline the resulting render function * directly inside setup(). * - Only affects `