Version: 0.0.11.0.01.0.21.1.01.2.12.0.02.0.12.0.22.1.03.0.03.0.13.0.23.0.33.0.43.1.03.1.13.2.03.2.13.3.03.3.13.3.23.3.34.0.0-04.0.0-14.0.0-64.0.0-74.0.0-84.0.0-94.0.0-104.0.0-114.0.0-124.0.0-134.0.0-144.0.0-154.0.04.0.14.1.04.1.14.1.24.2.04.2.14.2.24.2.34.2.44.3.04.3.14.3.24.3.34.4.04.5.04.6.0-rc14.6.0-rc24.6.0-rc34.6.0-rc44.6.04.6.14.6.24.6.34.6.44.6.54.6.64.6.74.7.0-rc14.7.0-rc24.7.0-rc34.7.0-rc44.7.0-rc54.7.0-rc64.7.0-rc74.7.04.7.14.7.24.7.34.7.54.7.64.7.74.7.84.8.04.9.04.9.14.10.04.11.04.12.04.13.04.14.04.14.14.15.04.15.14.15.24.15.34.15.44.16.04.16.14.16.24.17.04.17.14.18.04.19.04.19.14.19.24.20.04.20.14.20.24.22.04.23.04.23.14.23.24.23.34.23.44.24.04.24.14.25.04.26.0-pr2674-2021911757244.26.0-pr2674-202195158144.26.0-pr2674-202196124354.26.04.26.14.27.0-pr2674-20219261010234.27.04.28.04.28.14.29.04.30.04.30.14.30.24.30.34.30.44.30.54.30.64.31.04.32.04.32.14.33.04.33.14.33.24.33.34.33.44.33.54.33.64.34.04.35.04.35.14.35.24.35.34.35.44.36.04.37.04.37.14.37.24.38.04.38.14.38.24.38.35.0.0-alpha.05.0.0-alpha.15.0.0-alpha.25.0.0-alpha.35.0.0-alpha.45.0.0-alpha.55.0.0-alpha.65.0.0-beta.75.0.0-beta.85.0.0-beta.95.0.0-beta.105.0.0-beta.115.0.0-beta.125.0.0-beta.135.0.0-beta.145.0.0-beta.155.0.0-beta.165.0.0-beta.175.0.0-beta.185.0.0-beta.195.0.0-beta.205.0.0-beta.215.0.0-beta.225.0.0-beta.235.0.0-beta.245.0.0-beta.255.0.0-beta.265.0.0-beta.275.0.0-beta.285.0.0-beta.295.0.0-beta.305.0.0-beta.315.0.0-beta.325.0.0-beta.335.0.0-beta.345.0.0-beta.355.0.0-beta.365.0.0-beta.375.0.0-beta.385.0.0-beta.395.0.0-beta.405.0.0-beta.415.0.0-beta.425.0.0-beta.435.0.0-beta.445.0.0-beta.455.0.0-beta.465.0.0-beta.475.0.0-beta.485.0.0-beta.495.0.0-beta.505.0.0-beta.515.0.0-beta.525.0.0-beta.535.0.0-beta.545.0.05.0.15.0.25.1.05.2.05.2.15.3.05.3.15.4.05.4.15.5.05.5.15.5.25.6.05.6.15.6.25.7.05.7.15.8.05.8.15.8.25.9.05.9.15.10.05.11.05.12.05.13.05.13.15.13.25.14.05.15.05.16.05.17.05.17.15.17.25.17.35.17.45.18.05.18.15.18.25.19.05.19.1
import { AnyActorRef, SnapshotFrom } from "./types.js";
interface WaitForOptions {
/**
* How long to wait before rejecting, if no emitted state satisfies the
* predicate.
*
* @defaultValue Infinity
*/
timeout: number;
/** A signal which stops waiting when aborted. */
signal?: AbortSignal;
}
* Subscribes to an actor ref and waits for its emitted value to satisfy a
* predicate, and then resolves with that value. Will throw if the desired state
* is not reached after an optional timeout. (defaults to Infinity).
* @example
* ```js
* const state = await waitFor(someService, (state) => {
* return state.hasTag('loaded');
* });
* state.hasTag('loaded'); // true
* ```
* @param actorRef The actor ref to subscribe to
* @param predicate Determines if a value matches the condition to wait for
* @param options
* @returns A promise that eventually resolves to the emitted value that matches
* the condition
export declare function waitFor<TActorRef extends AnyActorRef>(actorRef: TActorRef, predicate: (emitted: SnapshotFrom<TActorRef>) => boolean, options?: Partial<WaitForOptions>): Promise<SnapshotFrom<TActorRef>>;
export {};