Summary:
Add missing props to virtual list

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[General] [Fixed] - Virtual list props

Pull Request resolved: https://github.com/facebook/react-native/pull/35434

Test Plan:
relative pull request in DefinitelyTyped
https://github.com/DefinitelyTyped/DefinitelyTyped/pull/63323

Reviewed By: javache

Differential Revision: D41553396

Pulled By: NickGerleman

fbshipit-source-id: d51a93410ece9ad5f0bb61e2ee51076973e80c8c
This commit is contained in:
Ali Akbar Azizi 2022-11-28 12:14:21 -08:00 коммит произвёл Facebook GitHub Bot
Родитель 4e668167f9
Коммит 6c33fd1c48
3 изменённых файлов: 17 добавлений и 84 удалений

42
Libraries/Lists/FlatList.d.ts поставляемый
Просмотреть файл

@ -19,48 +19,6 @@ import {ViewStyle} from '../StyleSheet/StyleSheetTypes';
import {View} from '../Components/View/View';
export interface FlatListProps<ItemT> extends VirtualizedListProps<ItemT> {
/**
* Rendered in between each item, but not at the top or bottom
*/
ItemSeparatorComponent?: React.ComponentType<any> | null | undefined;
/**
* Rendered when the list is empty.
*/
ListEmptyComponent?:
| React.ComponentType<any>
| React.ReactElement
| null
| undefined;
/**
* Rendered at the very end of the list.
*/
ListFooterComponent?:
| React.ComponentType<any>
| React.ReactElement
| null
| undefined;
/**
* Styling for internal View for ListFooterComponent
*/
ListFooterComponentStyle?: StyleProp<ViewStyle> | undefined;
/**
* Rendered at the very beginning of the list.
*/
ListHeaderComponent?:
| React.ComponentType<any>
| React.ReactElement
| null
| undefined;
/**
* Styling for internal View for ListHeaderComponent
*/
ListHeaderComponentStyle?: StyleProp<ViewStyle> | undefined;
/**
* Optional custom style for multi-item rows generated when numColumns > 1
*/

42
Libraries/Lists/SectionList.d.ts поставляемый
Просмотреть файл

@ -61,48 +61,6 @@ export type SectionListRenderItem<ItemT, SectionT = DefaultSectionT> = (
export interface SectionListProps<ItemT, SectionT = DefaultSectionT>
extends VirtualizedListWithoutRenderItemProps<ItemT> {
/**
* Rendered in between adjacent Items within each section.
*/
ItemSeparatorComponent?: React.ComponentType<any> | null | undefined;
/**
* Rendered when the list is empty.
*/
ListEmptyComponent?:
| React.ComponentType<any>
| React.ReactElement
| null
| undefined;
/**
* Rendered at the very end of the list.
*/
ListFooterComponent?:
| React.ComponentType<any>
| React.ReactElement
| null
| undefined;
/**
* Styling for internal View for ListFooterComponent
*/
ListFooterComponentStyle?: StyleProp<ViewStyle> | undefined | null;
/**
* Rendered at the very beginning of the list.
*/
ListHeaderComponent?:
| React.ComponentType<any>
| React.ReactElement
| null
| undefined;
/**
* Styling for internal View for ListHeaderComponent
*/
ListHeaderComponentStyle?: StyleProp<ViewStyle> | undefined | null;
/**
* Rendered in between each section.
*/

17
Libraries/Lists/VirtualizedList.d.ts поставляемый
Просмотреть файл

@ -9,6 +9,8 @@
import type * as React from 'react';
import type {LayoutChangeEvent} from '../../types';
import {StyleProp} from '../StyleSheet/StyleSheet';
import {ViewStyle} from '../StyleSheet/StyleSheetTypes';
import type {ScrollViewProps} from '../Components/ScrollView/ScrollView';
export interface ViewToken {
@ -124,6 +126,11 @@ export interface VirtualizedListProps<ItemT>
export interface VirtualizedListWithoutRenderItemProps<ItemT>
extends ScrollViewProps {
/**
* Rendered in between each item, but not at the top or bottom
*/
ItemSeparatorComponent?: React.ComponentType<any> | null | undefined;
/**
* Rendered when the list is empty. Can be a React Component Class, a render function, or
* a rendered element.
@ -144,6 +151,11 @@ export interface VirtualizedListWithoutRenderItemProps<ItemT>
| null
| undefined;
/**
* Styling for internal View for ListFooterComponent
*/
ListFooterComponentStyle?: StyleProp<ViewStyle> | undefined;
/**
* Rendered at the top of all the items. Can be a React Component Class, a render function, or
* a rendered element.
@ -154,6 +166,11 @@ export interface VirtualizedListWithoutRenderItemProps<ItemT>
| null
| undefined;
/**
* Styling for internal View for ListHeaderComponent
*/
ListHeaderComponentStyle?: StyleProp<ViewStyle> | undefined;
/**
* The default accessor functions assume this is an Array<{key: string}> but you can override
* getItem, getItemCount, and keyExtractor to handle any type of index-based data.