@janiscommerce/ui-native
Version:
components library for Janis app
27 lines (26 loc) • 790 B
TypeScript
import React, { FC } from 'react';
import { FlatListProps, ScrollViewProps } from 'react-native';
type TypeData = any;
type RCProps = {
item: TypeData;
index: number;
};
type TypeRenderComponent = ({ item, index }: RCProps) => React.ReactElement;
export declare enum TypeList {
FlatList = "flatList",
ScrollView = "scrollView"
}
interface BaseProps {
data: TypeData[] | undefined;
renderComponent: TypeRenderComponent;
type?: TypeList;
}
type FlatListOnlyProps = Omit<FlatListProps<TypeData>, 'data' | 'renderItem'> & {
type?: TypeList.FlatList;
};
type ScrollViewOnlyProps = ScrollViewProps & {
type: TypeList.ScrollView;
};
type ListProps = BaseProps & (FlatListOnlyProps | ScrollViewOnlyProps);
declare const List: FC<ListProps>;
export default List;