vue/flow/vnode.js

69 lines
1.6 KiB
JavaScript
Raw Normal View History

declare type VNodeChildren = Array<?VNode | string | VNodeChildren> | string
2016-05-14 15:08:21 +08:00
declare type VNodeComponentOptions = {
2016-07-26 09:28:46 +08:00
Ctor: Class<Component>;
propsData: ?Object;
listeners: ?Object;
children: ?VNodeChildren;
tag?: string;
2016-05-14 15:08:21 +08:00
}
2016-07-26 09:28:46 +08:00
declare type MountedComponentVNode = {
2016-05-14 15:08:21 +08:00
componentOptions: VNodeComponentOptions;
child: Component;
2016-05-14 19:40:56 +08:00
parent: VNode;
2016-06-04 22:47:14 +08:00
data: VNodeData;
2016-05-14 15:08:21 +08:00
}
2016-05-14 15:38:41 +08:00
// interface for vnodes in update modules
2016-07-26 09:28:46 +08:00
declare type VNodeWithData = {
2016-05-14 15:38:41 +08:00
tag: string;
data: VNodeData;
children: Array<VNode> | void;
text: void;
2016-11-08 03:47:14 +08:00
elm: any;
2016-05-14 15:38:41 +08:00
ns: string | void;
context: Component;
key: string | number | void;
2016-05-14 19:40:56 +08:00
parent?: VNodeWithData;
2016-06-02 06:20:13 +08:00
child?: Component;
isRootInsert: boolean;
2016-05-14 15:38:41 +08:00
}
2016-05-14 15:08:21 +08:00
declare interface VNodeData {
key?: string | number;
slot?: string;
ref?: string;
pre?: boolean;
tag?: string;
2016-05-14 15:08:21 +08:00
staticClass?: string;
class?: any;
2016-11-08 05:13:04 +08:00
staticStyle?: { [key: string]: any };
2016-05-14 15:08:21 +08:00
style?: Array<Object> | Object;
props?: { [key: string]: any };
attrs?: { [key: string]: string };
2016-07-20 05:52:10 +08:00
domProps?: { [key: string]: any };
2016-05-14 15:08:21 +08:00
hook?: { [key: string]: Function };
on?: ?{ [key: string]: Function | Array<Function> };
nativeOn?: { [key: string]: Function | Array<Function> };
2016-07-16 05:48:42 +08:00
transition?: Object;
show?: boolean; // marker for v-show
2016-05-14 15:08:21 +08:00
inlineTemplate?: {
2016-07-26 09:28:46 +08:00
render: Function;
staticRenderFns: Array<Function>;
2016-05-14 15:08:21 +08:00
};
2016-05-14 19:40:56 +08:00
directives?: Array<VNodeDirective>;
2016-06-04 22:47:14 +08:00
keepAlive?: boolean;
scopedSlots?: { [key: string]: Function }
2016-05-14 19:40:56 +08:00
}
declare type VNodeDirective = {
2016-07-26 09:28:46 +08:00
name: string;
rawName: string;
2016-07-26 09:28:46 +08:00
value?: any;
oldValue?: any;
arg?: string;
modifiers?: ASTModifiers;
def?: Object;
2016-05-14 15:08:21 +08:00
}