vnode.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. declare type VNodeChildren = 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 type MountedComponentVNode = {
  11. componentOptions: VNodeComponentOptions;
  12. child: 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> | void;
  21. text: void;
  22. elm: HTMLElement;
  23. ns: string | void;
  24. context: Component;
  25. key: string | number | void;
  26. parent?: VNodeWithData;
  27. child?: Component;
  28. isRootInsert: boolean;
  29. }
  30. declare interface VNodeData {
  31. key?: string | number;
  32. slot?: string;
  33. ref?: string;
  34. tag?: string;
  35. staticClass?: string;
  36. class?: any;
  37. style?: Array<Object> | Object;
  38. show?: true;
  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. inlineTemplate?: {
  47. render: Function;
  48. staticRenderFns: Array<Function>;
  49. };
  50. directives?: Array<VNodeDirective>;
  51. keepAlive?: boolean;
  52. }
  53. declare type VNodeDirective = {
  54. name: string;
  55. value?: any;
  56. oldValue?: any;
  57. arg?: string;
  58. modifiers?: { [key: string]: boolean };
  59. }