From c41450f86fdadcb8570767ba2a51d2cc67150537 Mon Sep 17 00:00:00 2001 From: John Gunther Date: Tue, 20 Jun 2017 10:01:34 -0400 Subject: [PATCH] Added missing types for Collection properties --- .../react-virtualized/dist/es/Collection.d.ts | 61 +++++++++++++++++-- 1 file changed, 55 insertions(+), 6 deletions(-) diff --git a/types/react-virtualized/dist/es/Collection.d.ts b/types/react-virtualized/dist/es/Collection.d.ts index 9f37eea8f6..98055df8f1 100644 --- a/types/react-virtualized/dist/es/Collection.d.ts +++ b/types/react-virtualized/dist/es/Collection.d.ts @@ -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 }): 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; }; /**