@cbnsndwch/zero-sources

IUser interface

Home > @cbnsndwch/zrocket-contracts > IUser

IUser interface

Represents a user entity in the chat system.

IEntityBase - Provides base entity properties like id IHasCreatedAt - Provides creation timestamp functionality

This interface defines the structure for a user object containing personal information, contact details, presence status, and user preferences.

Signature:

interface IUser extends IEntityBase, IHasCreatedAt, IHasName, IHasUsername

Extends: IEntityBase, IHasCreatedAt, IHasName, IHasUsername

Example

const user: IUser = {
    id: 'user123',
    email: 'john.doe@example.com',
    name: 'John Doe',
    username: 'johndoe',
    active: true,
    presence: UserPresenceStatus.ONLINE,
    profile: {},
    createdAt: new Date()
};

Properties

Property

Modifiers

Type

Description

active

boolean

Whether the user's profile is currently active (enabled) in the system.

additionalEmails?

string[]

(Optional) The user's additional email addresses.

avatarUrl?

string

(Optional) The URL of the user's avatar image.

bio?

string

(Optional) A short text bio or description of the user.

defaultPresence?

UserPresenceStatus

(Optional) Default presence status of the user.

defaultRoom?

string

(Optional) The default room that the user has set for quick access.

email

string

The user's preferred email address.

externalId?

ExternalUserId

(Optional) If the user signed up using an external provider, this field contains the user's id on that provider.

The format is <providerId>/<userId>, e.g. google/1234567890 where google is the provider id and 1234567890 is the user's Google Id.

preferences?

Dict

(Optional) User preferences stored as a dictionary.

presence?

UserPresenceStatus

(Optional) Current presence status of the user.

presenceText?

string

(Optional) Text that describes the user's current presence status.

profile

Dict

Additional user profile information stored as a dictionary.

How was this page?