export type IdleEventName = "mousemove" | "mousedown" | "keydown" | "touchstart" | "touchmove" | "scroll" | "wheel" | "resize" | (string & {}); export interface IdleOptions { /** Idle timeout in ms. Default 10000. Use `set({ idle })` to change at runtime. */ idle?: number; /** Activity events. Default includes scroll/wheel for #26 + mobile touch. */ events?: IdleEventName[]; /** Called once when the user becomes idle. */ onIdle?: (() => void) | null; /** Called once when activity resumes after idle. */ onActive?: (() => void) | null; /** Called when the tab becomes hidden. */ onHide?: (() => void) | null; /** Called when the tab becomes visible again. */ onShow?: (() => void) | null; /** Keep re-arming after each idle event. Default true. */ keepTracking?: boolean; /** Start in idle state. Default false (v1 quirk `true` removed). */ startAtIdle?: boolean; /** Use setInterval instead of setTimeout to re-fire onIdle. Default false. */ recurIdleCall?: boolean; /** * Event target for activity listeners. Defaults to global `window`. * Pass an iframe's `contentWindow` for #25, or any EventTarget in tests. */ target?: EventTarget | null; } interface ResolvedSettings extends Required> { onIdle: (() => void) | null; onActive: (() => void) | null; onHide: (() => void) | null; onShow: (() => void) | null; target: EventTarget | null; } export declare class IdleJs { settings: ResolvedSettings; idle: boolean; visible: boolean; /** Timestamp (ms) of last observed activity. Enables elapsed check on visibility return (#29). */ lastActive: number; private timerId; private isInterval; private started; private stopListener; private activityHandler; private visibilityHandler; constructor(options?: IdleOptions); private clearTimer; private arm; private rearm; /** @deprecated Use `rearm` semantics via `reset()` + running state. Kept for v1 compat. */ resetTimeout(_settings?: unknown, keepTracking?: boolean): void; /** @deprecated Use `arm()` internally. Kept for v1 compat. */ timeout(_settings?: unknown): void; start(): this; stop(): this; reset(options?: { idle?: boolean; visible?: boolean; }): this; throwOnBadKey(keys: string[], goodKeys: string[]): void; set(options: Partial): void; private reattach; } export {}; //# sourceMappingURL=index.d.mts.map