Class RainlinkDatabase<G>

A class for storing data using key like Map. Aka: reduce version of Map

Type Parameters

  • G = unknown

Hierarchy (view full)

Constructors

Accessors

Methods

Constructors

Accessors

  • get size(): number
  • Get how many elements of current database

    Returns number

    number

  • get values(): G[]
  • Get all current values of current database

    Returns G[]

    unknown[]

  • get full(): [string, G][]
  • Get all current values of current database

    Returns [string, G][]

    unknown[]

Methods

  • Get data from database

    Type Parameters

    • D = G

    Parameters

    • key: string

      key of that data

    Returns undefined | D

    D

  • detete data from database and returns the deleted data

    Type Parameters

    • D = G

    Parameters

    • key: string

      key of that data

    Returns undefined | D

    D

  • detete all data from database

    Returns void

  • Set data from database

    Type Parameters

    • D = G

    Parameters

    • key: string

      the key you want to set

    • data: D

      data of that key

    Returns undefined | D

    D

  • executes a provided function once for each array element.

    Parameters

    • callback: ((value: G, key: string) => unknown)

      Callback function

        • (value, key): unknown
        • Parameters

          • value: G
          • key: string

          Returns unknown

    Returns void