mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-03 08:40:12 +00:00
update react-paginate
This commit is contained in:
13
types/react-paginate/index.d.ts
vendored
13
types/react-paginate/index.d.ts
vendored
@@ -1,11 +1,8 @@
|
||||
// Type definitions for react-paginate 4.3
|
||||
// Type definitions for react-paginate 5.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>
|
||||
// Simon Archer <https://github.com/archy-bold>
|
||||
// Definitions by: Yasunori Ohoka <https://github.com/yasupeke>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
// TypeScript Version: 2.9
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
@@ -48,7 +45,7 @@ interface ReactPaginateProps {
|
||||
/**
|
||||
* The method to call when a page is clicked. Exposes the current page object as an argument.
|
||||
*/
|
||||
onPageChange?(selectedItem: {selected: number}): void;
|
||||
onPageChange?(selectedItem: { selected: number }): void;
|
||||
|
||||
/**
|
||||
* The initial page selected.
|
||||
@@ -122,4 +119,4 @@ interface ReactPaginateProps {
|
||||
}
|
||||
|
||||
declare const ReactPaginate: React.ComponentClass<ReactPaginateProps>;
|
||||
export = ReactPaginate;
|
||||
export default ReactPaginate;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from "react";
|
||||
import ReactPaginate = require("react-paginate");
|
||||
import * as React from 'react';
|
||||
import ReactPaginate from 'react-paginate';
|
||||
|
||||
class Test extends React.Component {
|
||||
render() {
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
{
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"react-paginate-tests.tsx"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
@@ -21,5 +17,9 @@
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"jsx": "react"
|
||||
}
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"react-paginate-tests.tsx"
|
||||
]
|
||||
}
|
||||
|
||||
125
types/react-paginate/v4/index.d.ts
vendored
Normal file
125
types/react-paginate/v4/index.d.ts
vendored
Normal file
@@ -0,0 +1,125 @@
|
||||
// Type definitions for react-paginate 4.3
|
||||
// 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>
|
||||
// Simon Archer <https://github.com/archy-bold>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
interface ReactPaginateProps {
|
||||
/**
|
||||
* The total number of pages.
|
||||
*/
|
||||
pageCount: number;
|
||||
|
||||
/**
|
||||
* The range of pages displayed.
|
||||
*/
|
||||
pageRangeDisplayed: number;
|
||||
|
||||
/**
|
||||
* The number of pages to display for margins.
|
||||
*/
|
||||
marginPagesDisplayed: number;
|
||||
|
||||
/**
|
||||
* Label for the `previous` button.
|
||||
*/
|
||||
previousLabel?: string | JSX.Element;
|
||||
|
||||
/**
|
||||
* Label for the `next` button.
|
||||
*/
|
||||
nextLabel?: string | JSX.Element;
|
||||
|
||||
/**
|
||||
* Label for ellipsis.
|
||||
*/
|
||||
breakLabel?: string | JSX.Element;
|
||||
|
||||
/**
|
||||
* The classname on tag `li` of the ellipsis element.
|
||||
*/
|
||||
breakClassName?: string | JSX.Element;
|
||||
|
||||
/**
|
||||
* The method to call when a page is clicked. Exposes the current page object as an argument.
|
||||
*/
|
||||
onPageChange?(selectedItem: { selected: number }): void;
|
||||
|
||||
/**
|
||||
* The initial page selected.
|
||||
*/
|
||||
initialPage?: number;
|
||||
|
||||
/**
|
||||
* To override selected page with parent prop.
|
||||
*/
|
||||
forcePage?: number;
|
||||
|
||||
/**
|
||||
* Disable onPageChange callback with initial page. Default: false
|
||||
*/
|
||||
disableInitialCallback?: boolean;
|
||||
|
||||
/**
|
||||
* The classname of the pagination container.
|
||||
*/
|
||||
containerClassName?: string;
|
||||
|
||||
/**
|
||||
* The classname on tag `li` of each page element.
|
||||
*/
|
||||
pageClassName?: string;
|
||||
|
||||
/**
|
||||
* The classname on tag `a` of each page element.
|
||||
*/
|
||||
pageLinkClassName?: string;
|
||||
|
||||
/**
|
||||
* The classname for the active page.
|
||||
*/
|
||||
activeClassName?: string;
|
||||
|
||||
/**
|
||||
* The classname on tag `li` of the `previous` button.
|
||||
*/
|
||||
previousClassName?: string;
|
||||
|
||||
/**
|
||||
* The classname on tag `li` of the `next` button.
|
||||
*/
|
||||
nextClassName?: string;
|
||||
|
||||
/**
|
||||
* The classname on tag `a` of the `previous` button.
|
||||
*/
|
||||
previousLinkClassName?: string;
|
||||
|
||||
/**
|
||||
* The classname on tag `a` of the `next` button.
|
||||
*/
|
||||
nextLinkClassName?: string;
|
||||
|
||||
/**
|
||||
* The classname for disabled `previous` and `next` buttons.
|
||||
*/
|
||||
disabledClassName?: string;
|
||||
|
||||
/**
|
||||
* The method is called to generate the href attribute value on tag a of each page element.
|
||||
*/
|
||||
hrefBuilder?(pageIndex: number): void;
|
||||
|
||||
/**
|
||||
* Extra context to add to the aria-label HTML attribute.
|
||||
*/
|
||||
extraAriaContext?: string;
|
||||
}
|
||||
|
||||
declare const ReactPaginate: React.ComponentClass<ReactPaginateProps>;
|
||||
export = ReactPaginate;
|
||||
33
types/react-paginate/v4/react-paginate-tests.tsx
Normal file
33
types/react-paginate/v4/react-paginate-tests.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import * as React from 'react';
|
||||
import ReactPaginate = require('react-paginate');
|
||||
|
||||
class Test extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<ReactPaginate
|
||||
pageCount={1}
|
||||
pageRangeDisplayed={10}
|
||||
marginPagesDisplayed={2}
|
||||
previousLabel={'previous'}
|
||||
nextLabel={'next'}
|
||||
breakLabel={'break-me'}
|
||||
breakClassName={'break-class'}
|
||||
onPageChange={(selectedItem: {selected: number}) => null}
|
||||
initialPage={2}
|
||||
forcePage={3}
|
||||
disableInitialCallback={false}
|
||||
containerClassName={'container'}
|
||||
pageClassName={'page-li'}
|
||||
pageLinkClassName={'page-a'}
|
||||
activeClassName={'active'}
|
||||
previousClassName={'previous-li'}
|
||||
nextClassName={'next-li'}
|
||||
previousLinkClassName={'previous-a'}
|
||||
nextLinkClassName={'next-a'}
|
||||
disabledClassName={'disabled'}
|
||||
hrefBuilder={(pageIndex: number) => null}
|
||||
extraAriaContext={'aria'}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
30
types/react-paginate/v4/tsconfig.json
Normal file
30
types/react-paginate/v4/tsconfig.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../../",
|
||||
"typeRoots": [
|
||||
"../../"
|
||||
],
|
||||
"paths": {
|
||||
"react-paginate": [
|
||||
"react-paginate/v4"
|
||||
]
|
||||
},
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"jsx": "react"
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"react-paginate-tests.tsx"
|
||||
]
|
||||
}
|
||||
1
types/react-paginate/v4/tslint.json
Normal file
1
types/react-paginate/v4/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user