]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
types: use RenderFunction type (#342)
authorDmitry Sharshakov <d3dx12.xx@gmail.com>
Mon, 21 Oct 2019 17:44:01 +0000 (20:44 +0300)
committerEvan You <yyx990803@gmail.com>
Mon, 21 Oct 2019 17:44:01 +0000 (13:44 -0400)
packages/runtime-core/src/apiCreateComponent.ts
packages/runtime-core/src/apiOptions.ts

index c4ef3eee590b77a659332aaf41beca4f90a87cab..1979d231f0fa7edc8510e34016dc44b0221bc2ca 100644 (file)
@@ -5,8 +5,7 @@ import {
   ComponentOptionsWithArrayProps,
   ComponentOptionsWithObjectProps
 } from './apiOptions'
-import { SetupContext } from './component'
-import { VNodeChild } from './vnode'
+import { SetupContext, RenderFunction } from './component'
 import { ComponentPublicInstance } from './componentProxy'
 import { ExtractPropTypes } from './componentProps'
 import { isFunction } from '@vue/shared'
@@ -14,7 +13,7 @@ import { isFunction } from '@vue/shared'
 // overload 1: direct setup function
 // (uses user defined props interface)
 export function createComponent<Props, RawBindings = object>(
-  setup: (props: Props, ctx: SetupContext) => RawBindings | (() => VNodeChild)
+  setup: (props: Props, ctx: SetupContext) => RawBindings | RenderFunction
 ): {
   new (): ComponentPublicInstance<Props, RawBindings>
 }
index 59b69dc913b3fe1cc82666acb902ea9e124df6c3..d3a87ade6dd2e96b08d562f5708ca8b142a7234a 100644 (file)
@@ -2,7 +2,8 @@ import {
   ComponentInternalInstance,
   Data,
   Component,
-  SetupContext
+  SetupContext,
+  RenderFunction
 } from './component'
 import {
   isFunction,
@@ -32,7 +33,6 @@ import {
 import { reactive } from '@vue/reactivity'
 import { ComponentObjectPropsOptions, ExtractPropTypes } from './componentProps'
 import { Directive } from './directives'
-import { VNodeChild } from './vnode'
 import { ComponentPublicInstance } from './componentProxy'
 import { warn } from './warning'
 
@@ -47,7 +47,7 @@ interface ComponentOptionsBase<
     this: null,
     props: Props,
     ctx: SetupContext
-  ) => RawBindings | (() => VNodeChild) | void
+  ) => RawBindings | RenderFunction | void
   name?: string
   template?: string
   // Note: we are intentionally using the signature-less `Function` type here