tour.d.ts 6.2 KB

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