vnode.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. tag?: string
  9. }
  10. declare interface MountedComponentVNode {
  11. componentOptions: VNodeComponentOptions;
  12. child: Component;
  13. parent: VNode;
  14. data: VNodeData;
  15. }
  16. // interface for vnodes in update modules
  17. declare interface VNodeWithData {
  18. tag: string;
  19. data: VNodeData;
  20. children: Array<VNode> | void;
  21. text: void;
  22. elm: HTMLElement;
  23. ns: string | void;
  24. context: Component;
  25. key: string | number | void;
  26. parent?: VNodeWithData;
  27. child?: Component;
  28. }
  29. declare interface VNodeData {
  30. key?: string | number;
  31. slot?: string;
  32. ref?: string;
  33. tag?: string;
  34. staticClass?: string;
  35. class?: any;
  36. style?: Array<Object> | Object;
  37. show?: true;
  38. props?: { [key: string]: any };
  39. attrs?: { [key: string]: string };
  40. staticAttrs?: { [key: string]: string };
  41. hook?: { [key: string]: Function };
  42. on?: { [key: string]: Function | Array<Function> };
  43. transition?: {
  44. definition: String | Object,
  45. appear: boolean
  46. };
  47. inlineTemplate?: {
  48. render: Function,
  49. staticRenderFns: Array<Function>
  50. };
  51. directives?: Array<VNodeDirective>;
  52. keepAlive?: boolean;
  53. }
  54. declare type VNodeDirective = {
  55. name: string,
  56. value?: any,
  57. oldValue?: any,
  58. arg?: string,
  59. modifiers?: { [key: string]: boolean }
  60. }