manipulation.d.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. export interface ManipulationMethods {
  2. /**
  3. * Add new slides to the end. slides could be
  4. * HTMLElement or HTML string with new slide or
  5. * array with such slides, for example:
  6. *
  7. * @example
  8. * ```js
  9. * appendSlide('<div class="swiper-slide">Slide 10"</div>')
  10. *
  11. * appendSlide([
  12. * '<div class="swiper-slide">Slide 10"</div>',
  13. * '<div class="swiper-slide">Slide 11"</div>'
  14. * ]);
  15. * ```
  16. */
  17. appendSlide(slides: HTMLElement | string | string[] | HTMLElement[]): void;
  18. /**
  19. * Add new slides to the beginning. slides could be
  20. * HTMLElement or HTML string with new slide or array with such slides, for example:
  21. *
  22. * @example
  23. * ```js
  24. * prependSlide('<div class="swiper-slide">Slide 0"</div>')
  25. *
  26. * prependSlide([
  27. * '<div class="swiper-slide">Slide 1"</div>',
  28. * '<div class="swiper-slide">Slide 2"</div>'
  29. * ]);
  30. * ```
  31. */
  32. prependSlide(slides: HTMLElement | string | string[] | HTMLElement[]): void;
  33. /**
  34. * Add new slides to the required index. slides could be HTMLElement or HTML string with new slide or array with such slides, for example:
  35. *
  36. * @example
  37. * ```js
  38. * addSlide(1, '<div class="swiper-slide">Slide 10"</div>')
  39. *
  40. * addSlide(1, [
  41. * '<div class="swiper-slide">Slide 10"</div>',
  42. * '<div class="swiper-slide">Slide 11"</div>'
  43. * ]);
  44. * ```
  45. */
  46. addSlide(index: number, slides: HTMLElement | string | string[] | HTMLElement[]): void;
  47. /**
  48. * Remove selected slides. slideIndex could be a number with slide index to remove or array with indexes.
  49. *
  50. * @example
  51. * ```js
  52. * removeSlide(0); // remove first slide
  53. * removeSlide([0, 1]); // remove first and second slides
  54. * removeAllSlides(); // Remove all slides
  55. * ```
  56. */
  57. removeSlide(slideIndex: number | number[]): void;
  58. /**
  59. * Remove all slides
  60. */
  61. removeAllSlides(): void;
  62. }
  63. export interface ManipulationEvents {}
  64. export interface ManipulationOptions {}