vnode.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. declare type VNodeChildren = Array<any> | () => 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 interface MountedComponentVNode {
  11. componentOptions: VNodeComponentOptions;
  12. child: Component;
  13. parent: VNode;
  14. }
  15. // interface for vnodes in update modules
  16. declare interface 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. }
  27. declare interface VNodeData {
  28. pre?: true;
  29. key?: string | number;
  30. slot?: string;
  31. staticClass?: string;
  32. class?: any;
  33. style?: Array<Object> | Object;
  34. show?: true;
  35. props?: { [key: string]: any };
  36. attrs?: { [key: string]: string };
  37. staticAttrs?: { [key: string]: string };
  38. hook?: { [key: string]: Function };
  39. on?: { [key: string]: Function | Array<Function> };
  40. transition?: {
  41. definition: String | Object,
  42. appear: boolean
  43. };
  44. inlineTemplate?: {
  45. render: Function,
  46. staticRenderFns: Array<Function>
  47. };
  48. directives?: Array<VNodeDirective>;
  49. }
  50. declare type VNodeDirective = {
  51. name: string,
  52. value?: any,
  53. oldValue?: any,
  54. arg?: string,
  55. modifiers?: { [key: string]: boolean }
  56. }