Class List<T>

Type Parameters

  • T

Hierarchy

  • EventEmitter<"update">
    • List

Implements

  • Set<T>
  • RelativeIndexable<T>

Constructors

  • Type Parameters

    • T

    Parameters

    • Optionalvalues: null | Iterable<T> | readonly T[]

    Returns List<T>

Properties

[toStringTag]: "List" = 'List'
data: Set<T> = ...
prefixed: string | boolean

Accessors

  • get size(): number
  • Returns number

    the number of (unique) elements in Set.

Methods

  • Returns IterableIterator<T>

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

    Parameters

    • value: T

    Returns this

  • Type Parameters

    • T extends "update"

    Parameters

    • event: T
    • fn: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    • Optionalcontext: any

    Returns this

  • Takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array.

    Parameters

    • index: number

    Returns T

  • Returns void

  • Removes a specified value from the Set.

    Parameters

    • value: T

    Returns boolean

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

  • Parameters

    • index: number

    Returns void

  • Type Parameters

    • U

    Parameters

    • other: ReadonlySetLike<U>

    Returns List<T>

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

  • Calls each of the listeners registered for a given event.

    Type Parameters

    • T extends "update"

    Parameters

    • event: T
    • Rest...args: any[]

    Returns boolean

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

    Returns IterableIterator<[T, T]>

  • Return an array listing the events for which the emitter has registered listeners.

    Returns "update"[]

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

    Parameters

    • callbackfn: ((value: T, value2: T, list: List<T>) => void)
        • (value, value2, list): void
        • Parameters

          Returns void

    • OptionalthisArg: any

    Returns void

  • Parameters

    • value: T

    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 List<T & 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.

  • Parameters

    • Optionalseparator: string

    Returns string

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

    Returns IterableIterator<T>

  • Return the number of listeners listening to a given event.

    Parameters

    • event: "update"

    Returns number

  • Return the listeners registered for a given event.

    Type Parameters

    • T extends "update"

    Parameters

    • event: T

    Returns ((...args: any[]) => void)[]

  • Type Parameters

    • T extends "update"

    Parameters

    • event: T
    • Optionalfn: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    • Optionalcontext: any
    • Optionalonce: boolean

    Returns this

  • Add a listener for a given event.

    Type Parameters

    • T extends "update"

    Parameters

    • event: T
    • fn: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    • Optionalcontext: any

    Returns this

  • Add a one-time listener for a given event.

    Type Parameters

    • T extends "update"

    Parameters

    • event: T
    • fn: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    • Optionalcontext: any

    Returns this

  • Parameters

    • Rest...items: T[]

    Returns number

  • Remove all listeners, or those of the specified event.

    Parameters

    • Optionalevent: "update"

    Returns this

  • Remove the listeners of a given event.

    Type Parameters

    • T extends "update"

    Parameters

    • event: T
    • Optionalfn: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    • Optionalcontext: any
    • Optionalonce: boolean

    Returns this

  • Parameters

    • index: number
    • value: T

    Returns void

  • Parameters

    • start: number
    • deleteCount: number
    • Rest...items: T[]

    Returns T[]

  • Type Parameters

    • U

    Parameters

    • other: ReadonlySetLike<U>

    Returns List<T | U>

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

  • Returns a string representation of an object.

    Returns string

  • Type Parameters

    • U

    Parameters

    • other: ReadonlySetLike<U>

    Returns List<T | 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 IterableIterator<T>