import { StyleValue } from './jsx' import { Kdu } from './kdu' import { DirectiveFunction, DirectiveOptions } from './options' import { Ref } from './v3-generated' import { ComponentPublicInstance } from './v3-component-public-instance' /** * For extending allowed non-declared props on components in TSX */ export interface ComponentCustomProps {} /** * Default allowed non-declared props on component in TSX */ export interface AllowedComponentProps { class?: unknown style?: unknown } export type ScopedSlot = (props: any) => ScopedSlotReturnValue type ScopedSlotReturnValue = | KNode | string | boolean | number | null | undefined | ScopedSlotReturnArray interface ScopedSlotReturnArray extends Array {} // Scoped slots are guaranteed to return Array of KNodes starting in 2.6 export type NormalizedScopedSlot = (props: any) => ScopedSlotChildren export type ScopedSlotChildren = KNode[] | undefined // Relaxed type compatible with $createElement export type KNodeChildren = | KNodeChildrenArrayContents | [ScopedSlot] | string | boolean | number | null | undefined export interface KNodeChildrenArrayContents extends Array {} export interface KNode { tag?: string data?: KNodeData children?: KNode[] text?: string elm?: Node ns?: string context?: Kdu key?: string | number | symbol | boolean componentOptions?: KNodeComponentOptions componentInstance?: Kdu parent?: KNode raw?: boolean isStatic?: boolean isRootInsert: boolean isComment: boolean } export interface KNodeComponentOptions { Ctor: typeof Kdu propsData?: object listeners?: object children?: KNode[] tag?: string } export type KNodeRef = | string | Ref | (( ref: Element | ComponentPublicInstance | null, refs: Record ) => void) export interface KNodeData { key?: string | number slot?: string scopedSlots?: { [key: string]: ScopedSlot | undefined } ref?: KNodeRef refInFor?: boolean tag?: string staticClass?: string class?: any staticStyle?: { [key: string]: any } style?: StyleValue props?: { [key: string]: any } attrs?: { [key: string]: any } domProps?: { [key: string]: any } hook?: { [key: string]: Function } on?: { [key: string]: Function | Function[] } nativeOn?: { [key: string]: Function | Function[] } transition?: object show?: boolean inlineTemplate?: { render: Function staticRenderFns: Function[] } directives?: KNodeDirective[] keepAlive?: boolean } export interface KNodeDirective { name: string value?: any oldValue?: any expression?: string arg?: string oldArg?: string modifiers?: { [key: string]: boolean } def?: DirectiveFunction | DirectiveOptions }