vnode.js 1.5 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 type MountedComponentVNode = {
  11. componentOptions: VNodeComponentOptions;
  12. child: Component;
  13. parent: VNode;
  14. data: VNodeData;
  15. }
  16. // interface for vnodes in update modules
  17. declare type 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. isRootInsert: boolean;
  29. }
  30. declare interface VNodeData {
  31. key?: string | number;
  32. slot?: string;
  33. ref?: string;
  34. tag?: string;
  35. staticClass?: string;
  36. class?: any;
  37. style?: Array<Object> | Object;
  38. show?: true;
  39. props?: { [key: string]: any };
  40. attrs?: { [key: string]: string };
  41. domProps?: { [key: string]: any };
  42. hook?: { [key: string]: Function };
  43. on?: ?{ [key: string]: Function | Array<Function> };
  44. nativeOn?: { [key: string]: Function | Array<Function> };
  45. transition?: Object;
  46. inlineTemplate?: {
  47. render: Function;
  48. staticRenderFns: Array<Function>;
  49. };
  50. directives?: Array<VNodeDirective>;
  51. keepAlive?: boolean;
  52. [key: string]: any;
  53. }
  54. declare type VNodeDirective = {
  55. name: string;
  56. value?: any;
  57. oldValue?: any;
  58. arg?: string;
  59. modifiers?: { [key: string]: boolean };
  60. }