vnode.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. declare type VNodeChildren = Array<?VNode | string | VNodeChildren> | string
  2. declare type VNodeComponentOptions = {
  3. Ctor: Class<Component>;
  4. propsData: ?Object;
  5. listeners: ?Object;
  6. children: ?Array<VNode>;
  7. tag?: string;
  8. }
  9. declare type MountedComponentVNode = {
  10. componentOptions: VNodeComponentOptions;
  11. child: Component;
  12. parent: VNode;
  13. data: VNodeData;
  14. }
  15. // interface for vnodes in update modules
  16. declare type VNodeWithData = {
  17. tag: string;
  18. data: VNodeData;
  19. children: ?Array<VNode>;
  20. text: void;
  21. elm: any;
  22. ns: string | void;
  23. context: Component;
  24. key: string | number | void;
  25. parent?: VNodeWithData;
  26. child?: Component;
  27. isRootInsert: boolean;
  28. }
  29. declare interface VNodeData {
  30. key?: string | number;
  31. slot?: string;
  32. ref?: string;
  33. pre?: boolean;
  34. tag?: string;
  35. staticClass?: string;
  36. class?: any;
  37. staticStyle?: { [key: string]: any };
  38. style?: Array<Object> | Object;
  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. show?: boolean; // marker for v-show
  47. inlineTemplate?: {
  48. render: Function;
  49. staticRenderFns: Array<Function>;
  50. };
  51. directives?: Array<VNodeDirective>;
  52. keepAlive?: boolean;
  53. scopedSlots?: { [key: string]: Function }
  54. }
  55. declare type VNodeDirective = {
  56. name: string;
  57. rawName: string;
  58. value?: any;
  59. oldValue?: any;
  60. arg?: string;
  61. modifiers?: ASTModifiers;
  62. def?: Object;
  63. }