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:
@@ -3,8 +3,8 @@ import {
|
||||
Data,
|
||||
SetupContext,
|
||||
ComponentInternalOptions,
|
||||
PublicAPIComponent,
|
||||
Component,
|
||||
ConcreteComponent,
|
||||
InternalRenderFunction
|
||||
} from './component'
|
||||
import {
|
||||
@@ -52,7 +52,7 @@ import { Directive } from './directives'
|
||||
import {
|
||||
CreateComponentPublicInstance,
|
||||
ComponentPublicInstance
|
||||
} from './componentProxy'
|
||||
} from './componentPublicInstance'
|
||||
import { warn } from './warning'
|
||||
import { VNodeChild } from './vnode'
|
||||
|
||||
@@ -103,7 +103,7 @@ export interface ComponentOptionsBase<
|
||||
// Luckily `render()` doesn't need any arguments nor does it care about return
|
||||
// type.
|
||||
render?: Function
|
||||
components?: Record<string, PublicAPIComponent>
|
||||
components?: Record<string, Component>
|
||||
directives?: Record<string, Directive>
|
||||
inheritAttrs?: boolean
|
||||
emits?: (E | EE[]) & ThisType<void>
|
||||
@@ -132,7 +132,7 @@ export interface ComponentOptionsBase<
|
||||
* marker for AsyncComponentWrapper
|
||||
* @internal
|
||||
*/
|
||||
__asyncLoader?: () => Promise<Component>
|
||||
__asyncLoader?: () => Promise<ConcreteComponent>
|
||||
/**
|
||||
* cache for merged $options
|
||||
* @internal
|
||||
|
||||
Reference in New Issue
Block a user