refactor: adjust internal vnode types + more dts tests

This commit is contained in:
Evan You
2019-11-04 18:38:55 -05:00
parent 957d3a0547
commit dfc7c0f12a
23 changed files with 489 additions and 318 deletions

View File

@@ -5,9 +5,9 @@ import {
VNodeChildren,
Fragment,
Portal,
isVNode,
Suspense
isVNode
} from './vnode'
import { Suspense, SuspenseProps } from './components/Suspense'
import { isObject, isArray } from '@vue/shared'
import { RawSlots } from './componentSlots'
import { FunctionalComponent } from './component'
@@ -67,6 +67,9 @@ type RawChildren =
// fake constructor type returned from `createComponent`
interface Constructor<P = any> {
__isFragment?: never
__isPortal?: never
__isSuspense?: never
new (): { $props: P }
}
@@ -100,12 +103,7 @@ export function h(
export function h(type: typeof Suspense, children?: RawChildren): VNode
export function h(
type: typeof Suspense,
props?:
| (RawProps & {
onResolve?: () => void
onRecede?: () => void
})
| null,
props?: (RawProps & SuspenseProps) | null,
children?: RawChildren | RawSlots
): VNode