Trying to avoid forbidden-type Function

This commit is contained in:
Peter Glas
2017-03-23 16:14:34 +01:00
parent c149878dc3
commit 79725c7599
2 changed files with 5 additions and 7 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
// Type definitions for react-paginate v4.2
// Type definitions for react-paginate 4.2
// Project: https://github.com/AdeleD/react-paginate
// Definitions by: Simon Hartcher <https://github.com/deevus>, Wouter Hardeman <https://github.com/wouterhardeman>, pegel03 <https://github.com/pegel03>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -45,7 +45,7 @@ interface ReactPaginateProps {
/**
* The method to call when a page is clicked. Exposes the current page object as an argument.
*/
onPageChange?: Function;
onPageChange?: (selectedItem: {selected: number}) => void;
/**
* The initial page selected.
@@ -110,7 +110,7 @@ interface ReactPaginateProps {
/**
* The method is called to generate the href attribute value on tag a of each page element.
*/
hrefBuilder?: Function;
hrefBuilder?: (pageIndex: number) => void;
}
declare const ReactPaginate: React.ComponentClass<ReactPaginateProps>;
+2 -4
View File
@@ -3,8 +3,6 @@ import ReactPaginate = require("react-paginate");
class Test extends React.Component<{}, {}> {
public onClick: Function;
render() {
return (
<ReactPaginate
@@ -15,7 +13,7 @@ class Test extends React.Component<{}, {}> {
nextLabel={'next'}
breakLabel={'break-me'}
breakClassName={'break-class'}
onPageChange={this.onClick}
onPageChange={(selectedItem: {selected: number}) => null}
initialPage={2}
forcePage={3}
disableInitialCallback={false}
@@ -28,7 +26,7 @@ class Test extends React.Component<{}, {}> {
previousLinkClassName={'previous-a'}
nextLinkClassName={'next-a'}
disabledClassName={'disabled'}
hrefBuilder={this.onClick}
hrefBuilder={(pageIndex: number) => null}
/>
);
}