/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow * @format */ import type { LayoutEvent } from '../../../types'; import type { FocusEvent } from '../Types/CoreEventTypes'; import type { CellRendererProps, RenderItemType } from './VirtualizedListProps'; import View, { type ViewProps } from '../../../exports/View'; import StyleSheet from '../../../exports/StyleSheet'; import { VirtualizedListCellContextProvider } from './VirtualizedListContext.js'; import invariant from 'fbjs/lib/invariant'; import * as React from 'react'; type ViewStyleProp = $PropertyType; export type Props = { CellRendererComponent?: ?React.ComponentType>, ItemSeparatorComponent: ?React.ComponentType, ListItemComponent?: ?(React.ComponentType | React.Element), cellKey: string, horizontal: ?boolean, index: number, inversionStyle: ViewStyleProp, item: ItemT, onCellLayout?: (event: LayoutEvent, cellKey: string, index: number) => void, onCellFocusCapture?: (event: FocusEvent) => void, onUnmount: (cellKey: string) => void, onUpdateSeparators: (cellKeys: Array, props: $Shape>) => void, prevCellKey: ?string, renderItem?: ?RenderItemType, ... }; type SeparatorProps = $ReadOnly<{| highlighted: boolean, leadingItem: ?ItemT, |}>; type State = { separatorProps: SeparatorProps, ... }; declare export default class CellRenderer extends React.Component, State> { state: State, static getDerivedStateFromProps(props: Props, prevState: State): ?State, _separators: any, updateSeparatorProps(newProps: SeparatorProps): any, componentWillUnmount(): any, _onLayout: any, _renderElement(renderItem: ?RenderItemType, ListItemComponent: any, item: ItemT, index: number): React.Node, render(): React.Node, } const styles = StyleSheet.create({ row: { flexDirection: 'row' }, rowReverse: { flexDirection: 'row-reverse' }, columnReverse: { flexDirection: 'column-reverse' } });