2016-09-06 21:28:17 +08:00
|
|
|
import { Vue } from "./vue";
|
2016-08-24 03:01:30 +08:00
|
|
|
|
2019-01-16 01:38:58 +08:00
|
|
|
// Scoped slots are guaranteed to return Array of VNodes starting in 2.6
|
2018-12-11 07:36:41 +08:00
|
|
|
export type ScopedSlot = (props: any) => ScopedSlotChildren;
|
2019-01-16 01:38:58 +08:00
|
|
|
export type ScopedSlotChildren = VNode[] | undefined;
|
2016-11-26 01:08:42 +08:00
|
|
|
|
2018-12-11 07:36:41 +08:00
|
|
|
// Relaxed type compatible with $createElement
|
|
|
|
export type VNodeChildren = VNodeChildrenArrayContents | [ScopedSlot] | string | boolean | null | undefined;
|
|
|
|
export interface VNodeChildrenArrayContents extends Array<VNodeChildren | VNode> {}
|
2016-08-24 03:01:30 +08:00
|
|
|
|
|
|
|
export interface VNode {
|
|
|
|
tag?: string;
|
|
|
|
data?: VNodeData;
|
|
|
|
children?: VNode[];
|
|
|
|
text?: string;
|
|
|
|
elm?: Node;
|
|
|
|
ns?: string;
|
|
|
|
context?: Vue;
|
|
|
|
key?: string | number;
|
|
|
|
componentOptions?: VNodeComponentOptions;
|
2017-01-13 07:04:36 +08:00
|
|
|
componentInstance?: Vue;
|
2016-08-24 03:01:30 +08:00
|
|
|
parent?: VNode;
|
|
|
|
raw?: boolean;
|
|
|
|
isStatic?: boolean;
|
|
|
|
isRootInsert: boolean;
|
|
|
|
isComment: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface VNodeComponentOptions {
|
2016-11-21 00:59:10 +08:00
|
|
|
Ctor: typeof Vue;
|
2017-11-27 22:30:58 +08:00
|
|
|
propsData?: object;
|
|
|
|
listeners?: object;
|
2018-12-11 07:36:41 +08:00
|
|
|
children?: VNode[];
|
2016-08-24 03:01:30 +08:00
|
|
|
tag?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface VNodeData {
|
|
|
|
key?: string | number;
|
|
|
|
slot?: string;
|
2018-12-04 09:31:39 +08:00
|
|
|
scopedSlots?: { [key: string]: ScopedSlot | undefined };
|
2016-08-24 03:01:30 +08:00
|
|
|
ref?: string;
|
2018-10-25 01:05:15 +08:00
|
|
|
refInFor?: boolean;
|
2016-08-24 03:01:30 +08:00
|
|
|
tag?: string;
|
|
|
|
staticClass?: string;
|
|
|
|
class?: any;
|
2016-11-08 05:13:04 +08:00
|
|
|
staticStyle?: { [key: string]: any };
|
2017-11-27 22:30:58 +08:00
|
|
|
style?: object[] | object;
|
2016-08-24 03:01:30 +08: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[] };
|
2017-11-27 22:30:58 +08:00
|
|
|
transition?: object;
|
2016-08-24 03:01:30 +08:00
|
|
|
show?: boolean;
|
|
|
|
inlineTemplate?: {
|
|
|
|
render: Function;
|
|
|
|
staticRenderFns: Function[];
|
|
|
|
};
|
|
|
|
directives?: VNodeDirective[];
|
|
|
|
keepAlive?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface VNodeDirective {
|
2018-10-23 04:09:23 +08:00
|
|
|
name: string;
|
|
|
|
value?: any;
|
|
|
|
oldValue?: any;
|
|
|
|
expression?: any;
|
|
|
|
arg?: string;
|
|
|
|
modifiers?: { [key: string]: boolean };
|
2016-08-24 03:01:30 +08:00
|
|
|
}
|