|
1 | 1 | /* eslint no-unused-vars: 0 */ // --> OFF |
2 | 2 | /* eslint no-undef: 0 */ // --> OFF |
3 | | -import * as React from "react"; |
| 3 | +import * as React from 'react' |
4 | 4 |
|
5 | 5 | export type RenderArrowProps = { |
6 | | - type: "PREV" | "NEXT"; |
7 | | - onClick: () => void; |
8 | | - isEdge: boolean; |
9 | | -}; |
| 6 | + type: 'PREV' | 'NEXT' |
| 7 | + onClick: () => void |
| 8 | + isEdge: boolean |
| 9 | +} |
10 | 10 |
|
11 | 11 | export type RenderPaginationProps = { |
12 | | - pages: number[]; |
13 | | - activePage: number; |
| 12 | + pages: number[] |
| 13 | + activePage: number |
14 | 14 | // The onClick event that sets the state of the carousel and sends |
15 | 15 | // it to a specific page. |
16 | | - onClick: (indicatorId: string) => void; |
17 | | -}; |
| 16 | + onClick: (indicatorId: string) => void |
| 17 | +} |
18 | 18 |
|
19 | 19 | export type ItemObject = { |
20 | 20 | // Children's props |
21 | | - object: any; |
22 | | - index: number; |
23 | | -}; |
| 21 | + object: any |
| 22 | + index: number |
| 23 | +} |
24 | 24 |
|
25 | 25 | export type Breakpoint = { |
26 | | - itemsToScroll: number; |
27 | | - itemsToShow: number; |
28 | | -}; |
| 26 | + itemsToScroll: number |
| 27 | + itemsToShow: number |
| 28 | +} |
29 | 29 |
|
30 | | -export interface ReactElasticCarouselProps { |
31 | | - children: React.ReactNode; |
| 30 | +export interface NextElasticCarouselProps { |
| 31 | + children: React.ReactNode |
32 | 32 |
|
33 | | - className?: string; |
| 33 | + className?: string |
34 | 34 | // Defaults to 1 |
35 | | - itemsToShow?: number; |
| 35 | + itemsToShow?: number |
36 | 36 | // Defaults to false |
37 | | - verticalMode?: boolean; |
| 37 | + verticalMode?: boolean |
38 | 38 | // Defaults to false |
39 | | - isRTL: boolean; |
| 39 | + isRTL: boolean |
40 | 40 | // Defaults to true |
41 | | - pagination?: boolean; |
| 41 | + pagination?: boolean |
42 | 42 | // Defaults to 500 |
43 | | - transitionMs?: number; |
| 43 | + transitionMs?: number |
44 | 44 | // Defaults to "ease" |
45 | | - easing?: string; |
| 45 | + easing?: string |
46 | 46 | // Defaults to "ease" |
47 | | - tiltEasing?: string; |
| 47 | + tiltEasing?: string |
48 | 48 | // Defaults to true. |
49 | | - enableTilt?: boolean; |
| 49 | + enableTilt?: boolean |
50 | 50 | // Defaults to 1 |
51 | | - itemsToScroll?: number; |
| 51 | + itemsToScroll?: number |
52 | 52 | // Collection of objects with a width, itemsToShow and itemsToScroll |
53 | 53 | breakPoints?: { |
54 | | - width: number; |
55 | | - itemsToShow?: number; |
56 | | - itemsToScroll?: number; |
57 | | - }[]; |
| 54 | + width: number |
| 55 | + itemsToShow?: number |
| 56 | + itemsToScroll?: number |
| 57 | + }[] |
58 | 58 | // Defaults to 0 |
59 | | - initialActiveIndex?: number; |
| 59 | + initialActiveIndex?: number |
60 | 60 | // Defaults to 0 |
61 | | - initialFirstItem?: number; |
| 61 | + initialFirstItem?: number |
62 | 62 | // Defaults to true |
63 | | - showArrows?: boolean; |
| 63 | + showArrows?: boolean |
64 | 64 | // Defaults to false (not compatible with verticalMode yet !) |
65 | | - showEmptySlots?: boolean; |
| 65 | + showEmptySlots?: boolean |
66 | 66 | // Defaults to true |
67 | | - disableArrowsOnEnd?: boolean; |
| 67 | + disableArrowsOnEnd?: boolean |
68 | 68 | // Defaults to boolean |
69 | | - focusOnSelect?: boolean; |
| 69 | + focusOnSelect?: boolean |
70 | 70 | // Function to generate your own navigation arrows. |
71 | | - renderArrow?: (props: RenderArrowProps) => void; |
| 71 | + renderArrow?: (props: RenderArrowProps) => void |
72 | 72 | // Function to generate your own pagination component. |
73 | | - renderPagination?: (props: RenderPaginationProps) => JSX.Element; |
| 73 | + renderPagination?: (props: RenderPaginationProps) => JSX.Element |
74 | 74 | // Defaults to "CENTER" |
75 | | - itemPosition?: "START" | "CENTER" | "END"; |
| 75 | + itemPosition?: 'START' | 'CENTER' | 'END' |
76 | 76 | // A padding for each element - Defaults to [0,0,0,0] |
77 | | - itemPadding?: number[]; |
| 77 | + itemPadding?: number[] |
78 | 78 | // A margin at the beginning and at the end of the carousel - Defaults to 0 (not compatible with verticalMode yet !) |
79 | | - outerSpacing?: number; |
| 79 | + outerSpacing?: number |
80 | 80 | // Enable or disable swipe - Defaults to true |
81 | | - enableSwipe?: boolean; |
| 81 | + enableSwipe?: boolean |
82 | 82 | /** Enable or disable mouse swipe */ |
83 | | - enableMouseSwipe?: boolean; |
| 83 | + enableMouseSwipe?: boolean |
84 | 84 | /** Prevent page scroll on touchmove. |
85 | 85 | * Use this to stop the browser from scrolling while a user swipes. |
86 | 86 | * More details: https://github.com/FormidableLabs/react-swipeable#preventdefaulttouchmoveevent-details |
87 | 87 | */ |
88 | | - preventDefaultTouchmoveEvent?: boolean; |
| 88 | + preventDefaultTouchmoveEvent?: boolean |
89 | 89 | // Enable or disable auto play - Defaults to true |
90 | | - enableAutoPlay?: boolean; |
| 90 | + enableAutoPlay?: boolean |
91 | 91 | /** Set auto play speed (ms) - Defaults to 2000 */ |
92 | | - autoPlaySpeed?: number; |
| 92 | + autoPlaySpeed?: number |
93 | 93 | // A callback for the change of an item |
94 | | - onChange?: (currentItemObject: ItemObject, currentPageIndex: number) => void; |
| 94 | + onChange?: (currentItemObject: ItemObject, currentPageIndex: number) => void |
95 | 95 | // A callback for the beginning of the next transition |
96 | | - onNextStart?: ( |
97 | | - prevItemObject: ItemObject, |
98 | | - nextItemObject: ItemObject |
99 | | - ) => void; |
| 96 | + onNextStart?: (prevItemObject: ItemObject, nextItemObject: ItemObject) => void |
100 | 97 | // A callback for the beginning of the prev transition |
101 | | - onPrevStart?: ( |
102 | | - prevItemObject: ItemObject, |
103 | | - nextItemObject: ItemObject |
104 | | - ) => void; |
| 98 | + onPrevStart?: (prevItemObject: ItemObject, nextItemObject: ItemObject) => void |
105 | 99 | // A callback for the end of the next transition |
106 | | - onNextEnd?: (nextItemObject: ItemObject, currentPageIndex: number) => void; |
| 100 | + onNextEnd?: (nextItemObject: ItemObject, currentPageIndex: number) => void |
107 | 101 | // A callback for the end of the prev transition |
108 | | - onPrevEnd?: (nextItemObject: ItemObject, currentPageIndex: number) => void; |
| 102 | + onPrevEnd?: (nextItemObject: ItemObject, currentPageIndex: number) => void |
109 | 103 | // A callback for the "slider-container" resize |
110 | | - onResize?: (currentBreakpoint: Breakpoint) => void; |
| 104 | + onResize?: (currentBreakpoint: Breakpoint) => void |
111 | 105 | } |
112 | 106 |
|
113 | | -declare class ReactElasticCarousel extends React.Component<ReactElasticCarouselProps> {} |
| 107 | +declare class NextElasticCarousel extends React.Component<NextElasticCarouselProps> {} |
114 | 108 |
|
115 | | -export default ReactElasticCarousel; |
| 109 | +export default NextElasticCarousel |
0 commit comments