mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
replaced single declaration file with multiple files to represent the module structure of react-virtualized. This makes the future maintanance easier, because changes in the lib can be easier mirrored in the corresponding declaration file. This typings update should be the last with large breaking changes
79 lines
2.0 KiB
TypeScript
79 lines
2.0 KiB
TypeScript
import { PureComponent } from 'react'
|
|
|
|
export type KeyMapper = (
|
|
rowIndex: number,
|
|
columnIndex: number
|
|
) => any;
|
|
|
|
export type CellMeasurerCacheParams = {
|
|
defaultHeight?: number,
|
|
defaultWidth?: number,
|
|
fixedHeight?: boolean,
|
|
fixedWidth?: boolean,
|
|
minHeight?: number,
|
|
minWidth?: number,
|
|
keyMapper?: KeyMapper
|
|
}
|
|
export class CellMeasurerCache {
|
|
constructor(params: CellMeasurerCacheParams);
|
|
clear(
|
|
rowIndex: number,
|
|
columnIndex: number
|
|
): void;
|
|
clearAll(): void;
|
|
columnWidth: (params: { index: number }) => number | undefined;
|
|
hasFixedHeight(): boolean;
|
|
hasFixedWidth(): boolean;
|
|
getHeight(
|
|
rowIndex: number,
|
|
columnIndex: number
|
|
): number | undefined;
|
|
getWidth(
|
|
rowIndex: number,
|
|
columnIndex: number
|
|
): number | undefined;
|
|
has(
|
|
rowIndex: number,
|
|
columnIndex: number
|
|
): boolean;
|
|
rowHeight: (params: { index: number }) => number | undefined;
|
|
set(
|
|
rowIndex: number,
|
|
columnIndex: number,
|
|
width: number,
|
|
height: number
|
|
): void;
|
|
}
|
|
|
|
export type CellMeasurerChildProps = {
|
|
getColumnWidth: () => number,
|
|
getRowHeight: () => number,
|
|
resetMeasurements: () => any,
|
|
resetMeasurementsForColumn: (index: number) => any,
|
|
resetMeasurementsForRow: (index: number) => any,
|
|
}
|
|
|
|
export type CellMeasurerProps = {
|
|
cache?: CellMeasurerCache;
|
|
children?: (props: CellMeasurerChildProps) => React.ReactNode;
|
|
columnIndex?: number;
|
|
index?: number;
|
|
parent?: React.ReactType;
|
|
rowIndex?: number;
|
|
style?: React.CSSProperties;
|
|
}
|
|
/**
|
|
* Wraps a cell and measures its rendered content.
|
|
* Measurements are stored in a per-cell cache.
|
|
* Cached-content is not be re-measured.
|
|
*/
|
|
export class CellMeasurer extends PureComponent<CellMeasurerProps, {}> {
|
|
constructor(props: CellMeasurerProps, context: any);
|
|
|
|
componentDidMount(): void;
|
|
|
|
componentDidUpdate(prevProps: CellMeasurerProps, prevState: any): void;
|
|
|
|
render(): JSX.Element;
|
|
}
|