vnode.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. context: Component;
  11. componentOptions: VNodeComponentOptions;
  12. componentInstance: 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>;
  21. text: void;
  22. elm: any;
  23. ns: string | void;
  24. context: Component;
  25. key: string | number | void;
  26. parent?: VNodeWithData;
  27. componentInstance?: Component;
  28. isRootInsert: boolean;
  29. }
  30. declare interface VNodeData {
  31. key?: string | number;
  32. slot?: string;
  33. ref?: string;
  34. pre?: boolean;
  35. tag?: string;
  36. staticClass?: string;
  37. class?: any;
  38. staticStyle?: { [key: string]: any };
  39. style?: Array<Object> | Object;
  40. normalizedStyle?: Object;
  41. props?: { [key: string]: any };
  42. attrs?: { [key: string]: string };
  43. domProps?: { [key: string]: any };
  44. hook?: { [key: string]: Function };
  45. on?: ?{ [key: string]: Function | Array<Function> };
  46. nativeOn?: { [key: string]: Function | Array<Function> };
  47. transition?: Object;
  48. show?: boolean; // marker for v-show
  49. inlineTemplate?: {
  50. render: Function;
  51. staticRenderFns: Array<Function>;
  52. };
  53. directives?: Array<VNodeDirective>;
  54. keepAlive?: boolean;
  55. scopedSlots?: { [key: string]: Function };
  56. model?: {
  57. value: any;
  58. callback: Function;
  59. };
  60. }
  61. declare type VNodeDirective = {
  62. name: string;
  63. rawName: string;
  64. value?: any;
  65. oldValue?: any;
  66. arg?: string;
  67. modifiers?: ASTModifiers;
  68. def?: Object;
  69. }