anchor.d.ts 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import { EpPropFinalized, EpPropMergeType } from "../../../utils/vue/props/types.js";
  2. import _default from "./anchor.vue.js";
  3. import * as _$vue from "vue";
  4. import { ExtractPublicPropTypes } from "vue";
  5. //#region ../../packages/components/anchor/src/anchor.d.ts
  6. interface AnchorProps {
  7. /**
  8. * @description scroll container
  9. */
  10. container?: string | HTMLElement | Window | null;
  11. /**
  12. * @description Set the offset of the anchor scroll
  13. */
  14. offset?: number;
  15. /**
  16. * @description The offset of the element starting to trigger the anchor
  17. */
  18. bound?: number;
  19. /**
  20. * @description Set the scroll duration of the container when the anchor is clicked, in milliseconds
  21. */
  22. duration?: number;
  23. /**
  24. * @description Whether to show the marker
  25. */
  26. marker?: boolean;
  27. /**
  28. * @description Set Anchor type
  29. */
  30. type?: 'default' | 'underline';
  31. /**
  32. * @description Set Anchor direction
  33. */
  34. direction?: 'vertical' | 'horizontal';
  35. /**
  36. * @description Scroll whether link is selected at the top
  37. */
  38. selectScrollTop?: boolean;
  39. }
  40. /**
  41. * @deprecated Removed after 3.0.0, Use `AnchorProps` instead.
  42. */
  43. declare const anchorProps: {
  44. container: {
  45. readonly type: _$vue.PropType<EpPropMergeType<(new (...args: any[]) => string | Window | HTMLElement) | (() => string | Window | HTMLElement | null) | (((new (...args: any[]) => string | Window | HTMLElement) | (() => string | Window | HTMLElement | null)) | null)[], unknown, unknown>>;
  46. readonly required: false;
  47. readonly validator: ((val: unknown) => boolean) | undefined;
  48. __epPropKey: true;
  49. };
  50. offset: EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
  51. bound: EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
  52. duration: EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
  53. marker: EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
  54. type: EpPropFinalized<(new (...args: any[]) => "default" | "underline") | (() => "default" | "underline") | (((new (...args: any[]) => "default" | "underline") | (() => "default" | "underline")) | null)[], unknown, unknown, string, boolean>;
  55. direction: EpPropFinalized<(new (...args: any[]) => "horizontal" | "vertical") | (() => "horizontal" | "vertical") | (((new (...args: any[]) => "horizontal" | "vertical") | (() => "horizontal" | "vertical")) | null)[], unknown, unknown, string, boolean>;
  56. selectScrollTop: BooleanConstructor;
  57. };
  58. /**
  59. * @deprecated Removed after 3.0.0, Use `AnchorProps` instead.
  60. */
  61. type AnchorPropsPublic = ExtractPublicPropTypes<typeof anchorProps>;
  62. type AnchorInstance = InstanceType<typeof _default> & unknown;
  63. declare const anchorEmits: {
  64. change: (href: string) => boolean;
  65. click: (e: MouseEvent, href?: string) => boolean;
  66. };
  67. type AnchorEmits = typeof anchorEmits;
  68. //#endregion
  69. export { AnchorEmits, AnchorInstance, AnchorProps, AnchorPropsPublic, anchorEmits, anchorProps };