carousel.d.ts 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. import * as vue from 'vue';
  2. import { Ref, VNode } from 'vue';
  3. interface Data$1 {
  4. [key: string]: unknown
  5. }
  6. declare const SNAP_ALIGN_OPTIONS = ['center', 'start', 'end', 'center-even', 'center-odd']
  7. declare const BREAKPOINT_MODE_OPTIONS = ['viewport', 'carousel']
  8. declare const DIR_OPTIONS = [
  9. 'ltr',
  10. 'left-to-right',
  11. 'rtl',
  12. 'right-to-left',
  13. 'ttb',
  14. 'top-to-bottom',
  15. 'btt',
  16. 'bottom-to-top',
  17. ]
  18. declare const I18N_DEFAULT_CONFIG = {
  19. ariaNextSlide: 'Navigate to next slide',
  20. ariaPreviousSlide: 'Navigate to previous slide',
  21. ariaNavigateToSlide: 'Navigate to slide {slideNumber}',
  22. ariaGallery: 'Gallery',
  23. itemXofY: 'Item {currentSlide} of {slidesCount}',
  24. iconArrowUp: 'Arrow pointing upwards',
  25. iconArrowDown: 'Arrow pointing downwards',
  26. iconArrowRight: 'Arrow pointing to the right',
  27. iconArrowLeft: 'Arrow pointing to the left',
  28. }
  29. type Breakpoints = { [key: number]: Partial<CarouselConfig> }
  30. type SnapAlign = (typeof SNAP_ALIGN_OPTIONS)[number]
  31. type Dir = (typeof DIR_OPTIONS)[number]
  32. type BreakpointMode = (typeof BREAKPOINT_MODE_OPTIONS)[number]
  33. type I18nKeys = keyof typeof I18N_DEFAULT_CONFIG
  34. interface CarouselConfig {
  35. enabled: boolean
  36. itemsToShow: number
  37. itemsToScroll: number
  38. modelValue?: number
  39. transition?: number
  40. gap: number
  41. autoplay?: number
  42. snapAlign: SnapAlign
  43. wrapAround?: boolean
  44. pauseAutoplayOnHover?: boolean
  45. mouseDrag?: boolean
  46. touchDrag?: boolean
  47. dir?: Dir
  48. breakpointMode?: string
  49. breakpoints?: Breakpoints
  50. height: string | number
  51. i18n: { [key in I18nKeys]?: string }
  52. }
  53. interface CarouselNav {
  54. slideTo: (index: number) => void
  55. next: () => void
  56. prev: () => void
  57. }
  58. interface CarouselData {
  59. config: CarouselConfig
  60. slidesCount: Ref<number>
  61. slideSize: Ref<number>
  62. currentSlide: Ref<number>
  63. maxSlide: Ref<number>
  64. minSlide: Ref<number>
  65. middleSlide: Ref<number>
  66. }
  67. interface CarouselMethods extends CarouselNav {
  68. updateBreakpointsConfig: () => void
  69. updateSlidesData: () => void
  70. updateSlideSize: () => void
  71. restartCarousel: () => void
  72. }
  73. interface CarouselExposed extends CarouselMethods {
  74. nav: CarouselNav
  75. data: CarouselData
  76. }
  77. declare const _default$1: vue.DefineComponent<{
  78. enabled: boolean;
  79. itemsToShow: number;
  80. itemsToScroll: number;
  81. modelValue?: number | undefined;
  82. transition?: number | undefined;
  83. gap: number;
  84. autoplay?: number | undefined;
  85. snapAlign: SnapAlign;
  86. wrapAround?: boolean | undefined;
  87. pauseAutoplayOnHover?: boolean | undefined;
  88. mouseDrag?: boolean | undefined;
  89. touchDrag?: boolean | undefined;
  90. dir?: Dir | undefined;
  91. breakpointMode?: string | undefined;
  92. breakpoints?: Breakpoints | undefined;
  93. height: string | number;
  94. i18n: { [key in I18nKeys]?: string; };
  95. }, () => VNode<vue.RendererNode, vue.RendererElement, {
  96. [key: string]: any;
  97. }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, "drag" | "init" | "slide-start" | "loop" | "update:modelValue" | "slide-end" | "before-init", vue.PublicProps, Readonly<{
  98. enabled: boolean;
  99. itemsToShow: number;
  100. itemsToScroll: number;
  101. modelValue?: number | undefined;
  102. transition?: number | undefined;
  103. gap: number;
  104. autoplay?: number | undefined;
  105. snapAlign: SnapAlign;
  106. wrapAround?: boolean | undefined;
  107. pauseAutoplayOnHover?: boolean | undefined;
  108. mouseDrag?: boolean | undefined;
  109. touchDrag?: boolean | undefined;
  110. dir?: Dir | undefined;
  111. breakpointMode?: string | undefined;
  112. breakpoints?: Breakpoints | undefined;
  113. height: string | number;
  114. i18n: { [key in I18nKeys]?: string; };
  115. }> & Readonly<{}>, {
  116. snapAlign: string;
  117. enabled: boolean;
  118. itemsToShow: number;
  119. itemsToScroll: number;
  120. modelValue: number;
  121. transition: number;
  122. gap: number;
  123. autoplay: number;
  124. wrapAround: boolean;
  125. pauseAutoplayOnHover: boolean;
  126. mouseDrag: boolean;
  127. touchDrag: boolean;
  128. dir: string;
  129. breakpointMode: string;
  130. breakpoints: Record<string, any>;
  131. height: string | number;
  132. i18n: Record<string, any>;
  133. }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
  134. interface Data {
  135. [key: string]: unknown;
  136. }
  137. declare const Icon: {
  138. (props: Data): vue.VNode<vue.RendererNode, vue.RendererElement, {
  139. [key: string]: any;
  140. }> | undefined;
  141. props: {
  142. name: StringConstructor;
  143. title: StringConstructor;
  144. };
  145. };
  146. declare const Navigation: (props: any, { slots, attrs }: any) => vue.VNode<vue.RendererNode, vue.RendererElement, {
  147. [key: string]: any;
  148. }>[];
  149. declare const Pagination: () => VNode<vue.RendererNode, vue.RendererElement, {
  150. [key: string]: any;
  151. }>;
  152. declare const _default: vue.DefineComponent<vue.ExtractPropTypes<{
  153. index: {
  154. type: NumberConstructor;
  155. default: number;
  156. };
  157. isClone: {
  158. type: BooleanConstructor;
  159. default: boolean;
  160. };
  161. }>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
  162. [key: string]: any;
  163. }> | vue.VNode<vue.RendererNode, vue.RendererElement, {
  164. [key: string]: any;
  165. }>[] | undefined, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
  166. index: {
  167. type: NumberConstructor;
  168. default: number;
  169. };
  170. isClone: {
  171. type: BooleanConstructor;
  172. default: boolean;
  173. };
  174. }>> & Readonly<{}>, {
  175. index: number;
  176. isClone: boolean;
  177. }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
  178. export { type BreakpointMode, type Breakpoints, _default$1 as Carousel, type CarouselConfig, type CarouselData, type CarouselExposed, type CarouselMethods, type CarouselNav, type Data$1 as Data, type Dir, type I18nKeys, Icon, Navigation, Pagination, _default as Slide, type SnapAlign };