vue3-core/packages/compiler-sfc/src/index.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

90 lines
2.5 KiB
TypeScript
Raw Normal View History

export const version: string = __VERSION__
2019-11-07 10:58:15 +08:00
// API
export { parse } from './parse'
2019-11-07 10:58:15 +08:00
export { compileTemplate } from './compileTemplate'
export { compileStyle, compileStyleAsync } from './compileStyle'
export { compileScript } from './compileScript'
export { rewriteDefault, rewriteDefaultAST } from './rewriteDefault'
export { resolveTypeElements, inferRuntimeType } from './script/resolveType'
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>
// error messages
import {
DOMErrorMessages,
errorMessages as coreErrorMessages,
} from '@vue/compiler-dom'
export const errorMessages: Record<number, string> = {
...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 }
// 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
// Internals for type resolution
export { invalidateTypeCache, registerTS } from './script/resolveType'
export { extractRuntimeProps } from './script/defineProps'
export { extractRuntimeEmits } from './script/defineEmits'
2019-11-07 10:58:15 +08:00
// Types
export type {
2019-11-07 10:58:15 +08:00
SFCParseOptions,
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'
export type {
TemplateCompiler,
2019-12-14 00:24:09 +08:00
SFCTemplateCompileOptions,
SFCTemplateCompileResults,
} from './compileTemplate'
export type {
SFCStyleCompileOptions,
SFCAsyncStyleCompileOptions,
SFCStyleCompileResults,
} from './compileStyle'
export type { SFCScriptCompileOptions } from './compileScript'
export type { ScriptCompileContext } from './script/context'
export type {
TypeResolveContext,
SimpleTypeResolveOptions,
SimpleTypeResolveContext,
} from './script/resolveType'
export type {
AssetURLOptions,
AssetURLTagConfig,
} from './template/transformAssetUrl'
export type {
CompilerOptions,
CompilerError,
BindingMetadata,
} from '@vue/compiler-core'
/**
* @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