Skip to content

Commit 4231399

Browse files
jamesonhillnihgwu
andauthored
feat: add type declarations (#193)
* 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 <nihgwu@live.com>
1 parent 43c84d0 commit 4231399

File tree

5 files changed

+679
-1
lines changed

5 files changed

+679
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- feat: add `ignoreFunctionInColumnCompare` to solve closure problem in renderers
66
- chore: skip unnecessary cloneElement in `renderElement`
7+
- feat: add type declarations
78

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

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "a react table component to display large data set with high performance and flexibility",
55
"main": "lib/index.js",
66
"module": "es/index.js",
7+
"types": "types/index.d.ts",
78
"files": [
89
"lib/",
910
"es/",
@@ -62,6 +63,7 @@
6263
"@babel/plugin-transform-runtime": "^7.0.0",
6364
"@babel/preset-env": "^7.0.0",
6465
"@babel/preset-react": "^7.0.0",
66+
"@types/react": "^16.9.46",
6567
"babel-core": "^7.0.0-bridge.0",
6668
"babel-eslint": "^9.0.0",
6769
"babel-jest": "^23.4.2",

src/BaseTable.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ class BaseTable extends React.PureComponent {
212212

213213
/**
214214
* Reset cached offsets for positioning after a specific rowIndex, should be used only in dynamic mode(estimatedRowHeight is provided)
215+
*
216+
* @param {number} rowIndex
217+
* @param {boolean} shouldForceUpdate
215218
*/
216219
resetAfterRowIndex(rowIndex = 0, shouldForceUpdate = true) {
217220
if (!this.props.estimatedRowHeight) return;
@@ -283,7 +286,7 @@ class BaseTable extends React.PureComponent {
283286
* - `center` - Center align the row within the table.
284287
* - `end` - Align the row to the bottom side of the table.
285288
* - `start` - Align the row to the top side of the table.
286-
289+
*
287290
* @param {number} rowIndex
288291
* @param {string} align
289292
*/

0 commit comments

Comments
 (0)