vnode.js 1.4 KB

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