Skip to content

Commit 1e9d131

Browse files
authored
fix(types): app.component should accept defineComponent return type (#822)
fix #730
1 parent 4dfd4b8 commit 1e9d131

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/runtime-core/src/apiCreateApp.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ export interface App<HostElement = any> {
1717
config: AppConfig
1818
use(plugin: Plugin, ...options: any[]): this
1919
mixin(mixin: ComponentOptions): this
20-
component(name: string): Component | undefined
21-
component(name: string, component: Component): this
20+
component(name: string): PublicAPIComponent | undefined
21+
component(name: string, component: PublicAPIComponent): this
2222
directive(name: string): Directive | undefined
2323
directive(name: string, directive: Directive): this
2424
mount(
@@ -55,7 +55,7 @@ export interface AppConfig {
5555
export interface AppContext {
5656
config: AppConfig
5757
mixins: ComponentOptions[]
58-
components: Record<string, Component>
58+
components: Record<string, PublicAPIComponent>
5959
directives: Record<string, Directive>
6060
provides: Record<string | symbol, any>
6161
reload?: () => void // HMR only
@@ -168,7 +168,7 @@ export function createAppAPI<HostNode, HostElement>(
168168
if (__DEV__ && context.components[name]) {
169169
warn(`Component "${name}" has already been registered in target app.`)
170170
}
171-
context.components[name] = component as Component
171+
context.components[name] = component
172172
return app
173173
},
174174

0 commit comments

Comments
 (0)