UNPKG

@serenity-js/core

Version:

The core Serenity/JS framework, providing the Screenplay Pattern interfaces, as well as the test reporting and integration infrastructure

42 lines 1.34 kB
import type { JSONObject } from 'tiny-types'; import type { Clock } from './Clock'; import type { DelayedCallback } from './DelayedCallback'; import { Duration } from './Duration'; import type { RepeatUntilLimits } from './RepeatUntilLimits'; /** * @group Time */ export declare class Scheduler { private readonly clock; private readonly interactionTimeout; private scheduledOperations; /** * @param clock * @param interactionTimeout * The maximum amount of time to give to a callback to complete before throwing an error */ constructor(clock: Clock, interactionTimeout: Duration); toJSON(): JSONObject; /** * Schedules a callback function to be invoked after a delay * * @param delay * @param callback */ after<Result>(delay: Duration, callback: DelayedCallback<Result>): Promise<Result>; /** * Returns a `Promise` to be resolved after a `delay` * * @param delay */ waitFor(delay: Duration): Promise<void>; /** * Schedules a callback function to be repeated, according to configured limits. * * @param callback * @param limits */ repeatUntil<Result>(callback: DelayedCallback<Result>, limits?: RepeatUntilLimits<Result>): Promise<Result>; stop(): void; } //# sourceMappingURL=Scheduler.d.ts.map