Interface IAccountService

This interface describes all methods for interacting with user accounts.

interface IAccountService {
    get status(): AsyncOp;
    get user(): User;
    onUpdate(fn: ((user: User) => void)): (() => void);
    refresh(): Promise<void>;
    update(user: User): Promise<void>;
}

Accessors

Methods

Accessors

Methods

  • Registers a callback to be called when the user object is updated.

    client.account.onUpdate((user) => {
    console.log("User updated:", user);
    });

    Parameters

    • fn: ((user: User) => void)

      The callback function

        • (user): void
        • Parameters

          Returns void

    Returns (() => void)

    A function that unregisters the callback.

      • (): void
      • Returns void