import { Ref } from "@effect/core/io/Ref/definition"; import { TestClock } from "@effect/core/testing/TestClock/definition"; import { Annotations } from "@effect/core/testing/Annotations/definition"; import { Effect } from "@effect/core/io/Effect/definition"; import { Duration } from "@tsplus/stdlib/data/Duration"; import { Deferred } from "@effect/core/io/Deferred/definition"; import { List } from "@tsplus/stdlib/collections/List/definition"; import { SortedSet } from "@tsplus/stdlib/collections/SortedSet/definition"; import { Fiber } from "@effect/core/io/Fiber/definition"; import { TestAnnotation } from "@effect/core/testing/TestAnnotation/definition"; import { HashMap } from "@tsplus/stdlib/collections/HashMap/definition"; import { FiberId } from "@effect/core/io/FiberId/definition"; import { Maybe } from "@tsplus/stdlib/data/Maybe/definition"; import { identity } from "@tsplus/stdlib/data/Function"; import { Ord } from "@tsplus/stdlib/prelude/Ord/definition"; import { LiveClock } from "@effect/core/io/Clock"; import type { Live } from "@effect/core/testing/Live"; import { SuspendedWarningData } from "@effect/core/testing/TestClock/_internal/SuspendedWarningData"; import { WarningData } from "@effect/core/testing/TestClock/_internal/WarningData"; /** * The warning message that will be displayed if a test is using time but is * not advancing the `TestClock`. */ export declare const warning: string; /** * The warning message that will be displayed if a test is advancing the clock * but a fiber is still running. */ export declare const suspendedWarning: string; export declare class TestClockInternal extends LiveClock { readonly clockState: Ref; readonly live: Live; readonly annotations: Annotations; readonly warningState: Ref.Synchronized; readonly suspendedWarningState: Ref.Synchronized; constructor(clockState: Ref, live: Live, annotations: Annotations, warningState: Ref.Synchronized, suspendedWarningState: Ref.Synchronized); /** * Returns the current clock time in milliseconds. */ get currentTime(): Effect; /** * Saves the `TestClock`'s current state in an effect which, when run, will * restore the `TestClock` state to the saved state */ get save(): Effect>; /** * Sets the current clock time to the specified instant. Any effects that * were scheduled to occur on or before the new time will be run in order. */ setTime(instant: number): Effect; /** * Semantically blocks the current fiber until the clock time is equal to or * greater than the specified duration. Once the clock time is adjusted to * on or after the duration, the fiber will automatically be resumed. */ sleep(duration: Duration): Effect; /** * Returns a list of the times at which all queued effects are scheduled to * resume. */ get sleeps(): Effect>; /** * Increments the current clock time by the specified duration. Any effects * that were scheduled to occur on or before the new time will be run in * order. */ adjust(duration: Duration): Effect; /** * Increments the current clock time by the specified duration. Any effects * that were scheduled to occur on or before the new time will be run in * order. */ adjustWith(duration: Duration): (effect: import("../../../io/Effect").Effect) => import("../../../io/Effect").Effect; /** * Returns a set of all fibers in this test. */ get supervisedFibers(): Effect>>; /** * Captures a "snapshot" of the identifier and status of all fibers in this * test other than the current fiber. Fails with the `Unit` value if any of * these fibers are not done or suspended. Note that because we cannot * synchronize on the status of multiple fibers at the same time this * snapshot may not be fully consistent. */ private get freeze(); /** * Forks a fiber that will display a warning message if a test is using time * but is not advancing the `TestClock`. */ private get warningStart(); /** * Cancels the warning message that is displayed if a test is using time but * is not advancing the `TestClock`. */ get warningDone(): Effect; /** * Returns whether all descendants of this fiber are done or suspended. */ private get suspended(); /** * Polls until all descendants of this fiber are done or suspended. */ private get awaitSuspended(); /** * Forks a fiber that will display a warning message if a test is advancing * the `TestClock` but a fiber is not suspending. */ private get suspendedWarningStart(); /** * Cancels the warning message that is displayed if a test is advancing the * `TestClock` but a fiber is not suspending. */ get suspendedWarningDone(): import("../../../io/Effect").Effect; /** * Runs all effects scheduled to occur on or before the specified instant, * which may depend on the current time, in order. */ private run; } //# sourceMappingURL=TestClockInternal.d.ts.map