Fix implicit any error for Carousel

This commit is contained in:
Wei Zhu 2017-11-22 10:54:27 +08:00
parent ecaf3a0883
commit 50f85480d1
2 changed files with 6 additions and 4 deletions

View File

@ -66,7 +66,7 @@ export interface CarouselProps {
slickGoTo?: number;
}
export default class Carousel extends React.Component<CarouselProps, any> {
export default class Carousel extends React.Component<CarouselProps, {}> {
static defaultProps = {
dots: true,
arrows: false,
@ -78,7 +78,7 @@ export default class Carousel extends React.Component<CarouselProps, any> {
private slick: any;
constructor(props) {
constructor(props: CarouselProps) {
super(props);
this.onWindowResized = debounce(this.onWindowResized, 500, {
leading: false,
@ -110,7 +110,7 @@ export default class Carousel extends React.Component<CarouselProps, any> {
}
}
saveSlick = (node) => {
saveSlick = (node: any) => {
this.slick = node;
}
@ -122,7 +122,7 @@ export default class Carousel extends React.Component<CarouselProps, any> {
this.slick.slickPrev();
}
goTo(slide) {
goTo(slide: number) {
this.slick.slickGoTo(slide);
}

View File

@ -93,3 +93,5 @@ declare module "*.json" {
}
declare module "prop-types"
declare module "lodash.debounce"