Skip to content

Commit

Permalink
fix(types): support TypeScript 4.8
Browse files Browse the repository at this point in the history
fix #6554
  • Loading branch information
yyx990803 committed Aug 31, 2022
1 parent 9875ecd commit 5381abc
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 64 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"devDependencies": {
"@babel/types": "^7.12.0",
"@esbuild-plugins/node-modules-polyfill": "^0.1.4",
"@microsoft/api-extractor": "^7.15.1",
"@microsoft/api-extractor": "~7.20.0",
"@rollup/plugin-commonjs": "^18.0.0",
"@rollup/plugin-json": "^4.0.0",
"@rollup/plugin-node-resolve": "^11.2.1",
Expand Down Expand Up @@ -93,7 +93,7 @@
"todomvc-app-css": "^2.3.0",
"ts-jest": "^27.0.5",
"tslib": "^2.4.0",
"typescript": "^4.7.4",
"typescript": "^4.8.0",
"vite": "^2.9.8",
"vue": "workspace:*",
"yorkie": "^2.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-core/src/apiCreateApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-core/src/compat/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions packages/runtime-core/src/components/BaseTransition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions packages/runtime-core/src/vnode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -661,7 +661,7 @@ export function cloneVNode<T, U>(
anchor: vnode.anchor
}
if (__COMPAT__) {
defineLegacyVNodeProperties(cloned)
defineLegacyVNodeProperties(cloned as VNode)
}
return cloned as any
}
Expand Down
Loading

0 comments on commit 5381abc

Please sign in to comment.