]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
types: fix createComponent type when using simple function (#334)
authorDmitry Sharshakov <d3dx12.xx@gmail.com>
Fri, 18 Oct 2019 18:58:15 +0000 (21:58 +0300)
committerEvan You <yyx990803@gmail.com>
Fri, 18 Oct 2019 18:58:15 +0000 (14:58 -0400)
packages/runtime-core/src/apiCreateComponent.ts

index 4f70224dbbeb81cff487853e19a81e5a6f20f7df..c4ef3eee590b77a659332aaf41beca4f90a87cab 100644 (file)
@@ -13,9 +13,11 @@ import { isFunction } from '@vue/shared'
 
 // overload 1: direct setup function
 // (uses user defined props interface)
-export function createComponent<Props>(
-  setup: (props: Props, ctx: SetupContext) => object | (() => VNodeChild)
-): (props: Props) => any
+export function createComponent<Props, RawBindings = object>(
+  setup: (props: Props, ctx: SetupContext) => RawBindings | (() => VNodeChild)
+): {
+  new (): ComponentPublicInstance<Props, RawBindings>
+}
 
 // overload 2: object format with no props
 // (uses user defined props interface)