vnode.js 1.3 KB

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