From 1f4937c2fdf62c0a1ccf53381179450772dd2f60 Mon Sep 17 00:00:00 2001 From: Dmitry Sharshakov Date: Mon, 21 Oct 2019 20:44:01 +0300 Subject: [PATCH] types: use RenderFunction type (#342) --- packages/runtime-core/src/apiCreateComponent.ts | 5 ++--- packages/runtime-core/src/apiOptions.ts | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/runtime-core/src/apiCreateComponent.ts b/packages/runtime-core/src/apiCreateComponent.ts index c4ef3eee59..1979d231f0 100644 --- a/packages/runtime-core/src/apiCreateComponent.ts +++ b/packages/runtime-core/src/apiCreateComponent.ts @@ -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( - setup: (props: Props, ctx: SetupContext) => RawBindings | (() => VNodeChild) + setup: (props: Props, ctx: SetupContext) => RawBindings | RenderFunction ): { new (): ComponentPublicInstance } diff --git a/packages/runtime-core/src/apiOptions.ts b/packages/runtime-core/src/apiOptions.ts index 59b69dc913..d3a87ade6d 100644 --- a/packages/runtime-core/src/apiOptions.ts +++ b/packages/runtime-core/src/apiOptions.ts @@ -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 -- 2.47.3