/** * @since 1.0.0 */ import type { Equal } from "@effect/data/Equal"; import type { Inspectable } from "@effect/data/Inspectable"; import type { Pipeable } from "@effect/data/Pipeable"; import type { Predicate, Refinement } from "@effect/data/Predicate"; declare const TypeId: unique symbol; /** * @since 1.0.0 * @category symbol */ export type TypeId = typeof TypeId; /** * @since 1.0.0 * @category models */ export interface HashSet extends Iterable, Equal, Pipeable, Inspectable { readonly [TypeId]: TypeId; } /** * @since 1.0.0 * @category refinements */ export declare const isHashSet: { (u: Iterable): u is HashSet; (u: unknown): u is HashSet; }; /** * Creates an empty `HashSet`. * * @since 1.0.0 * @category constructors */ export declare const empty: () => HashSet; /** * Construct a new `HashSet` from a `Collection` of values * * @since 1.0.0 * @category constructors */ export declare const fromIterable: (elements: Iterable) => HashSet; /** * Construct a new `HashSet` from a variable number of values. * * @since 1.0.0 * @category constructors */ export declare const make: >(...elements: As) => HashSet; /** * Checks if the specified value exists in the `HashSet`. * * @since 1.0.0 * @category elements */ export declare const has: { (value: A): (self: HashSet) => boolean; (self: HashSet, value: A): boolean; }; /** * Check if a predicate holds true for some `HashSet` element. * * @since 1.0.0 * @category elements */ export declare const some: { (f: Predicate): (self: HashSet) => boolean; (self: HashSet, f: Predicate): boolean; }; /** * Check if a predicate holds true for every `HashSet` element. * * @since 1.0.0 * @category elements */ export declare const every: { (refinement: Refinement): (self: HashSet) => self is HashSet; (predicate: Predicate): (self: HashSet) => boolean; (self: HashSet, refinement: Refinement): self is HashSet; (self: HashSet, predicate: Predicate): boolean; }; /** * Returns `true` if and only if every element in the this `HashSet` is an * element of the second set, * * **NOTE**: the hash and equal of both sets must be the same. * * @since 1.0.0 * @category elements */ export declare const isSubset: { (that: HashSet): (self: HashSet) => boolean; (self: HashSet, that: HashSet): boolean; }; /** * Returns an `IterableIterator` of the values in the `HashSet`. * * @since 1.0.0 * @category getters */ export declare const values: (self: HashSet) => IterableIterator; /** * Calculates the number of values in the `HashSet`. * * @since 1.0.0 * @category getters */ export declare const size: (self: HashSet) => number; /** * Marks the `HashSet` as mutable. * * @since 1.0.0 */ export declare const beginMutation: (self: HashSet) => HashSet; /** * Marks the `HashSet` as immutable. * * @since 1.0.0 */ export declare const endMutation: (self: HashSet) => HashSet; /** * Mutates the `HashSet` within the context of the provided function. * * @since 1.0.0 */ export declare const mutate: { (f: (set: HashSet) => void): (self: HashSet) => HashSet; (self: HashSet, f: (set: HashSet) => void): HashSet; }; /** * Adds a value to the `HashSet`. * * @since 1.0.0 */ export declare const add: { (value: A): (self: HashSet) => HashSet; (self: HashSet, value: A): HashSet; }; /** * Removes a value from the `HashSet`. * * @since 1.0.0 */ export declare const remove: { (value: A): (self: HashSet) => HashSet; (self: HashSet, value: A): HashSet; }; /** * Computes the set difference between this `HashSet` and the specified * `Iterable`. * * **NOTE**: the hash and equal of the values in both the set and the iterable * must be the same. * * @since 1.0.0 */ export declare const difference: { (that: Iterable): (self: HashSet) => HashSet; (self: HashSet, that: Iterable): HashSet; }; /** * Returns a `HashSet` of values which are present in both this set and that * `Iterable`. * * **NOTE**: the hash and equal of the values in both the set and the iterable * must be the same. * * @since 1.0.0 */ export declare const intersection: { (that: Iterable): (self: HashSet) => HashSet; (self: HashSet, that: Iterable): HashSet; }; /** * Computes the set union `(`self` + `that`)` between this `HashSet` and the * specified `Iterable`. * * **NOTE**: the hash and equal of the values in both the set and the iterable * must be the same. * * @since 1.0.0 */ export declare const union: { (that: Iterable): (self: HashSet) => HashSet; (self: HashSet, that: Iterable): HashSet; }; /** * Checks if a value is present in the `HashSet`. If it is present, the value * will be removed from the `HashSet`, otherwise the value will be added to the * `HashSet`. * * @since 1.0.0 */ export declare const toggle: { (value: A): (self: HashSet) => HashSet; (self: HashSet, value: A): HashSet; }; /** * Maps over the values of the `HashSet` using the specified function. * * @since 1.0.0 * @category mapping */ export declare const map: { (f: (a: A) => B): (self: HashSet) => HashSet; (self: HashSet, f: (a: A) => B): HashSet; }; /** * Chains over the values of the `HashSet` using the specified function. * * @since 1.0.0 * @category sequencing */ export declare const flatMap: { (f: (a: A) => Iterable): (self: HashSet) => HashSet; (self: HashSet, f: (a: A) => Iterable): HashSet; }; /** * Applies the specified function to the values of the `HashSet`. * * @since 1.0.0 * @category traversing */ export declare const forEach: { (f: (value: A) => void): (self: HashSet) => void; (self: HashSet, f: (value: A) => void): void; }; /** * Reduces the specified state over the values of the `HashSet`. * * @since 1.0.0 * @category folding */ export declare const reduce: { (zero: Z, f: (accumulator: Z, value: A) => Z): (self: HashSet) => Z; (self: HashSet, zero: Z, f: (accumulator: Z, value: A) => Z): Z; }; /** * Filters values out of a `HashSet` using the specified predicate. * * @since 1.0.0 * @category filtering */ export declare const filter: { (f: Refinement): (self: HashSet) => HashSet; (f: Predicate): (self: HashSet) => HashSet; (self: HashSet, f: Refinement): HashSet; (self: HashSet, f: Predicate): HashSet; }; /** * Partition the values of a `HashSet` using the specified predicate. * * If a value matches the predicate, it will be placed into the `HashSet` on the * right side of the resulting `Tuple`, otherwise the value will be placed into * the left side. * * @since 1.0.0 * @category partitioning */ export declare const partition: { (refinement: Refinement): (self: HashSet) => [HashSet>, HashSet]; (predicate: (a: A) => boolean): (self: HashSet) => [HashSet, HashSet]; (self: HashSet, refinement: Refinement): [HashSet>, HashSet]; (self: HashSet, predicate: (a: A) => boolean): [HashSet, HashSet]; }; export {}; //# sourceMappingURL=HashSet.d.ts.map