import React, {ComponentClass} from 'react'; import { FlatListProps, SectionListProps, ScrollViewProps, ViewStyle, } from 'react-native'; import {default as Reanimated2} from 'react-native-reanimated'; export interface CollapsibleHeaderProps { headerHeight?: number; renderScrollHeader: () => | React.ComponentType | React.ReactElement | null; tabbarHeight?: number; frozeTop?: number; overflowHeight?: number; makeScrollTrans?: (scrollValue: Reanimated2.SharedValue) => void; headerRespond?: boolean; scrollEnabled?: boolean; isRefreshing?: boolean; onStartRefresh?: () => void; renderRefreshControl?: ( refreshProps: RefreshControlProps, ) => React.ReactElement; refreshHeight?: number; overflowPull?: number; pullExtendedCoefficient?: number; enableSnap?: boolean; scrollingCheckDuration?: number; } export interface CommonSceneProps { index: number; } export interface NormalSceneBaseProps extends CommonSceneProps { isRefreshing?: boolean; onStartRefresh?: () => void; renderRefreshControl?: ( refreshProps: RefreshControlProps, ) => React.ReactElement; renderLoadingView?: (headerHeight: number) => React.ReactElement; } export interface IGestureContainerProps extends CollapsibleHeaderProps { initialPage: number; renderTabView: any; forwardedRef: any; renderFooterComponent: React.ReactElement; FloatingButtonComponent: React.ReactElement; tabContentBackgroundColor: string; componentId?: string; } export interface RefreshControlProps { refreshValue: Reanimated2.SharedValue; refreshType: Reanimated2.SharedValue; progress: Reanimated2.SharedValue; } export interface NormalSceneProps extends ScrollViewProps, NormalSceneBaseProps { ContainerView: any; forwardedRef: any; loadingDelayDuration: number; loadingVisible: boolean; LoadingComponent: React.ReactElement; StickyHeaderComponent: React.ReactElement; } export interface HPageViewProps { forwardedRef: React.LegacyRef; } export type RefreshType = | 'pullToRefresh' | 'enough' | 'prepare' | 'refreshing' | 'finish'; export interface IHeaderContext { tabsIsWorking: Reanimated2.SharedValue; isTouchTabs: Reanimated2.SharedValue; isSlidingHeader: Reanimated2.SharedValue; shareAnimatedValue: Reanimated2.SharedValue; frozeTop: number; tabbarHeight: number; headerHeight: number; refreshHeight: number; overflowPull: number; pullExtendedCoefficient: number; headerTrans: Reanimated2.SharedValue; expectHeight: number; tabsRefreshEnabled: boolean; refHasChanged: (ref: React.RefObject) => void; curIndexValue: Reanimated2.SharedValue; updateSceneInfo: (e: updateSceneInfoType) => void; enableSnap: boolean; scrollingCheckDuration: number; floatingButtonHeight: number; componentId?: string; } export type updateSceneInfoType = { scrollRef: any; index: number; refreshTrans: Reanimated2.SharedValue; isRefreshing: Reanimated2.SharedValue; isRefreshingWithAnimation: Reanimated2.SharedValue; isDragging: Reanimated2.SharedValue; scrollEnabledValue: Reanimated2.SharedValue; canPullRefresh: boolean; scrollY: Reanimated2.SharedValue; isLosingMomentum: Reanimated2.SharedValue; onRefreshStatusCallback: (isToRefresh: boolean) => void; }; export type ScrollableView = ComponentClass< SectionListProps | FlatListProps | ScrollViewProps >; export enum Direction { top, horizontal, bottom, } export type ForwardRefType = | ((instance: T | null) => void) | React.MutableRefObject | null; export type GesturePanContext = { starty: number; basyY: number; };