wip: test + typing for value

This commit is contained in:
Evan You
2019-05-29 22:11:33 +08:00
parent ef4fde3522
commit dde6c151e4
4 changed files with 117 additions and 13 deletions

View File

@@ -1,19 +1,11 @@
import { VNode, normalizeVNode, VNodeChild } from './vnode'
import { ReactiveEffect, observable } from '@vue/observer'
import { ReactiveEffect, UnwrapBindings, observable } from '@vue/observer'
import { isFunction, EMPTY_OBJ } from '@vue/shared'
import { RenderProxyHandlers } from './componentProxy'
import { ComponentPropsOptions, PropValidator } from './componentProps'
interface Value<T> {
value: T
}
export type Data = { [key: string]: any }
type UnwrapBindings<T> = {
[key in keyof T]: T[key] extends Value<infer V> ? V : T[key]
}
type ExtractPropTypes<PropOptions> = {
readonly [key in keyof PropOptions]: PropOptions[key] extends PropValidator<
infer V