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
56 lines
1.6 KiB
TypeScript
56 lines
1.6 KiB
TypeScript
import { PropTypes, PureComponent, Validator, Requireable } from 'react'
|
|
|
|
export type OnSectionRenderedParams = {
|
|
columnStartIndex: number,
|
|
columnStopIndex: number,
|
|
rowStartIndex: number,
|
|
rowStopIndex: number
|
|
}
|
|
|
|
export type ChildProps = {
|
|
onSectionRendered: (params: OnSectionRenderedParams) => void,
|
|
scrollToColumn: number,
|
|
scrollToRow: number
|
|
};
|
|
/**
|
|
* This HOC decorates a virtualized component and responds to arrow-key events by scrolling one row or column at a time.
|
|
*/
|
|
export type ArrowKeyStepperProps = {
|
|
children?: (props: ChildProps) => React.ReactNode;
|
|
className?: string;
|
|
columnCount: number;
|
|
rowCount: number;
|
|
mode?: 'edges' | 'cells';
|
|
}
|
|
export type ScrollIndexes = {
|
|
scrollToRow: number,
|
|
scrollToColumn: number
|
|
}
|
|
export class ArrowKeyStepper extends PureComponent<ArrowKeyStepperProps, ScrollIndexes> {
|
|
static defaultProps: {
|
|
disabled: false,
|
|
mode: 'edges',
|
|
scrollToColumn: 0,
|
|
scrollToRow: 0
|
|
};
|
|
|
|
static propTypes: {
|
|
children: Validator<(props: ChildProps) => React.ReactNode>,
|
|
className: Requireable<string>,
|
|
columnCount: Validator<number>,
|
|
disabled: Validator<boolean>,
|
|
mode: Validator<'cells' | 'edges'>,
|
|
rowCount: Validator<number>,
|
|
scrollToColumn: Validator<number>,
|
|
scrollToRow: Validator<number>
|
|
};
|
|
|
|
constructor(props: ArrowKeyStepperProps, context: any);
|
|
|
|
componentWillReceiveProps(nextProps: ArrowKeyStepperProps): void;
|
|
|
|
setScrollIndexes(params: ScrollIndexes): void;
|
|
|
|
render(): JSX.Element;
|
|
}
|