Class Base<Payload>

Base class for all structures.

Type Parameters

Hierarchy

Constructors

Properties

#client: Client<boolean>

Client instance attached to the Object

#endpointUrl: string = Endpoints.account

Endpoint url the object will request to

#payload: Payload

The payload of the object.

Accessors

  • get payload(): Payload
  • Get the payload of the object

    Returns Payload

  • set payload(payload: Partial<Payload>): void
  • Updates the payload of the object.

    Returns

    The current instance

    Parameters

    • payload: Partial<Payload>

      The payload to merge into the current instance

    Returns void

Methods

  • Creates a new instance of the same structure with the same payload.

    Returns

    A clone of the current instance

    Returns Base<Payload>

  • Fetches the objects data from it's endpoint

    Returns

    The instance of the object

    Returns Promise<Base<Payload>>

  • Gets the value from the payload from its key

    Returns

    Type Parameters

    Parameters

    • key: K

      The key to get the value of

    Returns Nullify<P[K]>

  • Converts the object instance into JSON

    Returns

    Stringified payload of the object

    Returns string

Generated using TypeDoc