Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

43 righe
1.2 KiB

  1. import { ScrollbarPlugin } from 'smooth-scrollbar';
  2. export declare enum OverscrollEffect {
  3. BOUNCE = "bounce",
  4. GLOW = "glow"
  5. }
  6. export declare type Data2d = {
  7. x: number;
  8. y: number;
  9. };
  10. export declare type OnScrollCallback = (this: OverscrollPlugin, position: Data2d) => void;
  11. export declare type OverscrollOptions = {
  12. effect?: OverscrollEffect;
  13. onScroll?: OnScrollCallback;
  14. damping: number;
  15. maxOverscroll: number;
  16. glowColor: string;
  17. };
  18. export default class OverscrollPlugin extends ScrollbarPlugin {
  19. static pluginName: string;
  20. static defaultOptions: OverscrollOptions;
  21. options: OverscrollOptions;
  22. private _glow;
  23. private _bounce;
  24. private _wheelScrollBack;
  25. private _lockWheel;
  26. private readonly _isWheelLocked;
  27. private _touching;
  28. private _lastEventType;
  29. private _amplitude;
  30. private _position;
  31. private readonly _enabled;
  32. private _releaseWheel;
  33. onInit(): void;
  34. onUpdate(): void;
  35. onRender(remainMomentum: Data2d): void;
  36. transformDelta(delta: Data2d, fromEvent: Event): Data2d;
  37. private _willOverscroll;
  38. private _absorbMomentum;
  39. private _addAmplitude;
  40. private _render;
  41. private _nextAmp;
  42. }