12 lines
367 B
TypeScript
12 lines
367 B
TypeScript
|
|
export interface UseIdleOptions {
|
||
|
|
/** 空闲超时时间(毫秒),默认值 10000 */
|
||
|
|
timeout?: number;
|
||
|
|
/** 监听的事件列表,默认值 ['mousedown', 'mousemove', 'keypress', 'scroll', 'touchstart', 'wheel'] */
|
||
|
|
events?: string[];
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 检测用户是否处于空闲状态
|
||
|
|
*/
|
||
|
|
export default function useIdle(options?: UseIdleOptions): boolean;
|