react-native-reanimated
Version:
More powerful alternative to Animated library for React Native.
20 lines • 1.23 kB
TypeScript
import type { Component } from 'react';
import type { ScrollView, ScrollViewProps } from 'react-native';
import type { SharedValue } from '../commonTypes';
import type { AnimatedRef } from './commonTypes';
declare const NATIVE_SCROLL_EVENT_NAMES: readonly ["onScroll", "onScrollBeginDrag", "onScrollEndDrag", "onMomentumScrollBegin", "onMomentumScrollEnd"];
type ScrollableComponent = Component<Pick<ScrollViewProps, (typeof NATIVE_SCROLL_EVENT_NAMES)[number]>> & Pick<ScrollView, 'getScrollableNode'>;
/**
* Lets you synchronously get the current offset of a scrollable component.
*
* @param animatedRef - An [animated
* ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef)
* attached to a scrollable component.
* @returns A shared value which holds the current scroll offset of the
* scrollable component.
* @see https://docs.swmansion.com/react-native-reanimated/docs/scroll/useScrollOffset
*/
export declare const useScrollOffset: typeof useScrollOffsetWeb;
declare function useScrollOffsetWeb<C extends ScrollableComponent>(animatedRef: AnimatedRef<C> | null, providedOffset?: SharedValue<number>): SharedValue<number>;
export {};
//# sourceMappingURL=useScrollOffset.d.ts.map