export default function useLock(duration?: number): [() => boolean, (lock: boolean) => void];