types: refactor VNodeProps type

This commit is contained in:
Evan You
2019-11-01 09:58:27 -04:00
parent 28895b8817
commit 06c5b0a861
4 changed files with 17 additions and 23 deletions

View File

@@ -1,6 +1,7 @@
import {
VNodeTypes,
VNode,
VNodeProps,
createVNode,
VNodeChildren,
Fragment,
@@ -9,7 +10,6 @@ import {
Suspense
} from './vnode'
import { isObject, isArray } from '@vue/shared'
import { Ref } from '@vue/reactivity'
import { RawSlots } from './componentSlots'
import { FunctionalComponent } from './component'
import {
@@ -51,17 +51,14 @@ h(Component, {}, {}) // named slots
h(Component, null, {})
**/
export interface RawProps {
[key: string]: any
key?: string | number
ref?: string | Ref | Function
type RawProps = VNodeProps & {
// used to differ from a single VNode object as children
_isVNode?: never
// used to differ from Array children
[Symbol.iterator]?: never
}
export type RawChildren =
type RawChildren =
| string
| number
| boolean
@@ -69,8 +66,6 @@ export type RawChildren =
| VNodeChildren
| (() => any)
export { RawSlots }
// fake constructor type returned from `createComponent`
interface Constructor<P = any> {
new (): { $props: P }