The function to evaluate. It can return a boolean or a promise of a boolean. / 要评估的函数,可以返回布尔值或布尔值的 promise
The options for the polling. / 轮询的配置项
Optionalinterval?: numberThe interval between condition checks in milliseconds.
两次条件检查之间的间隔毫秒数
Optionalsignal?: AbortSignalThe signal to abort the polling.
中止轮询的信号
Optionaltimeout?: numberThe maximum time in milliseconds to wait before rejecting with a TimeoutError.
在抛出 TimeoutError 之前等待的最大毫秒数
A promise that resolves when the condition becomes true. / 条件为 true 时解析的 promise
Polls a condition until it returns true, a timeout elapses, or the signal is aborted.
轮询直到条件返回 true、超时或信号被中止。