import type { PollSpec } from '@fun-xyz/fiat-contract/types'; export interface SchedulePollHandlers { /** * Runs one poll. Resolving `false` stops the schedule — the caller decides, * because "did the flow move on" is a question about the envelope this module * deliberately does not read. */ onPoll: () => boolean | Promise; /** The deadline passed with the flow still on this state. */ onGiveUp?: () => void; /** A poll failed, or the spec was unusable. A failed request does not stop the schedule. */ onError?: (error: unknown) => void; } /** * Polls `spec` until the caller stops it, the deadline passes, or the returned * canceller is called. Always call the canceller on unmount. */ export declare function schedulePoll(spec: PollSpec, handlers: SchedulePollHandlers): () => void; /** * Translates a `PollSpec` into `retry` options. * * The numbers pass through untouched. The contract bounds them — whole, inside * the platform timer range, `backoffFactor >= 1`, and `maxIntervalMs` required * alongside a factor and never below `intervalMs` — so sanitising here would * only hide an emission that is already invalid. */ export declare function attemptOptionsFor(spec: PollSpec): { delay: number; initialDelay: number; minDelay: number; maxDelay: number; factor: number; jitter: boolean; maxAttempts: number; }; //# sourceMappingURL=schedulePoll.d.ts.map