vnode.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. declare type VNodeChildren = Array<any> | () => Array<any> | string
  2. declare type VNodeComponentOptions = {
  3. Ctor: Class<Component>,
  4. propsData: ?Object,
  5. listeners: ?Object,
  6. parent: Component,
  7. children: ?VNodeChildren
  8. }
  9. declare interface MountedComponentVNode {
  10. componentOptions: VNodeComponentOptions;
  11. child: Component;
  12. }
  13. // interface for vnodes in update modules
  14. declare interface VNodeWithData {
  15. tag: string;
  16. data: VNodeData;
  17. children: Array<VNode> | void;
  18. text: void;
  19. elm: Node;
  20. ns: string | void;
  21. context: Component;
  22. key: string | number | void;
  23. }
  24. declare interface VNodeData {
  25. pre?: true;
  26. key?: string | number;
  27. slot?: string;
  28. staticClass?: string;
  29. class?: any;
  30. style?: Array<Object> | Object;
  31. show?: true;
  32. props?: { [key: string]: any };
  33. attrs?: { [key: string]: string };
  34. staticAttrs?: { [key: string]: string };
  35. hook?: { [key: string]: Function };
  36. on?: { [key: string]: Function | Array<Function> };
  37. transition?: {
  38. definition: String | Object,
  39. appear: boolean
  40. };
  41. inlineTemplate?: {
  42. render: Function,
  43. staticRenderFns: Array<Function>
  44. };
  45. directives?: Array<{
  46. name: string,
  47. value?: any,
  48. arg?: string,
  49. modifiers?: { [key: string]: boolean }
  50. }>;
  51. }