Skip to content

Commit 64ef7c7

Browse files
committed
feat(types): re-expose resolve asset utitlies and registerRuntimeCompiler in type definitions
close #1109
1 parent bc1f097 commit 64ef7c7

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

packages/runtime-core/src/component.ts

-1
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,6 @@ let compile: CompileFunction | undefined
549549
/**
550550
* For runtime-dom to register the compiler.
551551
* Note the exported method uses any to avoid d.ts relying on the compiler types.
552-
* @internal
553552
*/
554553
export function registerRuntimeCompiler(_compile: any) {
555554
compile = _compile

packages/runtime-core/src/helpers/resolveAssets.ts

-9
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,12 @@ import { warn } from '../warning'
1212
const COMPONENTS = 'components'
1313
const DIRECTIVES = 'directives'
1414

15-
/**
16-
* @internal
17-
*/
1815
export function resolveComponent(name: string): Component | string | undefined {
1916
return resolveAsset(COMPONENTS, name) || name
2017
}
2118

2219
export const NULL_DYNAMIC_COMPONENT = Symbol()
2320

24-
/**
25-
* @internal
26-
*/
2721
export function resolveDynamicComponent(
2822
component: unknown
2923
): Component | string | typeof NULL_DYNAMIC_COMPONENT {
@@ -35,9 +29,6 @@ export function resolveDynamicComponent(
3529
}
3630
}
3731

38-
/**
39-
* @internal
40-
*/
4132
export function resolveDirective(name: string): Directive | undefined {
4233
return resolveAsset(DIRECTIVES, name)
4334
}

packages/runtime-core/src/index.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ export {
8181
callWithAsyncErrorHandling,
8282
ErrorCodes
8383
} from './errorHandling'
84+
export {
85+
resolveComponent,
86+
resolveDirective,
87+
resolveDynamicComponent
88+
} from './helpers/resolveAssets'
89+
// For integration with runtime compiler
90+
export { registerRuntimeCompiler } from './component'
8491
export {
8592
useTransitionState,
8693
resolveTransitionHooks,
@@ -204,11 +211,6 @@ export { HMRRuntime } from './hmr'
204211
// For compiler generated code
205212
// should sync with '@vue/compiler-core/src/runtimeConstants.ts'
206213
export { withCtx } from './helpers/withRenderContext'
207-
export {
208-
resolveComponent,
209-
resolveDirective,
210-
resolveDynamicComponent
211-
} from './helpers/resolveAssets'
212214
export { renderList } from './helpers/renderList'
213215
export { toHandlers } from './helpers/toHandlers'
214216
export { renderSlot } from './helpers/renderSlot'
@@ -236,8 +238,6 @@ const _toDisplayString = toDisplayString
236238
const _camelize = camelize
237239
export { _toDisplayString as toDisplayString, _camelize as camelize }
238240

239-
// For integration with runtime compiler
240-
export { registerRuntimeCompiler } from './component'
241241
// For test-utils
242242
export { transformVNodeArgs } from './vnode'
243243

0 commit comments

Comments
 (0)