Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Transformable
    • Ladder

Index

Constructors

constructor

  • Returns Ladder

Properties

cachedSince

cachedSince: Date
overrides

cached_since

entries

entries: Entry[]

total

total: number

Accessors

leagueId

  • set leagueId(id: string): void
  • Parameters

    • id: string

    Returns void

options

  • set options(options: Options): void
  • Parameters

    Returns void

Methods

filterBy

  • filterBy<K>(property: K, value: Entry[K]): Entry[]
  • example

    Display online characters from the ladder.

    const online = ladder.filterBy("online", true);
    console.log(`${online.length} of the first 200 characters are currently online.`);
    

    Type parameters

    Parameters

    • property: K

      Name of a ladder entry property

    • value: Entry[K]

      Value of the property that should be filtered

    Returns Entry[]

    A new list of characters matching the filter

filterByCharacter

  • example

    Get all characters which have the Assassin ascendancy.

    const assassins = ladder.filterByCharacter("class", "Assassin");
    console.log(`${assassins.length} of the first 200 characters are Assassins.`);
    

    Type parameters

    Parameters

    • property: K

      Name of a character property

    • value: Character[K]

      Value of the property that should be filtered

    Returns Entry[]

    A new list of characters matching the filter

getNextEntries

  • getNextEntries(append?: boolean): Promise<null | Entry[]>
  • remarks

    Uses the same [[LadderOptions]] that have been used getting this ladder. If you want to fetch an entire ladder, it is highly recommended to set the limit option to 200.

    Parameters

    • append: boolean = true

      Set to true if the next entries should be appended to this ladders entries

    Returns Promise<null | Entry[]>

    The next set of ladder entries, null when there are no more entries

toPlain

  • toPlain(): unknown
  • Converts this class back into a plain javascript object.

    remarks

    Property keys which have been renamed during the initial transformation to a class object will be reverted to the original keys. For example, the cachedSince property in the Ladder class will be reverted to the original API property, cached_since.

    Returns unknown

Generated using TypeDoc