import type { ReactElement } from 'react'; import type { ViewStyle, ColorValue } from 'react-native'; import type { OnScroll } from './ShadowlistViewNativeComponent'; export interface ViewToken { item: ElementT; index: number; key: string; isViewable: boolean; } export interface ShadowlistCommands { setStartReachedEnabled: (enabled: boolean) => void; setEndReachedEnabled: (enabled: boolean) => void; scrollToIndex: (index: number) => void; scrollToOffset: (offset: number, animated?: boolean) => void; scrollToEnd: (animated?: boolean) => void; } export interface ViewabilityConfig { itemVisiblePercentThreshold?: number; } export interface ShadowlistProps { data: ReadonlyArray; renderElement: (info: { element: ElementT; index: number; }) => ReactElement; keyExtractor?: (item: ElementT, index: number) => string; style?: ViewStyle; elementStyle?: ViewStyle; inverted?: boolean; horizontal?: boolean; stickyHeader?: boolean; stickyFooter?: boolean; autoHideHeader?: boolean; autoHideFooter?: boolean; dragEnabled?: boolean; onReorder?: (info: { from: number; to: number; data: ElementT[]; }) => void; stickyHeaderIndices?: ReadonlyArray; renderStickyHeaderOverlay?: (activeIndex: number) => ReactElement | null; columns?: number; containerOffsetIndex?: number; keyboardAvoidingEnabled?: boolean; keyboardAvoidingOffset?: number; refreshing?: boolean; onRefresh?: () => void; refreshColor?: ColorValue; initialElementsSize?: number; onStartReached?: () => void; onEndReached?: () => void; onStartReachedThreshold?: number; onEndReachedThreshold?: number; onScroll?: (event: { nativeEvent: OnScroll; }) => void; snapToItem?: boolean; snapToAlignment?: 'start' | 'center' | 'end'; viewabilityConfig?: ViewabilityConfig; onViewableItemsChanged?: (info: { viewableItems: ViewToken[]; changed: ViewToken[]; }) => void; ItemSeparatorComponent?: ReactElement | (() => ReactElement | null) | null; ListHeaderComponent?: ReactElement | (() => ReactElement | null) | null; ListFooterComponent?: ReactElement | (() => ReactElement | null) | null; ListEmptyComponent?: ReactElement | (() => ReactElement | null) | null; } export interface SectionBase { data: ReadonlyArray; key?: string; renderItem?: SectionListRenderItem; keyExtractor?: (item: ItemT, index: number) => string; } export type SectionListData = SectionT & SectionBase; export interface SectionListRenderItemInfo { item: ItemT; index: number; section: SectionListData; } export type SectionListRenderItem = (info: SectionListRenderItemInfo) => ReactElement | null; export interface SectionListProps { sections: ReadonlyArray>; renderItem?: SectionListRenderItem; renderSectionHeader?: (info: { section: SectionListData; }) => ReactElement | null; renderSectionFooter?: (info: { section: SectionListData; }) => ReactElement | null; keyExtractor?: (item: ItemT, index: number) => string; stickySectionHeadersEnabled?: boolean; ItemSeparatorComponent?: ReactElement | (() => ReactElement | null) | null; SectionSeparatorComponent?: ReactElement | (() => ReactElement | null) | null; style?: ViewStyle; elementStyle?: ViewStyle; inverted?: boolean; initialElementsSize?: number; containerOffsetIndex?: number; keyboardAvoidingEnabled?: boolean; keyboardAvoidingOffset?: number; refreshing?: boolean; onRefresh?: () => void; refreshColor?: ColorValue; onScroll?: (event: { nativeEvent: OnScroll; }) => void; onStartReached?: () => void; onEndReached?: () => void; onStartReachedThreshold?: number; onEndReachedThreshold?: number; ListHeaderComponent?: ReactElement | (() => ReactElement | null) | null; ListFooterComponent?: ReactElement | (() => ReactElement | null) | null; ListEmptyComponent?: ReactElement | (() => ReactElement | null) | null; } export interface TreeListRenderNodeInfo { item: ItemT; index: number; depth: number; isExpanded: boolean; hasChildren: boolean; indent: number; toggle: () => void; } export interface TreeListCommands extends ShadowlistCommands { scrollToNode: (id: string) => void; } export interface TreeListProps { data: ReadonlyArray; getChildren: (item: ItemT) => ReadonlyArray | undefined; keyExtractor: (item: ItemT) => string; renderNode: (info: TreeListRenderNodeInfo) => ReactElement; expandedIds?: ReadonlyArray | ReadonlySet; initialExpandedIds?: ReadonlyArray | ReadonlySet; onExpandedChange?: (expandedIds: Set) => void; indentWidth?: number; style?: ViewStyle; elementStyle?: ViewStyle; initialElementsSize?: number; containerOffsetIndex?: number; keyboardAvoidingEnabled?: boolean; keyboardAvoidingOffset?: number; refreshing?: boolean; onRefresh?: () => void; refreshColor?: ColorValue; onScroll?: (event: { nativeEvent: OnScroll; }) => void; onStartReached?: () => void; onEndReached?: () => void; onStartReachedThreshold?: number; onEndReachedThreshold?: number; ItemSeparatorComponent?: ReactElement | (() => ReactElement | null) | null; ListHeaderComponent?: ReactElement | (() => ReactElement | null) | null; ListFooterComponent?: ReactElement | (() => ReactElement | null) | null; ListEmptyComponent?: ReactElement | (() => ReactElement | null) | null; } //# sourceMappingURL=types.d.ts.map