UNPKG

@typed/fp

Version:

Data Structures and Resources for fp-ts

57 lines 1.85 kB
/** * RefMapM is a collection of helpers for working with Refs that manage a mutable Map. * It utilizes standard JS reference-based keys. * @since 0.13.4 */ import { Endomorphism } from 'fp-ts/Endomorphism'; import { Predicate } from 'fp-ts/Predicate'; import * as E from './Env'; import * as EO from './EnvOption'; import * as Ref from './Ref'; /** * @since 0.13.4 * @category Model */ export interface RefMapM<E, K, V> extends Ref.Ref<E, Map<K, V>> { } /** * @since 0.13.4 * @category Combinator */ export declare const deleteAt: <K>(key: K) => <E, V>(rm: RefMapM<E, K, V>) => E.Env<E, Map<K, V>>; /** * @since 0.13.4 * @category Combinator */ export declare function filter<A>(predicate: Predicate<A>): <E, K>(rm: RefMapM<E, K, A>) => E.Env<E, Map<K, A>>; /** * @since 0.13.4 * @category Combinator */ export declare function filterWithIndex<K, V>(predicate: (k: K, v: V) => boolean): <E>(rm: RefMapM<E, K, V>) => E.Env<E, Map<K, V>>; /** * @since 0.13.4 * @category Combinator */ export declare const insertAt: <K, V>(key: K, value: V) => <E>(rm: RefMapM<E, K, V>) => EO.EnvOption<E, Map<K, V>>; /** * @since 0.13.4 * @category Combinator */ export declare const modifyAt: <K, V>(key: K, f: Endomorphism<V>) => <E>(rm: RefMapM<E, K, V>) => EO.EnvOption<E, Map<K, V>>; /** * @since 0.13.4 * @category Combinator */ export declare const updateAt: <K, V>(key: K, value: V) => <E>(rm: RefMapM<E, K, V>) => EO.EnvOption<E, Map<K, V>>; /** * @since 0.13.4 * @category Combinator */ export declare const upsertAt: <K, V>(key: K, value: V) => <E>(rm: RefMapM<E, K, V>) => E.Env<E, Map<K, V>>; /** * @since 0.13.4 * @category Combinator */ export declare const getOrCreate: <K, E1, V>(key: K, create: E.Env<E1, V>) => <E2>(rm: RefMapM<E2, K, V>) => E.Env<E2 & E1, V | NonNullable<V>>; //# sourceMappingURL=RefMapM.d.ts.map