vnode.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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: ?VNodeChildren;
  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> | 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. isRootInsert: boolean;
  28. }
  29. declare interface VNodeData {
  30. key?: string | number;
  31. slot?: string;
  32. ref?: string;
  33. tag?: string;
  34. staticClass?: string;
  35. class?: any;
  36. style?: Array<Object> | Object;
  37. props?: { [key: string]: any };
  38. attrs?: { [key: string]: string };
  39. domProps?: { [key: string]: any };
  40. hook?: { [key: string]: Function };
  41. on?: ?{ [key: string]: Function | Array<Function> };
  42. nativeOn?: { [key: string]: Function | Array<Function> };
  43. transition?: Object;
  44. show?: boolean; // marker for v-show
  45. inlineTemplate?: {
  46. render: Function;
  47. staticRenderFns: Array<Function>;
  48. };
  49. directives?: Array<VNodeDirective>;
  50. keepAlive?: boolean;
  51. }
  52. declare type VNodeDirective = {
  53. name: string;
  54. rawName: string;
  55. value?: any;
  56. oldValue?: any;
  57. arg?: string;
  58. modifiers?: { [key: string]: boolean };
  59. def?: Object;
  60. }