vnode.d.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import { Vue } from "./vue";
  2. export type VNodeChildren = VNodeChildrenArrayContents | string;
  3. export interface VNodeChildrenArrayContents {
  4. [x: number]: VNode | string | VNodeChildren;
  5. }
  6. export interface VNode {
  7. tag?: string;
  8. data?: VNodeData;
  9. children?: VNode[];
  10. text?: string;
  11. elm?: Node;
  12. ns?: string;
  13. context?: Vue;
  14. key?: string | number;
  15. componentOptions?: VNodeComponentOptions;
  16. child?: Vue;
  17. parent?: VNode;
  18. raw?: boolean;
  19. isStatic?: boolean;
  20. isRootInsert: boolean;
  21. isComment: boolean;
  22. }
  23. export interface VNodeComponentOptions {
  24. Ctor: Vue;
  25. propsData?: Object;
  26. listeners?: Object;
  27. children?: VNodeChildren;
  28. tag?: string;
  29. }
  30. export interface VNodeData {
  31. key?: string | number;
  32. slot?: string;
  33. ref?: string;
  34. tag?: string;
  35. staticClass?: string;
  36. class?: any;
  37. style?: Object[] | Object;
  38. props?: { [key: string]: any };
  39. attrs?: { [key: string]: any };
  40. domProps?: { [key: string]: any };
  41. hook?: { [key: string]: Function };
  42. on?: { [key: string]: Function | Function[] };
  43. nativeOn?: { [key: string]: Function | Function[] };
  44. transition?: Object;
  45. show?: boolean;
  46. inlineTemplate?: {
  47. render: Function;
  48. staticRenderFns: Function[];
  49. };
  50. directives?: VNodeDirective[];
  51. keepAlive?: boolean;
  52. }
  53. export interface VNodeDirective {
  54. readonly name: string;
  55. readonly value: any;
  56. readonly oldValue: any;
  57. readonly expression: any;
  58. readonly arg: string;
  59. readonly modifiers: { [key: string]: boolean };
  60. }