import { Immutable } from './immutable'; /** * Immutable Set cannot be changed once created */ export declare class ImmutableSet implements Immutable> { size: number; private readonly set; /** * The constructor of ImmutableSet * * @typedef T generic type parameter * @param {Set} initialSet - The initial set to use. If not provided, the set will be empty. * @param {() => void} onMutate - A callback function that will be called whenever the set is mutated. */ constructor(initialSet?: Set, onMutate?: (newSet: ImmutableSet) => void); /** * The function is called when the set is mutated * * @param {Immutable>} _newSet - The new set that was created. */ onMutate(_newSet: Immutable>): void; /** * Add new items to the set, and then call the onMutate with the new ImmutableSet * * @typedef T generic type parameter * @param {T[]} value - The items to add to the set. * @returns {ImmutableSet} A new ImmutableSet with the new items added. */ add(...value: T[]): ImmutableSet; /** * clear the set values * * @typedef T generic type parameter */ clear(): void; /** * delete item from set * * @typedef T generic type parameter * @param {T} value - The key to delete from the set. * @returns {ImmutableSet} A new ImmutableSet */ delete(value: T): ImmutableSet; /** * It takes a function that mutates a set, and returns a new immutable set that is the result of that mutation * * @param {(set: Set) => void} fn - (set: Set) => void * @returns {ImmutableSet} A new ImmutableSet */ withMutation(fn: (set: Set) => void): ImmutableSet; /** * It returns true if the value is in the set, and false otherwise * * @typedef T generic type parameter * @param {T} value - The value to check for. * @returns {boolean} A boolean value. */ has(value: T): boolean; /** * It returns an array of the values in the set * * @returns {T[]} An array of the values in the set. */ toArray(): T[]; }