refactor(types): widen Component type to include consutructor types

returned from `defineComponent`

ref: https://github.com/vuejs/vue-router-next/pull/421
also close #1880

Previous `Component` type is now exported as `ConcreteComponent`.

This introduces a minor breaking change when calling `h(comp, { ... })`
will now fail if `comp` is a of generic `Component` type, since it does
not specify what props it expects.
This commit is contained in:
Evan You
2020-08-19 16:11:29 -04:00
parent 4baf852a34
commit eb2ae44d94
21 changed files with 117 additions and 102 deletions

View File

@@ -1,6 +1,6 @@
/* eslint-disable no-restricted-globals */
import {
Component,
ConcreteComponent,
ComponentInternalInstance,
ComponentOptions,
InternalRenderFunction
@@ -10,7 +10,7 @@ import { extend } from '@vue/shared'
export let isHmrUpdating = false
export const hmrDirtyComponents = new Set<Component>()
export const hmrDirtyComponents = new Set<ConcreteComponent>()
export interface HMRRuntime {
createRecord: typeof createRecord