Merge pull request #7947 from andrewBalekha/react-slick-definition

React slick definition
This commit is contained in:
Mohamed Hegazy
2016-06-22 16:50:01 -07:00
committed by GitHub
2 changed files with 81 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
/// <reference path="../react/react.d.ts" />
/// <reference path="../react/react-dom.d.ts" />
/// <reference path="./react-slick.d.ts" />
import * as React from "react"
import * as ReactDOM from "react-dom"
import * as Slider from "react-slick"
class SliderTest extends React.Component<React.Props<{}>, {}> {
render() {
let settings = {
speed: 500,
slidesToShow: 8,
slidesToScroll: 1,
draggable: false,
infinite: false
};
return (
<div>
<Slider {...settings} >
<div><h1>Slide1</h1></div>
<div><h1>Slide2</h1></div>
</Slider>
</div>
)
}
}
ReactDOM.render(<SliderTest />, document.body);
+50
View File
@@ -0,0 +1,50 @@
// 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
/// <reference path="../react/react.d.ts"/>
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}[]
}
declare module "react-slick" {
var Slider: __React.ClassicComponentClass<Slider>;
export = Slider;
}