ISet
Defined in: packages/data/src/set/iset.ts:17
A collection with caller-supplied equality and set algebra.
Method names deliberately mirror the native Set (union, intersection,
difference, symmetricDifference, isSubsetOf, isSupersetOf,
isDisjointFrom), so the only thing a caller has to learn is what this adds:
caller-supplied equality. Native Set is locked to SameValueZero, which is
the actual reason this type is wanted.
The set-algebra members are implemented here, not delegated to
@ac-kit/algo’s free functions of the same names: those are built on native
Set and so are locked to SameValueZero themselves, which is precisely
what an implementation of this interface has to escape.
Extends
Section titled “Extends”ICollection<T>
Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”T
Methods
Section titled “Methods”[iterator]()
Section titled “[iterator]()”[iterator]():
Iterator<T,any,any>
Defined in: node_modules/.store/typescript-npm-6.0.3-585eecd158/package/lib/lib.es2015.iterable.d.ts:47
Returns
Section titled “Returns”Iterator<T, any, any>
Inherited from
Section titled “Inherited from”add(
item):void
Defined in: packages/data/src/set/iset.ts:18
Parameters
Section titled “Parameters”T
Returns
Section titled “Returns”void
addAll()
Section titled “addAll()”addAll(
items):void
Defined in: packages/data/src/set/iset.ts:21
Takes an Iterable so another set can be added without materialising it.
Parameters
Section titled “Parameters”Iterable<T>
Returns
Section titled “Returns”void
clear()
Section titled “clear()”clear():
void
Defined in: packages/data/src/collection/icollection.ts:23
Removes all elements from the collection.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”count()
Section titled “count()”count():
number
Defined in: packages/data/src/collection/icollection.ts:20
The number of elements in the collection.
A method, not a getter: its async counterpart needs a round trip to the backing store, and a member must have the same shape in both.
Returns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”delete()
Section titled “delete()”delete(
item):boolean
Defined in: packages/data/src/set/iset.ts:23
Parameters
Section titled “Parameters”T
Returns
Section titled “Returns”boolean
difference()
Section titled “difference()”difference(
other):ISet<T>
Defined in: packages/data/src/set/iset.ts:28
Parameters
Section titled “Parameters”Iterable<T>
Returns
Section titled “Returns”ISet<T>
has(
item):boolean
Defined in: packages/data/src/set/iset.ts:24
Parameters
Section titled “Parameters”T
Returns
Section titled “Returns”boolean
intersection()
Section titled “intersection()”intersection(
other):ISet<T>
Defined in: packages/data/src/set/iset.ts:27
Parameters
Section titled “Parameters”Iterable<T>
Returns
Section titled “Returns”ISet<T>
isDisjointFrom()
Section titled “isDisjointFrom()”isDisjointFrom(
other):boolean
Defined in: packages/data/src/set/iset.ts:32
Parameters
Section titled “Parameters”Iterable<T>
Returns
Section titled “Returns”boolean
isSubsetOf()
Section titled “isSubsetOf()”isSubsetOf(
other):boolean
Defined in: packages/data/src/set/iset.ts:30
Parameters
Section titled “Parameters”Iterable<T>
Returns
Section titled “Returns”boolean
isSupersetOf()
Section titled “isSupersetOf()”isSupersetOf(
other):boolean
Defined in: packages/data/src/set/iset.ts:31
Parameters
Section titled “Parameters”Iterable<T>
Returns
Section titled “Returns”boolean
symmetricDifference()
Section titled “symmetricDifference()”symmetricDifference(
other):ISet<T>
Defined in: packages/data/src/set/iset.ts:29
Parameters
Section titled “Parameters”Iterable<T>
Returns
Section titled “Returns”ISet<T>
union()
Section titled “union()”union(
other):ISet<T>
Defined in: packages/data/src/set/iset.ts:26
Parameters
Section titled “Parameters”Iterable<T>
Returns
Section titled “Returns”ISet<T>