UNPKG

1.5 kBTypeScriptView Raw
1import { ElementUIComponent } from './component'
2
3export type CarouselIndicatorTrigger = 'hover' | 'click'
4export type CarouselIndicatorPosition = 'outside' | 'none'
5export type CarouselArrowVisibility = 'always' | 'hover' | 'never'
6export type CarouselType = 'card'
7export type CarouselDirection = 'horizontal' | 'vertical'
8
9/** Loop a series of images or texts in a limited space */
10export declare class ElCarousel extends ElementUIComponent {
11 /** Height of the carousel */
12 height: number
13
14 /** Index of the initially active slide (starting from 0) */
15 initialIndex: number
16
17 /** How indicators are triggered */
18 trigger: CarouselIndicatorTrigger
19
20 /** Whether automatically loop the slides */
21 autoplay: boolean
22
23 /** Interval of the auto loop, in milliseconds */
24 interval: number
25
26 /** Position of the indicators */
27 indicatorPosition: CarouselIndicatorPosition
28
29 /** When arrows are shown */
30 arrow: CarouselArrowVisibility
31
32 /** Type of the Carousel */
33 type: CarouselType
34
35 /** Display direction */
36 direction: CarouselDirection
37
38 /**
39 * Manually switch slide by index
40 *
41 * @param index Index of the slide to be switched to (starting from 0)
42 */
43 setActiveItem (index: number): void
44
45 /**
46 * Manually switch slide by carousel item's name
47 *
48 * @param name The name of the corresponding `el-carousel-item`
49 */
50 setActiveItem (name: string): void
51
52 /** Switch to the previous slide */
53 prev (): void
54
55 /** Switch to the next slide */
56 next (): void
57}