import React from 'react'; import PagerViewNativeComponent, { type NativeProps } from './PagerViewNativeComponent'; export type SetPageOptions = { /** * `'scroll'` scrolls past every page between the current one and the target. * `'direct'` slides the target in next to the current page, as if they were * neighbours. Defaults to `'scroll'`. */ animation?: 'scroll' | 'direct'; }; export type PagerViewMethods = { /** * A helper function to scroll to a specific page in the PagerView. * The transition between pages will be animated. */ setPage: (selectedPage: number, options?: SetPageOptions) => void; /** * A helper function to scroll to a specific page in the PagerView. * The transition between pages will *not* be animated. */ setPageWithoutAnimation: (selectedPage: number) => void; /** * A helper function to enable/disable scroll imperatively * The recommended way is using the scrollEnabled prop, however, there might be a case where a * imperative solution is more useful (e.g. for not blocking an animation) */ setScrollEnabled: (scrollEnabled: boolean) => void; /** * @deprecated The ref is the native view itself, use it directly. */ pagerView: React.ComponentRef; }; export type PagerViewRef = React.ComponentRef & PagerViewMethods; type LazyProps = { /** * Mounts a page's content only when the pager gets near it. Set it once: * the pager isn't tracked while `lazy` is off, so turning it on later starts * from `initialPage`. */ lazy?: boolean; /** With `lazy`, how many pages on each side are mounted ahead of time. */ lazyPreloadDistance?: number; /** With `lazy`, what a page shows before its content is mounted. */ renderLazyPlaceholder?: (index: number) => React.ReactNode; }; export type PagerViewProps = Omit & LazyProps & { /** * `'locale'` follows `I18nManager.isRTL`; native only receives `'ltr' | 'rtl'`. */ layoutDirection?: 'ltr' | 'rtl' | 'locale'; ref?: React.Ref; }; /** * Container that allows to flip left and right between child views. Each * child view of the `PagerView` will be treated as a separate page * and will be stretched to fill the `PagerView`. * * It is important all children are ``s and not composite components. * You can set style properties like `padding` or `backgroundColor` for each * child. It is also important that each child have a `key` prop. * * ```tsx * * * First page * * * Second page * * * ``` */ export declare function PagerView({ ref, lazy, lazyPreloadDistance, renderLazyPlaceholder, ...props }: PagerViewProps): React.JSX.Element; /** Keeps `useRef(null)` working. */ export type PagerView = PagerViewRef; export {}; //# sourceMappingURL=PagerView.d.ts.map