overcentric
Version:
Overcentric watches your website, product, and users - and tells you what matters and what to do about it.
17 lines (16 loc) • 650 B
TypeScript
type ActivityListener = () => void;
/**
* Start listening for real user-input events. Safe to call multiple times;
* listeners are only attached once.
*/
export declare function initActivityTracking(): void;
/**
* Register a callback that fires (throttled) whenever genuine user activity
* occurs. Returns an unsubscribe function.
*/
export declare function onUserActivity(fn: ActivityListener): () => void;
/** Milliseconds since the last detected user activity. */
export declare function timeSinceLastActivity(): number;
/** Timestamp (ms) of the last detected user activity. */
export declare function getLastActivity(): number;
export {};