Skip to content

Commit fea34b0

Browse files
authored
Merge pull request #79 from sag1v/fix-typings2
fixed typings file - resolve #76
2 parents 57052e0 + 4cd6522 commit fea34b0

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/react-elastic-carousel/components/Carousel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ Carousel.propTypes = {
667667
/** Collection of objects with a width, itemsToShow and itemsToScroll */
668668
breakPoints: PropTypes.arrayOf(
669669
PropTypes.shape({
670-
width: PropTypes.number,
670+
width: PropTypes.number.isRequired,
671671
itemsToShow: PropTypes.number,
672672
itemsToScroll: PropTypes.number
673673
})

src/react-elastic-carousel/index.d.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from "react";
1+
import * as React from "react";
22

33
type RenderArrowProps = {
44
type: "PREV" | "NEXT";
@@ -27,6 +27,7 @@ type Breakpoint = {
2727

2828
export interface ReactElasticCarouselProps {
2929
className?: string;
30+
// Defaults to 1
3031
itemsToShow?: number;
3132
// Defaults to false
3233
verticalMode?: boolean;
@@ -42,10 +43,11 @@ export interface ReactElasticCarouselProps {
4243
enableTilt?: boolean;
4344
// Defaults to 1
4445
itemsToScroll?: number;
46+
// Collection of objects with a width, itemsToShow and itemsToScroll
4547
breakPoints?: {
4648
width: number;
47-
itemsToShow: number;
48-
itemsToScroll: number;
49+
itemsToShow?: number;
50+
itemsToScroll?: number;
4951
}[];
5052
// Defaults to 0
5153
initialFirstItem?: number;
@@ -62,7 +64,7 @@ export interface ReactElasticCarouselProps {
6264
// Defaults to "CENTER"
6365
itemPosition?: "START" | "CENTER" | "END";
6466
// A padding for each element - Defaults to [0,0,0,0]
65-
itemPadding: number[];
67+
itemPadding?: number[];
6668
// Enable or disable swipe - Defaults to true
6769
enableSwipe?: boolean;
6870
/** Enable or disable mouse swipe */
@@ -76,6 +78,7 @@ export interface ReactElasticCarouselProps {
7678
enableAutoPlay?: boolean;
7779
/** Set auto play speed (ms) - Defaults to 2000 */
7880
autoPlaySpeed?: number;
81+
// A callback for the change of an item
7982
onChange?: (currentItemObject: ItemObject, currentPageIndex: number) => void;
8083
// A callback for the beginning of the next transition
8184
onNextStart?: (

0 commit comments

Comments
 (0)