import { type HookErrorHandler } from '../utils/errors.js'; /** Options for {@link useLockFn}. @public */ export interface UseLockFnOptions { /** Observes a rejected invocation before the original error is rethrown. */ readonly onError?: HookErrorHandler; } /** The stable function returned by {@link useLockFn}. @public */ export type LockFn = (...args: Args) => Promise; /** * Prevents overlapping calls to an async or sync function. * * Calls made while another invocation is pending resolve to `undefined`. The * lock is released in `finally`, including when the function throws or * rejects, and the original failure remains a rejected promise. * * @public */ export declare function useLockFn(fn: (...args: Args) => Result | PromiseLike, options?: UseLockFnOptions): LockFn>;