- Added `cssInterop` for styling in `PagerView`. - Updated `onScrollEnd` to pass the current index in `PagerView`. - Introduced `PagerList` component for better feed view management. - Refactored imports to ensure consistency across modules. - Enhanced type definitions for better TypeScript support. Signed-off-by: Innei <tukon479@gmail.com>
27 lines
917 B
TypeScript
27 lines
917 B
TypeScript
import { requireNativeView } from "expo"
|
|
import type { NativeSyntheticEvent, ViewProps } from "react-native"
|
|
|
|
export const EnhancePagerView = requireNativeView<
|
|
ViewProps &
|
|
PagerProps & {
|
|
ref: React.RefObject<PagerRef>
|
|
}
|
|
>("EnhancePagerView")
|
|
export const EnhancePageView = requireNativeView("EnhancePageView")
|
|
|
|
export interface PagerProps {
|
|
onPageChange?: (e: NativeSyntheticEvent<{ index: number }>) => void
|
|
onScroll?: (e: NativeSyntheticEvent<{ percent: number; direction: "left" | "right" }>) => void
|
|
onScrollBegin?: () => void
|
|
onScrollEnd?: (e: NativeSyntheticEvent<{ index: number }>) => void
|
|
onPageWillAppear?: (e: NativeSyntheticEvent<{ index: number }>) => void
|
|
page?: number
|
|
pageGap?: number
|
|
transitionStyle?: "scroll" | "pageCurl"
|
|
}
|
|
export interface PagerRef {
|
|
setPage: (index: number) => void
|
|
getPage: () => number
|
|
getState: () => "idle" | "dragging" | "scrolling"
|
|
}
|