Skip to content

Commit

Permalink
feat: add type declarations (#193)
Browse files Browse the repository at this point in the history
* Add initial typings

* Add types path

* Update types

* Add more row & column types

* Fix types path

* Add generic params

* Add missing type param

* Update cellRenderer props

* Remove omit

* Add callOrReturn type

* Update types

* Remove types

* update types from Neo

* fix typo

* fix column consts

* Add some util types

* Fix normalizeColumns arg type

* add types for utils from Neo

* update

* fix unflattern return type

* add types for methods

* update

* changelog

* fix

* fix

* update

Co-authored-by: Neo Nie <[email protected]>
  • Loading branch information
jamesonhill and nihgwu authored Aug 17, 2020
1 parent 43c84d0 commit 4231399
Show file tree
Hide file tree
Showing 5 changed files with 679 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- feat: add `ignoreFunctionInColumnCompare` to solve closure problem in renderers
- chore: skip unnecessary cloneElement in `renderElement`
- feat: add type declarations

## v1.10.9 (2020-08-13)

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "a react table component to display large data set with high performance and flexibility",
"main": "lib/index.js",
"module": "es/index.js",
"types": "types/index.d.ts",
"files": [
"lib/",
"es/",
Expand Down Expand Up @@ -62,6 +63,7 @@
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@types/react": "^16.9.46",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^9.0.0",
"babel-jest": "^23.4.2",
Expand Down
5 changes: 4 additions & 1 deletion src/BaseTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ class BaseTable extends React.PureComponent {

/**
* Reset cached offsets for positioning after a specific rowIndex, should be used only in dynamic mode(estimatedRowHeight is provided)
*
* @param {number} rowIndex
* @param {boolean} shouldForceUpdate
*/
resetAfterRowIndex(rowIndex = 0, shouldForceUpdate = true) {
if (!this.props.estimatedRowHeight) return;
Expand Down Expand Up @@ -283,7 +286,7 @@ class BaseTable extends React.PureComponent {
* - `center` - Center align the row within the table.
* - `end` - Align the row to the bottom side of the table.
* - `start` - Align the row to the top side of the table.
*
* @param {number} rowIndex
* @param {string} align
*/
Expand Down
Loading

0 comments on commit 4231399

Please sign in to comment.