Added missing types for Collection properties

This commit is contained in:
John Gunther
2017-06-20 10:01:34 -04:00
parent a18c1af6c1
commit c41450f86f

View File

@@ -1,7 +1,10 @@
import { PureComponent, Validator, Requireable } from 'react'
import {
Alignment,
Index,
ScrollParams,
ScrollPosition,
SectionRenderedParams,
SizeInfo,
SizeAndPositionInfo
} from '../../index';
@@ -23,6 +26,11 @@ export type CollectionCellRendererParams = {
export type CollectionCellRenderer = (params: CollectionCellRendererParams) => React.ReactNode;
export type CollectionProps = {
'aria-label'?: string;
/**
* Outer height of Collection is set to "auto". This property should only be
* used in conjunction with the WindowScroller HOC.
*/
autoHeight?: boolean;
/**
* Number of cells in Collection.
*/
@@ -46,17 +54,58 @@ export type CollectionProps = {
* ({ index: number }): { height: number, width: number, x: number, y: number }
*/
cellSizeAndPositionGetter: CollectionCellSizeAndPositionGetter,
/**
* Optional custom CSS class name to attach to root Collection element.
*/
className?: string;
height: number;
horizontalOverscanSize?: number;
/**
* Optional custom id to attach to root Collection element.
*/
id?: string;
noContentRenderer?: () => JSX.Element;
/**
* Callback invoked whenever the scroll offset changes within the inner
* scrollable region: ({ clientHeight, clientWidth, scrollHeight, scrollLeft, scrollTop, scrollWidth }): void
*/
onScroll?: (params: ScrollParams) => any;
/**
* Callback invoked with information about the section of the Collection
* that was just rendered: ({ indices: Array<number> }): void
*/
onSectionRendered?: (params: SectionRenderedParams) => any;
/**
* Horizontal offset
*/
scrollLeft?: number;
/**
* Controls the alignment of scrolled-to-cells. The default ("auto") scrolls
* the least amount possible to ensure that the specified cell is fully
* visible. Use "start" to always align cells to the top/left of the
* Collection and "end" to align them bottom/right. Use "center" to align
* specified cell in the middle of container.
*/
scrollToAlignment?: Alignment;
scrollToCell?: number;
/**
* Vertical Offset
*/
scrollTop?: number;
/**
* Optionally override the size of the sections a Collection's cells are split into.
*/
sectionSize?: number;
className?: string;
height: number;
width: number;
horizontalOverscanSize?: number;
noContentRenderer?: () => JSX.Element;
scrollToCell?: number;
/**
* Optional custom inline style to attach to root Collection element.
*/
style?: React.CSSProperties;
verticalOverscanSize?: number;
/**
* Width of Collection; this property determines the number of visible
* (vs virtualized) columns.
*/
width: number;
};
/**