keyboard.d.ts 839 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import Swiper from '../swiper-class';
  2. export interface KeyboardMethods {
  3. /**
  4. * Whether the keyboard control is enabled
  5. */
  6. enabled: boolean;
  7. /**
  8. * Enable keyboard control
  9. */
  10. enable(): void;
  11. /**
  12. * Disable keyboard control
  13. */
  14. disable(): void;
  15. }
  16. export interface KeyboardEvents {
  17. /**
  18. * Event will be fired on key press
  19. */
  20. keyPress: (swiper: Swiper, keyCode: string) => void;
  21. }
  22. export interface KeyboardOptions {
  23. /**
  24. * Set to `true` to enable keyboard control
  25. *
  26. * @default false
  27. */
  28. enabled?: boolean;
  29. /**
  30. * When enabled it will control sliders that are currently in viewport
  31. *
  32. * @default true
  33. */
  34. onlyInViewport?: boolean;
  35. /**
  36. * When enabled it will enable keyboard navigation by Page Up and Page Down keys
  37. *
  38. * @default true
  39. */
  40. pageUpDown?: boolean;
  41. }