@types/react-virtualized
Advanced tools
Comparing version 9.2.0 to 9.2.1
@@ -29,15 +29,3 @@ // Type definitions for react-virtualized 9.2.1 | ||
export interface CellMeasurerProps { | ||
cellRenderer: (info: { columnIndex: number, rowIndex: number }) => React.ReactNode; | ||
cellSizeCache?: { | ||
clearAllColumnWidths(): void; | ||
clearAllRowHeights(): void; | ||
clearColumnWidth(index: number): void; | ||
clearRowHeight(index: number): void; | ||
getColumnWidth(index: number): number; | ||
getRowHeight(index: number): number; | ||
hasColumnWidth(index: number): boolean; | ||
hasRowHeight(index: number): boolean; | ||
setColumnWidth(index: number, width: number): void; | ||
setRowHeight(index: number, height: number): void; | ||
}; | ||
cache?: CellMeasurerCache; | ||
children?: React.StatelessComponent<{ | ||
@@ -50,7 +38,6 @@ getColumnWidth: () => number, | ||
}>; | ||
columnCount: number; | ||
container?: React.ReactType; | ||
height?: number; | ||
rowCount: number; | ||
width?: number; | ||
columnIndex: number; | ||
parent?: React.ReactType; | ||
rowIndex: number; | ||
style?: React.CSSProperties; | ||
} | ||
@@ -79,13 +66,2 @@ export class CellMeasurer extends React.PureComponent<CellMeasurerProps, {}> { } | ||
export class CellMeasurerCache { | ||
_cellHeightCache: Cache; | ||
_cellWidthCache: Cache; | ||
_columnWidthCache: Cache; | ||
_defaultHeight?: number; | ||
_defaultWidth?: number; | ||
_minHeight?: number; | ||
_minWidth?: number; | ||
_keyMapper: KeyMapper; | ||
_rowHeightCache: Cache; | ||
_hasFixedHeight: boolean; | ||
_hasFixedWidth: boolean; | ||
constructor(params: CellMeasurerCacheParams); | ||
@@ -119,6 +95,2 @@ clear( | ||
): void; | ||
_updateCachedColumnAndRowSizes( | ||
rowIndex: number, | ||
columnIndex: number | ||
): void; | ||
} | ||
@@ -227,4 +199,13 @@ | ||
export type RowClickHandlerParams = { | ||
rowData: { | ||
columnData: Object, | ||
id: string, | ||
index: number | ||
} | ||
} | ||
// ref: https://github.com/bvaughn/react-virtualized/blob/master/docs/Table.md | ||
export interface TableProps { | ||
deferredMeasurementCache?: CellMeasurerCache; | ||
autoHeight?: boolean; | ||
@@ -240,11 +221,11 @@ children?: React.ReactChildren; | ||
headerStyle?: any; | ||
height: number; | ||
height?: number; | ||
id?: string; | ||
noRowsRender?: () => void; | ||
onHeaderClick?: (dataKey: string, columnData: any) => void; | ||
onRowClick?: (info: IndexParam) => void; | ||
onRowDoubleClick?: (info: IndexParam) => void; | ||
onRowMouseOut?: (info: IndexParam) => void; | ||
onRowMouseOver?: (info: IndexParam) => void; | ||
onRowsRendered?: (info: IndexParam) => void; | ||
onRowClick?: (info: RowClickHandlerParams) => void; | ||
onRowDoubleClick?: (info: RowClickHandlerParams) => void; | ||
onRowMouseOut?: (info: RowClickHandlerParams) => void; | ||
onRowMouseOver?: (info: RowClickHandlerParams) => void; | ||
onRowsRendered?: (info: RowClickHandlerParams) => void; | ||
overscanRowCount?: number; | ||
@@ -267,5 +248,14 @@ onScroll?: (info: { clientHeight: number, scrollHeight: number, scrollTop: number }) => void; | ||
tabIndex?: number; | ||
width: number; | ||
width?: number; | ||
} | ||
export class Table extends React.PureComponent<TableProps, {}> { } | ||
export class Table extends React.PureComponent<TableProps, {}> { | ||
forceUpdateGrid(): void; | ||
/** See Grid#measureAllCells */ | ||
measureAllRows(): void; | ||
/** See Grid#recomputeGridSize */ | ||
recomputeRowHeights(index?: number): void; | ||
/** See Grid#scrollToCell */ | ||
scrollToRow(index?: number): void; | ||
Grid: Grid; | ||
} | ||
@@ -428,3 +418,3 @@ export const defaultTableCellDataGetter: TableCellDataGetter; | ||
containerStyle?: React.CSSProperties; | ||
deferredMeasurementCache?: Object; | ||
deferredMeasurementCache?: CellMeasurerCache; | ||
estimatedColumnSize?: number; | ||
@@ -459,3 +449,36 @@ estimatedRowSize?: number; | ||
}; | ||
export class Grid extends React.PureComponent<GridProps, {}> { } | ||
export class Grid extends React.PureComponent<GridProps, {}> { | ||
/** | ||
* Invalidate Grid size and recompute visible cells. | ||
* This is a deferred wrapper for recomputeGridSize(). | ||
* It sets a flag to be evaluated on cDM/cDU to avoid unnecessary renders. | ||
* This method is intended for advanced use-cases like CellMeasurer. | ||
*/ | ||
invalidateCellSizeAfterRender(params: { | ||
columnIndex: number, | ||
rowIndex: number | ||
}): void; | ||
/** | ||
* Pre-measure all columns and rows in a Grid. | ||
* Typically cells are only measured as needed and estimated sizes are used for cells that have not yet been measured. | ||
* This method ensures that the next call to getTotalSize() returns an exact size (as opposed to just an estimated one). | ||
*/ | ||
measureAllCells(): void; | ||
/** | ||
* Forced recompute of row heights and column widths. | ||
* This function should be called if dynamic column or row sizes have changed but nothing else has. | ||
* Since Grid only receives :columnCount and :rowCount it has no way of detecting when the underlying data changes. | ||
*/ | ||
recomputeGridSize(params?: { | ||
columnIndex?: number, | ||
rowIndex?: number | ||
}): void; | ||
/** | ||
* Ensure column and row are visible. | ||
*/ | ||
scrollToCell(params: { | ||
columnIndex: number, | ||
rowIndex: number | ||
}): void; | ||
} | ||
@@ -462,0 +485,0 @@ export type InfiniteLoaderProps = { |
{ | ||
"name": "@types/react-virtualized", | ||
"version": "9.2.0", | ||
"version": "9.2.1", | ||
"description": "TypeScript definitions for react-virtualized", | ||
@@ -22,4 +22,4 @@ "license": "MIT", | ||
"peerDependencies": {}, | ||
"typesPublisherContentHash": "76f25f0150d5cbca98dbeece3ea4e1f60da2be9746a893a3b7cf034d3fb47e04", | ||
"typesPublisherContentHash": "5dca8ccda9f244e133b6ad8efb1f7c65e2fcdab56074c7c69d90811255094552", | ||
"typeScriptVersion": "2.1" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Fri, 10 Mar 2017 06:47:50 GMT | ||
* Last updated: Thu, 23 Mar 2017 00:16:54 GMT | ||
* Dependencies: react | ||
@@ -14,0 +14,0 @@ * Global values: none |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
20412
514
0