Skip to content

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.

T

[iterator](): Iterator<T, any, any>

Defined in: node_modules/.store/typescript-npm-6.0.3-585eecd158/package/lib/lib.es2015.iterable.d.ts:47

Iterator<T, any, any>

ICollection.[iterator]


add(item): void

Defined in: packages/data/src/set/iset.ts:18

T

void


addAll(items): void

Defined in: packages/data/src/set/iset.ts:21

Takes an Iterable so another set can be added without materialising it.

Iterable<T>

void


clear(): void

Defined in: packages/data/src/collection/icollection.ts:23

Removes all elements from the collection.

void

ICollection.clear


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.

number

ICollection.count


delete(item): boolean

Defined in: packages/data/src/set/iset.ts:23

T

boolean


difference(other): ISet<T>

Defined in: packages/data/src/set/iset.ts:28

Iterable<T>

ISet<T>


has(item): boolean

Defined in: packages/data/src/set/iset.ts:24

T

boolean


intersection(other): ISet<T>

Defined in: packages/data/src/set/iset.ts:27

Iterable<T>

ISet<T>


isDisjointFrom(other): boolean

Defined in: packages/data/src/set/iset.ts:32

Iterable<T>

boolean


isSubsetOf(other): boolean

Defined in: packages/data/src/set/iset.ts:30

Iterable<T>

boolean


isSupersetOf(other): boolean

Defined in: packages/data/src/set/iset.ts:31

Iterable<T>

boolean


symmetricDifference(other): ISet<T>

Defined in: packages/data/src/set/iset.ts:29

Iterable<T>

ISet<T>


union(other): ISet<T>

Defined in: packages/data/src/set/iset.ts:26

Iterable<T>

ISet<T>