import { MergedComponent, MountedComponent } from './component' import { Slots } from './vdom' export type Data = Record export interface ComponentOptions< P = {}, D = {}, M = {}, C = {}, This = MergedComponent & M & C > { data?: (this: This) => Partial props?: ComponentPropsOptions

computed?: ComponentComputedOptions watch?: ComponentWatchOptions render?: (this: This, props: Readonly

, slots: Slots, attrs: Data) => any inheritAttrs?: boolean displayName?: string // TODO other options readonly [key: string]: any } export type ComponentPropsOptions

= { [K in keyof P]: PropValidator } export type Prop = { (): T } | { new (...args: any[]): T & object } export type PropType = Prop | Prop[] export type PropValidator = PropOptions | PropType export interface PropOptions { type?: PropType | true | null required?: boolean default?: T | null | undefined | (() => T | null | undefined) validator?(value: T): boolean } export interface ComponentComputedOptions { [key: string]: (this: This, c: any) => any } export interface ComponentWatchOptions { [key: string]: ComponentWatchOption } export type ComponentWatchOption = | WatchHandler | WatchHandler[] | WatchOptionsWithHandler | string export type WatchHandler = ( this: This, val: any, oldVal: any ) => void export interface WatchOptionsWithHandler extends WatchOptions { handler: WatchHandler } export interface WatchOptions { sync?: boolean deep?: boolean immediate?: boolean }