types: improve typing

This commit is contained in:
Evan You
2019-10-08 09:26:09 -04:00
parent 016231d09f
commit 1393ee52ca
8 changed files with 42 additions and 24 deletions

View File

@@ -13,7 +13,7 @@ import { FunctionalComponent } from './component'
import {
ComponentOptionsWithoutProps,
ComponentOptionsWithArrayProps,
ComponentOptionsWithProps,
ComponentOptionsWithObjectProps,
ComponentOptions
} from './apiOptions'
import { ExtractPropTypes } from './componentProps'
@@ -121,7 +121,7 @@ export function h<P extends string>(
children?: RawChildren | RawSlots
): VNode
export function h<P>(
type: ComponentOptionsWithProps<P>,
type: ComponentOptionsWithObjectProps<P>,
props?: (RawProps & ExtractPropTypes<P>) | null,
children?: RawChildren | RawSlots
): VNode