types: improve type exports

This commit is contained in:
Evan You
2019-09-06 12:58:31 -04:00
parent d87bed0138
commit 360f3b4f37
25 changed files with 253 additions and 204 deletions

View File

@@ -12,14 +12,14 @@ import {
hasOwn
} from '@vue/shared'
import { warn } from './warning'
import { Data, ComponentInstance } from './component'
import { Data, ComponentInternalInstance } from './component'
import { PatchFlags } from './patchFlags'
export type ComponentPropsOptions<P = Data> = {
[K in keyof P]: Prop<P[K]> | null
}
type Prop<T> = PropOptions<T> | PropType<T>
export type Prop<T> = PropOptions<T> | PropType<T>
interface PropOptions<T = any> {
type?: PropType<T> | true | null
@@ -90,7 +90,7 @@ type NormalizedPropsOptions = Record<string, NormalizedProp>
// - else: everything goes in `props`.
export function resolveProps(
instance: ComponentInstance,
instance: ComponentInternalInstance,
rawProps: any,
_options: ComponentPropsOptions | void
) {