Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
31 lines
824 B
Plaintext
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 };
|