Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BaseClientCollection<K, V>

Basic Client Collection, the ShardClient instance is attached to this

Type parameters

  • K

  • V

Hierarchy

Index

Constructors

constructor

Properties

[Symbol.toStringTag]

[Symbol.toStringTag]: string

Optional _lastUsed

_lastUsed: Map<K, number>

cache

cache: Map<K, V>

client

client: ShardClient

enabled

enabled: boolean

Optional expire

expire: undefined | number

Optional interval

interval: Timers.Interval

intervalTime

intervalTime: number

lastUsed

lastUsed: Map<K, number>

length

length: number

limit

limit: number

shouldStartInterval

shouldStartInterval: boolean

size

size: number

Methods

[Symbol.iterator]

  • [Symbol.iterator](): IterableIterator<[K, V]>
  • Returns IterableIterator<[K, V]>

clear

  • clear(): void
  • Returns void

clone

  • clone(): BaseCollection<K, V>
  • Returns BaseCollection<K, V>

delete

  • delete(key: K): boolean
  • Parameters

    • key: K

    Returns boolean

entries

  • entries(): IterableIterator<[K, V]>
  • Returns IterableIterator<[K, V]>

every

  • every(func: function): boolean
  • Parameters

    • func: function
        • (v: V, k: K): boolean
        • Parameters

          • v: V
          • k: K

          Returns boolean

    Returns boolean

filter

  • filter(func: function): Array<V>
  • Parameters

    • func: function
        • (v: V, k: K): boolean
        • Parameters

          • v: V
          • k: K

          Returns boolean

    Returns Array<V>

find

  • find(func: function): V | undefined
  • Parameters

    • func: function
        • (v: V, k: K): boolean
        • Parameters

          • v: V
          • k: K

          Returns boolean

    Returns V | undefined

first

  • first(): V | undefined
  • Returns V | undefined

forEach

  • forEach(func: function, thisArg?: any): void
  • Parameters

    • func: function
        • (v: V, k: K, map: Map<K, V>): void
        • Parameters

          • v: V
          • k: K
          • map: Map<K, V>

          Returns void

    • Optional thisArg: any

    Returns void

get

  • get(key: K): V | undefined
  • Parameters

    • key: K

    Returns V | undefined

has

  • has(key: K): boolean
  • Parameters

    • key: K

    Returns boolean

join

  • join(separator?: undefined | string): string
  • Parameters

    • Optional separator: undefined | string

    Returns string

keys

  • keys(): IterableIterator<K>
  • Returns IterableIterator<K>

map

  • map(func: function): Array<any>
  • Parameters

    • func: function
        • (v: V, k: K): any
        • Parameters

          • v: V
          • k: K

          Returns any

    Returns Array<any>

reduce

  • reduce(func: function, initialValue?: any): any
  • Parameters

    • func: function
        • (intial: any, v: V): any
        • Parameters

          • intial: any
          • v: V

          Returns any

    • Optional initialValue: any

    Returns any

set

  • set(key: K, value: V): this
  • Parameters

    • key: K
    • value: V

    Returns this

setEnabled

  • setEnabled(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

setExpire

  • setExpire(value: number): this
  • Parameters

    • value: number

    Returns this

setIntervalTimeout

  • setIntervalTimeout(value: number): this
  • Parameters

    • value: number

    Returns this

some

  • some(func: function): boolean
  • Parameters

    • func: function
        • (v: V, k: K): boolean
        • Parameters

          • v: V
          • k: K

          Returns boolean

    Returns boolean

sort

  • sort(func?: undefined | function): Array<V>
  • Parameters

    • Optional func: undefined | function

    Returns Array<V>

startInterval

  • startInterval(): void
  • Returns void

stopInterval

  • stopInterval(): void
  • Returns void

toArray

  • toArray(): Array<V>
  • Returns Array<V>

toJSON

  • toJSON(): Array<V>
  • Returns Array<V>

toString

  • toString(): string
  • Returns string

values

  • values(): IterableIterator<V>
  • Returns IterableIterator<V>

Generated using TypeDoc