import type { Falsy } from "../core/types.js";
export interface PollFn<T> {
    (abort: AbortSignal): T | Falsy | Promise<T | Falsy>;
}
export declare class PollTimeoutError extends Error {
}
/**
 * Repeatedly call a function until a truthy value is returned.
 *
 * + The function is called at most every event cycle.
 * + If a timeout occurs, a {@link PollTimeoutError} is thrown and the abort signal passed to the function is aborted with the same error.
 *
 * @param fn The function to run.
 * @param timeout An optional timeout.
 * @returns The first truthy value.
 */
export declare function poll<T>(fn: PollFn<T>, timeout?: number): Promise<T>;
//# sourceMappingURL=poll.d.ts.map