vnode.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. declare type VNodeChildren = Array<any> | 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. show?: true;
  38. props?: { [key: string]: any };
  39. attrs?: { [key: string]: string };
  40. domProps?: { [key: string]: any };
  41. hook?: { [key: string]: Function };
  42. on?: ?{ [key: string]: Function | Array<Function> };
  43. nativeOn?: { [key: string]: Function | Array<Function> };
  44. transition?: Object;
  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. value?: any;
  55. oldValue?: any;
  56. arg?: string;
  57. modifiers?: { [key: string]: boolean };
  58. }