diff --git a/notNeededPackages.json b/notNeededPackages.json index 4acd790e24..11bef06fb9 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1068,6 +1068,12 @@ "sourceRepoURL": "https://github.com/paularmstrong/normalizr", "asOfVersion": "2.0.18" }, + { + "libraryName": "Nuka Carousel", + "typingsPackageName": "nuka-carousel", + "sourceRepoURL": "https://github.com/FormidableLabs/nuka-carousel/", + "asOfVersion": "4.4.6" + }, { "libraryName": "Numbro", "typingsPackageName": "numbro", diff --git a/types/nuka-carousel/index.d.ts b/types/nuka-carousel/index.d.ts deleted file mode 100644 index 97edd08a6d..0000000000 --- a/types/nuka-carousel/index.d.ts +++ /dev/null @@ -1,288 +0,0 @@ -// Type definitions for nuka-carousel 4.4 -// Project: https://github.com/FormidableLabs/nuka-carousel -// Definitions by: Roman Charugin -// Alex Smith -// matt-sungwook -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 - -import * as React from 'react'; - -export default class Carousel extends React.Component {} - -export type CarouselCellAlignProp = 'left' | 'center' | 'right'; - -export type CarouselHeightModeProp = 'first' | 'current' | 'max'; - -export type CarouselSlidesToScrollProp = number | 'auto'; - -export type CarouselSlideWidthProp = string | number; - -export interface CarouselSlideRenderControlProps { - /** - * Space between slides, as an integer, but reflected as px - */ - cellSpacing: number; - /** - * Current slide index - */ - currentSlide: number; - /** - * Current frame width (px) - */ - frameWidth: number; - /** - * Go to X slide method - * @param index Slide's index to go - */ - goToSlide: (index: number) => void; - /** - * Go to the next slide method - */ - nextSlide: () => void; - /** - * Go to the previous slide method - */ - previousSlide: () => void; - /** - * Total amount of slides - */ - slideCount: number; - /** - * Slides to scroll at once - */ - slidesToScroll: number; - /** - * Slides to show at once - */ - slidesToShow: number; - /** - * Current slide width (px) - */ - slideWidth: number; - /** - * Infinite mode enabled - */ - wrapAround: boolean; -} - -export type CarouselRenderControl = (props: CarouselSlideRenderControlProps) => JSX.Element; - -export interface CarouselProps { - /** - * Hook to be called after a slide is changed - * @param prevSlide Index of the previous slide - */ - afterSlide?: (prevSlide: number) => void; - /** - * Autoplay mode active - * @default false - */ - autoplay?: boolean; - /** - * Interval for autoplay iteration (ms) - * @default 3000 - */ - autoplayInterval?: number; - /** - * Hook to be called before a slide is changed - * @param currentSlide Index of the current slide - * @param endSlide Index of the last slide - */ - beforeSlide?: (currentSlide: number, endSlide: number) => void; - /** - * When displaying more than one slide, - * sets which position to anchor the current slide to - */ - cellAlign?: CarouselCellAlignProp; - /** - * Space between slides, as an integer, but reflected as px - */ - cellSpacing?: number; - /** - * Additional className - */ - className?: string; - /** - * When set to true, disable keyboard controls - * @default false - */ - disableKeyboardControls?: boolean; - /** - * Enable mouse swipe/dragging - */ - dragging?: boolean; - /** - * Animation easing function - * @see https://github.com/d3/d3-ease - */ - easing?: string; - /** - * Animation easing function when swipe exceeds edge - * @see https://github.com/d3/d3-ease - */ - edgeEasing?: string; - /** - * Used to set overflow style property on slider frame - * @default 'hidden' - */ - frameOverflow?: string; - /** - * Used to set the margin of the slider frame. - * Accepts any string dimension value such as "0px 20px" or "500px" - * @example '0px 20px' - * @example '500px' - */ - framePadding?: string; - /** - * Change the height of the slides based either on the first slide, - * the current slide, or the maximum height of all slides. - */ - heightMode?: CarouselHeightModeProp; - /** - * Initial height of the slides (px) - */ - initialSlideHeight?: number; - /** - * Initial width of the slides (px) - */ - initialSlideWidth?: number; - /** - * Window onResize callback - */ - onResize?: () => void; - /** - * Pause autoPlay when mouse is over carousel - * @default true - */ - pauseOnHover?: boolean; - /** - * Function for rendering top left control - */ - renderTopLeftControls?: CarouselRenderControl; - /** - * Function for rendering top center control - */ - renderTopCenterControls?: CarouselRenderControl; - /** - * Function for rendering top right control - */ - renderTopRightControls?: CarouselRenderControl; - /** - * Function for rendering center left control - */ - renderCenterLeftControls?: CarouselRenderControl; - /** - * Function for rendering center center control - */ - renderCenterCenterControls?: CarouselRenderControl; - /** - * Function for rendering center right control - */ - renderCenterRightControls?: CarouselRenderControl; - /** - * Function for rendering bottom left control - */ - renderBottomLeftControls?: CarouselRenderControl; - /** - * Function for rendering bottom center control - */ - renderBottomCenterControls?: CarouselRenderControl; - /** - * Function for rendering bottom right control - */ - renderBottomRightControls?: CarouselRenderControl; - /** - * Manually set the index of the slide to be shown - */ - slideIndex?: number; - /** - * Slides to scroll at once. Set to "auto" - * to always scroll the current number of visible slides - */ - slidesToScroll?: CarouselSlidesToScrollProp; - /** - * Slides to show at once - */ - slidesToShow?: number; - /** - * Manually set slideWidth - * @example '20px' - * @example 0.8 - */ - slideWidth?: CarouselSlideWidthProp; - /** - * Animation duration - */ - speed?: number; - /** - * Enable touch swipe/dragging - */ - swiping?: boolean; - /** - * Enable the slides to transition vertically - */ - vertical?: boolean; - /** - * Used to hardcode the slider width - * @example '80%' - * @example '500px' - */ - width?: string; - /** - * Sets infinite wrapAround mode - * @default false - */ - wrapAround?: boolean; - /** - * Used to remove all controls at once. Overwrites the render[Top, Right, Bottom, Left]CenterControls() - * @default false - */ - withoutControls?: boolean; -} - -export interface CarouselState { - /** - * Current slide index - */ - currentSlide: number; - /** - * Is dragging enabled - */ - dragging: boolean; - /** - * Easing function name - */ - easing: string; - /** - * Current frame width - */ - frameWidth: number; - /** - * Current left value - */ - isWrappingAround: boolean; - left: number; - pauseOnHover: boolean; - resetWrapAroundPosition: boolean; - /** - * Total amount of slides - */ - slideCount: number; - /** - * Slides to scroll at once - */ - slidesToScroll: number; - /** - * Current slide width - */ - slideWidth: CarouselSlideWidthProp; - /** - * Current top value - */ - top: number; - /** - * Is infinite mode enabled - */ - wrapToIndex: boolean; -} diff --git a/types/nuka-carousel/nuka-carousel-tests.tsx b/types/nuka-carousel/nuka-carousel-tests.tsx deleted file mode 100644 index 03df5e6251..0000000000 --- a/types/nuka-carousel/nuka-carousel-tests.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import * as React from 'react'; -import { render } from 'react-dom'; - -import Carousel, { CarouselProps } from 'nuka-carousel'; - -const props: CarouselProps = { - afterSlide: () => {}, - autoplay: true, - autoplayInterval: 5000, - beforeSlide: () => {}, - cellAlign: 'center', - cellSpacing: 500, - dragging: true, - easing: 'easePoly', - edgeEasing: 'easePolyInOut', - framePadding: '100px', - heightMode: 'max', - initialSlideHeight: 200, - initialSlideWidth: 500, - onResize: () => {}, - renderTopLeftControls: () =>