vue/flow/vnode.js

66 lines
1.4 KiB
JavaScript
Raw Normal View History

2016-05-14 15:08:21 +08:00
declare type VNodeChildren = Array<any> | () => Array<any> | string
declare type VNodeComponentOptions = {
Ctor: Class<Component>,
propsData: ?Object,
listeners: ?Object,
parent: Component,
children: ?VNodeChildren,
tag?: string
2016-05-14 15:08:21 +08:00
}
declare interface MountedComponentVNode {
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
declare interface VNodeWithData {
tag: string;
data: VNodeData;
children: Array<VNode> | void;
text: void;
2016-05-14 19:40:56 +08:00
elm: HTMLElement;
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;
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;
tag?: string;
2016-05-14 15:08:21 +08:00
staticClass?: string;
class?: any;
style?: Array<Object> | Object;
show?: true;
props?: { [key: string]: any };
attrs?: { [key: string]: string };
staticAttrs?: { [key: string]: string };
hook?: { [key: string]: Function };
on?: { [key: string]: Function | Array<Function> };
transition?: {
definition: String | Object,
appear: boolean
};
inlineTemplate?: {
render: Function,
staticRenderFns: Array<Function>
};
2016-05-14 19:40:56 +08:00
directives?: Array<VNodeDirective>;
2016-06-04 22:47:14 +08:00
keepAlive?: boolean;
2016-05-14 19:40:56 +08:00
}
declare type VNodeDirective = {
name: string,
value?: any,
2016-05-25 06:28:17 +08:00
oldValue?: any,
2016-05-14 19:40:56 +08:00
arg?: string,
modifiers?: { [key: string]: boolean }
2016-05-14 15:08:21 +08:00
}