Skip to main content

ShardsUtil

shardsUtil

@classdesc

A class to handle shards and realms indexing.

Index

Constructors

constructor

Methods

staticgetDate

  • getDate(date?: null | string): string | DateTime<boolean>
  • @method

    getDate - get provided date in luxon


    Parameters

    NameTypeDefaultDescription
    optionaldatenull | string

    date to get in moment

    Returns string | DateTime<boolean>

staticgetNextShard

  • getNextShard(date: DateTime<boolean>, shardType?: (black | red)[]): null | { duration: string; end: DateTime<boolean>; index: number; info: ShardInfo; start: DateTime<boolean> }
  • Get the next occuring black/red shard from the given date;


    Parameters

    NameTypeDefaultDescription
    dateDateTime<boolean>
    optionalshardType(black | red)[]

    The type of shard to get the next occuring shard for

    Returns null | { duration: string; end: DateTime<boolean>; index: number; info: ShardInfo; start: DateTime<boolean> }

    the shard details or null if no shard is found

staticgetNextShardFromNow

  • getNextShardFromNow(shardType?: (black | red)[]): { duration: string; end: DateTime<boolean>; index: number; info: ShardInfo; start: DateTime<boolean> }
  • Get the next occuring shard from the given date


    Parameters

    NameTypeDefaultDescription
    optionalshardType(black | red)[]

    The type of shard to get the next occuring shard for

    Returns { duration: string; end: DateTime<boolean>; index: number; info: ShardInfo; start: DateTime<boolean> }

    an upcoming shard relative from now

    • duration: string
    • end: DateTime<boolean>
    • index: number
    • info: ShardInfo
    • start: DateTime<boolean>

staticgetStatus

  • Get all three shards status for a given date relative to the current time


    Parameters

    NameTypeDefaultDescription
    dateDateTime<boolean>

    The date for which to get the status for

    Returns ShardsCountdown[] | No Shard

staticgetSuffix

  • getSuffix(number: number): string
  • Returns suffix for a given number


    Parameters

    NameTypeDefaultDescription
    numbernumber

    The number to get the suffix for

    Returns string

staticshardsIndex

  • shardsIndex(date: DateTime<boolean>): { currentRealm: prairie | forest | valley | wasteland | vault; currentShard: C | b | A | a | B }
  • Returns shards index for a given date


    Parameters

    NameTypeDefaultDescription
    dateDateTime<boolean>

    Returns { currentRealm: prairie | forest | valley | wasteland | vault; currentShard: C | b | A | a | B }

    • currentRealm: prairie | forest | valley | wasteland | vault
    • currentShard: C | b | A | a | B