Interface IdSet

Extended Set type that includes isNegative flag for the entire collection

interface IdSet {
    "[IS_NEGATIVE]": boolean;
    "[toStringTag]": string;
    size: number;
    "[iterator]"(): SetIterator<number>;
    add(value: number): this;
    clear(): void;
    delete(value: number): boolean;
    difference<U>(other: ReadonlySetLike<U>): Set<number>;
    entries(): SetIterator<[number, number]>;
    forEach(
        callbackfn: (value: number, value2: number, set: Set<number>) => void,
        thisArg?: any,
    ): void;
    has(value: number): boolean;
    intersection<U>(other: ReadonlySetLike<U>): Set<number & U>;
    isDisjointFrom(other: ReadonlySetLike<unknown>): boolean;
    isSubsetOf(other: ReadonlySetLike<unknown>): boolean;
    isSupersetOf(other: ReadonlySetLike<unknown>): boolean;
    keys(): SetIterator<number>;
    symmetricDifference<U>(other: ReadonlySetLike<U>): Set<number | U>;
    union<U>(other: ReadonlySetLike<U>): Set<number | U>;
    values(): SetIterator<number>;
}

Hierarchy

  • Set<number>
    • IdSet

Properties

"[IS_NEGATIVE]": boolean
"[toStringTag]": string
size: number

the number of (unique) elements in Set.

Methods

  • Iterates over values in the set.

    Returns SetIterator<number>

  • Appends a new element with a specified value to the end of the Set.

    Parameters

    • value: number

    Returns this

  • Returns void

  • Removes a specified value from the Set.

    Parameters

    • value: number

    Returns boolean

    Returns true if an element in the Set existed and has been removed, or false if the element does not exist.

  • Type Parameters

    • U

    Parameters

    • other: ReadonlySetLike<U>

    Returns Set<number>

    a new Set containing all the elements in this Set which are not also in the argument.

  • Returns an iterable of [v,v] pairs for every value v in the set.

    Returns SetIterator<[number, number]>

  • Executes a provided function once per each value in the Set object, in insertion order.

    Parameters

    • callbackfn: (value: number, value2: number, set: Set<number>) => void
    • OptionalthisArg: any

    Returns void

  • Parameters

    • value: number

    Returns boolean

    a boolean indicating whether an element with the specified value exists in the Set or not.

  • Type Parameters

    • U

    Parameters

    • other: ReadonlySetLike<U>

    Returns Set<number & U>

    a new Set containing all the elements which are both in this Set and in the argument.

  • Parameters

    • other: ReadonlySetLike<unknown>

    Returns boolean

    a boolean indicating whether this Set has no elements in common with the argument.

  • Parameters

    • other: ReadonlySetLike<unknown>

    Returns boolean

    a boolean indicating whether all the elements in this Set are also in the argument.

  • Parameters

    • other: ReadonlySetLike<unknown>

    Returns boolean

    a boolean indicating whether all the elements in the argument are also in this Set.

  • Despite its name, returns an iterable of the values in the set.

    Returns SetIterator<number>

  • Type Parameters

    • U

    Parameters

    • other: ReadonlySetLike<U>

    Returns Set<number | U>

    a new Set containing all the elements which are in either this Set or in the argument, but not in both.

  • Type Parameters

    • U

    Parameters

    • other: ReadonlySetLike<U>

    Returns Set<number | U>

    a new Set containing all the elements in this Set and also all the elements in the argument.

  • Returns an iterable of values in the set.

    Returns SetIterator<number>