zoom.d.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import Swiper from '../swiper-class';
  2. export interface ZoomMethods {
  3. /**
  4. * Whether the zoom module is enabled
  5. */
  6. enabled: boolean;
  7. /**
  8. * Current image scale ratio
  9. */
  10. scale: number;
  11. /**
  12. * Enable zoom module
  13. */
  14. enable(): void;
  15. /**
  16. * Disable zoom module
  17. */
  18. disable(): void;
  19. /**
  20. * Zoom in image of the currently active slide
  21. */
  22. in(): void;
  23. /**
  24. * Zoom out image of the currently active slide
  25. */
  26. out(): void;
  27. /**
  28. * Toggle image zoom of the currently active slide
  29. */
  30. toggle(): void;
  31. }
  32. export interface ZoomEvents {
  33. /**
  34. * Event will be fired on zoom change
  35. */
  36. zoomChange: (swiper: Swiper, scale: number, imageEl: HTMLElement, slideEl: HTMLElement) => void;
  37. }
  38. export interface ZoomOptions {
  39. /**
  40. * Maximum image zoom multiplier
  41. *
  42. * @default 3
  43. */
  44. maxRatio?: number;
  45. /**
  46. * Minimal image zoom multiplier
  47. *
  48. * @default 1
  49. */
  50. minRatio?: number;
  51. /**
  52. * Enable/disable zoom-in by slide's double tap
  53. *
  54. * @default true
  55. */
  56. toggle?: boolean;
  57. /**
  58. * CSS class name of zoom container
  59. *
  60. * @default 'swiper-zoom-container'
  61. */
  62. containerClass?: string;
  63. /**
  64. * CSS class name of zoomed in container
  65. *
  66. * @default 'swiper-slide-zoomed'
  67. */
  68. zoomedSlideClass?: string;
  69. }