Class List<T>

Type Parameters

  • T

Hierarchy

  • EventEmitter<{
        add: [T];
        update: [];
    }>
    • List

Implements

  • 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

Methods

  • Returns IterableIterator<T>

  • Parameters

    • index: number
    • value: T
    • _delete: boolean = false

    Returns void

  • Type Parameters

    • T extends "add" | "update"

    Parameters

    • event: T
    • fn: ((...args: ArgumentMap<{
          add: [T];
          update: [];
      }>[Extract<T, "add" | "update">]) => void)
        • (...args): void
        • Parameters

          • Rest...args: ArgumentMap<{
                add: [T];
                update: [];
            }>[Extract<T, "add" | "update">]

          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

  • Parameters

    • value: T

    Returns boolean

  • Parameters

    • index: number

    Returns void

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

    Type Parameters

    • T extends "add" | "update"

    Parameters

    • event: T
    • Rest...args: ArgumentMap<{
          add: [T];
          update: [];
      }>[Extract<T, "add" | "update">]

    Returns boolean

  • Returns IterableIterator<[number, T]>

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

    Returns ("add" | "update")[]

  • Parameters

    • value: T
    • index: number = ...

    Returns void

  • Parameters

    • Optionalseparator: string

    Returns string

  • Returns IterableIterator<number>

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

    Parameters

    • event: "add" | "update"

    Returns number

  • Return the listeners registered for a given event.

    Type Parameters

    • T extends "add" | "update"

    Parameters

    • event: T

    Returns ((...args: ArgumentMap<{
        add: [T];
        update: [];
    }>[Extract<T, "add" | "update">]) => void)[]

  • Type Parameters

    • T extends "add" | "update"

    Parameters

    • event: T
    • Optionalfn: ((...args: ArgumentMap<{
          add: [T];
          update: [];
      }>[Extract<T, "add" | "update">]) => void)
        • (...args): void
        • Parameters

          • Rest...args: ArgumentMap<{
                add: [T];
                update: [];
            }>[Extract<T, "add" | "update">]

          Returns void

    • Optionalcontext: any
    • Optionalonce: boolean

    Returns this

  • Add a listener for a given event.

    Type Parameters

    • T extends "add" | "update"

    Parameters

    • event: T
    • fn: ((...args: ArgumentMap<{
          add: [T];
          update: [];
      }>[Extract<T, "add" | "update">]) => void)
        • (...args): void
        • Parameters

          • Rest...args: ArgumentMap<{
                add: [T];
                update: [];
            }>[Extract<T, "add" | "update">]

          Returns void

    • Optionalcontext: any

    Returns this

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

    Type Parameters

    • T extends "add" | "update"

    Parameters

    • event: T
    • fn: ((...args: ArgumentMap<{
          add: [T];
          update: [];
      }>[Extract<T, "add" | "update">]) => void)
        • (...args): void
        • Parameters

          • Rest...args: ArgumentMap<{
                add: [T];
                update: [];
            }>[Extract<T, "add" | "update">]

          Returns void

    • Optionalcontext: any

    Returns this

  • Parameters

    • Rest...items: T[]

    Returns number

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

    Parameters

    • Optionalevent: "add" | "update"

    Returns this

  • Remove the listeners of a given event.

    Type Parameters

    • T extends "add" | "update"

    Parameters

    • event: T
    • Optionalfn: ((...args: ArgumentMap<{
          add: [T];
          update: [];
      }>[Extract<T, "add" | "update">]) => void)
        • (...args): void
        • Parameters

          • Rest...args: ArgumentMap<{
                add: [T];
                update: [];
            }>[Extract<T, "add" | "update">]

          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[]

  • Returns a string representation of an object.

    Returns string