import type { Pausable } from "../use-pausable/index.cjs"; import type { WindowEventName } from "../utils/basic.cjs"; export interface UseUserIdleOptions { /** * Event names that listen to for detected user activity * * @defaultValue ['mousemove', 'mousedown', 'resize', 'keydown', 'touchstart', 'wheel'] */ events?: WindowEventName[]; /** * Listen for document visibility change * * @defaultValue true */ watchVisibility?: boolean; /** * Initial state of the ref idle * * @defaultValue false */ initialState?: boolean; /** * Reset the idle state immediately * * @defaultValue true */ immediate?: boolean; } export interface UseUserIdleReturns extends Pausable<[reset?: boolean], [reset?: boolean]> { /** * Whether the user is idle */ isIdle: boolean; /** * The timestamp of the last user activity */ lastActive: number; /** * Reset the idle state * * @param restart - Whether to restart the idle timer,`true` by default. */ reset: (restart?: boolean, updateTimestamp?: boolean) => void; } /** * A React Hook that helps to detect whether the user is idle or not. */ export declare function useUserIdle(timeout?: number, options?: UseUserIdleOptions): UseUserIdleReturns;