import React from "react"; import { FlatListProps, ViewStyle, FlatList as RNFlatList } from "react-native"; import { State as GestureState } from "react-native-gesture-handler"; import Animated from "react-native-reanimated"; declare const defaultProps: { autoscrollThreshold: number; autoscrollSpeed: number; animationConfig: Animated.SpringConfig; scrollEnabled: boolean; activationDistance: number; refreshControlOffset: number; }; declare type DefaultProps = Readonly; declare type AnimatedFlatListType = { getNode: () => RNFlatList; }; export declare type DragEndParams = { data: T[]; from: number; to: number; }; export declare type RenderItemParams = { item: T; index?: number; drag: () => void; isActive: boolean; }; declare type Modify = Omit & R; declare type Props = Modify, { autoscrollSpeed?: number; autoscrollThreshold?: number; data: T[]; onRef?: (ref: React.RefObject>) => void; onDragBegin?: (index: number) => void; onRelease?: (index: number) => void; onDragEnd?: (params: DragEndParams) => void; renderItem: (params: RenderItemParams) => React.ReactNode; animationConfig: Partial; activationDistance?: number; debug?: boolean; layoutInvalidationKey?: string; onScrollOffsetChange?: (scrollOffset: number) => void; refreshing?: boolean; onRefresh?: () => void; refreshControlOffset?: number; } & Partial>; declare type State = { activeKey: string | null; hoverComponent: React.ReactNode | null; isLoaderActive: boolean | false; }; declare type CellData = { size: Animated.Value; offset: Animated.Value; measurements: { size: number; offset: number; }; style: Animated.AnimateProps; currentIndex: Animated.Value; onLayout: () => void; onUnmount: () => void; }; declare class DraggableFlatList extends React.Component, State> { state: State; containerRef: any; flatlistRef: any; panGestureHandlerRef: any; containerSize: Animated.Value; activationDistance: Animated.Value; touchAbsolute: Animated.Value; touchCellOffset: Animated.Value; panGestureState: Animated.Value; isPressedIn: { native: Animated.Value; js: boolean; }; hasMoved: Animated.Value<0>; disabled: Animated.Value<0>; activeIndex: Animated.Value; isHovering: Animated.Node<0 | 1>; spacerIndex: Animated.Value; activeCellSize: Animated.Value; scrollOffset: Animated.Value; scrollViewSize: Animated.Value; isScrolledUp: Animated.Node<0 | 1>; isScrolledDown: Animated.Node<0 | 1>; hoverAnim: Animated.Node; hoverMid: Animated.Node; hoverOffset: Animated.Node; hoverTo: Animated.Value<0>; hoverClock: Animated.Clock; hoverAnimState: { finished: Animated.Value<0>; velocity: Animated.Value<0>; position: Animated.Value<0>; time: Animated.Value<0>; }; hoverAnimConfig: any; distToTopEdge: Animated.Node; distToBottomEdge: Animated.Node; cellAnim: Map; cellData: Map; cellRefs: Map; moveEndParams: Animated.Value[]; resetHoverSpring: Animated.Node[]; keyToIndex: Map; isAutoscrolling: { native: Animated.Value; js: boolean; }; queue: (() => void | Promise)[]; isLoading: Animated.Value<0>; isNotFirstLoad: Animated.Value<0>; static getDerivedStateFromProps(props: Props): { extraData: any; }; static defaultProps: { autoscrollThreshold: number; autoscrollSpeed: number; animationConfig: Animated.SpringConfig; scrollEnabled: boolean; activationDistance: number; refreshControlOffset: number; }; constructor(props: Props); dataKeysHaveChanged: (a: T[], b: T[]) => boolean; componentDidUpdate: (prevProps: Modify void) | undefined; onDragBegin?: ((index: number) => void) | undefined; onRelease?: ((index: number) => void) | undefined; onDragEnd?: ((params: DragEndParams) => void) | undefined; renderItem: (params: RenderItemParams) => any; animationConfig: Partial; activationDistance?: number | undefined; debug?: boolean | undefined; layoutInvalidationKey?: string | undefined; onScrollOffsetChange?: ((scrollOffset: number) => void) | undefined; refreshing?: boolean | undefined; onRefresh?: (() => void) | undefined; refreshControlOffset?: number | undefined; } & Partial>>, prevState: State) => Promise; flushQueue: () => Promise; resetHoverState: () => void; drag: (hoverComponent: any, activeKey: string) => void; onRelease: ([index]: readonly number[]) => void; onDragEnd: ([from, to]: readonly number[]) => void; updateCellData: (data?: T[]) => void; setCellData: (key: string, index: number) => void; measureAll: (data: T[]) => void; measureCell: (key: string) => Promise; keyExtractor: (item: T, index: number) => any; onContainerLayout: () => void; onListContentSizeChange: (w: number, h: number) => void; targetScrollOffset: Animated.Value; resolveAutoscroll?: (scrollParams: readonly number[]) => void; onAutoscrollComplete: (params: readonly number[]) => void; scrollToAsync: (offset: number) => Promise; getScrollTargetOffset: (distFromTop: number, distFromBottom: number, scrollOffset: number, isScrolledUp: boolean, isScrolledDown: boolean) => number; autoscroll: ([distFromTop, distFromBottom, scrollOffset, isScrolledUp, isScrolledDown]: readonly number[]) => Promise; isAtTopEdge: Animated.Node<0 | 1>; isAtBottomEdge: Animated.Node<0 | 1>; isAtEdge: Animated.Node<0 | 1>; autoscrollParams: Animated.Node[]; checkAutoscroll: Animated.Node; onScroll: (...args: any[]) => void; scrollToContent: (animated?: boolean) => void; onGestureRelease: Animated.Node[]; onPanStateChange: (...args: any[]) => void; onPanGestureEvent: (...args: any[]) => void; hoverComponentTranslate: Animated.Node; hoverComponentOpacity: Animated.Node<0 | 1>; renderHoverComponent: () => any; renderItem: ({ item, index }: { item: T; index: number; }) => any; CellRendererComponent: (cellProps: any) => any; renderDebug(): any; onContainerTouchEnd: () => void; componentDidMount(): void; render(): any; } export default DraggableFlatList;