navigation.d.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import { CSSSelector } from '../shared';
  2. import Swiper from '../swiper-class';
  3. export interface NavigationMethods {
  4. /**
  5. * HTMLElement of "next" navigation button
  6. */
  7. nextEl: HTMLElement;
  8. /**
  9. * HTMLElement of "previous" navigation button
  10. */
  11. prevEl: HTMLElement;
  12. /**
  13. * Update navigation buttons state (enabled/disabled)
  14. */
  15. update(): void;
  16. /**
  17. * Initialize navigation
  18. */
  19. init(): void;
  20. /**
  21. * Destroy navigation
  22. */
  23. destroy(): void;
  24. }
  25. export interface NavigationEvents {
  26. /**
  27. * Event will be fired on navigation hide
  28. */
  29. navigationHide: (swiper: Swiper) => void;
  30. /**
  31. * Event will be fired on navigation show
  32. */
  33. navigationShow: (swiper: Swiper) => void;
  34. }
  35. export interface NavigationOptions {
  36. /**
  37. * String with CSS selector or HTML element of the element that will work
  38. * like "next" button after click on it
  39. *
  40. * @default null
  41. */
  42. nextEl?: CSSSelector | HTMLElement | null;
  43. /**
  44. * String with CSS selector or HTML element of the element that will work
  45. * like "prev" button after click on it
  46. *
  47. * @default null
  48. */
  49. prevEl?: CSSSelector | HTMLElement | null;
  50. /**
  51. * Toggle navigation buttons visibility after click on Slider's container
  52. *
  53. * @default false
  54. */
  55. hideOnClick?: boolean;
  56. /**
  57. * CSS class name added to navigation button when it becomes disabled
  58. *
  59. * @default 'swiper-button-disabled'
  60. */
  61. disabledClass?: string;
  62. /**
  63. * CSS class name added to navigation button when it becomes hidden
  64. *
  65. * @default 'swiper-button-hidden'
  66. */
  67. hiddenClass?: string;
  68. /**
  69. * CSS class name added to navigation button when it is disabled
  70. *
  71. * @default 'swiper-button-lock'
  72. */
  73. lockClass?: string;
  74. }