import { Slots } from './vdom' import { MountedComponent } from './component' export type Data = Record export interface RenderFunction

{ (props: P, slots: Slots): any } export interface ComponentOptions { data?: () => Partial props?: ComponentPropsOptions

computed?: ComponentComputedOptions watch?: ComponentWatchOptions render?: RenderFunction

// TODO other options readonly [key: string]: any } export type ComponentPropsOptions

= { [K in keyof P]: PropValidator } export type NormalizedPropsOptions

= { [K in keyof P]: PropOptions } export type Prop = { (): T } | { new (...args: any[]): T & object } export type PropType = Prop | Prop[] export type PropValidator = PropOptions | PropType export interface PropOptions { type?: PropType required?: boolean default?: T | null | undefined | (() => T | null | undefined) validator?(value: T): boolean } export interface ComponentComputedOptions { [key: string]: (this: MountedComponent & D & P, c: any) => any } export interface ComponentWatchOptions { [key: string]: ( this: MountedComponent & D & P, oldValue: any, newValue: any ) => void }