mousewheel.d.ts 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import Swiper from '../swiper-class';
  2. import { CSSSelector } from '../shared';
  3. export interface MousewheelMethods {
  4. /**
  5. * Whether the mousewheel control is enabled
  6. */
  7. enabled: boolean;
  8. /**
  9. * Enable mousewheel control
  10. */
  11. enable(): void;
  12. /**
  13. * Disable mousewheel control
  14. */
  15. disable(): void;
  16. }
  17. export interface MousewheelEvents {
  18. /**
  19. * Event will be fired on mousewheel scroll
  20. */
  21. scroll: (swiper: Swiper, event: WheelEvent) => void;
  22. }
  23. export interface MousewheelOptions {
  24. /**
  25. * Set to `true` to force mousewheel swipes to axis. So in horizontal mode mousewheel will work only with horizontal mousewheel scrolling, and only with vertical scrolling in vertical mode.
  26. *
  27. * @default false
  28. */
  29. forceToAxis?: boolean;
  30. /**
  31. * Set to `true` and swiper will release mousewheel event and allow page scrolling when swiper is on edge positions (in the beginning or in the end)
  32. *
  33. * @default false
  34. */
  35. releaseOnEdges?: boolean;
  36. /**
  37. * Set to `true` to invert sliding direction
  38. *
  39. * @default false
  40. */
  41. invert?: boolean;
  42. /**
  43. * Multiplier of mousewheel data, allows to tweak mouse wheel sensitivity
  44. *
  45. * @default 1
  46. */
  47. sensitivity?: number;
  48. /**
  49. * String with CSS selector or HTML element of the container accepting mousewheel events. By default it is swiper
  50. *
  51. * @default 'container'
  52. */
  53. eventsTarget?: 'container' | 'wrapper' | CSSSelector | HTMLElement;
  54. /**
  55. * Minimum mousewheel scroll delta to trigger swiper slide change
  56. *
  57. * @default null
  58. */
  59. thresholdDelta?: number | null;
  60. /**
  61. * Minimum mousewheel scroll time delta (in ms) to trigger swiper slide change
  62. *
  63. * @default null
  64. */
  65. thresholdTime?: number | null;
  66. }