import { Endomorphism } from 'fp-ts/Endomorphism'; import { Eq } from 'fp-ts/Eq'; import { FromIO1 } from 'fp-ts/FromIO'; import { Lazy } from 'fp-ts/function'; import { Option } from 'fp-ts/Option'; import { Pointed1 } from 'fp-ts/Pointed'; import { ReadonlyRecord } from 'fp-ts/ReadonlyRecord'; import { Lens } from 'monocle-ts/Lens'; import { Observable } from 'rxjs'; import { a as ReadonlyAtom } from './ReadonlyAtom-7cbf97ea.js'; /** @since 1.0.0 */ /** * @since 1.0.0 * @category Model */ interface Atom extends Observable { eq: Eq; get: () => T; set: (next: T) => void; } /** * @since 1.0.0 * @category Refinements */ declare const isAtom: (fa: unknown) => fa is Atom; /** * @since 1.0.0 * @category Constructors */ declare const make: (evaluate: (prev: Option) => T, source: Observable, eq: Eq) => Atom; /** * @since 1.0.0 * @category Constructors */ declare const fromIO: FromIO1['fromIO']; /** * @since 3.0.0 * @category Constructors */ declare const getOf: (eq: Eq) => (a: A) => Atom; /** * @since 1.0.0 * @category Constructors */ declare const of: Pointed1['of']; /** * Convert an `Atom` to `ReadonlyAtom`. * * @since 1.0.0 * @category Converters */ declare const toReadonlyAtom: (a: Atom) => ReadonlyAtom; /** * Compose an `Atom` with a `Lens`. * * @since 1.0.0 * @category Compositions */ declare const lens: (ab: Lens, eq?: Eq) => (a: Atom) => Atom; /** * Return an `Atom` from an `Atom` and prop. * * @since 1.0.0 * @category Compositions */ declare const prop: (prop: P, eq?: Eq) => (sa: Atom) => Atom; /** * Return an `AtomOption` from an `Atom` focused on a key of a `ReadonlyRecord`. * If you set `None` it won't change the `ReadonlyRecord`. * * @since 1.0.0 * @category Compositions */ declare const key: (key: string, eq?: Eq) => (sa: Atom>) => Atom>; /** * Return an `AtomOption` from an `Atom` focused on an index of a * `ReadonlyArray`. If you set `None` it won't change the `ReadonlyArray`. If * the index is out of bound, it won't change the `ReadonlyArray` no matter what * you pass as `Option`. * * @since 1.0.0 * @category Compositions */ declare const index: (index: number, eq?: Eq) => (sa: Atom>) => Atom>; /** * Sequence of `Atom.get` and `Atom.set` using `Endomorphism` to modify the value. * * @since 1.1.0 * @category Utils */ declare const modify: (e: Endomorphism) => (a: Atom) => void; /** * Like `modify` but flipped, which the ā€œVā€ suffix denotes. * * @since 1.1.0 * @category Utils */ declare const modifyV: (a: Atom) => (e: Endomorphism) => void; /** * Return an `Atom` from an `Atom` with new Eq instance. * * @since 1.1.0 * @category Utils */ declare const distinct: (eq: Eq) => Endomorphism>; /** * Return an `Atom` from an `AtomOption` replacing `None` with the given value. * * @since 1.0.0 * @category Utils */ declare const withDefault: (d: Lazy, eq?: Eq) => (sa: Atom>) => Atom; /** * @since 1.0.0 * @category Instances */ declare const URI = "Atom"; /** * @since 1.0.0 * @category Instances */ type URI = typeof URI; declare module 'fp-ts/lib/HKT' { interface URItoKind { readonly [URI]: Atom; } } /** * @since 1.0.0 * @category Instances */ declare const Pointed: Pointed1; /** * @since 1.0.0 * @category Instances */ declare const FromIO: FromIO1; type Atom$1_Atom = Atom; declare const Atom$1_isAtom: typeof isAtom; declare const Atom$1_make: typeof make; declare const Atom$1_fromIO: typeof fromIO; declare const Atom$1_getOf: typeof getOf; declare const Atom$1_of: typeof of; declare const Atom$1_toReadonlyAtom: typeof toReadonlyAtom; declare const Atom$1_lens: typeof lens; declare const Atom$1_prop: typeof prop; declare const Atom$1_key: typeof key; declare const Atom$1_index: typeof index; declare const Atom$1_modify: typeof modify; declare const Atom$1_modifyV: typeof modifyV; declare const Atom$1_distinct: typeof distinct; declare const Atom$1_withDefault: typeof withDefault; type Atom$1_URI = URI; declare const Atom$1_Pointed: typeof Pointed; declare const Atom$1_FromIO: typeof FromIO; declare namespace Atom$1 { export { Atom$1_Atom as Atom, Atom$1_isAtom as isAtom, Atom$1_make as make, Atom$1_fromIO as fromIO, Atom$1_getOf as getOf, Atom$1_of as of, Atom$1_toReadonlyAtom as toReadonlyAtom, Atom$1_lens as lens, Atom$1_prop as prop, Atom$1_key as key, Atom$1_index as index, Atom$1_modify as modify, Atom$1_modifyV as modifyV, Atom$1_distinct as distinct, Atom$1_withDefault as withDefault, Atom$1_URI as URI, Atom$1_Pointed as Pointed, Atom$1_FromIO as FromIO, }; } export { Atom$1 as A, FromIO as F, Pointed as P, URI as U, Atom as a, index as b, modify as c, modifyV as d, distinct as e, fromIO as f, getOf as g, isAtom as i, key as k, lens as l, make as m, of as o, prop as p, toReadonlyAtom as t, withDefault as w };