UNPKG

@cute-dw/core

Version:

This TypeScript library is the main part of a more powerfull package designed for the fast WEB software development. The cornerstone of the library is the **DataStore** class, which might be useful when you need a full control of the data, but do not need

39 lines (38 loc) 2.67 kB
import { AbstractCollection } from "./AbstractCollection"; import { ImmutableCollection } from "./Collection"; /** * This immutable interface places additional stipulations, beyond those inherited from the `ImmutableCollection` interface */ export interface ImmutableSet<E> extends ImmutableCollection<E>, ReadonlySet<E> { /** Returns a boolean asserting whether an element is present with the given value in the `Set` object or not */ has(value: E): boolean; /** Returns a new iterator object that contains an array of `[value, value]` for each element in the `Set` object, in insertion order */ entries(): IterableIterator<[E, E]>; /** An alias for `values` */ keys(): IterableIterator<E>; /** Returns a new iterator object that yields the values for each element in the `Set` object in insertion order */ values(): IterableIterator<E>; /** Calls `callbackFn` once for each value present in the `Set` object, in insertion orders */ forEach(callbackfn: (value: E, value2: E, set: Set<E>) => void, thisArg?: any): void; /** Returns a new iterator object that yields the values for each element in the `Set` object in insertion order */ [Symbol.iterator](): IterableIterator<E>; } /** * This class provides a skeletal implementation of the mutable `Set` interface to minimize the effort required to implement this interface */ export declare abstract class AbstractSet<E> extends AbstractCollection<E> implements ImmutableSet<E>, Set<E> { /** Removes the element associated to the value and returns a boolean asserting whether an element was successfully removed or not */ abstract delete(value: E): boolean; /** Returns a boolean asserting whether an element is present with the given value in the `Set` object or not */ abstract has(value: E): boolean; /** Returns a new iterator object that contains an array of `[value, value]` for each element in the `Set` object, in insertion order */ abstract entries(): IterableIterator<[E, E]>; /** An alias for `values` */ abstract keys(): IterableIterator<E>; /** Returns a new iterator object that yields the values for each element in the `Set` object in insertion order */ abstract values(): IterableIterator<E>; /** Calls `callbackFn` once for each value present in the `Set` object, in insertion orders */ abstract forEach(callbackfn: (value: E, value2: E, set: Set<E>) => void, thisArg?: any): void; /** Returns a new iterator object that yields the values for each element in the `Set` object in insertion order */ abstract [Symbol.iterator](): IterableIterator<E>; }