feat(runtime-core): add special property to get class component options (#821)

This commit is contained in:
Katashin
2020-03-12 23:46:32 +08:00
committed by GitHub
parent 1e9d1319c3
commit dd17fa1c90
4 changed files with 25 additions and 5 deletions

View File

@@ -58,13 +58,18 @@ export interface FunctionalComponent<P = {}> extends SFCInternalOptions {
displayName?: string
}
export interface ClassComponent {
new (...args: any[]): ComponentPublicInstance<any, any, any, any, any>
__vccOpts: ComponentOptions
}
export type Component = ComponentOptions | FunctionalComponent
// A type used in public APIs where a component type is expected.
// The constructor type is an artificial type returned by defineComponent().
export type PublicAPIComponent =
| Component
| { new (): ComponentPublicInstance<any, any, any, any, any> }
| { new (...args: any[]): ComponentPublicInstance<any, any, any, any, any> }
export { ComponentOptions }