util.d.ts 986 B

123456789101112131415161718192021222324252627282930313233343536
  1. import { ThumbProps } from "./thumb.js";
  2. import { CSSProperties } from "vue";
  3. //#region ../../packages/components/scrollbar/src/util.d.ts
  4. declare const GAP = 4;
  5. declare const BAR_MAP: {
  6. readonly vertical: {
  7. readonly offset: "offsetHeight";
  8. readonly scroll: "scrollTop";
  9. readonly scrollSize: "scrollHeight";
  10. readonly size: "height";
  11. readonly key: "vertical";
  12. readonly axis: "Y";
  13. readonly client: "clientY";
  14. readonly direction: "top";
  15. };
  16. readonly horizontal: {
  17. readonly offset: "offsetWidth";
  18. readonly scroll: "scrollLeft";
  19. readonly scrollSize: "scrollWidth";
  20. readonly size: "width";
  21. readonly key: "horizontal";
  22. readonly axis: "X";
  23. readonly client: "clientX";
  24. readonly direction: "left";
  25. };
  26. };
  27. declare const renderThumbStyle: ({
  28. move,
  29. size,
  30. bar
  31. }: Pick<ThumbProps, "move" | "size"> & {
  32. bar: (typeof BAR_MAP)[keyof typeof BAR_MAP];
  33. }) => CSSProperties;
  34. //#endregion
  35. export { BAR_MAP, GAP, renderThumbStyle };