feat(types): adjust type exports for manual render function and tooling usage
- v-model and v-show directives are now exposed as public - compiler-used runtime helpers are now exposed for TS tooling, but marked as @private close #1329
This commit is contained in:
@@ -12,12 +12,18 @@ import { warn } from '../warning'
|
||||
const COMPONENTS = 'components'
|
||||
const DIRECTIVES = 'directives'
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export function resolveComponent(name: string): Component | string | undefined {
|
||||
return resolveAsset(COMPONENTS, name) || name
|
||||
}
|
||||
|
||||
export const NULL_DYNAMIC_COMPONENT = Symbol()
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export function resolveDynamicComponent(
|
||||
component: unknown
|
||||
): Component | string | typeof NULL_DYNAMIC_COMPONENT {
|
||||
@@ -29,11 +35,17 @@ export function resolveDynamicComponent(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
export function resolveDirective(name: string): Directive | undefined {
|
||||
return resolveAsset(DIRECTIVES, name)
|
||||
}
|
||||
|
||||
// overload 1: components
|
||||
/**
|
||||
* @private
|
||||
* overload 1: components
|
||||
*/
|
||||
function resolveAsset(
|
||||
type: typeof COMPONENTS,
|
||||
name: string,
|
||||
@@ -44,7 +56,7 @@ function resolveAsset(
|
||||
type: typeof DIRECTIVES,
|
||||
name: string
|
||||
): Directive | undefined
|
||||
|
||||
// implementation
|
||||
function resolveAsset(
|
||||
type: typeof COMPONENTS | typeof DIRECTIVES,
|
||||
name: string,
|
||||
|
||||
Reference in New Issue
Block a user