/** * @since 1.0.0 */ import * as Context from "effect/Context"; import * as Effect from "effect/Effect"; import * as Layer from "effect/Layer"; import * as Stream from "effect/Stream"; import type * as Atom from "./Atom.js"; import type { Registry } from "./index.js"; import * as Result from "./Result.js"; declare const TypeId: TypeId; type TypeId = "~effect-atom/atom/Registry"; /** * @since 1.0.0 * @category guards */ export declare const isRegistry: (u: unknown) => u is Registry; /** * @since 1.0.0 * @category models */ export interface Registry { readonly [TypeId]: TypeId; readonly getNodes: () => ReadonlyMap | string, Node>; readonly get: (atom: Atom.Atom) => A; readonly mount: (atom: Atom.Atom) => () => void; readonly refresh: (atom: Atom.Atom) => void; readonly set: (atom: Atom.Writable, value: W) => void; readonly setSerializable: (key: string, encoded: unknown) => void; readonly modify: (atom: Atom.Writable, f: (_: R) => [returnValue: A, nextValue: W]) => A; readonly update: (atom: Atom.Writable, f: (_: R) => W) => void; readonly subscribe: (atom: Atom.Atom, f: (_: A) => void, options?: { readonly immediate?: boolean; }) => () => void; readonly reset: () => void; readonly dispose: () => void; } /** * @since 1.0.0 * @category models */ interface Node { readonly atom: Atom.Atom; readonly value: () => A; } /** * @since 1.0.0 * @category constructors */ export declare const make: (options?: { readonly initialValues?: Iterable, any]> | undefined; readonly scheduleTask?: ((f: () => void) => void) | undefined; readonly timeoutResolution?: number | undefined; readonly defaultIdleTTL?: number | undefined; } | undefined) => Registry; declare const AtomRegistry_base: Context.TagClass; /** * @since 1.0.0 * @category Tags */ export declare class AtomRegistry extends AtomRegistry_base { } /** * @since 1.0.0 * @category Layers */ export declare const layerOptions: (options?: { readonly initialValues?: Iterable, any]> | undefined; readonly scheduleTask?: ((f: () => void) => void) | undefined; readonly timeoutResolution?: number | undefined; readonly defaultIdleTTL?: number | undefined; }) => Layer.Layer; /** * @since 1.0.0 * @category Layers */ export declare const layer: Layer.Layer; /** * @since 1.0.0 * @category Conversions */ export declare const toStream: { (atom: Atom.Atom): (self: Registry) => Stream.Stream; (self: Registry, atom: Atom.Atom): Stream.Stream; }; /** * @since 1.0.0 * @category Conversions */ export declare const toStreamResult: { (atom: Atom.Atom>): (self: Registry) => Stream.Stream; (self: Registry, atom: Atom.Atom>): Stream.Stream; }; /** * @since 1.0.0 * @category Conversions */ export declare const getResult: { (atom: Atom.Atom>, options?: { readonly suspendOnWaiting?: boolean | undefined; }): (self: Registry) => Effect.Effect; (self: Registry, atom: Atom.Atom>, options?: { readonly suspendOnWaiting?: boolean | undefined; }): Effect.Effect; }; export {}; //# sourceMappingURL=Registry.d.ts.map