index.d.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import { GUI } from '../../core';
  2. import type { Group } from '../../shapes';
  3. import type { ScrollbarOptions, ScrollbarStyleProps } from './types';
  4. export type { ScrollbarOptions, ScrollbarStyleProps };
  5. export declare class Scrollbar extends GUI<ScrollbarStyleProps> {
  6. static tag: string;
  7. private slider;
  8. private range;
  9. private get padding();
  10. constructor(options: ScrollbarOptions);
  11. private get value();
  12. private get trackLength();
  13. private get availableSpace();
  14. private get trackRadius();
  15. private get thumbRadius();
  16. /**
  17. * accord to thumbLen and value, calculate the values of slider
  18. */
  19. private getValues;
  20. getValue(): number;
  21. private renderSlider;
  22. render(attributes: ScrollbarStyleProps, container: Group): void;
  23. /**
  24. * 设置value
  25. * @param value 当前位置的占比
  26. */
  27. setValue(value: number, animate?: boolean): void;
  28. /**
  29. * 值改变事件
  30. */
  31. private onValueChange;
  32. bindEvents(): void;
  33. /**
  34. * 根据orient取出对应轴向上的值
  35. * 主要用于取鼠标坐标在orient方向上的位置
  36. */
  37. private getOrientVal;
  38. /**
  39. * 点击轨道事件
  40. */
  41. private onTrackClick;
  42. /**
  43. * 悬浮事件
  44. */
  45. private onHover;
  46. private onThumbMouseenter;
  47. private onTrackMouseenter;
  48. private onThumbMouseleave;
  49. private onTrackMouseleave;
  50. }