1
- import { Component , Data , validateComponentName } from './component'
1
+ import {
2
+ Component ,
3
+ Data ,
4
+ validateComponentName ,
5
+ PublicAPIComponent
6
+ } from './component'
2
7
import { ComponentOptions } from './apiOptions'
3
8
import { ComponentPublicInstance } from './componentProxy'
4
9
import { Directive , validateDirectiveName } from './directives'
@@ -82,10 +87,7 @@ export function createAppContext(): AppContext {
82
87
}
83
88
84
89
export type CreateAppFunction < HostElement > = (
85
- rootComponent :
86
- | Component
87
- // for compatibility with defineComponent() return types
88
- | { new ( ) : ComponentPublicInstance < any , any , any , any , any > } ,
90
+ rootComponent : PublicAPIComponent ,
89
91
rootProps ?: Data | null
90
92
) => App < HostElement >
91
93
@@ -156,7 +158,7 @@ export function createAppAPI<HostNode, HostElement>(
156
158
return app
157
159
} ,
158
160
159
- component ( name : string , component ?: Component ) : any {
161
+ component ( name : string , component ?: PublicAPIComponent ) : any {
160
162
if ( __DEV__ ) {
161
163
validateComponentName ( name , context . config )
162
164
}
@@ -166,7 +168,7 @@ export function createAppAPI<HostNode, HostElement>(
166
168
if ( __DEV__ && context . components [ name ] ) {
167
169
warn ( `Component "${ name } " has already been registered in target app.` )
168
170
}
169
- context . components [ name ] = component
171
+ context . components [ name ] = component as Component
170
172
return app
171
173
} ,
172
174
0 commit comments