/** * @since 1.0.0 */ import type * as HashSet from "@effect/data/HashSet"; import type * as Option from "@effect/data/Option"; import type { Predicate } from "@effect/data/Predicate"; import type * as STM from "@effect/stm/STM"; /** * @since 1.0.0 * @category symbols */ export declare const TSetTypeId: unique symbol; /** * @since 1.0.0 * @category symbols */ export type TSetTypeId = typeof TSetTypeId; /** * Transactional set implemented on top of `TMap`. * * @since 1.0.0 * @category models */ export interface TSet extends TSet.Variance { } /** * @since 1.0.0 */ export declare namespace TSet { /** * @since 1.0.0 * @category models */ interface Variance { readonly [TSetTypeId]: { readonly _A: (_: never) => A; }; } } /** * Stores new element in the set. * * @since 1.0.0 * @category mutations */ export declare const add: { (value: A): (self: TSet) => STM.STM; (self: TSet, value: A): STM.STM; }; /** * Atomically transforms the set into the difference of itself and the * provided set. * * @since 1.0.0 * @category mutations */ export declare const difference: { (other: TSet): (self: TSet) => STM.STM; (self: TSet, other: TSet): STM.STM; }; /** * Makes an empty `TSet`. * * @since 1.0.0 * @category constructors */ export declare const empty: () => STM.STM>; /** * Atomically performs transactional-effect for each element in set. * * @since 1.0.0 * @category elements */ export declare const forEach: { (f: (value: A) => STM.STM): (self: TSet) => STM.STM; (self: TSet, f: (value: A) => STM.STM): STM.STM; }; /** * Makes a new `TSet` initialized with provided iterable. * * @since 1.0.0 * @category constructors */ export declare const fromIterable: (iterable: Iterable) => STM.STM>; /** * Tests whether or not set contains an element. * * @since 1.0.0 * @category elements */ export declare const has: { (value: A): (self: TSet) => STM.STM; (self: TSet, value: A): STM.STM; }; /** * Atomically transforms the set into the intersection of itself and the * provided set. * * @since 1.0.0 * @category mutations */ export declare const intersection: { (other: TSet): (self: TSet) => STM.STM; (self: TSet, other: TSet): STM.STM; }; /** * Tests if the set is empty or not * * @since 1.0.0 * @category getters */ export declare const isEmpty: (self: TSet) => STM.STM; /** * Makes a new `TSet` that is initialized with specified values. * * @since 1.0.0 * @category constructors */ export declare const make: >(...elements: Elements) => STM.STM>; /** * Atomically folds using a pure function. * * @since 1.0.0 * @category folding */ export declare const reduce: { (zero: Z, f: (accumulator: Z, value: A) => Z): (self: TSet) => STM.STM; (self: TSet, zero: Z, f: (accumulator: Z, value: A) => Z): STM.STM; }; /** * Atomically folds using a transactional function. * * @since 1.0.0 * @category folding */ export declare const reduceSTM: { (zero: Z, f: (accumulator: Z, value: A) => STM.STM): (self: TSet) => STM.STM; (self: TSet, zero: Z, f: (accumulator: Z, value: A) => STM.STM): STM.STM; }; /** * Removes a single element from the set. * * @since 1.0.0 * @category mutations */ export declare const remove: { (value: A): (self: TSet) => STM.STM; (self: TSet, value: A): STM.STM; }; /** * Removes elements from the set. * * @since 1.0.0 * @category mutations */ export declare const removeAll: { (iterable: Iterable): (self: TSet) => STM.STM; (self: TSet, iterable: Iterable): STM.STM; }; /** * Removes bindings matching predicate and returns the removed entries. * * @since 1.0.0 * @category mutations */ export declare const removeIf: { (predicate: Predicate): (self: TSet) => STM.STM>; (self: TSet, predicate: Predicate): STM.STM>; }; /** * Removes elements matching predicate. * * @since 1.0.0 * @category mutations */ export declare const removeIfDiscard: { (predicate: Predicate): (self: TSet) => STM.STM; (self: TSet, predicate: Predicate): STM.STM; }; /** * Retains bindings matching predicate and returns removed bindings. * * @since 1.0.0 * @category mutations */ export declare const retainIf: { (predicate: Predicate): (self: TSet) => STM.STM>; (self: TSet, predicate: Predicate): STM.STM>; }; /** * Retains elements matching predicate. * * @since 1.0.0 * @category mutations */ export declare const retainIfDiscard: { (predicate: Predicate): (self: TSet) => STM.STM; (self: TSet, predicate: Predicate): STM.STM; }; /** * Returns the set's cardinality. * * @since 1.0.0 * @category getters */ export declare const size: (self: TSet) => STM.STM; /** * Takes the first matching value, or retries until there is one. * * @since 1.0.0 * @category mutations */ export declare const takeFirst: { (pf: (a: A) => Option.Option): (self: TSet) => STM.STM; (self: TSet, pf: (a: A) => Option.Option): STM.STM; }; /** * Takes the first matching value, or retries until there is one. * * @since 1.0.0 * @category mutations */ export declare const takeFirstSTM: { (pf: (a: A) => STM.STM, B>): (self: TSet) => STM.STM; (self: TSet, pf: (a: A) => STM.STM, B>): STM.STM; }; /** * Takes all matching values, or retries until there is at least one. * * @since 1.0.0 * @category mutations */ export declare const takeSome: { (pf: (a: A) => Option.Option): (self: TSet) => STM.STM]>; (self: TSet, pf: (a: A) => Option.Option): STM.STM]>; }; /** * Takes all matching values, or retries until there is at least one. * * @since 1.0.0 * @category mutations */ export declare const takeSomeSTM: { (pf: (a: A) => STM.STM, B>): (self: TSet) => STM.STM]>; (self: TSet, pf: (a: A) => STM.STM, B>): STM.STM]>; }; /** * Collects all elements into a `Chunk`. * * @since 1.0.0 * @category destructors */ export declare const toChunk: (self: TSet) => STM.STM>; /** * Collects all elements into a `HashSet`. * * @since 1.0.0 * @category destructors */ export declare const toHashSet: (self: TSet) => STM.STM>; /** * Collects all elements into a `ReadonlyArray`. * * @since 1.0.0 * @category destructors */ export declare const toReadonlyArray: (self: TSet) => STM.STM>; /** * Collects all elements into a `ReadonlySet`. * * @since 1.0.0 * @category destructors */ export declare const toReadonlySet: (self: TSet) => STM.STM>; /** * Atomically updates all elements using a pure function. * * @since 1.0.0 * @category mutations */ export declare const transform: { (f: (a: A) => A): (self: TSet) => STM.STM; (self: TSet, f: (a: A) => A): STM.STM; }; /** * Atomically updates all elements using a transactional function. * * @since 1.0.0 * @category mutations */ export declare const transformSTM: { (f: (a: A) => STM.STM): (self: TSet) => STM.STM; (self: TSet, f: (a: A) => STM.STM): STM.STM; }; /** * Atomically transforms the set into the union of itself and the provided * set. * * @since 1.0.0 * @category mutations */ export declare const union: { (other: TSet): (self: TSet) => STM.STM; (self: TSet, other: TSet): STM.STM; }; //# sourceMappingURL=TSet.d.ts.map