import { Ref } from "@effect/core/io/Ref/definition"; import { Layer } from "@effect/core/io/Layer/definition"; import { Effect } from "@effect/core/io/Effect/definition"; import { Scope } from "@effect/core/io/Scope/definition"; import { Env } from "@tsplus/stdlib/service/Env"; import { Maybe } from "@tsplus/stdlib/data/Maybe/definition"; import { FiberRefs } from "@effect/core/io/FiberRefs/definition"; import { Deferred } from "@effect/core/io/Deferred/definition"; import { Exit } from "@effect/core/io/Exit/definition"; /** * A `MemoMap` memoizes layers. */ export declare class MemoMap { readonly ref: Ref.Synchronized, readonly [Effect, Scope.Finalizer]>>; constructor(ref: Ref.Synchronized, readonly [Effect, Scope.Finalizer]>>); /** * Checks the memo map to see if a layer exists. If it is, immediately * returns it. Otherwise, obtains the layer, stores it in the memo map, * and adds a finalizer to the `Scope`. */ getOrElseMemoize(layer: Layer, scope: Scope): Effect>; } /** * Creates an empty `MemoMap`. */ export declare function makeMemoMap(): Effect; /** * Builds a layer into a scoped value. * @tsplus getter effect/core/io/Layer build * @tsplus location "@effect/core/io/Layer/memoMap" */ export declare function build(self: Layer): Effect>; /** * Builds a layer into an Effect value. Any resources associated with this layer * will be released when the specified scope is closed unless their scope has * been extended. This allows building layers where the lifetime of some of * the services output by the layer exceed the lifetime of the effect the * layer is provided to. * @tsplus static effect/core/io/Layer.Aspects buildWithScope * @tsplus pipeable effect/core/io/Layer buildWithScope * @tsplus location "@effect/core/io/Layer/memoMap" */ export declare function buildWithScope(scope: Scope): (self: import("@effect/core/io/Layer/definition").Layer) => import("../Effect").Effect>; /** * @tsplus static effect/core/io/Layer.Aspects withScope * @tsplus pipeable effect/core/io/Layer withScope * @tsplus location "@effect/core/io/Layer/memoMap" */ export declare function withScope(scope: Scope): (self: import("@effect/core/io/Layer/definition").Layer) => import("../Effect").Effect import("../Effect").Effect>>; /** * Returns whether this layer is a fresh version that will not be shared. * @tsplus getter effect/core/io/Layer isFresh * @tsplus location "@effect/core/io/Layer/memoMap" */ export declare function isFresh(self: Layer): boolean; //# sourceMappingURL=memoMap.d.ts.map