tour.d.ts 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. import { IconPropType } from "../../../utils/vue/icon.js";
  2. import { EpPropFinalized, EpPropMergeType } from "../../../utils/vue/props/types.js";
  3. import { TourContentProps } from "./content.js";
  4. import { TourGap, TourMask } from "./types.js";
  5. import _default from "./tour.vue.js";
  6. import * as _$vue from "vue";
  7. import { CSSProperties, ExtractPublicPropTypes } from "vue";
  8. import * as _$_floating_ui_dom0 from "@floating-ui/dom";
  9. //#region ../../packages/components/tour/src/tour.d.ts
  10. interface TourProps {
  11. /**
  12. * @description open tour
  13. */
  14. modelValue?: boolean;
  15. /**
  16. * @description what is the current step
  17. */
  18. current?: number;
  19. /**
  20. * @description whether to show the arrow
  21. */
  22. showArrow?: boolean;
  23. /**
  24. * @description whether to show a close button
  25. */
  26. showClose?: boolean;
  27. /**
  28. * @description custom close icon
  29. */
  30. closeIcon?: IconPropType;
  31. /**
  32. * @description position of the guide card relative to the target element
  33. */
  34. placement?: TourContentProps['placement'];
  35. /**
  36. * @description custom style for content
  37. */
  38. contentStyle?: CSSProperties;
  39. /**
  40. * @description whether to enable masking, change mask style and fill color by pass custom props
  41. */
  42. mask?: TourMask;
  43. /**
  44. * @description transparent gap between mask and target
  45. */
  46. gap?: TourGap;
  47. /**
  48. * @description tour's zIndex
  49. */
  50. zIndex?: number;
  51. /**
  52. * @description support pass custom scrollIntoView options
  53. */
  54. scrollIntoViewOptions?: boolean | ScrollIntoViewOptions;
  55. /**
  56. * @description type, affects the background color and text color
  57. */
  58. type?: 'default' | 'primary';
  59. /**
  60. * @description which element the TourContent appends to
  61. */
  62. appendTo?: string | HTMLElement;
  63. /**
  64. * @description whether the Tour can be closed by pressing ESC
  65. */
  66. closeOnPressEscape?: boolean;
  67. /**
  68. * @description whether the target element can be clickable, when using mask
  69. */
  70. targetAreaClickable?: boolean;
  71. }
  72. /**
  73. * @deprecated Removed after 3.0.0, Use `TourProps` instead.
  74. */
  75. declare const tourProps: {
  76. modelValue: BooleanConstructor;
  77. current: EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
  78. showArrow: EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
  79. showClose: EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
  80. closeIcon: {
  81. readonly type: _$vue.PropType<EpPropMergeType<(new (...args: any[]) => (string | _$vue.Component) & {}) | (() => string | _$vue.Component) | (((new (...args: any[]) => (string | _$vue.Component) & {}) | (() => string | _$vue.Component)) | null)[], unknown, unknown>>;
  82. readonly required: false;
  83. readonly validator: ((val: unknown) => boolean) | undefined;
  84. __epPropKey: true;
  85. };
  86. placement: EpPropFinalized<(new (...args: any[]) => "left" | "right" | "bottom" | "top" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => _$_floating_ui_dom0.Placement) | (((new (...args: any[]) => "left" | "right" | "bottom" | "top" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => _$_floating_ui_dom0.Placement)) | null)[], "left" | "right" | "bottom" | "top" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end", unknown, string, boolean>;
  87. contentStyle: {
  88. readonly type: _$vue.PropType<CSSProperties>;
  89. readonly required: false;
  90. readonly validator: ((val: unknown) => boolean) | undefined;
  91. __epPropKey: true;
  92. };
  93. mask: EpPropFinalized<(new (...args: any[]) => boolean | {
  94. style?: CSSProperties;
  95. color?: string;
  96. }) | (() => TourMask) | (((new (...args: any[]) => boolean | {
  97. style?: CSSProperties;
  98. color?: string;
  99. }) | (() => TourMask)) | null)[], unknown, unknown, boolean, boolean>;
  100. gap: EpPropFinalized<(new (...args: any[]) => TourGap) | (() => TourGap) | (((new (...args: any[]) => TourGap) | (() => TourGap)) | null)[], unknown, unknown, () => {
  101. offset: number;
  102. radius: number;
  103. }, boolean>;
  104. zIndex: {
  105. readonly type: _$vue.PropType<number>;
  106. readonly required: false;
  107. readonly validator: ((val: unknown) => boolean) | undefined;
  108. __epPropKey: true;
  109. };
  110. scrollIntoViewOptions: EpPropFinalized<(new (...args: any[]) => boolean | ScrollIntoViewOptions) | (() => boolean | ScrollIntoViewOptions) | (((new (...args: any[]) => boolean | ScrollIntoViewOptions) | (() => boolean | ScrollIntoViewOptions)) | null)[], unknown, unknown, () => {
  111. block: string;
  112. }, boolean>;
  113. type: {
  114. readonly type: _$vue.PropType<EpPropMergeType<(new (...args: any[]) => "default" | "primary") | (() => "default" | "primary") | (((new (...args: any[]) => "default" | "primary") | (() => "default" | "primary")) | null)[], unknown, unknown>>;
  115. readonly required: false;
  116. readonly validator: ((val: unknown) => boolean) | undefined;
  117. __epPropKey: true;
  118. };
  119. appendTo: EpPropFinalized<(new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement) | (((new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement)) | null)[], unknown, unknown, string, boolean>;
  120. closeOnPressEscape: EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
  121. targetAreaClickable: EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
  122. };
  123. /**
  124. * @deprecated Removed after 3.0.0, Use `TourProps` instead.
  125. */
  126. type TourPropsPublic = ExtractPublicPropTypes<typeof tourProps>;
  127. type TourInstance = InstanceType<typeof _default> & unknown;
  128. declare const tourEmits: {
  129. "update:modelValue": (value: boolean) => boolean;
  130. "update:current": (current: number) => boolean;
  131. close: (current: number) => boolean;
  132. finish: () => boolean;
  133. change: (current: number) => boolean;
  134. };
  135. type TourEmits = typeof tourEmits;
  136. //#endregion
  137. export { TourEmits, TourInstance, TourProps, TourPropsPublic, tourEmits, tourProps };