vnode.d.ts 1.8 KB

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