vnode.js 1.9 KB

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