]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(types): app.component should accept defineComponent return type (#822)
authorhareku <hareku908@gmail.com>
Thu, 12 Mar 2020 14:19:30 +0000 (23:19 +0900)
committerGitHub <noreply@github.com>
Thu, 12 Mar 2020 14:19:30 +0000 (10:19 -0400)
fix #730

packages/runtime-core/src/apiCreateApp.ts

index 73ecd8480d1779e7bd583516d3ba648b6e2cb0d9..4f710511c7c8ee56e36541f49f14a06fd238ec4d 100644 (file)
@@ -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(
@@ -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
@@ -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
       },