Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Collection<KeyType, ValueType>

Collection-ish

Type parameters

  • KeyType

  • ValueType

Hierarchy

  • Map<KeyType, ValueType>
    • Collection

Index

Constructors

  • new Collection<KeyType, ValueType>(iterable?: undefined): Collection<KeyType, ValueType>
  • Type parameters

    • KeyType

    • ValueType

    Parameters

    • Optional iterable: undefined

    Returns Collection<KeyType, ValueType>

Properties

[toStringTag]: string
size: number
[species]: MapConstructor

Methods

  • [iterator](): IterableIterator<[KeyType, ValueType]>
  • Returns an iterable of entries in the map.

    Returns IterableIterator<[KeyType, ValueType]>

  • clear(): void
  • Returns void

  • delete(key: KeyType): boolean
  • Parameters

    • key: KeyType

    Returns boolean

  • entries(): IterableIterator<[KeyType, ValueType]>
  • Returns an iterable of key, value pairs for every entry in the map.

    Returns IterableIterator<[KeyType, ValueType]>

  • find(func: (item: ValueType) => boolean): undefined | ValueType
  • Parameters

    • func: (item: ValueType) => boolean
        • (item: ValueType): boolean
        • Parameters

          • item: ValueType

          Returns boolean

    Returns undefined | ValueType

  • forEach(callbackfn: (value: ValueType, key: KeyType, map: Map<KeyType, ValueType>) => void, thisArg?: any): void
  • Parameters

    • callbackfn: (value: ValueType, key: KeyType, map: Map<KeyType, ValueType>) => void
        • (value: ValueType, key: KeyType, map: Map<KeyType, ValueType>): void
        • Parameters

          • value: ValueType
          • key: KeyType
          • map: Map<KeyType, ValueType>

          Returns void

    • Optional thisArg: any

    Returns void

  • get(key: KeyType): undefined | ValueType
  • Parameters

    • key: KeyType

    Returns undefined | ValueType

  • has(key: KeyType): boolean
  • Parameters

    • key: KeyType

    Returns boolean

  • keys(): IterableIterator<KeyType>
  • Returns an iterable of keys in the map

    Returns IterableIterator<KeyType>

  • set(key: KeyType, value: ValueType): Collection<KeyType, ValueType>
  • Parameters

    • key: KeyType
    • value: ValueType

    Returns Collection<KeyType, ValueType>

  • values(): IterableIterator<ValueType>
  • Returns an iterable of values in the map

    Returns IterableIterator<ValueType>

Generated using TypeDoc