fix(types): support TypeScript 4.8

fix #6554
This commit is contained in:
Evan You
2022-08-31 14:02:48 +08:00
parent 9875ecd762
commit 5381abc057
6 changed files with 62 additions and 64 deletions

View File

@@ -175,7 +175,7 @@ export type CreateAppFunction<HostElement> = (
let uid = 0
export function createAppAPI<HostElement>(
render: RootRenderFunction,
render: RootRenderFunction<HostElement>,
hydrate?: RootHydrateFunction
): CreateAppFunction<HostElement> {
return function createApp(rootComponent, rootProps = null) {

View File

@@ -324,7 +324,7 @@ export function createCompatVue(
export function installAppCompatProperties(
app: App,
context: AppContext,
render: RootRenderFunction
render: RootRenderFunction<any>
) {
installFilterMethod(app, context)
installLegacyOptionMergeStrats(app.config)

View File

@@ -52,9 +52,7 @@ export interface BaseTransitionProps<HostElement = RendererElement> {
onAppearCancelled?: Hook<(el: HostElement) => void>
}
export interface TransitionHooks<
HostElement extends RendererElement = RendererElement
> {
export interface TransitionHooks<HostElement = RendererElement> {
mode: BaseTransitionProps['mode']
persisted: boolean
beforeEnter(el: HostElement): void

View File

@@ -606,7 +606,7 @@ export function cloneVNode<T, U>(
// key enumeration cost.
const { props, ref, patchFlag, children } = vnode
const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props
const cloned: VNode = {
const cloned: VNode<T, U> = {
__v_isVNode: true,
__v_skip: true,
type: vnode.type,
@@ -661,7 +661,7 @@ export function cloneVNode<T, U>(
anchor: vnode.anchor
}
if (__COMPAT__) {
defineLegacyVNodeProperties(cloned)
defineLegacyVNodeProperties(cloned as VNode)
}
return cloned as any
}