index.d.ts 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524
  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. * The transition speed in milliseconds.
  396. */
  397. speed?: number;
  398. /**
  399. * Determines whether to rewind the slider or not.
  400. */
  401. rewind?: boolean;
  402. /**
  403. * The transition speed on rewind in milliseconds.
  404. */
  405. rewindSpeed?: number;
  406. /**
  407. * Allows to rewind by drag.
  408. * The slider `type` must be `slide` (or `undefined`) and the `drag` option must be enabled.
  409. */
  410. rewindByDrag?: boolean;
  411. /**
  412. * Defines the slider max width, accepting the CSS format such as 10em, 80vw.
  413. */
  414. width?: number | string;
  415. /**
  416. * Defines the slider height, accepting the CSS format.
  417. */
  418. height?: number | string;
  419. /**
  420. * Fixes width of slides, accepting the CSS format.
  421. * The slider will ignore the `perPage` option if you provide this value.
  422. */
  423. fixedWidth?: number | string;
  424. /**
  425. * Fixes height of slides, accepting the CSS format.
  426. * The slider will ignore the `heightRatio` option if you provide this value.
  427. */
  428. fixedHeight?: number | string;
  429. /**
  430. * Determines height of slides by the ratio to the slider width.
  431. * For example, when the slider width is `1000` and the ratio is `0.5`, the height will be `500`.
  432. */
  433. heightRatio?: number;
  434. /**
  435. * Determines the number of slides to display in a page.
  436. */
  437. perPage?: number;
  438. /**
  439. * Determines the number of slides to move at once.
  440. */
  441. perMove?: number;
  442. /**
  443. * Determine the number of clones on each side of the slider.
  444. * In most cases, you don't need to provide this value.
  445. */
  446. clones?: number;
  447. /**
  448. * Determines whether to clone status classes for clones or not.
  449. */
  450. cloneStatus?: boolean;
  451. /**
  452. * Determines which slide should be active if there are multiple slides in a page.
  453. * Numbers and `'center'` are acceptable.
  454. */
  455. focus?: number | 'center';
  456. /**
  457. * The gap between slides. The CSS format is acceptable, such as `1em`.
  458. */
  459. gap?: number | string;
  460. /**
  461. * Sets padding left/right or top/bottom of the slider.
  462. * The CSS format is acceptable, such as `1em`.
  463. *
  464. * @example
  465. * ```ts
  466. * // By number
  467. * padding: 10,
  468. *
  469. * // By the CSS format
  470. * padding: '1rem',
  471. *
  472. * // Specifies each value for a horizontal slider
  473. * padding: { left: 10, right: 20 },
  474. * padding: { left: '1rem', right: '2rem' },
  475. *
  476. * // Specified each value for a vertical slider
  477. * padding: { top: 10, bottom: 20 },
  478. * ```
  479. */
  480. padding?: number | string | {
  481. left?: number | string;
  482. right?: number | string;
  483. } | {
  484. top?: number | string;
  485. bottom?: number | string;
  486. };
  487. /**
  488. * Determines whether to create/find arrows or not.
  489. */
  490. arrows?: boolean | 'slider';
  491. /**
  492. * Determines whether to create pagination (indicator dots) or not.
  493. */
  494. pagination?: boolean | 'slider';
  495. /**
  496. * The timing function for the CSS transition. For example, `linear`, ease or `cubic-bezier()`.
  497. */
  498. easing?: string;
  499. /**
  500. * The easing function for the drag free mode.
  501. * The default function is the `easeOutQuart` interpolation.
  502. */
  503. easingFunc?: (t: number) => number;
  504. /**
  505. * Allows to drag the slider by a mouse or swipe.
  506. * If `free`, the slider does not snap to a slide after drag.
  507. */
  508. drag?: boolean | 'free';
  509. /**
  510. * The required distance to start moving the slider by the touch action.
  511. * If you want to define the threshold for the mouse, provide an object.
  512. */
  513. dragMinThreshold?: number | {
  514. mouse: number;
  515. touch: number;
  516. };
  517. /**
  518. * Determine the power of "flick". The larger number this is, the farther the slider runs.
  519. * Around 500 is recommended.
  520. */
  521. flickPower?: number;
  522. /**
  523. * Limits the number of pages to move by "flick".
  524. */
  525. flickMaxPages?: number;
  526. /**
  527. * Destroys the slider.
  528. */
  529. destroy?: boolean | 'completely';
  530. }
  531. /**
  532. * The type for any function.
  533. *
  534. * @since 3.0.0
  535. */
  536. declare type AnyFunction = (...args: any[]) => any;
  537. /**
  538. * The type for a component.
  539. *
  540. * @since 3.0.0
  541. */
  542. declare type ComponentConstructor = (Splide: Splide, Components: Components, options: Options) => BaseComponent;
  543. /**
  544. * The interface for any component.
  545. *
  546. * @since 3.0.0
  547. */
  548. interface BaseComponent {
  549. setup?(): void;
  550. mount?(): void;
  551. destroy?(completely?: boolean): void;
  552. }
  553. /**
  554. * The interface for the Transition component.
  555. *
  556. * @since 3.0.0
  557. */
  558. interface TransitionComponent extends BaseComponent {
  559. start(index: number, done: () => void): void;
  560. cancel(): void;
  561. }
  562. /**
  563. * The interface for info of a splide instance to sync with.
  564. *
  565. * @since 3.2.8
  566. */
  567. interface SyncTarget {
  568. splide: Splide;
  569. isParent?: boolean;
  570. }
  571. /**
  572. * The interface for all components.
  573. *
  574. * @since 3.0.0
  575. */
  576. interface Components {
  577. [key: string]: BaseComponent;
  578. Options: OptionsComponent;
  579. Direction: DirectionComponent;
  580. Elements: ElementsComponent;
  581. Slides: SlidesComponent;
  582. Layout: LayoutComponent;
  583. Clones: ClonesComponent;
  584. Move: MoveComponent;
  585. Controller: ControllerComponent;
  586. Arrows: ArrowsComponent;
  587. Autoplay: AutoplayComponent;
  588. Cover: CoverComponent;
  589. Scroll: ScrollComponent;
  590. Drag: DragComponent;
  591. Keyboard: KeyboardComponent;
  592. LazyLoad: LazyLoadComponent;
  593. Pagination: PaginationComponent;
  594. Sync: SyncComponent;
  595. Wheel: WheelComponent;
  596. Transition: TransitionComponent;
  597. }
  598. /**
  599. * The interface for all internal events.
  600. *
  601. * @since 3.0.0
  602. */
  603. interface EventMap {
  604. 'mounted': () => void;
  605. 'ready': () => void;
  606. 'click': (Slide: SlideComponent, e: MouseEvent) => void;
  607. 'move': (index: number, prev: number, dest: number) => void;
  608. 'moved': (index: number, prev: number, dest: number) => void;
  609. 'shifted': () => void;
  610. 'active': (Slide: SlideComponent) => void;
  611. 'inactive': (Slide: SlideComponent) => void;
  612. 'visible': (Slide: SlideComponent) => void;
  613. 'hidden': (Slide: SlideComponent) => void;
  614. 'slide:keydown': (Slide: SlideComponent, e: KeyboardEvent) => void;
  615. 'refresh': () => void;
  616. 'updated': (options: Options) => void;
  617. 'resize': () => void;
  618. 'resized': () => void;
  619. 'drag': () => void;
  620. 'dragging': () => void;
  621. 'dragged': () => void;
  622. 'scroll': () => void;
  623. 'scrolled': () => void;
  624. 'destroy': () => void;
  625. 'arrows:mounted': (prev: HTMLButtonElement, next: HTMLButtonElement) => void;
  626. 'arrows:updated': (prev: HTMLButtonElement, next: HTMLButtonElement, prevIndex: number, nextIndex: number) => void;
  627. 'pagination:mounted': (data: PaginationData, item: PaginationItem) => void;
  628. 'pagination:updated': (data: PaginationData, prev: PaginationItem, curr: PaginationItem) => void;
  629. 'navigation:mounted': (splides: Splide[]) => void;
  630. 'autoplay:play': () => void;
  631. 'autoplay:playing': (rate: number) => void;
  632. 'autoplay:pause': () => void;
  633. 'lazyload:loaded': (img: HTMLImageElement, Slide: SlideComponent) => void;
  634. }
  635. /**
  636. * The interface for the Slides component.
  637. *
  638. * @since 3.0.0
  639. */
  640. interface SlidesComponent extends BaseComponent {
  641. update(): void;
  642. register(slide: HTMLElement, index: number, slideIndex: number): void;
  643. get(excludeClones?: boolean): SlideComponent[];
  644. getIn(page: number): SlideComponent[];
  645. getAt(index: number): SlideComponent | undefined;
  646. add(slide: string | Element | Array<string | Element>, index?: number): void;
  647. remove(selector: SlideMatcher): void;
  648. forEach(iteratee: SlidesIteratee, excludeClones?: boolean): void;
  649. filter(matcher: SlideMatcher): SlideComponent[];
  650. style(prop: string, value: string | number, useContainer?: boolean): void;
  651. getLength(excludeClones?: boolean): number;
  652. isEnough(): boolean;
  653. }
  654. /**
  655. * The iteratee function for Slides.
  656. *
  657. * @since 3.0.0
  658. */
  659. declare type SlidesIteratee = (Slide: SlideComponent, index: number, Slides: SlideComponent[]) => void;
  660. /**
  661. * The predicate function for Slides.
  662. *
  663. * @since 3.0.0
  664. */
  665. declare type SlidesPredicate = (Slide: SlideComponent, index: number, Slides: SlideComponent[]) => any;
  666. /**
  667. * The type for filtering SlideComponent objects.
  668. *
  669. * @since 3.0.0
  670. */
  671. declare type SlideMatcher = number | number[] | string | SlidesPredicate;
  672. /**
  673. * The interface for the EventBus instance.
  674. *
  675. * @since 3.0.0
  676. */
  677. interface EventBusObject {
  678. on(events: string | string[], callback: EventBusCallback, key?: object, priority?: number): void;
  679. off(events: string | string[], key?: object): void;
  680. offBy(key: object): void;
  681. emit(event: string, ...args: any[]): void;
  682. destroy(): void;
  683. }
  684. /**
  685. * The interface for each event handler object.
  686. *
  687. * @since 3.0.0
  688. */
  689. interface EventHandler {
  690. _event: string;
  691. _callback: AnyFunction;
  692. _namespace: string;
  693. _priority: number;
  694. _key?: object;
  695. }
  696. /**
  697. * The type for a callback function of the EventBus.
  698. *
  699. * @since 3.0.0
  700. */
  701. declare type EventBusCallback = AnyFunction;
  702. /**
  703. * The constructor to provided a simple event system.
  704. *
  705. * @since 3.0.0
  706. *
  707. * @return An EventBus object.
  708. */
  709. declare function EventBus(): EventBusObject;
  710. /**
  711. * The interface for the EventInterface object.
  712. *
  713. * @since 3.0.0
  714. */
  715. interface EventInterfaceObject {
  716. on<K extends keyof EventMap>(event: K, callback: EventMap[K], priority?: number): void;
  717. on(events: string | string[], callback: EventBusCallback, priority?: number): void;
  718. off<K extends keyof EventMap>(events: K | K[] | string | string[]): void;
  719. emit<K extends keyof EventMap>(event: K, ...args: Parameters<EventMap[K]>): void;
  720. emit(event: string, ...args: any[]): void;
  721. bind(target: Element | Window | Document | Array<Element | Window | Document>, events: string, callback: AnyFunction, options?: AddEventListenerOptions): void;
  722. unbind(target: Element | Window | Document | Array<Element | Window | Document>, events: string, callback?: AnyFunction): void;
  723. destroy(): void;
  724. }
  725. /**
  726. * The function that provides interface for internal and native events.
  727. *
  728. * @since 3.0.0
  729. *
  730. * @param Splide - A Splide instance.
  731. *
  732. * @return A collection of interface functions.
  733. */
  734. declare function EventInterface(Splide: Splide): EventInterfaceObject;
  735. /**
  736. * The interface for the returning value of the RequestInterval.
  737. *
  738. * @since 3.0.0
  739. */
  740. interface RequestIntervalInterface {
  741. start(resume?: boolean): void;
  742. pause(): void;
  743. rewind(): void;
  744. cancel(): void;
  745. set(interval: number): void;
  746. isPaused(): boolean;
  747. }
  748. /**
  749. * Requests interval like the native `setInterval()` with using `requestAnimationFrame`.
  750. *
  751. * @since 3.0.0
  752. *
  753. * @param interval - The interval duration in milliseconds.
  754. * @param onInterval - The callback fired on every interval.
  755. * @param onUpdate - Optional. Called on every animation frame, taking the progress rate.
  756. * @param limit - Optional. Limits the number of interval.
  757. */
  758. declare function RequestInterval(interval: number, onInterval: () => void, onUpdate?: (rate: number) => void, limit?: number): RequestIntervalInterface;
  759. /**
  760. * The interface for the State object.
  761. *
  762. * @since 3.0.0
  763. */
  764. interface StateObject {
  765. set(state: number): void;
  766. is(states: number | number[]): boolean;
  767. }
  768. /**
  769. * The function providing a super simple state system.
  770. *
  771. * @param initialState - Specifies the initial state.
  772. */
  773. declare function State(initialState: number): StateObject;
  774. /**
  775. * The interface for the returning value of the RequestInterval.
  776. *
  777. * @since 3.0.0
  778. */
  779. interface ThrottleInstance<F extends AnyFunction> extends Function {
  780. (...args: Parameters<F>): void;
  781. }
  782. /**
  783. * Returns the throttled function.
  784. *
  785. * @param func - A function to throttle.
  786. * @param duration - Optional. Throttle duration in milliseconds.
  787. *
  788. * @return A throttled function.
  789. */
  790. declare function Throttle<F extends AnyFunction>(func: F, duration?: number): ThrottleInstance<F>;
  791. /**
  792. * The frontend class for the Splide slider.
  793. *
  794. * @since 3.0.0
  795. */
  796. declare class Splide {
  797. /**
  798. * Changes the default options for all Splide instances.
  799. */
  800. static defaults: Options;
  801. /**
  802. * The collection of state numbers.
  803. */
  804. static readonly STATES: {
  805. CREATED: number;
  806. MOUNTED: number;
  807. IDLE: number;
  808. MOVING: number;
  809. DRAGGING: number;
  810. DESTROYED: number;
  811. };
  812. /**
  813. * The root element where the Splide is applied.
  814. */
  815. readonly root: HTMLElement;
  816. /**
  817. * The EventBusObject object.
  818. */
  819. readonly event: EventBusObject;
  820. /**
  821. * The collection of all component objects.
  822. */
  823. readonly Components: Components;
  824. /**
  825. * The StateObject object.
  826. */
  827. readonly state: StateObject;
  828. /**
  829. * An array with SyncTarget objects for splide instances to sync with.
  830. */
  831. readonly splides: SyncTarget[];
  832. /**
  833. * The collection of options.
  834. */
  835. private readonly _options;
  836. /**
  837. * The collection of all components.
  838. */
  839. private _Components;
  840. /**
  841. * The collection of extensions.
  842. */
  843. private _Extensions;
  844. /**
  845. * The Transition component.
  846. */
  847. private _Transition;
  848. /**
  849. * The Splide constructor.
  850. *
  851. * @param target - The selector for the target element, or the element itself.
  852. * @param options - Optional. An object with options.
  853. */
  854. constructor(target: string | HTMLElement, options?: Options);
  855. /**
  856. * Initializes the instance.
  857. *
  858. * @param Extensions - Optional. An object with extensions.
  859. * @param Transition - Optional. A Transition component.
  860. *
  861. * @return `this`
  862. */
  863. mount(Extensions?: Record<string, ComponentConstructor>, Transition?: ComponentConstructor): this;
  864. /**
  865. * Syncs the slider with the provided one.
  866. * This method must be called before the `mount()`.
  867. *
  868. * @example
  869. * ```ts
  870. * var primary = new Splide();
  871. * var secondary = new Splide();
  872. *
  873. * primary.sync( secondary );
  874. * primary.mount();
  875. * secondary.mount();
  876. * ```
  877. *
  878. * @param splide - A Splide instance to sync with.
  879. *
  880. * @return `this`
  881. */
  882. sync(splide: Splide): this;
  883. /**
  884. * Moves the slider with the following control pattern.
  885. *
  886. * | Pattern | Description |
  887. * |---|---|
  888. * | `i` | Goes to the slide `i` |
  889. * | `'+${i}'` | Increments the slide index by `i` |
  890. * | `'-${i}'` | Decrements the slide index by `i` |
  891. * | `'>'` | Goes to the next page |
  892. * | `'<'` | Goes to the previous page |
  893. * | `>${i}` | Goes to the page `i` |
  894. *
  895. * In most cases, `'>'` and `'<'` notations are enough to control the slider
  896. * because they respect `perPage` and `perMove` options.
  897. *
  898. * @example
  899. * ```ts
  900. * var splide = new Splide();
  901. *
  902. * // Goes to the slide 1:
  903. * splide.go( 1 );
  904. *
  905. * // Increments the index:
  906. * splide.go( '+2' );
  907. *
  908. * // Goes to the next page:
  909. * splide.go( '>' );
  910. *
  911. * // Goes to the page 2:
  912. * splide.go( '>2' );
  913. * ```
  914. *
  915. * @param control - A control pattern.
  916. *
  917. * @return `this`
  918. */
  919. go(control: number | string): this;
  920. /**
  921. * Registers an event handler.
  922. *
  923. * @example
  924. * ```ts
  925. * var splide = new Splide();
  926. *
  927. * // Listens to a single event:
  928. * splide.on( 'move', function() {} );
  929. *
  930. * // Listens to multiple events:
  931. * splide.on( 'move resize', function() {} );
  932. *
  933. * // Appends a namespace:
  934. * splide.on( 'move.myNamespace resize.myNamespace', function() {} );
  935. * ```
  936. *
  937. * @param events - An event name or names separated by spaces. Use a dot(.) to append a namespace.
  938. * @param callback - A callback function.
  939. *
  940. * @return `this`
  941. */
  942. on<K extends keyof EventMap>(events: K, callback: EventMap[K]): this;
  943. on(events: string | string[], callback: EventBusCallback): this;
  944. /**
  945. * Removes the registered all handlers for the specified event or events.
  946. * If you want to only remove a particular handler, use namespace to identify it.
  947. *
  948. * @example
  949. * ```ts
  950. * var splide = new Splide();
  951. *
  952. * // Removes all handlers assigned to "move":
  953. * splide.off( 'move' );
  954. *
  955. * // Only removes handlers that belong to the specified namespace:
  956. * splide.off( 'move.myNamespace' );
  957. * ```
  958. *
  959. * @param events - An event name or names separated by spaces. Use a dot(.) to append a namespace.
  960. *
  961. * @return `this`
  962. */
  963. off<K extends keyof EventMap>(events: K | K[] | string | string[]): this;
  964. /**
  965. * Emits an event and triggers registered handlers.
  966. *
  967. * @param event - An event name to emit.
  968. * @param args - Optional. Any number of arguments to pass to handlers.
  969. *
  970. * @return `this`
  971. */
  972. emit<K extends keyof EventMap>(event: K, ...args: Parameters<EventMap[K]>): this;
  973. emit(event: string, ...args: any[]): this;
  974. /**
  975. * Inserts a slide at the specified position.
  976. *
  977. * @example
  978. * ```ts
  979. * var splide = new Splide();
  980. * splide.mount();
  981. *
  982. * // Adds the slide by the HTML:
  983. * splide.add( '<li></li> );
  984. *
  985. * // or adds the element:
  986. * splide.add( document.createElement( 'li' ) );
  987. * ```
  988. *
  989. * @param slides - A slide element, an HTML string that represents a slide, or an array with them.
  990. * @param index - Optional. An index to insert a slide at.
  991. *
  992. * @return `this`
  993. */
  994. add(slides: string | HTMLElement | Array<string | HTMLElement>, index?: number): this;
  995. /**
  996. * Removes slides that match the matcher
  997. * that can be an index, an array with indices, a selector, or an iteratee function.
  998. *
  999. * @param matcher - An index, an array with indices, a selector string, or an iteratee function.
  1000. */
  1001. remove(matcher: SlideMatcher): this;
  1002. /**
  1003. * Checks the slider type.
  1004. *
  1005. * @param type - A type to test.
  1006. *
  1007. * @return `true` if the type matches the current one, or otherwise `false`.
  1008. */
  1009. is(type: string): boolean;
  1010. /**
  1011. * Refreshes the slider.
  1012. *
  1013. * @return `this`
  1014. */
  1015. refresh(): this;
  1016. /**
  1017. * Destroys the slider.
  1018. *
  1019. * @param completely - Optional. If `true`, Splide will not remount the slider by breakpoints.
  1020. *
  1021. * @return `this`
  1022. */
  1023. destroy(completely?: boolean): this;
  1024. /**
  1025. * Returns options.
  1026. *
  1027. * @return An object with the latest options.
  1028. */
  1029. get options(): Options;
  1030. /**
  1031. * Merges options to the current options and emits `updated` event.
  1032. *
  1033. * @param options - An object with new options.
  1034. */
  1035. set options(options: Options);
  1036. /**
  1037. * Returns the number of slides without clones.
  1038. *
  1039. * @return The number of slides.
  1040. */
  1041. get length(): number;
  1042. /**
  1043. * Returns the active slide index.
  1044. *
  1045. * @return The active slide index.
  1046. */
  1047. get index(): number;
  1048. }
  1049. /**
  1050. * The interface for the content of each slide.
  1051. *
  1052. * @since 3.0.0
  1053. */
  1054. interface SlideContent {
  1055. /**
  1056. * The HTML or text for each slide.
  1057. */
  1058. html?: string;
  1059. /**
  1060. * The collection of styles. They will remain after Splide is applied.
  1061. */
  1062. styles?: Record<string, string | number>;
  1063. /**
  1064. * The collection of attributes. They will remain after Splide is applied.
  1065. */
  1066. attrs?: Record<string, string | number | boolean>;
  1067. }
  1068. /**
  1069. * The interface for the config of the renderer.
  1070. *
  1071. * @since 3.0.0
  1072. */
  1073. interface RendererConfig {
  1074. /**
  1075. * The slider ID.
  1076. */
  1077. id?: string;
  1078. /**
  1079. * The additional class for the root element.
  1080. */
  1081. rootClass?: string;
  1082. /**
  1083. * The tag used for the list element.
  1084. */
  1085. listTag?: string;
  1086. /**
  1087. * The tag used for each slide.
  1088. */
  1089. slideTag?: string;
  1090. /**
  1091. * Determines whether to render arrows or not.
  1092. */
  1093. arrows?: boolean;
  1094. /**
  1095. * Keeps the slider hidden.
  1096. */
  1097. hidden?: boolean;
  1098. /**
  1099. * Determines whether to wrap the track by the slider element or not.
  1100. */
  1101. slider?: boolean;
  1102. /**
  1103. * The additional HTML rendered before the slider element.
  1104. */
  1105. beforeSlider?: string;
  1106. /**
  1107. * The additional HTML rendered after the slider element.
  1108. */
  1109. afterSlider?: string;
  1110. /**
  1111. * The additional HTML rendered before the track element.
  1112. */
  1113. beforeTrack?: string;
  1114. /**
  1115. * The additional HTML rendered after the track element.
  1116. */
  1117. afterTrack?: string;
  1118. }
  1119. /**
  1120. * The class to generate static HTML of the slider for the first view.
  1121. *
  1122. * @since 3.0.0
  1123. */
  1124. declare class SplideRenderer {
  1125. /**
  1126. * Removes a style element and clones.
  1127. *
  1128. * @param splide - A Splide instance.
  1129. */
  1130. static clean(splide: Splide): void;
  1131. /**
  1132. * Holds slide contents.
  1133. */
  1134. private readonly contents;
  1135. /**
  1136. * Stores data of slides.
  1137. */
  1138. private readonly slides;
  1139. /**
  1140. * The Direction component.
  1141. */
  1142. private readonly Direction;
  1143. /**
  1144. * Holds the Style instance.
  1145. */
  1146. private readonly Style;
  1147. /**
  1148. * Holds options.
  1149. */
  1150. private readonly options;
  1151. /**
  1152. * Holds options for this instance.
  1153. */
  1154. private readonly config;
  1155. /**
  1156. * The slider ID.
  1157. */
  1158. private readonly id;
  1159. /**
  1160. * An array with options for each breakpoint.
  1161. */
  1162. private readonly breakpoints;
  1163. /**
  1164. * The SplideRenderer constructor.
  1165. *
  1166. * @param contents - An array with slide contents. Each item must be an HTML or a plain text.
  1167. * @param options - Optional. Slider options.
  1168. * @param config - Static default options.
  1169. * @param defaults - Default options for the slider. Pass `Splide.defaults` if you are using it.
  1170. */
  1171. constructor(contents: string[] | SlideContent[], options?: Options, config?: RendererConfig, defaults?: Options);
  1172. /**
  1173. * Initializes the instance.
  1174. */
  1175. private init;
  1176. /**
  1177. * Initializes slides.
  1178. */
  1179. private initSlides;
  1180. /**
  1181. * Registers styles for the root element.
  1182. */
  1183. private registerRootStyles;
  1184. /**
  1185. * Registers styles for the track element.
  1186. */
  1187. private registerTrackStyles;
  1188. /**
  1189. * Registers styles for the list element.
  1190. */
  1191. private registerListStyles;
  1192. /**
  1193. * Registers styles for slides and clones.
  1194. */
  1195. private registerSlideStyles;
  1196. /**
  1197. * Builds multiple `translateX` for the list element.
  1198. *
  1199. * @param options - Options for each breakpoint.
  1200. *
  1201. * @return A string with multiple translate functions.
  1202. */
  1203. private buildTranslate;
  1204. /**
  1205. * Returns offset for the list element.
  1206. * This does not include gaps because it can not be converted into percent.
  1207. *
  1208. * @param options - Options for each breakpoint.
  1209. *
  1210. * @return The offset.
  1211. */
  1212. private cssOffsetClones;
  1213. /**
  1214. * Returns offset for centering the active slide.
  1215. *
  1216. * Note:
  1217. * ( 100% + gap ) / perPage - gap
  1218. * 100% / perPage + gap / perPage - gap;
  1219. * 50% / perPage + ( gap / perPage - gap ) / 2;
  1220. *
  1221. * @param options - Options for each breakpoint.
  1222. *
  1223. * @return The offset.
  1224. */
  1225. private cssOffsetCenter;
  1226. /**
  1227. * Returns offset for gaps.
  1228. *
  1229. * @param options - Options for each breakpoint.
  1230. *
  1231. * @return The offset as `calc()`.
  1232. */
  1233. private cssOffsetGaps;
  1234. /**
  1235. * Resolves the prop for the current direction and converts it into the Kebab case.
  1236. *
  1237. * @param prop - A property name to resolve.
  1238. *
  1239. * @return A resolved property name in the Kebab case.
  1240. */
  1241. private resolve;
  1242. /**
  1243. * Returns padding in the CSS format.
  1244. *
  1245. * @param options - Options.
  1246. * @param right - Determines whether to get padding right or left.
  1247. *
  1248. * @return Padding in the CSS format.
  1249. */
  1250. private cssPadding;
  1251. /**
  1252. * Returns height of the track element in the CSS format.
  1253. *
  1254. * @param options - Options.
  1255. *
  1256. * @return Height in the CSS format.
  1257. */
  1258. private cssTrackHeight;
  1259. /**
  1260. * Returns height provided though options in the CSS format.
  1261. *
  1262. * @param options - Options.
  1263. *
  1264. * @return Height in the CSS format.
  1265. */
  1266. private cssHeight;
  1267. /**
  1268. * Returns width of each slide in the CSS format.
  1269. *
  1270. * @param options - Options.
  1271. *
  1272. * @return Width in the CSS format.
  1273. */
  1274. private cssSlideWidth;
  1275. /**
  1276. * Returns height of each slide in the CSS format.
  1277. *
  1278. * @param options - Options.
  1279. *
  1280. * @return Height in the CSS format.
  1281. */
  1282. private cssSlideHeight;
  1283. /**
  1284. * Returns width or height of each slide in the CSS format, considering the current direction.
  1285. *
  1286. * @param options - Options.
  1287. *
  1288. * @return Width or height in the CSS format.
  1289. */
  1290. private cssSlideSize;
  1291. /**
  1292. * Returns the aspectRatio value to simulate the `heightRatio` option.
  1293. *
  1294. * @param options - Options.
  1295. *
  1296. * @return aspectRatio in the CSS format.
  1297. */
  1298. private cssAspectRatio;
  1299. /**
  1300. * Builds the css value by the provided value and unit.
  1301. *
  1302. * @param value - A value.
  1303. * @param unit - A CSS unit.
  1304. *
  1305. * @return A built value for a CSS value.
  1306. */
  1307. private buildCssValue;
  1308. /**
  1309. * Parses the CSS value into number and unit.
  1310. *
  1311. * @param value - A value to parse.
  1312. *
  1313. * @return An object with value and unit.
  1314. */
  1315. private parseCssValue;
  1316. /**
  1317. * Parses breakpoints and generate options for each breakpoint.
  1318. */
  1319. private parseBreakpoints;
  1320. /**
  1321. * Checks if the slide width is fixed or not.
  1322. *
  1323. * @return `true` if the slide width is fixed, or otherwise `false`.
  1324. */
  1325. private isFixedWidth;
  1326. /**
  1327. * Checks if the slider type is loop or not.
  1328. *
  1329. * @return `true` if the slider type is loop, or otherwise `false`.
  1330. */
  1331. private isLoop;
  1332. /**
  1333. * Checks if the active slide should be centered or not.
  1334. *
  1335. * @return `true` if the slide should be centered, or otherwise `false`.
  1336. */
  1337. private isCenter;
  1338. /**
  1339. * Checks if the direction is TTB or not.
  1340. *
  1341. * @return `true` if the direction is TTB, or otherwise `false`.
  1342. */
  1343. private isVertical;
  1344. /**
  1345. * Builds classes of the root element.
  1346. *
  1347. * @return Classes for the root element as a single string.
  1348. */
  1349. private buildClasses;
  1350. /**
  1351. * Converts provided attributes into a single string.
  1352. *
  1353. * @param attrs - An object with attributes.
  1354. *
  1355. * @return A built string.
  1356. */
  1357. private buildAttrs;
  1358. /**
  1359. * Converts provided styles into a single string.
  1360. *
  1361. * @param styles - An object with styles.
  1362. *
  1363. * @return A built string.
  1364. */
  1365. private buildStyles;
  1366. /**
  1367. * Generates HTML of slides with inserting provided contents.
  1368. *
  1369. * @return The HTML for all slides and clones.
  1370. */
  1371. private renderSlides;
  1372. /**
  1373. * Add the `background` style for the cover mode.
  1374. *
  1375. * @param content - A slide content.
  1376. */
  1377. private cover;
  1378. /**
  1379. * Generates clones.
  1380. *
  1381. * @param contents - An array with SlideContent objects.
  1382. */
  1383. private generateClones;
  1384. /**
  1385. * Returns the number of clones to generate.
  1386. *
  1387. * @return A number of clones.
  1388. */
  1389. private getCloneCount;
  1390. /**
  1391. * Generates arrows and the wrapper element.
  1392. *
  1393. * @return The HTML for arrows.
  1394. */
  1395. private renderArrows;
  1396. /**
  1397. * Generates an arrow HTML.
  1398. * Some attributes are temporary, and Splide changes them after mount.
  1399. *
  1400. * @param prev - Options for each breakpoint.
  1401. *
  1402. * @return The HTML for the prev or next arrow.
  1403. */
  1404. private renderArrow;
  1405. /**
  1406. * Returns the HTML of the slider.
  1407. *
  1408. * @return The generated HTML.
  1409. */
  1410. html(): string;
  1411. }
  1412. declare const EVENT_MOUNTED = "mounted";
  1413. declare const EVENT_READY = "ready";
  1414. declare const EVENT_MOVE = "move";
  1415. declare const EVENT_MOVED = "moved";
  1416. declare const EVENT_SHIFTED = "shifted";
  1417. declare const EVENT_CLICK = "click";
  1418. declare const EVENT_ACTIVE = "active";
  1419. declare const EVENT_INACTIVE = "inactive";
  1420. declare const EVENT_VISIBLE = "visible";
  1421. declare const EVENT_HIDDEN = "hidden";
  1422. declare const EVENT_SLIDE_KEYDOWN = "slide:keydown";
  1423. declare const EVENT_REFRESH = "refresh";
  1424. declare const EVENT_UPDATED = "updated";
  1425. declare const EVENT_RESIZE = "resize";
  1426. declare const EVENT_RESIZED = "resized";
  1427. declare const EVENT_REPOSITIONED = "repositioned";
  1428. declare const EVENT_DRAG = "drag";
  1429. declare const EVENT_DRAGGING = "dragging";
  1430. declare const EVENT_DRAGGED = "dragged";
  1431. declare const EVENT_SCROLL = "scroll";
  1432. declare const EVENT_SCROLLED = "scrolled";
  1433. declare const EVENT_DESTROY = "destroy";
  1434. declare const EVENT_ARROWS_MOUNTED = "arrows:mounted";
  1435. declare const EVENT_ARROWS_UPDATED = "arrows:updated";
  1436. declare const EVENT_PAGINATION_MOUNTED = "pagination:mounted";
  1437. declare const EVENT_PAGINATION_UPDATED = "pagination:updated";
  1438. declare const EVENT_NAVIGATION_MOUNTED = "navigation:mounted";
  1439. declare const EVENT_AUTOPLAY_PLAY = "autoplay:play";
  1440. declare const EVENT_AUTOPLAY_PLAYING = "autoplay:playing";
  1441. declare const EVENT_AUTOPLAY_PAUSE = "autoplay:pause";
  1442. declare const EVENT_LAZYLOAD_LOADED = "lazyload:loaded";
  1443. declare const CLASS_ROOT = "splide";
  1444. declare const CLASS_SLIDER: string;
  1445. declare const CLASS_TRACK: string;
  1446. declare const CLASS_LIST: string;
  1447. declare const CLASS_SLIDE: string;
  1448. declare const CLASS_CLONE: string;
  1449. declare const CLASS_CONTAINER: string;
  1450. declare const CLASS_ARROWS: string;
  1451. declare const CLASS_ARROW: string;
  1452. declare const CLASS_ARROW_PREV: string;
  1453. declare const CLASS_ARROW_NEXT: string;
  1454. declare const CLASS_PAGINATION: string;
  1455. declare const CLASS_PAGINATION_PAGE: string;
  1456. declare const CLASS_PROGRESS: string;
  1457. declare const CLASS_PROGRESS_BAR: string;
  1458. declare const CLASS_AUTOPLAY: string;
  1459. declare const CLASS_PLAY: string;
  1460. declare const CLASS_PAUSE: string;
  1461. declare const CLASS_SPINNER: string;
  1462. declare const CLASS_SR: string;
  1463. declare const CLASS_INITIALIZED = "is-initialized";
  1464. declare const CLASS_ACTIVE = "is-active";
  1465. declare const CLASS_PREV = "is-prev";
  1466. declare const CLASS_NEXT = "is-next";
  1467. declare const CLASS_VISIBLE = "is-visible";
  1468. declare const CLASS_LOADING = "is-loading";
  1469. /**
  1470. * The array with all status classes.
  1471. *
  1472. * @since 3.0.0
  1473. */
  1474. declare const STATUS_CLASSES: string[];
  1475. /**
  1476. * The collection of classes for elements that Splide dynamically creates.
  1477. *
  1478. * @since 3.0.0
  1479. */
  1480. declare const CLASSES: {
  1481. slide: string;
  1482. clone: string;
  1483. arrows: string;
  1484. arrow: string;
  1485. prev: string;
  1486. next: string;
  1487. pagination: string;
  1488. page: string;
  1489. spinner: string;
  1490. };
  1491. 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_SR, 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 };