UNPKG

633 BTypeScriptView Raw
1import * as React from 'react';
2declare type ScrollOptions = {
3 x?: number;
4 y?: number;
5 animated?: boolean;
6};
7declare type ScrollableView = {
8 scrollToTop(): void;
9} | {
10 scrollTo(options: ScrollOptions): void;
11} | {
12 scrollToOffset(options: {
13 offset?: number;
14 animated?: boolean;
15 }): void;
16} | {
17 scrollResponderScrollTo(options: ScrollOptions): void;
18};
19declare type ScrollableWrapper = {
20 getScrollResponder(): React.ReactNode;
21} | {
22 getNode(): ScrollableView;
23} | ScrollableView;
24export default function useScrollToTop(ref: React.RefObject<ScrollableWrapper>): void;
25export {};