index.d.ts 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517
  1. /**
  2. * The interface for the Arrows component.
  3. *
  4. * @since 3.0.0
  5. */
  6. interface ArrowsComponent extends BaseComponent {
  7. arrows: {
  8. prev?: HTMLButtonElement;
  9. next?: HTMLButtonElement;
  10. };
  11. }
  12. /**
  13. * The interface for the Autoplay component.
  14. *
  15. * @since 3.0.0
  16. */
  17. interface AutoplayComponent extends BaseComponent {
  18. play(): void;
  19. pause(): void;
  20. isPaused(): boolean;
  21. }
  22. /**
  23. * The interface for the Clone component.
  24. *
  25. * @since 3.0.0
  26. */
  27. interface ClonesComponent extends BaseComponent {
  28. }
  29. /**
  30. * The interface for the Controller component.
  31. *
  32. * @since 3.0.0
  33. */
  34. interface ControllerComponent extends BaseComponent {
  35. go(control: number | string, allowSameIndex?: boolean, callback?: AnyFunction): void;
  36. scroll(destination: number, useIndex?: boolean, snap?: boolean, duration?: number, callback?: AnyFunction): void;
  37. getNext(destination?: boolean): number;
  38. getPrev(destination?: boolean): number;
  39. getAdjacent(prev: boolean, destination?: boolean): number;
  40. getEnd(): number;
  41. setIndex(index: number): void;
  42. getIndex(prev?: boolean): number;
  43. toIndex(page: number): number;
  44. toPage(index: number): number;
  45. toDest(position: number): number;
  46. hasFocus(): boolean;
  47. }
  48. /**
  49. * The interface for the Cover component.
  50. *
  51. * @since 3.0.0
  52. */
  53. interface CoverComponent extends BaseComponent {
  54. }
  55. /**
  56. * The interface for the Direction component.
  57. *
  58. * @since 3.0.0
  59. */
  60. interface DirectionComponent extends BaseComponent {
  61. resolve(prop: string, axisOnly?: boolean): string;
  62. orient(value: number): number;
  63. }
  64. /**
  65. * The interface for the Drag component.
  66. *
  67. * @since 3.0.0
  68. */
  69. interface DragComponent extends BaseComponent {
  70. disable(disabled: boolean): void;
  71. isDragging(): boolean;
  72. }
  73. /**
  74. * The interface for elements which the slider consists of.
  75. *
  76. * @since 3.0.0
  77. */
  78. interface ElementCollection {
  79. root: HTMLElement;
  80. slider: HTMLElement;
  81. track: HTMLElement;
  82. list: HTMLElement;
  83. slides: HTMLElement[];
  84. arrows: HTMLElement;
  85. prev: HTMLButtonElement;
  86. next: HTMLButtonElement;
  87. bar: HTMLElement;
  88. autoplay: HTMLElement;
  89. play: HTMLButtonElement;
  90. pause: HTMLButtonElement;
  91. }
  92. /**
  93. * The interface for the Elements component.
  94. *
  95. * @since 3.0.0
  96. */
  97. interface ElementsComponent extends BaseComponent, ElementCollection {
  98. }
  99. /**
  100. * The interface for the Keyboard component.
  101. *
  102. * @since 3.0.0
  103. */
  104. interface KeyboardComponent extends BaseComponent {
  105. disable(disabled: boolean): void;
  106. }
  107. /**
  108. * The interface for the Layout component.
  109. *
  110. * @since 3.0.0
  111. */
  112. interface LayoutComponent extends BaseComponent {
  113. listSize(): number;
  114. slideSize(index: number, withoutGap?: boolean): number;
  115. sliderSize(): number;
  116. totalSize(index?: number, withoutGap?: boolean): number;
  117. getPadding(right: boolean): number;
  118. }
  119. /**
  120. * The interface for the Slide sub component.
  121. *
  122. * @since 3.0.0
  123. */
  124. interface SlideComponent extends BaseComponent {
  125. index: number;
  126. slideIndex: number;
  127. slide: HTMLElement;
  128. container: HTMLElement;
  129. isClone: boolean;
  130. update(): void;
  131. style(prop: string, value: string | number, useContainer?: boolean): void;
  132. isWithin(from: number, distance: number): boolean;
  133. }
  134. /**
  135. * The interface for the LazyLoad component.
  136. *
  137. * @since 3.0.0
  138. */
  139. interface LazyLoadComponent extends BaseComponent {
  140. }
  141. /**
  142. * The interface for the Move component.
  143. *
  144. * @since 3.0.0
  145. */
  146. interface MoveComponent extends BaseComponent {
  147. move(dest: number, index: number, prev: number, callback?: AnyFunction): void;
  148. jump(index: number): void;
  149. translate(position: number, preventLoop?: boolean): void;
  150. shift(position: number, backwards: boolean): number;
  151. cancel(): void;
  152. toIndex(position: number): number;
  153. toPosition(index: number, trimming?: boolean): number;
  154. getPosition(): number;
  155. getLimit(max: boolean): number;
  156. isBusy(): boolean;
  157. exceededLimit(max?: boolean | undefined, position?: number): boolean;
  158. }
  159. /**
  160. * The interface for the Options component.
  161. *
  162. * @since 3.0.0
  163. */
  164. interface OptionsComponent extends BaseComponent {
  165. }
  166. /**
  167. * The interface for the Pagination component.
  168. *
  169. * @since 3.0.0
  170. */
  171. interface PaginationComponent extends BaseComponent {
  172. items: PaginationItem[];
  173. getAt(index: number): PaginationItem;
  174. update(): void;
  175. }
  176. /**
  177. * The interface for data of the pagination.
  178. *
  179. * @since 3.0.0
  180. */
  181. interface PaginationData {
  182. list: HTMLUListElement;
  183. items: PaginationItem[];
  184. }
  185. /**
  186. * The interface for each pagination item.
  187. *
  188. * @since 3.0.0
  189. */
  190. interface PaginationItem {
  191. li: HTMLLIElement;
  192. button: HTMLButtonElement;
  193. page: number;
  194. }
  195. /**
  196. * The interface for the Scroll component.
  197. *
  198. * @since 3.0.0
  199. */
  200. interface ScrollComponent extends BaseComponent {
  201. scroll(position: number, duration?: number, callback?: AnyFunction): void;
  202. cancel(): void;
  203. }
  204. /**
  205. * The interface for the Sync component.
  206. *
  207. * @since 3.0.0
  208. */
  209. interface SyncComponent extends BaseComponent {
  210. remount(): void;
  211. }
  212. /**
  213. * The interface for the Wheel component.
  214. *
  215. * @since 3.0.0
  216. */
  217. interface WheelComponent extends BaseComponent {
  218. }
  219. /**
  220. * The interface for options.
  221. *
  222. * @since 3.0.0
  223. */
  224. interface Options extends ResponsiveOptions {
  225. /**
  226. * The type of the slider.
  227. * - 'slide': A slider with the slide transition
  228. * - 'loop' : A carousel slider
  229. * - 'fade' : A slider with the fade transition. This does not support the perPage option.
  230. */
  231. type?: string;
  232. /**
  233. * Determines whether to disable any actions while the slider is transitioning.
  234. * Even if `false`, the slider forcibly waits for transition on the loop points.
  235. */
  236. waitForTransition?: boolean;
  237. /**
  238. * If `true`, the width of slides are determined by their width.
  239. * The `perPage` and `perMove` options should be `1`.
  240. */
  241. autoWidth?: boolean;
  242. /**
  243. * If `true`, the height of slides are determined by their height.
  244. * The `perPage` and `perMove` options should be `1`.
  245. */
  246. autoHeight?: boolean;
  247. /**
  248. * The start index.
  249. */
  250. start?: number;
  251. /**
  252. * Changes the arrow SVG path, like 'm7.61 0.807-2.12...'.
  253. */
  254. arrowPath?: string;
  255. /**
  256. * Determines whether to activate autoplay or not.
  257. * If `paused`, it will not begin when the slider becomes active.
  258. * You need to provided play/pause buttons or manually start it by `Autoplay#play()`.
  259. */
  260. autoplay?: boolean | 'pause';
  261. /**
  262. * The autoplay interval in milliseconds.
  263. */
  264. interval?: number;
  265. /**
  266. * Determines whether to pause autoplay on mouseover.
  267. */
  268. pauseOnHover?: boolean;
  269. /**
  270. * Determines whether to pause autoplay when the slider contains the active element (focused element).
  271. * This should be `true` for accessibility.
  272. */
  273. pauseOnFocus?: boolean;
  274. /**
  275. * Determines whether to reset the autoplay progress when it is requested to start again.
  276. */
  277. resetProgress?: boolean;
  278. /**
  279. * Enables lazy loading.
  280. * Provide the `src` by the `data-splide-lazy` or the `srcset` by the `data-splide-lazy-srcset`.
  281. * You may also provide `src` for the placeholder, but the value must be different with the data.
  282. *
  283. * - `false`: Disables lazy loading
  284. * - `'nearby'`: Starts loading only images around the active slide (page)
  285. * - `'sequential'`: Loads images sequentially
  286. */
  287. lazyLoad?: boolean | 'nearby' | 'sequential';
  288. /**
  289. * Determine how many pages (not slides) around the active slide should be loaded beforehand.
  290. * This only works when the `lazyLoad` option is `'nearby'`.
  291. */
  292. preloadPages?: number;
  293. /**
  294. * Determines whether to enable keyboard shortcuts or not.
  295. * - `true` or `'global'`: Listens to the `keydown` event of the document.
  296. * - 'focused': Listens to the `keydown` event of the slider root element with adding `tabindex="0"` to it.
  297. * - `false`: Disables keyboard shortcuts.
  298. */
  299. keyboard?: boolean | string;
  300. /**
  301. * Enables navigation by the mouse wheel.
  302. * The `waitForTransition` option should be `true`.
  303. */
  304. wheel?: boolean;
  305. /**
  306. * Determines whether to release the wheel event when the slider reaches the first or last slide.
  307. */
  308. releaseWheel?: boolean;
  309. /**
  310. * The direction of the slider.
  311. * - 'ltr': Left to right
  312. * - 'rtl': Right to left
  313. * - 'ttb': Top to bottom
  314. */
  315. direction?: 'ltr' | 'rtl' | 'ttb';
  316. /**
  317. * Converts the image `src` to the css `background-image` URL of the parent element.
  318. * This requires `fixedHeight` or `heightRatio` option.
  319. */
  320. cover?: boolean;
  321. /**
  322. * Determines whether to add `tabindex="0"` to visible slides or not.
  323. */
  324. slideFocus?: boolean;
  325. /**
  326. * If `true`, the slider makes slides clickable to navigate another slider.
  327. * Use `Splide#sync()` to sync multiple sliders.
  328. */
  329. isNavigation?: boolean;
  330. /**
  331. * Determines whether to trim spaces before/after the slider if the `focus` option is available.
  332. * - `true`: Trims spaces. The slider may stay on the same location even when requested to move.
  333. * - `'move'`: Trims spaces and focuses to move the slider when requested.
  334. */
  335. trimSpace?: boolean | 'move';
  336. /**
  337. * Updates the `is-active` status of slides just before moving the slider.
  338. */
  339. updateOnMove?: boolean;
  340. /**
  341. * If `min`, the media query for breakpoints will be `min-width`, or otherwise, `max-width`.
  342. */
  343. mediaQuery?: 'min' | 'max';
  344. /**
  345. * The selector to get focusable elements
  346. * where `tabindex="-1"` will be assigned when their ascendant slide is hidden.
  347. */
  348. focusableNodes?: string;
  349. /**
  350. * The selector for nodes that cannot be dragged.
  351. */
  352. noDrag?: string;
  353. /**
  354. * Determines whether to use the Transition component or not.
  355. */
  356. useScroll?: boolean;
  357. /**
  358. * Options for specific breakpoints.
  359. *
  360. * @example
  361. * ```ts
  362. * {
  363. * 1000: {
  364. * perPage: 3,
  365. * gap : 20
  366. * },
  367. * 600: {
  368. * perPage: 1,
  369. * gap : 5,
  370. * },
  371. * }
  372. * ```
  373. */
  374. breakpoints?: Record<string | number, ResponsiveOptions>;
  375. /**
  376. * The collection of class names.
  377. */
  378. classes?: Record<string, string>;
  379. /**
  380. * The collection of i18n strings.
  381. */
  382. i18n?: Record<string, string>;
  383. }
  384. /**
  385. * The interface for options that can correspond with breakpoints.
  386. *
  387. * @since 3.0.0
  388. */
  389. interface ResponsiveOptions {
  390. /**
  391. * Accepts arbitrary properties for extensions, although it's not ideal typing.
  392. */
  393. [key: string]: any;
  394. /**
  395. * Determines whether to rewind the slider or not.
  396. */
  397. rewind?: boolean;
  398. /**
  399. * The transition speed in milliseconds.
  400. */
  401. speed?: number;
  402. /**
  403. * The transition speed on rewind in milliseconds.
  404. */
  405. rewindSpeed?: number;
  406. /**
  407. * Defines the slider max width, accepting the CSS format such as 10em, 80vw.
  408. */
  409. width?: number | string;
  410. /**
  411. * Defines the slider height, accepting the CSS format.
  412. */
  413. height?: number | string;
  414. /**
  415. * Fixes width of slides, accepting the CSS format.
  416. * The slider will ignore the `perPage` option if you provide this value.
  417. */
  418. fixedWidth?: number | string;
  419. /**
  420. * Fixes height of slides, accepting the CSS format.
  421. * The slider will ignore the `heightRatio` option if you provide this value.
  422. */
  423. fixedHeight?: number | string;
  424. /**
  425. * Determines height of slides by the ratio to the slider width.
  426. * For example, when the slider width is `1000` and the ratio is `0.5`, the height will be `500`.
  427. */
  428. heightRatio?: number;
  429. /**
  430. * Determines the number of slides to display in a page.
  431. */
  432. perPage?: number;
  433. /**
  434. * Determines the number of slides to move at once.
  435. */
  436. perMove?: number;
  437. /**
  438. * Determine the number of clones on each side of the slider.
  439. * In most cases, you don't need to provide this value.
  440. */
  441. clones?: number;
  442. /**
  443. * Determines whether to clone status classes for clones or not.
  444. */
  445. cloneStatus?: boolean;
  446. /**
  447. * Determines which slide should be active if there are multiple slides in a page.
  448. * Numbers and `'center'` are acceptable.
  449. */
  450. focus?: number | 'center';
  451. /**
  452. * The gap between slides. The CSS format is acceptable, such as `1em`.
  453. */
  454. gap?: number | string;
  455. /**
  456. * Sets padding left/right or top/bottom of the slider.
  457. * The CSS format is acceptable, such as `1em`.
  458. *
  459. * @example
  460. * ```ts
  461. * // By number
  462. * padding: 10,
  463. *
  464. * // By the CSS format
  465. * padding: '1rem',
  466. *
  467. * // Specifies each value for a horizontal slider
  468. * padding: { left: 10, right: 20 },
  469. * padding: { left: '1rem', right: '2rem' },
  470. *
  471. * // Specified each value for a vertical slider
  472. * padding: { top: 10, bottom: 20 },
  473. * ```
  474. */
  475. padding?: number | string | {
  476. left?: number | string;
  477. right?: number | string;
  478. } | {
  479. top?: number | string;
  480. bottom?: number | string;
  481. };
  482. /**
  483. * Determines whether to create/find arrows or not.
  484. */
  485. arrows?: boolean | 'slider';
  486. /**
  487. * Determines whether to create pagination (indicator dots) or not.
  488. */
  489. pagination?: boolean | 'slider';
  490. /**
  491. * The timing function for the CSS transition. For example, `linear`, ease or `cubic-bezier()`.
  492. */
  493. easing?: string;
  494. /**
  495. * The easing function for the drag free mode.
  496. * The default function is the `easeOutQuart` interpolation.
  497. */
  498. easingFunc?: (t: number) => number;
  499. /**
  500. * Determines whether to allow to drag the slider or not.
  501. * If `free`, the slider does not snap to a slide after drag.
  502. */
  503. drag?: boolean | 'free';
  504. /**
  505. * The required distance to start moving the slider by the touch action.
  506. * If you want to define the threshold for the mouse, provide an object.
  507. */
  508. dragMinThreshold?: number | {
  509. mouse: number;
  510. touch: number;
  511. };
  512. /**
  513. * Determine the power of "flick". The larger number this is, the farther the slider runs.
  514. * Around 500 is recommended.
  515. */
  516. flickPower?: number;
  517. /**
  518. * Limits the number of pages to move by "flick".
  519. */
  520. flickMaxPages?: number;
  521. /**
  522. * Destroys the slider.
  523. */
  524. destroy?: boolean | 'completely';
  525. }
  526. /**
  527. * The type for any function.
  528. *
  529. * @since 3.0.0
  530. */
  531. declare type AnyFunction = (...args: any[]) => any;
  532. /**
  533. * The type for a component.
  534. *
  535. * @since 3.0.0
  536. */
  537. declare type ComponentConstructor = (Splide: Splide, Components: Components, options: Options) => BaseComponent;
  538. /**
  539. * The interface for any component.
  540. *
  541. * @since 3.0.0
  542. */
  543. interface BaseComponent {
  544. setup?(): void;
  545. mount?(): void;
  546. destroy?(completely?: boolean): void;
  547. }
  548. /**
  549. * The interface for the Transition component.
  550. *
  551. * @since 3.0.0
  552. */
  553. interface TransitionComponent extends BaseComponent {
  554. start(index: number, done: () => void): void;
  555. cancel(): void;
  556. }
  557. /**
  558. * The interface for info of a splide instance to sync with.
  559. *
  560. * @since 3.2.8
  561. */
  562. interface SyncTarget {
  563. splide: Splide;
  564. isParent?: boolean;
  565. }
  566. /**
  567. * The interface for all components.
  568. *
  569. * @since 3.0.0
  570. */
  571. interface Components {
  572. [key: string]: BaseComponent;
  573. Options: OptionsComponent;
  574. Direction: DirectionComponent;
  575. Elements: ElementsComponent;
  576. Slides: SlidesComponent;
  577. Layout: LayoutComponent;
  578. Clones: ClonesComponent;
  579. Move: MoveComponent;
  580. Controller: ControllerComponent;
  581. Arrows: ArrowsComponent;
  582. Autoplay: AutoplayComponent;
  583. Cover: CoverComponent;
  584. Scroll: ScrollComponent;
  585. Drag: DragComponent;
  586. Keyboard: KeyboardComponent;
  587. LazyLoad: LazyLoadComponent;
  588. Pagination: PaginationComponent;
  589. Sync: SyncComponent;
  590. Wheel: WheelComponent;
  591. Transition: TransitionComponent;
  592. }
  593. /**
  594. * The interface for all internal events.
  595. *
  596. * @since 3.0.0
  597. */
  598. interface EventMap {
  599. 'mounted': () => void;
  600. 'ready': () => void;
  601. 'click': (Slide: SlideComponent, e: MouseEvent) => void;
  602. 'move': (index: number, prev: number, dest: number) => void;
  603. 'moved': (index: number, prev: number, dest: number) => void;
  604. 'shifted': () => void;
  605. 'active': (Slide: SlideComponent) => void;
  606. 'inactive': (Slide: SlideComponent) => void;
  607. 'visible': (Slide: SlideComponent) => void;
  608. 'hidden': (Slide: SlideComponent) => void;
  609. 'slide:keydown': (Slide: SlideComponent, e: KeyboardEvent) => void;
  610. 'refresh': () => void;
  611. 'updated': (options: Options) => void;
  612. 'resize': () => void;
  613. 'resized': () => void;
  614. 'drag': () => void;
  615. 'dragging': () => void;
  616. 'dragged': () => void;
  617. 'scroll': () => void;
  618. 'scrolled': () => void;
  619. 'destroy': () => void;
  620. 'arrows:mounted': (prev: HTMLButtonElement, next: HTMLButtonElement) => void;
  621. 'arrows:updated': (prev: HTMLButtonElement, next: HTMLButtonElement, prevIndex: number, nextIndex: number) => void;
  622. 'pagination:mounted': (data: PaginationData, item: PaginationItem) => void;
  623. 'pagination:updated': (data: PaginationData, prev: PaginationItem, curr: PaginationItem) => void;
  624. 'navigation:mounted': (splides: Splide[]) => void;
  625. 'autoplay:play': () => void;
  626. 'autoplay:playing': (rate: number) => void;
  627. 'autoplay:pause': () => void;
  628. 'lazyload:loaded': (img: HTMLImageElement, Slide: SlideComponent) => void;
  629. }
  630. /**
  631. * The interface for the Slides component.
  632. *
  633. * @since 3.0.0
  634. */
  635. interface SlidesComponent extends BaseComponent {
  636. update(): void;
  637. register(slide: HTMLElement, index: number, slideIndex: number): void;
  638. get(excludeClones?: boolean): SlideComponent[];
  639. getIn(page: number): SlideComponent[];
  640. getAt(index: number): SlideComponent | undefined;
  641. add(slide: string | Element | Array<string | Element>, index?: number): void;
  642. remove(selector: SlideMatcher): void;
  643. forEach(iteratee: SlidesIteratee, excludeClones?: boolean): void;
  644. filter(matcher: SlideMatcher): SlideComponent[];
  645. style(prop: string, value: string | number, useContainer?: boolean): void;
  646. getLength(excludeClones?: boolean): number;
  647. isEnough(): boolean;
  648. }
  649. /**
  650. * The iteratee function for Slides.
  651. *
  652. * @since 3.0.0
  653. */
  654. declare type SlidesIteratee = (Slide: SlideComponent, index: number, Slides: SlideComponent[]) => void;
  655. /**
  656. * The predicate function for Slides.
  657. *
  658. * @since 3.0.0
  659. */
  660. declare type SlidesPredicate = (Slide: SlideComponent, index: number, Slides: SlideComponent[]) => any;
  661. /**
  662. * The type for filtering SlideComponent objects.
  663. *
  664. * @since 3.0.0
  665. */
  666. declare type SlideMatcher = number | number[] | string | SlidesPredicate;
  667. /**
  668. * The interface for the EventBus instance.
  669. *
  670. * @since 3.0.0
  671. */
  672. interface EventBusObject {
  673. on(events: string | string[], callback: EventBusCallback, key?: object, priority?: number): void;
  674. off(events: string | string[], key?: object): void;
  675. offBy(key: object): void;
  676. emit(event: string, ...args: any[]): void;
  677. destroy(): void;
  678. }
  679. /**
  680. * The interface for each event handler object.
  681. *
  682. * @since 3.0.0
  683. */
  684. interface EventHandler {
  685. _event: string;
  686. _callback: AnyFunction;
  687. _namespace: string;
  688. _priority: number;
  689. _key?: object;
  690. }
  691. /**
  692. * The type for a callback function of the EventBus.
  693. *
  694. * @since 3.0.0
  695. */
  696. declare type EventBusCallback = AnyFunction;
  697. /**
  698. * The constructor to provided a simple event system.
  699. *
  700. * @since 3.0.0
  701. *
  702. * @return An EventBus object.
  703. */
  704. declare function EventBus(): EventBusObject;
  705. /**
  706. * The interface for the EventInterface object.
  707. *
  708. * @since 3.0.0
  709. */
  710. interface EventInterfaceObject {
  711. on<K extends keyof EventMap>(event: K, callback: EventMap[K], priority?: number): void;
  712. on(events: string | string[], callback: EventBusCallback, priority?: number): void;
  713. off<K extends keyof EventMap>(events: K | K[] | string | string[]): void;
  714. emit<K extends keyof EventMap>(event: K, ...args: Parameters<EventMap[K]>): void;
  715. emit(event: string, ...args: any[]): void;
  716. bind(target: Element | Window | Document | Array<Element | Window | Document>, events: string, callback: AnyFunction, options?: AddEventListenerOptions): void;
  717. unbind(target: Element | Window | Document | Array<Element | Window | Document>, events: string, callback?: AnyFunction): void;
  718. destroy(): void;
  719. }
  720. /**
  721. * The function that provides interface for internal and native events.
  722. *
  723. * @since 3.0.0
  724. *
  725. * @param Splide - A Splide instance.
  726. *
  727. * @return A collection of interface functions.
  728. */
  729. declare function EventInterface(Splide: Splide): EventInterfaceObject;
  730. /**
  731. * The interface for the returning value of the RequestInterval.
  732. *
  733. * @since 3.0.0
  734. */
  735. interface RequestIntervalInterface {
  736. start(resume?: boolean): void;
  737. pause(): void;
  738. rewind(): void;
  739. cancel(): void;
  740. set(interval: number): void;
  741. isPaused(): boolean;
  742. }
  743. /**
  744. * Requests interval like the native `setInterval()` with using `requestAnimationFrame`.
  745. *
  746. * @since 3.0.0
  747. *
  748. * @param interval - The interval duration in milliseconds.
  749. * @param onInterval - The callback fired on every interval.
  750. * @param onUpdate - Optional. Called on every animation frame, taking the progress rate.
  751. * @param limit - Optional. Limits the number of interval.
  752. */
  753. declare function RequestInterval(interval: number, onInterval: () => void, onUpdate?: (rate: number) => void, limit?: number): RequestIntervalInterface;
  754. /**
  755. * The interface for the State object.
  756. *
  757. * @since 3.0.0
  758. */
  759. interface StateObject {
  760. set(state: number): void;
  761. is(states: number | number[]): boolean;
  762. }
  763. /**
  764. * The function providing a super simple state system.
  765. *
  766. * @param initialState - Specifies the initial state.
  767. */
  768. declare function State(initialState: number): StateObject;
  769. /**
  770. * The interface for the returning value of the RequestInterval.
  771. *
  772. * @since 3.0.0
  773. */
  774. interface ThrottleInstance<F extends AnyFunction> extends Function {
  775. (...args: Parameters<F>): void;
  776. }
  777. /**
  778. * Returns the throttled function.
  779. *
  780. * @param func - A function to throttle.
  781. * @param duration - Optional. Throttle duration in milliseconds.
  782. *
  783. * @return A throttled function.
  784. */
  785. declare function Throttle<F extends AnyFunction>(func: F, duration?: number): ThrottleInstance<F>;
  786. /**
  787. * The frontend class for the Splide slider.
  788. *
  789. * @since 3.0.0
  790. */
  791. declare class Splide {
  792. /**
  793. * Changes the default options for all Splide instances.
  794. */
  795. static defaults: Options;
  796. /**
  797. * The collection of state numbers.
  798. */
  799. static readonly STATES: {
  800. CREATED: number;
  801. MOUNTED: number;
  802. IDLE: number;
  803. MOVING: number;
  804. DESTROYED: number;
  805. };
  806. /**
  807. * The root element where the Splide is applied.
  808. */
  809. readonly root: HTMLElement;
  810. /**
  811. * The EventBusObject object.
  812. */
  813. readonly event: EventBusObject;
  814. /**
  815. * The collection of all component objects.
  816. */
  817. readonly Components: Components;
  818. /**
  819. * The StateObject object.
  820. */
  821. readonly state: StateObject;
  822. /**
  823. * An array with SyncTarget objects for splide instances to sync with.
  824. */
  825. readonly splides: SyncTarget[];
  826. /**
  827. * The collection of options.
  828. */
  829. private readonly _options;
  830. /**
  831. * The collection of all components.
  832. */
  833. private _Components;
  834. /**
  835. * The collection of extensions.
  836. */
  837. private _Extensions;
  838. /**
  839. * The Transition component.
  840. */
  841. private _Transition;
  842. /**
  843. * The Splide constructor.
  844. *
  845. * @param target - The selector for the target element, or the element itself.
  846. * @param options - Optional. An object with options.
  847. */
  848. constructor(target: string | HTMLElement, options?: Options);
  849. /**
  850. * Initializes the instance.
  851. *
  852. * @param Extensions - Optional. An object with extensions.
  853. * @param Transition - Optional. A Transition component.
  854. *
  855. * @return `this`
  856. */
  857. mount(Extensions?: Record<string, ComponentConstructor>, Transition?: ComponentConstructor): this;
  858. /**
  859. * Syncs the slider with the provided one.
  860. * This method must be called before the `mount()`.
  861. *
  862. * @example
  863. * ```ts
  864. * var primary = new Splide();
  865. * var secondary = new Splide();
  866. *
  867. * primary.sync( secondary );
  868. * primary.mount();
  869. * secondary.mount();
  870. * ```
  871. *
  872. * @param splide - A Splide instance to sync with.
  873. *
  874. * @return `this`
  875. */
  876. sync(splide: Splide): this;
  877. /**
  878. * Moves the slider with the following control pattern.
  879. *
  880. * | Pattern | Description |
  881. * |---|---|
  882. * | `i` | Goes to the slide `i` |
  883. * | `'+${i}'` | Increments the slide index by `i` |
  884. * | `'-${i}'` | Decrements the slide index by `i` |
  885. * | `'>'` | Goes to the next page |
  886. * | `'<'` | Goes to the previous page |
  887. * | `>${i}` | Goes to the page `i` |
  888. *
  889. * In most cases, `'>'` and `'<'` notations are enough to control the slider
  890. * because they respect `perPage` and `perMove` options.
  891. *
  892. * @example
  893. * ```ts
  894. * var splide = new Splide();
  895. *
  896. * // Goes to the slide 1:
  897. * splide.go( 1 );
  898. *
  899. * // Increments the index:
  900. * splide.go( '+2' );
  901. *
  902. * // Goes to the next page:
  903. * splide.go( '>' );
  904. *
  905. * // Goes to the page 2:
  906. * splide.go( '>2' );
  907. * ```
  908. *
  909. * @param control - A control pattern.
  910. *
  911. * @return `this`
  912. */
  913. go(control: number | string): this;
  914. /**
  915. * Registers an event handler.
  916. *
  917. * @example
  918. * ```ts
  919. * var splide = new Splide();
  920. *
  921. * // Listens to a single event:
  922. * splide.on( 'move', function() {} );
  923. *
  924. * // Listens to multiple events:
  925. * splide.on( 'move resize', function() {} );
  926. *
  927. * // Appends a namespace:
  928. * splide.on( 'move.myNamespace resize.myNamespace', function() {} );
  929. * ```
  930. *
  931. * @param events - An event name or names separated by spaces. Use a dot(.) to append a namespace.
  932. * @param callback - A callback function.
  933. *
  934. * @return `this`
  935. */
  936. on<K extends keyof EventMap>(events: K, callback: EventMap[K]): this;
  937. on(events: string | string[], callback: EventBusCallback): this;
  938. /**
  939. * Removes the registered all handlers for the specified event or events.
  940. * If you want to only remove a particular handler, use namespace to identify it.
  941. *
  942. * @example
  943. * ```ts
  944. * var splide = new Splide();
  945. *
  946. * // Removes all handlers assigned to "move":
  947. * splide.off( 'move' );
  948. *
  949. * // Only removes handlers that belong to the specified namespace:
  950. * splide.off( 'move.myNamespace' );
  951. * ```
  952. *
  953. * @param events - An event name or names separated by spaces. Use a dot(.) to append a namespace.
  954. *
  955. * @return `this`
  956. */
  957. off<K extends keyof EventMap>(events: K | K[] | string | string[]): this;
  958. /**
  959. * Emits an event and triggers registered handlers.
  960. *
  961. * @param event - An event name to emit.
  962. * @param args - Optional. Any number of arguments to pass to handlers.
  963. *
  964. * @return `this`
  965. */
  966. emit<K extends keyof EventMap>(event: K, ...args: Parameters<EventMap[K]>): this;
  967. emit(event: string, ...args: any[]): this;
  968. /**
  969. * Inserts a slide at the specified position.
  970. *
  971. * @example
  972. * ```ts
  973. * var splide = new Splide();
  974. * splide.mount();
  975. *
  976. * // Adds the slide by the HTML:
  977. * splide.add( '<li></li> );
  978. *
  979. * // or adds the element:
  980. * splide.add( document.createElement( 'li' ) );
  981. * ```
  982. *
  983. * @param slides - A slide element, an HTML string that represents a slide, or an array with them.
  984. * @param index - Optional. An index to insert a slide at.
  985. *
  986. * @return `this`
  987. */
  988. add(slides: string | HTMLElement | Array<string | HTMLElement>, index?: number): this;
  989. /**
  990. * Removes slides that match the matcher
  991. * that can be an index, an array with indices, a selector, or an iteratee function.
  992. *
  993. * @param matcher - An index, an array with indices, a selector string, or an iteratee function.
  994. */
  995. remove(matcher: SlideMatcher): this;
  996. /**
  997. * Checks the slider type.
  998. *
  999. * @param type - A type to test.
  1000. *
  1001. * @return `true` if the type matches the current one, or otherwise `false`.
  1002. */
  1003. is(type: string): boolean;
  1004. /**
  1005. * Refreshes the slider.
  1006. *
  1007. * @return `this`
  1008. */
  1009. refresh(): this;
  1010. /**
  1011. * Destroys the slider.
  1012. *
  1013. * @param completely - Optional. If `true`, Splide will not remount the slider by breakpoints.
  1014. *
  1015. * @return `this`
  1016. */
  1017. destroy(completely?: boolean): this;
  1018. /**
  1019. * Returns options.
  1020. *
  1021. * @return An object with the latest options.
  1022. */
  1023. get options(): Options;
  1024. /**
  1025. * Merges options to the current options and emits `updated` event.
  1026. *
  1027. * @param options - An object with new options.
  1028. */
  1029. set options(options: Options);
  1030. /**
  1031. * Returns the number of slides without clones.
  1032. *
  1033. * @return The number of slides.
  1034. */
  1035. get length(): number;
  1036. /**
  1037. * Returns the active slide index.
  1038. *
  1039. * @return The active slide index.
  1040. */
  1041. get index(): number;
  1042. }
  1043. /**
  1044. * The interface for the content of each slide.
  1045. *
  1046. * @since 3.0.0
  1047. */
  1048. interface SlideContent {
  1049. /**
  1050. * The HTML or text for each slide.
  1051. */
  1052. html?: string;
  1053. /**
  1054. * The collection of styles. They will remain after Splide is applied.
  1055. */
  1056. styles?: Record<string, string | number>;
  1057. /**
  1058. * The collection of attributes. They will remain after Splide is applied.
  1059. */
  1060. attrs?: Record<string, string | number | boolean>;
  1061. }
  1062. /**
  1063. * The interface for the config of the renderer.
  1064. *
  1065. * @since 3.0.0
  1066. */
  1067. interface RendererConfig {
  1068. /**
  1069. * The slider ID.
  1070. */
  1071. id?: string;
  1072. /**
  1073. * The additional class for the root element.
  1074. */
  1075. rootClass?: string;
  1076. /**
  1077. * The tag used for the list element.
  1078. */
  1079. listTag?: string;
  1080. /**
  1081. * The tag used for each slide.
  1082. */
  1083. slideTag?: string;
  1084. /**
  1085. * Determines whether to render arrows or not.
  1086. */
  1087. arrows?: boolean;
  1088. /**
  1089. * Keeps the slider hidden.
  1090. */
  1091. hidden?: boolean;
  1092. /**
  1093. * Determines whether to wrap the track by the slider element or not.
  1094. */
  1095. slider?: boolean;
  1096. /**
  1097. * The additional HTML rendered before the slider element.
  1098. */
  1099. beforeSlider?: string;
  1100. /**
  1101. * The additional HTML rendered after the slider element.
  1102. */
  1103. afterSlider?: string;
  1104. /**
  1105. * The additional HTML rendered before the track element.
  1106. */
  1107. beforeTrack?: string;
  1108. /**
  1109. * The additional HTML rendered after the track element.
  1110. */
  1111. afterTrack?: string;
  1112. }
  1113. /**
  1114. * The class to generate static HTML of the slider for the first view.
  1115. *
  1116. * @since 3.0.0
  1117. */
  1118. declare class SplideRenderer {
  1119. /**
  1120. * Removes a style element and clones.
  1121. *
  1122. * @param splide - A Splide instance.
  1123. */
  1124. static clean(splide: Splide): void;
  1125. /**
  1126. * Holds slide contents.
  1127. */
  1128. private readonly contents;
  1129. /**
  1130. * Stores data of slides.
  1131. */
  1132. private readonly slides;
  1133. /**
  1134. * The Direction component.
  1135. */
  1136. private readonly Direction;
  1137. /**
  1138. * Holds the Style instance.
  1139. */
  1140. private readonly Style;
  1141. /**
  1142. * Holds options.
  1143. */
  1144. private readonly options;
  1145. /**
  1146. * Holds options for this instance.
  1147. */
  1148. private readonly config;
  1149. /**
  1150. * The slider ID.
  1151. */
  1152. private readonly id;
  1153. /**
  1154. * An array with options for each breakpoint.
  1155. */
  1156. private readonly breakpoints;
  1157. /**
  1158. * The SplideRenderer constructor.
  1159. *
  1160. * @param contents - An array with slide contents. Each item must be an HTML or a plain text.
  1161. * @param options - Optional. Slider options.
  1162. * @param config - Static default options.
  1163. * @param defaults - Default options for the slider. Pass `Splide.defaults` if you are using it.
  1164. */
  1165. constructor(contents: string[] | SlideContent[], options?: Options, config?: RendererConfig, defaults?: Options);
  1166. /**
  1167. * Initializes the instance.
  1168. */
  1169. private init;
  1170. /**
  1171. * Initializes slides.
  1172. */
  1173. private initSlides;
  1174. /**
  1175. * Registers styles for the root element.
  1176. */
  1177. private registerRootStyles;
  1178. /**
  1179. * Registers styles for the track element.
  1180. */
  1181. private registerTrackStyles;
  1182. /**
  1183. * Registers styles for the list element.
  1184. */
  1185. private registerListStyles;
  1186. /**
  1187. * Registers styles for slides and clones.
  1188. */
  1189. private registerSlideStyles;
  1190. /**
  1191. * Builds multiple `translateX` for the list element.
  1192. *
  1193. * @param options - Options for each breakpoint.
  1194. *
  1195. * @return A string with multiple translate functions.
  1196. */
  1197. private buildTranslate;
  1198. /**
  1199. * Returns offset for the list element.
  1200. * This does not include gaps because it can not be converted into percent.
  1201. *
  1202. * @param options - Options for each breakpoint.
  1203. *
  1204. * @return The offset.
  1205. */
  1206. private cssOffsetClones;
  1207. /**
  1208. * Returns offset for centering the active slide.
  1209. *
  1210. * Note:
  1211. * ( 100% + gap ) / perPage - gap
  1212. * 100% / perPage + gap / perPage - gap;
  1213. * 50% / perPage + ( gap / perPage - gap ) / 2;
  1214. *
  1215. * @param options - Options for each breakpoint.
  1216. *
  1217. * @return The offset.
  1218. */
  1219. private cssOffsetCenter;
  1220. /**
  1221. * Returns offset for gaps.
  1222. *
  1223. * @param options - Options for each breakpoint.
  1224. *
  1225. * @return The offset as `calc()`.
  1226. */
  1227. private cssOffsetGaps;
  1228. /**
  1229. * Resolves the prop for the current direction and converts it into the Kebab case.
  1230. *
  1231. * @param prop - A property name to resolve.
  1232. *
  1233. * @return A resolved property name in the Kebab case.
  1234. */
  1235. private resolve;
  1236. /**
  1237. * Returns padding in the CSS format.
  1238. *
  1239. * @param options - Options.
  1240. * @param right - Determines whether to get padding right or left.
  1241. *
  1242. * @return Padding in the CSS format.
  1243. */
  1244. private cssPadding;
  1245. /**
  1246. * Returns height of the track element in the CSS format.
  1247. *
  1248. * @param options - Options.
  1249. *
  1250. * @return Height in the CSS format.
  1251. */
  1252. private cssTrackHeight;
  1253. /**
  1254. * Returns height provided though options in the CSS format.
  1255. *
  1256. * @param options - Options.
  1257. *
  1258. * @return Height in the CSS format.
  1259. */
  1260. private cssHeight;
  1261. /**
  1262. * Returns width of each slide in the CSS format.
  1263. *
  1264. * @param options - Options.
  1265. *
  1266. * @return Width in the CSS format.
  1267. */
  1268. private cssSlideWidth;
  1269. /**
  1270. * Returns height of each slide in the CSS format.
  1271. *
  1272. * @param options - Options.
  1273. *
  1274. * @return Height in the CSS format.
  1275. */
  1276. private cssSlideHeight;
  1277. /**
  1278. * Returns width or height of each slide in the CSS format, considering the current direction.
  1279. *
  1280. * @param options - Options.
  1281. *
  1282. * @return Width or height in the CSS format.
  1283. */
  1284. private cssSlideSize;
  1285. /**
  1286. * Returns the aspectRatio value to simulate the `heightRatio` option.
  1287. *
  1288. * @param options - Options.
  1289. *
  1290. * @return aspectRatio in the CSS format.
  1291. */
  1292. private cssAspectRatio;
  1293. /**
  1294. * Builds the css value by the provided value and unit.
  1295. *
  1296. * @param value - A value.
  1297. * @param unit - A CSS unit.
  1298. *
  1299. * @return A built value for a CSS value.
  1300. */
  1301. private buildCssValue;
  1302. /**
  1303. * Parses the CSS value into number and unit.
  1304. *
  1305. * @param value - A value to parse.
  1306. *
  1307. * @return An object with value and unit.
  1308. */
  1309. private parseCssValue;
  1310. /**
  1311. * Parses breakpoints and generate options for each breakpoint.
  1312. */
  1313. private parseBreakpoints;
  1314. /**
  1315. * Checks if the slide width is fixed or not.
  1316. *
  1317. * @return `true` if the slide width is fixed, or otherwise `false`.
  1318. */
  1319. private isFixedWidth;
  1320. /**
  1321. * Checks if the slider type is loop or not.
  1322. *
  1323. * @return `true` if the slider type is loop, or otherwise `false`.
  1324. */
  1325. private isLoop;
  1326. /**
  1327. * Checks if the active slide should be centered or not.
  1328. *
  1329. * @return `true` if the slide should be centered, or otherwise `false`.
  1330. */
  1331. private isCenter;
  1332. /**
  1333. * Checks if the direction is TTB or not.
  1334. *
  1335. * @return `true` if the direction is TTB, or otherwise `false`.
  1336. */
  1337. private isVertical;
  1338. /**
  1339. * Builds classes of the root element.
  1340. *
  1341. * @return Classes for the root element as a single string.
  1342. */
  1343. private buildClasses;
  1344. /**
  1345. * Converts provided attributes into a single string.
  1346. *
  1347. * @param attrs - An object with attributes.
  1348. *
  1349. * @return A built string.
  1350. */
  1351. private buildAttrs;
  1352. /**
  1353. * Converts provided styles into a single string.
  1354. *
  1355. * @param styles - An object with styles.
  1356. *
  1357. * @return A built string.
  1358. */
  1359. private buildStyles;
  1360. /**
  1361. * Generates HTML of slides with inserting provided contents.
  1362. *
  1363. * @return The HTML for all slides and clones.
  1364. */
  1365. private renderSlides;
  1366. /**
  1367. * Add the `background` style for the cover mode.
  1368. *
  1369. * @param content - A slide content.
  1370. */
  1371. private cover;
  1372. /**
  1373. * Generates clones.
  1374. *
  1375. * @param contents - An array with SlideContent objects.
  1376. */
  1377. private generateClones;
  1378. /**
  1379. * Returns the number of clones to generate.
  1380. *
  1381. * @return A number of clones.
  1382. */
  1383. private getCloneCount;
  1384. /**
  1385. * Generates arrows and the wrapper element.
  1386. *
  1387. * @return The HTML for arrows.
  1388. */
  1389. private renderArrows;
  1390. /**
  1391. * Generates an arrow HTML.
  1392. * Some attributes are temporary, and Splide changes them after mount.
  1393. *
  1394. * @param prev - Options for each breakpoint.
  1395. *
  1396. * @return The HTML for the prev or next arrow.
  1397. */
  1398. private renderArrow;
  1399. /**
  1400. * Returns the HTML of the slider.
  1401. *
  1402. * @return The generated HTML.
  1403. */
  1404. html(): string;
  1405. }
  1406. declare const EVENT_MOUNTED = "mounted";
  1407. declare const EVENT_READY = "ready";
  1408. declare const EVENT_MOVE = "move";
  1409. declare const EVENT_MOVED = "moved";
  1410. declare const EVENT_SHIFTED = "shifted";
  1411. declare const EVENT_CLICK = "click";
  1412. declare const EVENT_ACTIVE = "active";
  1413. declare const EVENT_INACTIVE = "inactive";
  1414. declare const EVENT_VISIBLE = "visible";
  1415. declare const EVENT_HIDDEN = "hidden";
  1416. declare const EVENT_SLIDE_KEYDOWN = "slide:keydown";
  1417. declare const EVENT_REFRESH = "refresh";
  1418. declare const EVENT_UPDATED = "updated";
  1419. declare const EVENT_RESIZE = "resize";
  1420. declare const EVENT_RESIZED = "resized";
  1421. declare const EVENT_REPOSITIONED = "repositioned";
  1422. declare const EVENT_DRAG = "drag";
  1423. declare const EVENT_DRAGGING = "dragging";
  1424. declare const EVENT_DRAGGED = "dragged";
  1425. declare const EVENT_SCROLL = "scroll";
  1426. declare const EVENT_SCROLLED = "scrolled";
  1427. declare const EVENT_DESTROY = "destroy";
  1428. declare const EVENT_ARROWS_MOUNTED = "arrows:mounted";
  1429. declare const EVENT_ARROWS_UPDATED = "arrows:updated";
  1430. declare const EVENT_PAGINATION_MOUNTED = "pagination:mounted";
  1431. declare const EVENT_PAGINATION_UPDATED = "pagination:updated";
  1432. declare const EVENT_NAVIGATION_MOUNTED = "navigation:mounted";
  1433. declare const EVENT_AUTOPLAY_PLAY = "autoplay:play";
  1434. declare const EVENT_AUTOPLAY_PLAYING = "autoplay:playing";
  1435. declare const EVENT_AUTOPLAY_PAUSE = "autoplay:pause";
  1436. declare const EVENT_LAZYLOAD_LOADED = "lazyload:loaded";
  1437. declare const CLASS_ROOT = "splide";
  1438. declare const CLASS_SLIDER: string;
  1439. declare const CLASS_TRACK: string;
  1440. declare const CLASS_LIST: string;
  1441. declare const CLASS_SLIDE: string;
  1442. declare const CLASS_CLONE: string;
  1443. declare const CLASS_CONTAINER: string;
  1444. declare const CLASS_ARROWS: string;
  1445. declare const CLASS_ARROW: string;
  1446. declare const CLASS_ARROW_PREV: string;
  1447. declare const CLASS_ARROW_NEXT: string;
  1448. declare const CLASS_PAGINATION: string;
  1449. declare const CLASS_PAGINATION_PAGE: string;
  1450. declare const CLASS_PROGRESS: string;
  1451. declare const CLASS_PROGRESS_BAR: string;
  1452. declare const CLASS_AUTOPLAY: string;
  1453. declare const CLASS_PLAY: string;
  1454. declare const CLASS_PAUSE: string;
  1455. declare const CLASS_SPINNER: string;
  1456. declare const CLASS_INITIALIZED = "is-initialized";
  1457. declare const CLASS_ACTIVE = "is-active";
  1458. declare const CLASS_PREV = "is-prev";
  1459. declare const CLASS_NEXT = "is-next";
  1460. declare const CLASS_VISIBLE = "is-visible";
  1461. declare const CLASS_LOADING = "is-loading";
  1462. /**
  1463. * The array with all status classes.
  1464. *
  1465. * @since 3.0.0
  1466. */
  1467. declare const STATUS_CLASSES: string[];
  1468. /**
  1469. * The collection of classes for elements that Splide dynamically creates.
  1470. *
  1471. * @since 3.0.0
  1472. */
  1473. declare const CLASSES: {
  1474. slide: string;
  1475. clone: string;
  1476. arrows: string;
  1477. arrow: string;
  1478. prev: string;
  1479. next: string;
  1480. pagination: string;
  1481. page: string;
  1482. spinner: string;
  1483. };
  1484. export { AnyFunction, ArrowsComponent, AutoplayComponent, BaseComponent, CLASSES, CLASS_ACTIVE, CLASS_ARROW, CLASS_ARROWS, CLASS_ARROW_NEXT, CLASS_ARROW_PREV, CLASS_AUTOPLAY, CLASS_CLONE, CLASS_CONTAINER, CLASS_INITIALIZED, CLASS_LIST, CLASS_LOADING, CLASS_NEXT, CLASS_PAGINATION, CLASS_PAGINATION_PAGE, CLASS_PAUSE, CLASS_PLAY, CLASS_PREV, CLASS_PROGRESS, CLASS_PROGRESS_BAR, CLASS_ROOT, CLASS_SLIDE, CLASS_SLIDER, CLASS_SPINNER, CLASS_TRACK, CLASS_VISIBLE, ClonesComponent, ComponentConstructor, Components, ControllerComponent, CoverComponent, DirectionComponent, DragComponent, EVENT_ACTIVE, EVENT_ARROWS_MOUNTED, EVENT_ARROWS_UPDATED, EVENT_AUTOPLAY_PAUSE, EVENT_AUTOPLAY_PLAY, EVENT_AUTOPLAY_PLAYING, EVENT_CLICK, EVENT_DESTROY, EVENT_DRAG, EVENT_DRAGGED, EVENT_DRAGGING, EVENT_HIDDEN, EVENT_INACTIVE, EVENT_LAZYLOAD_LOADED, EVENT_MOUNTED, EVENT_MOVE, EVENT_MOVED, EVENT_NAVIGATION_MOUNTED, EVENT_PAGINATION_MOUNTED, EVENT_PAGINATION_UPDATED, EVENT_READY, EVENT_REFRESH, EVENT_REPOSITIONED, EVENT_RESIZE, EVENT_RESIZED, EVENT_SCROLL, EVENT_SCROLLED, EVENT_SHIFTED, EVENT_SLIDE_KEYDOWN, EVENT_UPDATED, EVENT_VISIBLE, ElementsComponent, EventBus, EventBusCallback, EventBusObject, EventHandler, EventInterface, EventInterfaceObject, EventMap, KeyboardComponent, LayoutComponent, LazyLoadComponent, MoveComponent, Options, OptionsComponent, PaginationComponent, PaginationData, PaginationItem, RequestInterval, RequestIntervalInterface, ResponsiveOptions, STATUS_CLASSES, ScrollComponent, SlideComponent, SlidesComponent, Splide, SplideRenderer, State, StateObject, SyncComponent, SyncTarget, Throttle, ThrottleInstance, TransitionComponent, WheelComponent, Splide as default };