2024-08-08 23:05:21 +08:00
|
|
|
export const version: string = __VERSION__
|
2023-03-30 16:58:41 +08:00
|
|
|
|
2019-11-07 10:58:15 +08:00
|
|
|
// API
|
2023-11-06 17:35:50 +08:00
|
|
|
export { parse } from './parse'
|
2019-11-07 10:58:15 +08:00
|
|
|
export { compileTemplate } from './compileTemplate'
|
|
|
|
export { compileStyle, compileStyleAsync } from './compileStyle'
|
2021-11-26 14:22:26 +08:00
|
|
|
export { compileScript } from './compileScript'
|
2023-03-28 11:54:22 +08:00
|
|
|
export { rewriteDefault, rewriteDefaultAST } from './rewriteDefault'
|
2023-04-16 11:11:26 +08:00
|
|
|
export { resolveTypeElements, inferRuntimeType } from './script/resolveType'
|
2023-05-19 08:26:44 +08:00
|
|
|
|
2023-11-06 17:35:50 +08:00
|
|
|
import { type SFCParseResult, parseCache as _parseCache } from './parse'
|
|
|
|
// #9521 export parseCache as a simple map to avoid exposing LRU types
|
|
|
|
export const parseCache = _parseCache as Map<string, SFCParseResult>
|
|
|
|
|
2023-12-26 15:06:56 +08:00
|
|
|
// error messages
|
|
|
|
import {
|
|
|
|
DOMErrorMessages,
|
|
|
|
errorMessages as coreErrorMessages,
|
|
|
|
} from '@vue/compiler-dom'
|
|
|
|
|
2024-08-08 23:05:21 +08:00
|
|
|
export const errorMessages: Record<number, string> = {
|
2023-12-26 15:06:56 +08:00
|
|
|
...coreErrorMessages,
|
|
|
|
...DOMErrorMessages,
|
|
|
|
}
|
|
|
|
|
2021-03-28 13:35:45 +08:00
|
|
|
// Utilities
|
|
|
|
export { parse as babelParse } from '@babel/parser'
|
|
|
|
import MagicString from 'magic-string'
|
|
|
|
export { MagicString }
|
2021-09-23 12:13:54 +08:00
|
|
|
// technically internal but we want it in @vue/repl, cast it as any to avoid
|
|
|
|
// relying on estree types
|
|
|
|
import { walk as _walk } from 'estree-walker'
|
|
|
|
export const walk = _walk as any
|
2021-08-24 01:55:06 +08:00
|
|
|
export {
|
|
|
|
generateCodeFrame,
|
|
|
|
walkIdentifiers,
|
|
|
|
extractIdentifiers,
|
|
|
|
isInDestructureAssignment,
|
|
|
|
isStaticProperty,
|
|
|
|
} from '@vue/compiler-core'
|
2021-03-28 13:35:45 +08:00
|
|
|
|
2023-04-14 17:27:50 +08:00
|
|
|
// Internals for type resolution
|
|
|
|
export { invalidateTypeCache, registerTS } from './script/resolveType'
|
2023-09-04 16:59:11 +08:00
|
|
|
export { extractRuntimeProps } from './script/defineProps'
|
|
|
|
export { extractRuntimeEmits } from './script/defineEmits'
|
2023-04-14 17:27:50 +08:00
|
|
|
|
2019-11-07 10:58:15 +08:00
|
|
|
// Types
|
2023-02-02 16:20:32 +08:00
|
|
|
export type {
|
2019-11-07 10:58:15 +08:00
|
|
|
SFCParseOptions,
|
2022-05-10 09:37:59 +08:00
|
|
|
SFCParseResult,
|
2019-11-07 10:58:15 +08:00
|
|
|
SFCDescriptor,
|
|
|
|
SFCBlock,
|
|
|
|
SFCTemplateBlock,
|
|
|
|
SFCScriptBlock,
|
2022-05-10 09:50:12 +08:00
|
|
|
SFCStyleBlock,
|
2019-11-07 10:58:15 +08:00
|
|
|
} from './parse'
|
2023-02-02 16:20:32 +08:00
|
|
|
export type {
|
2019-12-11 22:46:42 +08:00
|
|
|
TemplateCompiler,
|
2019-12-14 00:24:09 +08:00
|
|
|
SFCTemplateCompileOptions,
|
|
|
|
SFCTemplateCompileResults,
|
2019-12-11 22:46:42 +08:00
|
|
|
} from './compileTemplate'
|
2023-02-02 16:20:32 +08:00
|
|
|
export type {
|
2020-04-25 05:11:41 +08:00
|
|
|
SFCStyleCompileOptions,
|
|
|
|
SFCAsyncStyleCompileOptions,
|
|
|
|
SFCStyleCompileResults,
|
|
|
|
} from './compileStyle'
|
2023-02-02 16:20:32 +08:00
|
|
|
export type { SFCScriptCompileOptions } from './compileScript'
|
2023-04-16 11:11:26 +08:00
|
|
|
export type { ScriptCompileContext } from './script/context'
|
|
|
|
export type {
|
|
|
|
TypeResolveContext,
|
2023-09-04 16:59:11 +08:00
|
|
|
SimpleTypeResolveOptions,
|
2023-04-16 11:11:26 +08:00
|
|
|
SimpleTypeResolveContext,
|
|
|
|
} from './script/resolveType'
|
2023-02-02 16:20:32 +08:00
|
|
|
export type {
|
|
|
|
AssetURLOptions,
|
|
|
|
AssetURLTagConfig,
|
2023-04-05 16:35:10 +08:00
|
|
|
} from './template/transformAssetUrl'
|
2023-02-02 16:20:32 +08:00
|
|
|
export type {
|
2019-12-23 08:44:21 +08:00
|
|
|
CompilerOptions,
|
|
|
|
CompilerError,
|
2020-08-27 03:22:11 +08:00
|
|
|
BindingMetadata,
|
2019-12-23 08:44:21 +08:00
|
|
|
} from '@vue/compiler-core'
|
2023-11-25 16:39:30 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @deprecated this is preserved to avoid breaking vite-plugin-vue < 5.0
|
|
|
|
* with reactivityTransform: true. The desired behavior should be silently
|
|
|
|
* ignoring the option instead of breaking.
|
|
|
|
*/
|
|
|
|
export const shouldTransformRef = () => false
|