UNPKG

@rtdui/hooks

Version:

React hooks library base on @mantine/hooks

17 lines (16 loc) 748 B
export declare const isFixed: (current: number, fixedAt: number) => boolean; export declare const isPinned: (current: number, previous: number) => boolean; export declare const isReleased: (current: number, previous: number, fixedAt: number) => boolean; interface UseHeadroomInput { /** Number in px at which element should be fixed */ fixedAt?: number; /** Called when element is pinned */ onPin?: () => void; /** Called when element is at fixed position */ onFix?: () => void; /** Called when element is unpinned */ onRelease?: () => void; } /** 使用usePrevious替代,为了兼容iOS的滚动 */ export declare function useHeadroom2({ fixedAt, onPin, onFix, onRelease, }?: UseHeadroomInput): boolean; export {};