vnode.d.ts 1.6 KB

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