From d5faebe532cac24ff670443999777f14c29587d7 Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 3 Feb 2016 09:32:36 +0100 Subject: [PATCH 1/4] React slick definition type --- react-slick/react-slick-test.tsx | 31 ++++++++++++++++++++++ react-slick/react-slick.d.ts | 45 ++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 react-slick/react-slick-test.tsx create mode 100644 react-slick/react-slick.d.ts diff --git a/react-slick/react-slick-test.tsx b/react-slick/react-slick-test.tsx new file mode 100644 index 0000000000..c351419401 --- /dev/null +++ b/react-slick/react-slick-test.tsx @@ -0,0 +1,31 @@ +/// +/// +/// + +import * as React from "react" +import * as ReactDOM from "react-dom" +import * as Slider from "react-slick" + +class SliderTest extends React.Component, {}> { + + render() { + let settings = { + speed: 500, + slidesToShow: 8, + slidesToScroll: 1, + draggable: false, + infinite: false + }; + + return ( +
+ +

Slide1

+

Slide2

+
+
+ ) + } +} + +ReactDOM.render(, document.body); diff --git a/react-slick/react-slick.d.ts b/react-slick/react-slick.d.ts new file mode 100644 index 0000000000..222089b537 --- /dev/null +++ b/react-slick/react-slick.d.ts @@ -0,0 +1,45 @@ +/// + +declare module 'react-slick' { + interface __config { + className?: string + adaptiveHeight?: boolean + arrows?: boolean + autoplay?: boolean + autoplaySpeed?: number // integer + centerMode?: boolean + centerPadding?: string | any + cssEase?: string | any + dots?: boolean + dotsClass?: string + draggable?: boolean + easing?: string + fade?: boolean + focusOnSelect?: boolean + infinite?: boolean // should the gallery wrap around it's contents + initialSlide?: number // int + lazyLoad?: boolean + rtl?: boolean + slide?: string + slidesToShow?: number // int + slidesToScroll?: number // int + speed?: number //int + swipe?: boolean + swipeToSlide?: boolean + touchMove?: boolean + touchThreshold?: number // int + variableWidth?: boolean + useCSS?: boolean + vertical?: boolean + afterChange?: (() => void) + beforeChange?: (() => void) + slickGoTo?: number // int + } + + interface Slider extends __config { + responsive?: { breakpoint: number; settings: __config}[] + } + + var Slider: __React.ClassicComponentClass; + export = Slider; +} From 65ed470927fc807ffcfd29d726dfda6f4f79b549 Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 3 Feb 2016 09:47:43 +0100 Subject: [PATCH 2/4] React slick definition type --- react-slick/react-slick.d.ts | 78 ++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/react-slick/react-slick.d.ts b/react-slick/react-slick.d.ts index 222089b537..090037bc52 100644 --- a/react-slick/react-slick.d.ts +++ b/react-slick/react-slick.d.ts @@ -1,45 +1,45 @@ -/// +/// -declare module 'react-slick' { - interface __config { - className?: string - adaptiveHeight?: boolean - arrows?: boolean - autoplay?: boolean - autoplaySpeed?: number // integer - centerMode?: boolean - centerPadding?: string | any - cssEase?: string | any - dots?: boolean - dotsClass?: string - draggable?: boolean - easing?: string - fade?: boolean - focusOnSelect?: boolean - infinite?: boolean // should the gallery wrap around it's contents - initialSlide?: number // int - lazyLoad?: boolean - rtl?: boolean - slide?: string - slidesToShow?: number // int - slidesToScroll?: number // int - speed?: number //int - swipe?: boolean - swipeToSlide?: boolean - touchMove?: boolean - touchThreshold?: number // int - variableWidth?: boolean - useCSS?: boolean - vertical?: boolean - afterChange?: (() => void) - beforeChange?: (() => void) - slickGoTo?: number // int - } +interface __config { + className?: string + adaptiveHeight?: boolean + arrows?: boolean + autoplay?: boolean + autoplaySpeed?: number // integer + centerMode?: boolean + centerPadding?: string | any + cssEase?: string | any + dots?: boolean + dotsClass?: string + draggable?: boolean + easing?: string + fade?: boolean + focusOnSelect?: boolean + infinite?: boolean // should the gallery wrap around it's contents + initialSlide?: number // int + lazyLoad?: boolean + rtl?: boolean + slide?: string + slidesToShow?: number // int + slidesToScroll?: number // int + speed?: number //int + swipe?: boolean + swipeToSlide?: boolean + touchMove?: boolean + touchThreshold?: number // int + variableWidth?: boolean + useCSS?: boolean + vertical?: boolean + afterChange?: (() => void) + beforeChange?: (() => void) + slickGoTo?: number // int +} - interface Slider extends __config { - responsive?: { breakpoint: number; settings: __config}[] - } +interface Slider extends __config { + responsive?: { breakpoint: number; settings: __config}[] +} +declare module "react-slick" { var Slider: __React.ClassicComponentClass; export = Slider; } From 04faa1e002ed6996f20ebf9cb319d35f7f45de1e Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 3 Feb 2016 10:01:59 +0100 Subject: [PATCH 3/4] React slick definition type --- react-slick/react-slick.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/react-slick/react-slick.d.ts b/react-slick/react-slick.d.ts index 090037bc52..2dfadcf133 100644 --- a/react-slick/react-slick.d.ts +++ b/react-slick/react-slick.d.ts @@ -1,3 +1,8 @@ +// Type definitions for [react-slick] +// Project: [https://github.com/akiran/react-slick] +// Definitions by: [Andrey Balokha] <[https://github.com/andrewBalekha]> +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + /// interface __config { From 85ae5b9531449b4c878ec30aaea122f6572d6784 Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 3 Feb 2016 10:05:04 +0100 Subject: [PATCH 4/4] React slick definition type --- react-slick/react-slick.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/react-slick/react-slick.d.ts b/react-slick/react-slick.d.ts index 2dfadcf133..43c9cdcf69 100644 --- a/react-slick/react-slick.d.ts +++ b/react-slick/react-slick.d.ts @@ -1,6 +1,6 @@ -// Type definitions for [react-slick] -// Project: [https://github.com/akiran/react-slick] -// Definitions by: [Andrey Balokha] <[https://github.com/andrewBalekha]> +// Type definitions for react-slick +// Project: https://github.com/akiran/react-slick +// Definitions by: Andrey Balokha // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped ///