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
51 lines
1.4 KiB
TypeScript
51 lines
1.4 KiB
TypeScript
import { PureComponent, Validator, Requireable } from 'react'
|
|
|
|
export type OnScrollParams = {
|
|
clientHeight: number,
|
|
clientWidth: number,
|
|
scrollHeight: number,
|
|
scrollLeft: number,
|
|
scrollTop: number,
|
|
scrollWidth: number
|
|
}
|
|
|
|
export type ScrollSyncChildProps = {
|
|
clientHeight: number,
|
|
clientWidth: number,
|
|
onScroll: (params: OnScrollParams) => void,
|
|
scrollHeight: number,
|
|
scrollLeft: number,
|
|
scrollTop: number,
|
|
scrollWidth: number
|
|
}
|
|
|
|
export type ScrollSyncProps = {
|
|
children?: (props: ScrollSyncChildProps) => React.ReactNode
|
|
};
|
|
|
|
export type ScrollSyncState = {
|
|
clientHeight: number,
|
|
clientWidth: number,
|
|
scrollHeight: number,
|
|
scrollLeft: number,
|
|
scrollTop: number,
|
|
scrollWidth: number
|
|
};
|
|
|
|
/**
|
|
* HOC that simplifies the process of synchronizing scrolling between two or more virtualized components.
|
|
*/
|
|
export class ScrollSync extends PureComponent<ScrollSyncProps, ScrollSyncState> {
|
|
static propTypes: {
|
|
/**
|
|
* Function responsible for rendering 2 or more virtualized components.
|
|
* This function should implement the following signature:
|
|
* ({ onScroll, scrollLeft, scrollTop }) => PropTypes.element
|
|
*/
|
|
children: Validator<(props: ScrollSyncChildProps) => React.ReactNode>
|
|
};
|
|
|
|
constructor(props: ScrollSyncProps, context: any);
|
|
|
|
render(): JSX.Element;
|
|
} |