/** * Configuration for the {@link poll} function. */ export interface PollConfig { /** * How long to wait between polling checks in milliseconds. * * Defaults to 250. */ readonly wait?: number; /** * Predicate function that returns `true` when the polling condition has been met. */ readonly check: () => boolean; /** * Maximum number of polling iterations before giving up. * * Defaults to `Number.MAX_SAFE_INTEGER`. */ readonly timesToGiveup?: number; } /** * Polls at a regular interval until a condition is met or the maximum number of attempts is reached. * * @param config - Polling configuration including check function, wait interval, and max attempts. * @param config.check - Predicate function that returns true when the polling condition has been satisfied. * @param config.wait - Milliseconds to wait between polling iterations; defaults to 250. * @param config.timesToGiveup - Maximum number of polling iterations before giving up; defaults to `Number.MAX_SAFE_INTEGER` * @returns Resolves when the check condition returns `true` or the max attempts are exhausted. * * @dbxUtil * @dbxUtilCategory promise * @dbxUtilTags promise, poll, wait, retry, condition, async, interval * @dbxUtilRelated wait-for-ms, perform-task-loop */ export declare function poll({ check, wait, timesToGiveup }: PollConfig): Promise;