diff --git a/react-paginate/index.d.ts b/react-paginate/index.d.ts index 256f33be58..18636a8f6f 100644 --- a/react-paginate/index.d.ts +++ b/react-paginate/index.d.ts @@ -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 , Wouter Hardeman , 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; diff --git a/react-paginate/react-paginate-tests.tsx b/react-paginate/react-paginate-tests.tsx index 9919327c5e..5f8f8f1994 100644 --- a/react-paginate/react-paginate-tests.tsx +++ b/react-paginate/react-paginate-tests.tsx @@ -3,8 +3,6 @@ import ReactPaginate = require("react-paginate"); class Test extends React.Component<{}, {}> { - public onClick: Function; - render() { return ( { 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} /> ); }