From fe8caaa6ef210987708a16b7f4c76aa9861b4f8d Mon Sep 17 00:00:00 2001 From: maxmarinich Date: Mon, 1 Apr 2019 09:42:45 +0300 Subject: [PATCH 1/6] Update to v1.13 Updates for v1.13.8 --- types/react-alice-carousel/index.d.ts | 140 ++++++-------------------- 1 file changed, 31 insertions(+), 109 deletions(-) diff --git a/types/react-alice-carousel/index.d.ts b/types/react-alice-carousel/index.d.ts index e3002f1193..51633e9b9e 100644 --- a/types/react-alice-carousel/index.d.ts +++ b/types/react-alice-carousel/index.d.ts @@ -1,121 +1,43 @@ -// Type definitions for react-alice-carousel 1.7 +// Type definitions for react-alice-carousel 1.13 // Project: https://github.com/maxmarinich/react-alice-carousel // Definitions by: endigo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 2.3 -import * as React from "react"; +import * as React from 'react' export interface EventObject { - item: number; - slide: number; + item: number + slide: number + itemsInSlide: number } export interface Props { - /** - * Fired when the event object is changing / returns event object - */ - onSlideChange?: (e: EventObject) => void; - /** - * Fired when the event object was changed / returns event object - */ - onSlideChanged?: (e: EventObject) => void; - /** - * Disable keys controls (left, right, space) - * - * Default: false. - */ - keysControlDisabled?: boolean; - /** - * Disable play/pause button - * - * Default: false. - */ - playButtonEnabled?: boolean; - /** - * Disable buttons control - * - * Default: false. - */ - buttonsDisabled?: boolean; - /** - * Disable dots navigation - * - * Default: false. - */ - dotsDisabled?: boolean; - /** - * Disable swipe handlers - * - * Default: false. - */ - swipeDisabled?: boolean; - /** - * Number of items in the slide. - * - * Default: {}. - */ - responsive?: {}; - /** - * Duration of slides transition (milliseconds) - * - * Default: 250. - */ - duration?: number; - /** - * The starting index of the carousel - * - * Default: 0. - */ - startIndex?: number; - /** - * Sets the carousel at the specified position - * - * Default: 0. - */ - slideToIndex?: number; - /** - * Set auto play mode - * - * Default: false. - */ - autoPlay?: boolean; - /** - * Disable infinite mode - * - * Default: true. - */ - infinite?: boolean; - /** - * The offset of the alert from the page border, can be any number. - * - * Default: 14. - */ - mouseDragEnabled?: boolean; - /** - * Enable fadeout animation. Fired when 1 item is in the slide - * - * Default: false. - */ - fadeOutAnimation?: boolean; - /** - * Interval of auto play animation (milliseconds). If specified, a larger value will be taken from comparing this property and the duration one - * - * Default: 250. - */ - autoPlayInterval?: number; - /** - * To run auto play in the left direction specify rtl value - * - * Default: 'ltr'. - */ - autoPlayDirection?: string; - /** - * If this property is identified as true auto play animation will be stopped after clicking user on any gallery button - * - * Default: false. - */ - autoPlayActionDisabled?: boolean; + items?: Array<{}> + onSlideChange?: (e: EventObject) => void + onSlideChanged?: (e: EventObject) => void + onInitialized?: (e: EventObject) => void + onResized?: (e: EventObject) => void + keysControlDisabled?: boolean + playButtonEnabled?: boolean + buttonsDisabled?: boolean + dotsDisabled?: boolean + swipeDisabled?: boolean + responsive?: {} + stagePadding?: {} + duration?: number + startIndex?: number + slideToIndex?: number + autoPlay?: boolean + infinite?: boolean + mouseDragEnabled?: boolean + fadeOutAnimation?: boolean + autoPlayInterval?: number + autoPlayDirection?: string + disableAutoPlayOnAction?: boolean + stopAutoPlayOnHover?: boolean + showSlideInfo?: false + preventEventOnTouchMove?: false } export default class Carousel extends React.PureComponent {} From da8c48e9dc546edfa4707c560013ba7f3193b6b1 Mon Sep 17 00:00:00 2001 From: maxmarinich Date: Mon, 1 Apr 2019 11:12:52 +0300 Subject: [PATCH 2/6] Update index.d.ts --- types/react-alice-carousel/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-alice-carousel/index.d.ts b/types/react-alice-carousel/index.d.ts index 51633e9b9e..9650e6f20d 100644 --- a/types/react-alice-carousel/index.d.ts +++ b/types/react-alice-carousel/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/maxmarinich/react-alice-carousel // Definitions by: endigo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as React from 'react' From a22dcaeacb7ad4875a012e66109a0527a52217a6 Mon Sep 17 00:00:00 2001 From: maxmarinich Date: Mon, 1 Apr 2019 11:24:46 +0300 Subject: [PATCH 3/6] test fixes --- types/react-alice-carousel/index.d.ts | 58 +++++++++++++-------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/types/react-alice-carousel/index.d.ts b/types/react-alice-carousel/index.d.ts index 9650e6f20d..d3fc9b2fc7 100644 --- a/types/react-alice-carousel/index.d.ts +++ b/types/react-alice-carousel/index.d.ts @@ -4,40 +4,40 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -import * as React from 'react' +import * as React from "react"; export interface EventObject { - item: number - slide: number - itemsInSlide: number + item: number; + slide: number; + itemsInSlide: number; } export interface Props { - items?: Array<{}> - onSlideChange?: (e: EventObject) => void - onSlideChanged?: (e: EventObject) => void - onInitialized?: (e: EventObject) => void - onResized?: (e: EventObject) => void - keysControlDisabled?: boolean - playButtonEnabled?: boolean - buttonsDisabled?: boolean - dotsDisabled?: boolean - swipeDisabled?: boolean - responsive?: {} - stagePadding?: {} - duration?: number - startIndex?: number - slideToIndex?: number - autoPlay?: boolean - infinite?: boolean - mouseDragEnabled?: boolean - fadeOutAnimation?: boolean - autoPlayInterval?: number - autoPlayDirection?: string - disableAutoPlayOnAction?: boolean - stopAutoPlayOnHover?: boolean - showSlideInfo?: false - preventEventOnTouchMove?: false + items?: Array<{}>; + onSlideChange?: (e: EventObject) => void; + onSlideChanged?: (e: EventObject) => void; + onInitialized?: (e: EventObject) => void; + onResized?: (e: EventObject) => void; + keysControlDisabled?: boolean; + playButtonEnabled?: boolean; + buttonsDisabled?: boolean; + dotsDisabled?: boolean; + swipeDisabled?: boolean; + responsive?: {}; + stagePadding?: {}; + duration?: number; + startIndex?: number; + slideToIndex?: number; + autoPlay?: boolean; + infinite?: boolean; + mouseDragEnabled?: boolean; + fadeOutAnimation?: boolean; + autoPlayInterval?: number; + autoPlayDirection?: string; + disableAutoPlayOnAction?: boolean; + stopAutoPlayOnHover?: boolean; + showSlideInfo?: false; + preventEventOnTouchMove?: false; } export default class Carousel extends React.PureComponent {} From a0739c494229c89c770701ab1966f8bb42125889 Mon Sep 17 00:00:00 2001 From: maxmarinich Date: Mon, 1 Apr 2019 13:19:21 +0300 Subject: [PATCH 4/6] Update index.d.ts --- types/react-alice-carousel/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/react-alice-carousel/index.d.ts b/types/react-alice-carousel/index.d.ts index d3fc9b2fc7..2ef1f87cdd 100644 --- a/types/react-alice-carousel/index.d.ts +++ b/types/react-alice-carousel/index.d.ts @@ -35,6 +35,7 @@ export interface Props { autoPlayInterval?: number; autoPlayDirection?: string; disableAutoPlayOnAction?: boolean; + autoPlayActionDisabled?: boolean; stopAutoPlayOnHover?: boolean; showSlideInfo?: false; preventEventOnTouchMove?: false; From 6eae2186c7b735bd4169f3c30d45d34cc49aaade Mon Sep 17 00:00:00 2001 From: maxmarinich Date: Wed, 3 Apr 2019 10:08:15 +0300 Subject: [PATCH 5/6] review fixes --- types/react-alice-carousel/index.d.ts | 182 +++++++++++++++++++++----- 1 file changed, 152 insertions(+), 30 deletions(-) diff --git a/types/react-alice-carousel/index.d.ts b/types/react-alice-carousel/index.d.ts index 2ef1f87cdd..1301afc216 100644 --- a/types/react-alice-carousel/index.d.ts +++ b/types/react-alice-carousel/index.d.ts @@ -7,38 +7,160 @@ import * as React from "react"; export interface EventObject { - item: number; - slide: number; - itemsInSlide: number; + item: number; + slide: number; + itemsInSlide: number; } export interface Props { - items?: Array<{}>; - onSlideChange?: (e: EventObject) => void; - onSlideChanged?: (e: EventObject) => void; - onInitialized?: (e: EventObject) => void; - onResized?: (e: EventObject) => void; - keysControlDisabled?: boolean; - playButtonEnabled?: boolean; - buttonsDisabled?: boolean; - dotsDisabled?: boolean; - swipeDisabled?: boolean; - responsive?: {}; - stagePadding?: {}; - duration?: number; - startIndex?: number; - slideToIndex?: number; - autoPlay?: boolean; - infinite?: boolean; - mouseDragEnabled?: boolean; - fadeOutAnimation?: boolean; - autoPlayInterval?: number; - autoPlayDirection?: string; - disableAutoPlayOnAction?: boolean; - autoPlayActionDisabled?: boolean; - stopAutoPlayOnHover?: boolean; - showSlideInfo?: false; - preventEventOnTouchMove?: false; + /** + * Gallery items, preferable to use this property instead of children + * + * Default: []. + */ + items?: Array<{}>; + /** + * Number of items in the slide. + * + * Default: {}. + */ + responsive?: {}; + /** + * Padding left and right on the stage + * + * Default: {}. + */ + stagePadding?: {}; + /** + * Disable keys controls (left, right, space) + * + * Default: false. + */ + keysControlDisabled?: boolean; + /** + * Disable play/pause button + * + * Default: false. + */ + playButtonEnabled?: boolean; + /** + * Disable buttons control + * + * Default: false. + */ + buttonsDisabled?: boolean; + /** + * Disable dots navigation + * + * Default: false. + */ + dotsDisabled?: boolean; + /** + * Disable swipe handlers + * + * Default: false. + */ + swipeDisabled?: boolean; + /** + * Duration of slides transition (milliseconds) + * + * Default: 250. + */ + duration?: number; + /** + * The starting index of the carousel + * + * Default: 0. + */ + startIndex?: number; + /** + * Sets the carousel at the specified position + * + * Default: 0. + */ + slideToIndex?: number; + /** + * Set auto play mode + * + * Default: false. + */ + autoPlay?: boolean; + /** + * Disable infinite mode + * + * Default: true. + */ + infinite?: boolean; + /** + * Enable mouse drag animation + * + * Default: false. + */ + mouseDragEnabled?: boolean; + /** + * Enable fadeout animation. Fired when 1 item is in the slide + * + * Default: false. + */ + fadeOutAnimation?: boolean; + /** + * Interval of auto play animation (milliseconds). If specified, a larger value will be taken from comparing this property and the duration one + * + * Default: 250. + */ + autoPlayInterval?: number; + /** + * To run auto play in the left direction specify rtl value + * + * Default: 'ltr'. + */ + autoPlayDirection?: string; + /** + * If this property is identified as true auto play animation will be stopped after clicking user on any gallery button + * + * Default: false. + */ + disableAutoPlayOnAction?: boolean; + /** + * If this property is identified as true auto play animation will be stopped after clicking user on any gallery button + * + * Default: false. + */ + autoPlayActionDisabled?: boolean; + /** + * If this property is identified as false auto play animation won't stopped on hover + * + * Default: true. + */ + stopAutoPlayOnHover?: boolean; + /** + * Show slide info + * + * Default: false. + */ + showSlideInfo?: false; + /** + * Prevent the browser's touchmove event when carousel is swiping + * + * Default: false. + */ + preventEventOnTouchMove?: false; + /** + * Fired when the event object is changing / returns event object + */ + onSlideChange?: (e: EventObject) => void; + /** + * Fired when the event object was changed / returns event object + */ + onSlideChanged?: (e: EventObject) => void; + /** + * Fired when the gallery was initialized / returns event object + */ + onInitialized?: (e: EventObject) => void; + /** + * Fired when the gallery was resized / returns event object + */ + onResized?: (e: EventObject) => void; } -export default class Carousel extends React.PureComponent {} +export default class ReactAliceCarousel extends React.PureComponent {} From f23be011c3ac7781685cc94c34294de148e8f2f9 Mon Sep 17 00:00:00 2001 From: maxmarinich Date: Wed, 3 Apr 2019 11:05:04 +0300 Subject: [PATCH 6/6] build fixes --- types/react-alice-carousel/index.d.ts | 308 +++++++++++++------------- 1 file changed, 157 insertions(+), 151 deletions(-) diff --git a/types/react-alice-carousel/index.d.ts b/types/react-alice-carousel/index.d.ts index 1301afc216..a575d75aa5 100644 --- a/types/react-alice-carousel/index.d.ts +++ b/types/react-alice-carousel/index.d.ts @@ -7,160 +7,166 @@ import * as React from "react"; export interface EventObject { - item: number; - slide: number; - itemsInSlide: number; + item: number; + slide: number; + itemsInSlide: number; } export interface Props { - /** - * Gallery items, preferable to use this property instead of children - * - * Default: []. - */ - items?: Array<{}>; - /** - * Number of items in the slide. - * - * Default: {}. - */ - responsive?: {}; - /** - * Padding left and right on the stage - * - * Default: {}. - */ - stagePadding?: {}; - /** - * Disable keys controls (left, right, space) - * - * Default: false. - */ - keysControlDisabled?: boolean; - /** - * Disable play/pause button - * - * Default: false. - */ - playButtonEnabled?: boolean; - /** - * Disable buttons control - * - * Default: false. - */ - buttonsDisabled?: boolean; - /** - * Disable dots navigation - * - * Default: false. - */ - dotsDisabled?: boolean; - /** - * Disable swipe handlers - * - * Default: false. - */ - swipeDisabled?: boolean; - /** - * Duration of slides transition (milliseconds) - * - * Default: 250. - */ - duration?: number; - /** - * The starting index of the carousel - * - * Default: 0. - */ - startIndex?: number; - /** - * Sets the carousel at the specified position - * - * Default: 0. - */ - slideToIndex?: number; - /** - * Set auto play mode - * - * Default: false. - */ - autoPlay?: boolean; - /** - * Disable infinite mode - * - * Default: true. - */ - infinite?: boolean; - /** - * Enable mouse drag animation - * - * Default: false. - */ - mouseDragEnabled?: boolean; - /** - * Enable fadeout animation. Fired when 1 item is in the slide - * - * Default: false. - */ - fadeOutAnimation?: boolean; - /** - * Interval of auto play animation (milliseconds). If specified, a larger value will be taken from comparing this property and the duration one - * - * Default: 250. - */ - autoPlayInterval?: number; - /** - * To run auto play in the left direction specify rtl value - * - * Default: 'ltr'. - */ - autoPlayDirection?: string; - /** - * If this property is identified as true auto play animation will be stopped after clicking user on any gallery button - * - * Default: false. - */ - disableAutoPlayOnAction?: boolean; - /** - * If this property is identified as true auto play animation will be stopped after clicking user on any gallery button - * - * Default: false. - */ - autoPlayActionDisabled?: boolean; - /** - * If this property is identified as false auto play animation won't stopped on hover - * - * Default: true. - */ - stopAutoPlayOnHover?: boolean; - /** - * Show slide info - * - * Default: false. - */ - showSlideInfo?: false; - /** - * Prevent the browser's touchmove event when carousel is swiping - * - * Default: false. - */ - preventEventOnTouchMove?: false; - /** - * Fired when the event object is changing / returns event object - */ - onSlideChange?: (e: EventObject) => void; - /** - * Fired when the event object was changed / returns event object - */ - onSlideChanged?: (e: EventObject) => void; - /** - * Fired when the gallery was initialized / returns event object - */ - onInitialized?: (e: EventObject) => void; - /** - * Fired when the gallery was resized / returns event object - */ - onResized?: (e: EventObject) => void; + /** + * Gallery items, preferable to use this property instead of children + * + * Default: []. + */ + items?: Array<{}>; + /** + * Number of items in the slide. + * + * Default: {}. + */ + responsive?: {}; + /** + * Padding left and right on the stage + * + * Default: {}. + */ + stagePadding?: {}; + /** + * Disable keys controls (left, right, space) + * + * Default: false. + */ + keysControlDisabled?: boolean; + /** + * Disable play/pause button + * + * Default: false. + */ + playButtonEnabled?: boolean; + /** + * Disable buttons control + * + * Default: false. + */ + buttonsDisabled?: boolean; + /** + * Disable dots navigation + * + * Default: false. + */ + dotsDisabled?: boolean; + /** + * Disable swipe handlers + * + * Default: false. + */ + swipeDisabled?: boolean; + /** + * Duration of slides transition (milliseconds) + * + * Default: 250. + */ + duration?: number; + /** + * The starting index of the carousel + * + * Default: 0. + */ + startIndex?: number; + /** + * Sets the carousel at the specified position + * + * Default: 0. + */ + slideToIndex?: number; + /** + * Set auto play mode + * + * Default: false. + */ + autoPlay?: boolean; + /** + * Disable infinite mode + * + * Default: true. + */ + infinite?: boolean; + /** + * Enable mouse drag animation + * + * Default: false. + */ + mouseDragEnabled?: boolean; + /** + * Enable fadeout animation. Fired when 1 item is in the slide + * + * Default: false. + */ + fadeOutAnimation?: boolean; + /** + * Interval of auto play animation (milliseconds). If specified, a larger value will be taken from comparing this property and the duration one + * + * Default: 250. + */ + autoPlayInterval?: number; + /** + * To run auto play in the left direction specify rtl value + * + * Default: 'ltr'. + */ + autoPlayDirection?: string; + /** + * If this property is identified as true auto play animation will be stopped after clicking user on any gallery button + * + * Default: false. + */ + disableAutoPlayOnAction?: boolean; + /** + * If this property is identified as true auto play animation will be stopped after clicking user on any gallery button + * + * Default: false. + */ + autoPlayActionDisabled?: boolean; + /** + * If this property is identified as false auto play animation won't stopped on hover + * + * Default: true. + */ + stopAutoPlayOnHover?: boolean; + /** + * Show slide info + * + * Default: false. + */ + showSlideInfo?: false; + /** + * Prevent the browser's touchmove event when carousel is swiping + * + * Default: false. + */ + preventEventOnTouchMove?: false; + /** + * Prevent the browser's touchmove event when carousel is swiping + * + * Default: false. + */ + autoHeight?: false; + /** + * Fired when the event object is changing / returns event object + */ + onSlideChange?: (e: EventObject) => void; + /** + * Fired when the event object was changed / returns event object + */ + onSlideChanged?: (e: EventObject) => void; + /** + * Fired when the gallery was initialized / returns event object + */ + onInitialized?: (e: EventObject) => void; + /** + * Fired when the gallery was resized / returns event object + */ + onResized?: (e: EventObject) => void; } export default class ReactAliceCarousel extends React.PureComponent {}