Browse Source

feat(types): re-expose resolve asset utitlies and registerRuntimeCompiler in type definitions

close #1109
Evan You 6 năm trước cách đây
mục cha
commit
64ef7c76bf

+ 0 - 1
packages/runtime-core/src/component.ts

@@ -549,7 +549,6 @@ let compile: CompileFunction | undefined
 /**
  * For runtime-dom to register the compiler.
  * Note the exported method uses any to avoid d.ts relying on the compiler types.
- * @internal
  */
 export function registerRuntimeCompiler(_compile: any) {
   compile = _compile

+ 0 - 9
packages/runtime-core/src/helpers/resolveAssets.ts

@@ -12,18 +12,12 @@ import { warn } from '../warning'
 const COMPONENTS = 'components'
 const DIRECTIVES = 'directives'
 
-/**
- * @internal
- */
 export function resolveComponent(name: string): Component | string | undefined {
   return resolveAsset(COMPONENTS, name) || name
 }
 
 export const NULL_DYNAMIC_COMPONENT = Symbol()
 
-/**
- * @internal
- */
 export function resolveDynamicComponent(
   component: unknown
 ): Component | string | typeof NULL_DYNAMIC_COMPONENT {
@@ -35,9 +29,6 @@ export function resolveDynamicComponent(
   }
 }
 
-/**
- * @internal
- */
 export function resolveDirective(name: string): Directive | undefined {
   return resolveAsset(DIRECTIVES, name)
 }

+ 7 - 7
packages/runtime-core/src/index.ts

@@ -81,6 +81,13 @@ export {
   callWithAsyncErrorHandling,
   ErrorCodes
 } from './errorHandling'
+export {
+  resolveComponent,
+  resolveDirective,
+  resolveDynamicComponent
+} from './helpers/resolveAssets'
+// For integration with runtime compiler
+export { registerRuntimeCompiler } from './component'
 export {
   useTransitionState,
   resolveTransitionHooks,
@@ -204,11 +211,6 @@ export { HMRRuntime } from './hmr'
 // For compiler generated code
 // should sync with '@vue/compiler-core/src/runtimeConstants.ts'
 export { withCtx } from './helpers/withRenderContext'
-export {
-  resolveComponent,
-  resolveDirective,
-  resolveDynamicComponent
-} from './helpers/resolveAssets'
 export { renderList } from './helpers/renderList'
 export { toHandlers } from './helpers/toHandlers'
 export { renderSlot } from './helpers/renderSlot'
@@ -236,8 +238,6 @@ const _toDisplayString = toDisplayString
 const _camelize = camelize
 export { _toDisplayString as toDisplayString, _camelize as camelize }
 
-// For integration with runtime compiler
-export { registerRuntimeCompiler } from './component'
 // For test-utils
 export { transformVNodeArgs } from './vnode'