Skip to content

Commit

Permalink
fix(types): app.component should accept defineComponent return type (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
hareku authored Mar 12, 2020
1 parent 4dfd4b8 commit 1e9d131
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/runtime-core/src/apiCreateApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export interface App<HostElement = any> {
config: AppConfig
use(plugin: Plugin, ...options: any[]): this
mixin(mixin: ComponentOptions): this
component(name: string): Component | undefined
component(name: string, component: Component): this
component(name: string): PublicAPIComponent | undefined
component(name: string, component: PublicAPIComponent): this
directive(name: string): Directive | undefined
directive(name: string, directive: Directive): this
mount(
Expand Down Expand Up @@ -55,7 +55,7 @@ export interface AppConfig {
export interface AppContext {
config: AppConfig
mixins: ComponentOptions[]
components: Record<string, Component>
components: Record<string, PublicAPIComponent>
directives: Record<string, Directive>
provides: Record<string | symbol, any>
reload?: () => void // HMR only
Expand Down Expand Up @@ -168,7 +168,7 @@ export function createAppAPI<HostNode, HostElement>(
if (__DEV__ && context.components[name]) {
warn(`Component "${name}" has already been registered in target app.`)
}
context.components[name] = component as Component
context.components[name] = component
return app
},

Expand Down

0 comments on commit 1e9d131

Please sign in to comment.