vnode.d.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. staticStyle?: { [key: string]: any };
  38. style?: Object[] | Object;
  39. props?: { [key: string]: any };
  40. attrs?: { [key: string]: any };
  41. domProps?: { [key: string]: any };
  42. hook?: { [key: string]: Function };
  43. on?: { [key: string]: Function | Function[] };
  44. nativeOn?: { [key: string]: Function | Function[] };
  45. transition?: Object;
  46. show?: boolean;
  47. inlineTemplate?: {
  48. render: Function;
  49. staticRenderFns: Function[];
  50. };
  51. directives?: VNodeDirective[];
  52. keepAlive?: boolean;
  53. }
  54. export interface VNodeDirective {
  55. readonly name: string;
  56. readonly value: any;
  57. readonly oldValue: any;
  58. readonly expression: any;
  59. readonly arg: string;
  60. readonly modifiers: { [key: string]: boolean };
  61. }