2022-11-09 09:34:55 +00:00
|
|
|
import { StyleValue } from './jsx'
|
2022-05-27 09:26:55 +00:00
|
|
|
import { Vue } from './vue'
|
2022-07-04 04:08:41 +00:00
|
|
|
import { DirectiveFunction, DirectiveOptions } from './options'
|
2022-10-11 05:36:50 +00:00
|
|
|
import { Ref } from './v3-generated'
|
|
|
|
import { ComponentPublicInstance } from './v3-component-public-instance'
|
2016-08-23 19:01:30 +00:00
|
|
|
|
2022-07-05 02:12:21 +00:00
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
}
|
|
|
|
|
2022-05-27 09:26:55 +00:00
|
|
|
export type ScopedSlot = (props: any) => ScopedSlotReturnValue
|
|
|
|
type ScopedSlotReturnValue =
|
|
|
|
| VNode
|
|
|
|
| string
|
|
|
|
| boolean
|
|
|
|
| null
|
|
|
|
| undefined
|
|
|
|
| ScopedSlotReturnArray
|
2019-02-28 22:03:28 +00:00
|
|
|
interface ScopedSlotReturnArray extends Array<ScopedSlotReturnValue> {}
|
|
|
|
|
2019-01-15 17:38:58 +00:00
|
|
|
// Scoped slots are guaranteed to return Array of VNodes starting in 2.6
|
2022-05-27 09:26:55 +00:00
|
|
|
export type NormalizedScopedSlot = (props: any) => ScopedSlotChildren
|
|
|
|
export type ScopedSlotChildren = VNode[] | undefined
|
2016-11-25 17:08:42 +00:00
|
|
|
|
2018-12-10 23:36:41 +00:00
|
|
|
// Relaxed type compatible with $createElement
|
2022-05-27 09:26:55 +00:00
|
|
|
export type VNodeChildren =
|
|
|
|
| VNodeChildrenArrayContents
|
|
|
|
| [ScopedSlot]
|
|
|
|
| string
|
|
|
|
| boolean
|
|
|
|
| null
|
|
|
|
| undefined
|
|
|
|
export interface VNodeChildrenArrayContents
|
|
|
|
extends Array<VNodeChildren | VNode> {}
|
2016-08-23 19:01:30 +00:00
|
|
|
|
|
|
|
export interface VNode {
|
2022-05-27 09:26:55 +00:00
|
|
|
tag?: string
|
|
|
|
data?: VNodeData
|
|
|
|
children?: VNode[]
|
|
|
|
text?: string
|
|
|
|
elm?: Node
|
|
|
|
ns?: string
|
|
|
|
context?: Vue
|
|
|
|
key?: string | number | symbol | boolean
|
|
|
|
componentOptions?: VNodeComponentOptions
|
|
|
|
componentInstance?: Vue
|
|
|
|
parent?: VNode
|
|
|
|
raw?: boolean
|
|
|
|
isStatic?: boolean
|
|
|
|
isRootInsert: boolean
|
|
|
|
isComment: boolean
|
2016-08-23 19:01:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface VNodeComponentOptions {
|
2022-05-27 09:26:55 +00:00
|
|
|
Ctor: typeof Vue
|
|
|
|
propsData?: object
|
|
|
|
listeners?: object
|
|
|
|
children?: VNode[]
|
|
|
|
tag?: string
|
2016-08-23 19:01:30 +00:00
|
|
|
}
|
|
|
|
|
2022-10-11 05:36:50 +00:00
|
|
|
export type VNodeRef =
|
|
|
|
| string
|
|
|
|
| Ref
|
|
|
|
| ((
|
|
|
|
ref: Element | ComponentPublicInstance | null,
|
|
|
|
refs: Record<string, any>
|
|
|
|
) => void)
|
|
|
|
|
2016-08-23 19:01:30 +00:00
|
|
|
export interface VNodeData {
|
2022-05-27 09:26:55 +00:00
|
|
|
key?: string | number
|
|
|
|
slot?: string
|
|
|
|
scopedSlots?: { [key: string]: ScopedSlot | undefined }
|
2022-10-11 05:36:50 +00:00
|
|
|
ref?: VNodeRef
|
2022-05-27 09:26:55 +00:00
|
|
|
refInFor?: boolean
|
|
|
|
tag?: string
|
|
|
|
staticClass?: string
|
|
|
|
class?: any
|
|
|
|
staticStyle?: { [key: string]: any }
|
2022-11-09 09:34:55 +00:00
|
|
|
style?: StyleValue
|
2022-05-27 09:26:55 +00:00
|
|
|
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
|
2016-08-23 19:01:30 +00:00
|
|
|
inlineTemplate?: {
|
2022-05-27 09:26:55 +00:00
|
|
|
render: Function
|
|
|
|
staticRenderFns: Function[]
|
|
|
|
}
|
|
|
|
directives?: VNodeDirective[]
|
|
|
|
keepAlive?: boolean
|
2016-08-23 19:01:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface VNodeDirective {
|
2022-05-27 09:26:55 +00:00
|
|
|
name: string
|
|
|
|
value?: any
|
|
|
|
oldValue?: any
|
|
|
|
expression?: string
|
|
|
|
arg?: string
|
|
|
|
oldArg?: string
|
|
|
|
modifiers?: { [key: string]: boolean }
|
2022-07-04 04:08:41 +00:00
|
|
|
def?: DirectiveFunction | DirectiveOptions
|
2016-08-23 19:01:30 +00:00
|
|
|
}
|