Files
NapCatQQ/.pnpm-store/v3/files/8c/884fe868c2741eb12b32f0b428e3ee7f63b8f41c0baef4371dde6aba2de810eb464bce53e3f8148b8e60385eb8914226fa56a6f5c1a11eb310c8206b8f388f
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

31 lines
824 B
Plaintext

type ScrollValue = {
x: number;
y: number;
};
interface UseScrollPositionOptions {
/**
* The wait time in milliseconds before triggering the callback.
* @default 30
*/
delay?: number;
/**
* Whether the scroll position should be tracked or not.
* @default true
*/
isEnabled?: boolean;
/**
* The element to track the scroll position for.
*/
elementRef?: React.RefObject<HTMLElement> | null;
/**
* The callback function to be called when the scroll position changes.
*/
callback?: ({ prevPos, currPos }: {
prevPos: ScrollValue;
currPos: ScrollValue;
}) => void;
}
declare const useScrollPosition: (props: UseScrollPositionOptions) => ScrollValue;
export { ScrollValue, UseScrollPositionOptions, useScrollPosition };