Interface DataObjectInterface

Data Object interface.

Objects which hold data from some type of storage.

Hierarchy

Indexable

[k: string]: any

Methods

  • Search the array for this object and return the corresponding index.

    If strict is false, is() is used to compare. If strict is true, equals() is used.

    Parameters

    • array: any[]

      The array to search.

    • Optional strict: boolean

      Whether to use stronger comparison.

    Returns number

    The index if the object is in the array, -1 if it isn't.

  • Perform a more strict comparison of this object to another.

    Parameters

    • object: any

      The object to compare.

    Returns boolean

    True or false.

  • Check whether this object is in an array.

    If strict is false, is() is used to compare. If strict is true, equals() is used.

    Parameters

    • array: any[]

      The array to search.

    • Optional strict: boolean

      Whether to use stronger comparison.

    Returns boolean

    True if the object is in the array, false if it isn't.

  • Perform a less strict comparison of this object to another.

    Parameters

    • object: any

      The object to compare.

    Returns boolean

    True or false.

  • Refresh the object from storage. (Bypasses Nymph's cache.)

    If the object has been deleted from storage, the database cannot be reached, or a database error occurs, refresh() will return 0.

    Returns Promise<boolean | 0>

    False if the data has not been saved, 0 if it can't be refreshed, true on success.

Generated using TypeDoc