vnode.d.ts 1.6 KB

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