scrollbar.d.ts 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. import { EpPropFinalized } from "../../../utils/vue/props/types.js";
  2. import "../../../utils/index.js";
  3. import { _default } from "./scrollbar.vue.js";
  4. import * as vue from "vue";
  5. import { ExtractPublicPropTypes, StyleValue } from "vue";
  6. //#region ../../packages/components/scrollbar/src/scrollbar.d.ts
  7. interface ScrollbarProps {
  8. /**
  9. * @description trigger distance(px)
  10. * @default 0
  11. */
  12. distance?: number;
  13. /**
  14. * @description height of scrollbar
  15. * @default ''
  16. */
  17. height?: number | string;
  18. /**
  19. * @description max height of scrollbar
  20. * @default ''
  21. */
  22. maxHeight?: number | string;
  23. /**
  24. * @description whether to use the native scrollbar
  25. */
  26. native?: boolean;
  27. /**
  28. * @description style of wrap
  29. * @default ''
  30. */
  31. wrapStyle?: StyleValue;
  32. /**
  33. * @description class of wrap
  34. * @default ''
  35. */
  36. wrapClass?: string | string[];
  37. /**
  38. * @description class of view
  39. * @default ''
  40. */
  41. viewClass?: string | string[];
  42. /**
  43. * @description style of view
  44. * @default ''
  45. */
  46. viewStyle?: StyleValue;
  47. /**
  48. * @description do not respond to container size changes, if the container size does not change, it is better to set it to optimize performance
  49. */
  50. noresize?: boolean;
  51. /**
  52. * @description element tag of the view
  53. * @default 'div'
  54. */
  55. tag?: keyof HTMLElementTagNameMap | (string & {});
  56. /**
  57. * @description always show
  58. */
  59. always?: boolean;
  60. /**
  61. * @description minimum size of scrollbar
  62. * @default 20
  63. */
  64. minSize?: number;
  65. /**
  66. * @description Wrap tabindex
  67. * @default undefined
  68. */
  69. tabindex?: number | string;
  70. /**
  71. * @description id of view
  72. */
  73. id?: string;
  74. /**
  75. * @description role of view
  76. */
  77. role?: string;
  78. /**
  79. * @description native `aria-label` attribute
  80. */
  81. ariaLabel?: string;
  82. /**
  83. * @description native `aria-orientation` attribute
  84. */
  85. ariaOrientation?: 'horizontal' | 'vertical' | 'undefined';
  86. }
  87. /**
  88. * @deprecated Removed after 3.0.0, Use `ScrollbarProps` instead.
  89. */
  90. declare const scrollbarProps: {
  91. readonly ariaLabel: StringConstructor;
  92. readonly ariaOrientation: {
  93. readonly type: vue.PropType<string>;
  94. readonly required: false;
  95. readonly validator: ((val: unknown) => boolean) | undefined;
  96. __epPropKey: true;
  97. };
  98. readonly distance: EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
  99. readonly height: EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
  100. readonly maxHeight: EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
  101. readonly native: BooleanConstructor;
  102. readonly wrapStyle: EpPropFinalized<(new (...args: any[]) => string | false | vue.CSSProperties | StyleValue[]) | (() => StyleValue) | ((new (...args: any[]) => string | false | vue.CSSProperties | StyleValue[]) | (() => StyleValue))[], unknown, unknown, "", boolean>;
  103. readonly wrapClass: EpPropFinalized<readonly [StringConstructor, ArrayConstructor], unknown, unknown, "", boolean>;
  104. readonly viewClass: EpPropFinalized<readonly [StringConstructor, ArrayConstructor], unknown, unknown, "", boolean>;
  105. readonly viewStyle: EpPropFinalized<readonly [StringConstructor, ArrayConstructor, ObjectConstructor], unknown, unknown, "", boolean>;
  106. readonly noresize: BooleanConstructor;
  107. readonly tag: EpPropFinalized<StringConstructor, unknown, unknown, "div", boolean>;
  108. readonly always: BooleanConstructor;
  109. readonly minSize: EpPropFinalized<NumberConstructor, unknown, unknown, 20, boolean>;
  110. readonly tabindex: EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, undefined, boolean>;
  111. readonly id: StringConstructor;
  112. readonly role: StringConstructor;
  113. };
  114. /**
  115. * @deprecated Removed after 3.0.0, Use `ScrollbarProps` instead.
  116. */
  117. type ScrollbarPropsPublic = ExtractPublicPropTypes<typeof scrollbarProps>;
  118. declare const scrollbarEmits: {
  119. 'end-reached': (direction: ScrollbarDirection) => boolean;
  120. scroll: ({
  121. scrollTop,
  122. scrollLeft
  123. }: {
  124. scrollTop: number;
  125. scrollLeft: number;
  126. }) => boolean;
  127. };
  128. type ScrollbarEmits = typeof scrollbarEmits;
  129. type ScrollbarDirection = 'top' | 'bottom' | 'left' | 'right';
  130. type ScrollbarInstance = InstanceType<typeof _default> & unknown;
  131. //#endregion
  132. export { ScrollbarDirection, ScrollbarEmits, ScrollbarInstance, ScrollbarProps, ScrollbarPropsPublic, scrollbarEmits, scrollbarProps };