Options
All
  • Public
  • Public/Protected
  • All
Menu

Class default

Hierarchy

Index

Constructors

constructor

Properties

[$mobx]

[$mobx]: {}

Type declaration

changeListeners_

changeListeners_: any

client

client: Client

data_

data_: Map<string, ObservableValue<User>>

dehancer

dehancer: any

enhancer_

enhancer_: IEnhancer<User>

hasMap_

hasMap_: Map<string, ObservableValue<boolean>>

interceptors_

interceptors_: any

keysAtom_

keysAtom_: IAtom

name_

name_: string

Accessors

[toStringTag]

  • get [toStringTag](): string
  • Returns string

size

  • get size(): number
  • Returns number

Methods

$get

  • $get(id: string, data?: { _id: string; avatar?: null | { _id: string; content_type: string; deleted?: null | boolean; filename: string; message_id?: null | string; metadata: { type: "File" } | { type: "Text" } | { height: number; type: "Image"; width: number } | { height: number; type: "Video"; width: number } | { type: "Audio" }; object_id?: null | string; reported?: null | boolean; server_id?: null | string; size: number; tag: string; user_id?: null | string }; badges?: null | number; bot?: null | { owner: string }; flags?: null | number; online?: null | boolean; privileged?: boolean; profile?: null | { background?: null | { _id: string; content_type: string; deleted?: null | boolean; filename: string; message_id?: null | string; metadata: { type: "File" } | { type: "Text" } | { height: number; type: "Image"; width: number } | { height: number; type: "Video"; width: number } | { type: "Audio" }; object_id?: null | string; reported?: null | boolean; server_id?: null | string; size: number; tag: string; user_id?: null | string }; content?: null | string }; relations?: null | { _id: string; status: "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther" }[]; relationship?: null | "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther"; status?: null | { presence?: null | "Online" | "Idle" | "Focus" | "Busy" | "Invisible"; text?: null | string }; username: string }): User
  • Parameters

    • id: string
    • Optional data: { _id: string; avatar?: null | { _id: string; content_type: string; deleted?: null | boolean; filename: string; message_id?: null | string; metadata: { type: "File" } | { type: "Text" } | { height: number; type: "Image"; width: number } | { height: number; type: "Video"; width: number } | { type: "Audio" }; object_id?: null | string; reported?: null | boolean; server_id?: null | string; size: number; tag: string; user_id?: null | string }; badges?: null | number; bot?: null | { owner: string }; flags?: null | number; online?: null | boolean; privileged?: boolean; profile?: null | { background?: null | { _id: string; content_type: string; deleted?: null | boolean; filename: string; message_id?: null | string; metadata: { type: "File" } | { type: "Text" } | { height: number; type: "Image"; width: number } | { height: number; type: "Video"; width: number } | { type: "Audio" }; object_id?: null | string; reported?: null | boolean; server_id?: null | string; size: number; tag: string; user_id?: null | string }; content?: null | string }; relations?: null | { _id: string; status: "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther" }[]; relationship?: null | "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther"; status?: null | { presence?: null | "Online" | "Idle" | "Focus" | "Busy" | "Invisible"; text?: null | string }; username: string }
      • _id: string
        description

        Unique Id

      • Optional avatar?: null | { _id: string; content_type: string; deleted?: null | boolean; filename: string; message_id?: null | string; metadata: { type: "File" } | { type: "Text" } | { height: number; type: "Image"; width: number } | { height: number; type: "Video"; width: number } | { type: "Audio" }; object_id?: null | string; reported?: null | boolean; server_id?: null | string; size: number; tag: string; user_id?: null | string }
        description

        Avatar attachment

      • Optional badges?: null | number

        Format: int32

        description

        Bitfield of user badges

      • Optional bot?: null | { owner: string }
        description

        Bot information

      • Optional flags?: null | number

        Format: int32

        description

        Enum of user flags

      • Optional online?: null | boolean
        description

        Whether this user is currently online

      • Optional privileged?: boolean
        description

        Whether this user is privileged

      • Optional profile?: null | { background?: null | { _id: string; content_type: string; deleted?: null | boolean; filename: string; message_id?: null | string; metadata: { type: "File" } | { type: "Text" } | { height: number; type: "Image"; width: number } | { height: number; type: "Video"; width: number } | { type: "Audio" }; object_id?: null | string; reported?: null | boolean; server_id?: null | string; size: number; tag: string; user_id?: null | string }; content?: null | string }
        description

        User's profile page

      • Optional relations?: null | { _id: string; status: "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther" }[]
        description

        Relationships with other users

      • Optional relationship?: null | "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther"
        description

        Current session user's relationship with this user

      • Optional status?: null | { presence?: null | "Online" | "Idle" | "Focus" | "Busy" | "Invisible"; text?: null | string }
        description

        User's current status

      • username: string
        description

        Username

    Returns User

[iterator]

  • [iterator](): IterableIterator<IMapEntry<string, User>>
  • Returns IterableIterator<IMapEntry<string, User>>

changeUsername

  • changeUsername(username: string, password: string): Promise<{ _id: string; avatar?: null | { _id: string; content_type: string; deleted?: null | boolean; filename: string; message_id?: null | string; metadata: { type: "File" } | { type: "Text" } | { height: number; type: "Image"; width: number } | { height: number; type: "Video"; width: number } | { type: "Audio" }; object_id?: null | string; reported?: null | boolean; server_id?: null | string; size: number; tag: string; user_id?: null | string }; badges?: null | number; bot?: null | { owner: string }; flags?: null | number; online?: null | boolean; privileged?: boolean; profile?: null | { background?: null | { _id: string; content_type: string; deleted?: null | boolean; filename: string; message_id?: null | string; metadata: { type: "File" } | { type: "Text" } | { height: number; type: "Image"; width: number } | { height: number; type: "Video"; width: number } | { type: "Audio" }; object_id?: null | string; reported?: null | boolean; server_id?: null | string; size: number; tag: string; user_id?: null | string }; content?: null | string }; relations?: null | { _id: string; status: "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther" }[]; relationship?: null | "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther"; status?: null | { presence?: null | "Online" | "Idle" | "Focus" | "Busy" | "Invisible"; text?: null | string }; username: string }>
  • Change the username of the current user

    Parameters

    • username: string

      New username

    • password: string

      Current password

    Returns Promise<{ _id: string; avatar?: null | { _id: string; content_type: string; deleted?: null | boolean; filename: string; message_id?: null | string; metadata: { type: "File" } | { type: "Text" } | { height: number; type: "Image"; width: number } | { height: number; type: "Video"; width: number } | { type: "Audio" }; object_id?: null | string; reported?: null | boolean; server_id?: null | string; size: number; tag: string; user_id?: null | string }; badges?: null | number; bot?: null | { owner: string }; flags?: null | number; online?: null | boolean; privileged?: boolean; profile?: null | { background?: null | { _id: string; content_type: string; deleted?: null | boolean; filename: string; message_id?: null | string; metadata: { type: "File" } | { type: "Text" } | { height: number; type: "Image"; width: number } | { height: number; type: "Video"; width: number } | { type: "Audio" }; object_id?: null | string; reported?: null | boolean; server_id?: null | string; size: number; tag: string; user_id?: null | string }; content?: null | string }; relations?: null | { _id: string; status: "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther" }[]; relationship?: null | "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther"; status?: null | { presence?: null | "Online" | "Idle" | "Focus" | "Busy" | "Invisible"; text?: null | string }; username: string }>

clear

  • clear(): void
  • Returns void

createObj

  • createObj(data: { _id: string; avatar?: null | { _id: string; content_type: string; deleted?: null | boolean; filename: string; message_id?: null | string; metadata: { type: "File" } | { type: "Text" } | { height: number; type: "Image"; width: number } | { height: number; type: "Video"; width: number } | { type: "Audio" }; object_id?: null | string; reported?: null | boolean; server_id?: null | string; size: number; tag: string; user_id?: null | string }; badges?: null | number; bot?: null | { owner: string }; flags?: null | number; online?: null | boolean; privileged?: boolean; profile?: null | { background?: null | { _id: string; content_type: string; deleted?: null | boolean; filename: string; message_id?: null | string; metadata: { type: "File" } | { type: "Text" } | { height: number; type: "Image"; width: number } | { height: number; type: "Video"; width: number } | { type: "Audio" }; object_id?: null | string; reported?: null | boolean; server_id?: null | string; size: number; tag: string; user_id?: null | string }; content?: null | string }; relations?: null | { _id: string; status: "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther" }[]; relationship?: null | "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther"; status?: null | { presence?: null | "Online" | "Idle" | "Focus" | "Busy" | "Invisible"; text?: null | string }; username: string }): User
  • Create a user object. This is meant for internal use only.

    Parameters

    • data: { _id: string; avatar?: null | { _id: string; content_type: string; deleted?: null | boolean; filename: string; message_id?: null | string; metadata: { type: "File" } | { type: "Text" } | { height: number; type: "Image"; width: number } | { height: number; type: "Video"; width: number } | { type: "Audio" }; object_id?: null | string; reported?: null | boolean; server_id?: null | string; size: number; tag: string; user_id?: null | string }; badges?: null | number; bot?: null | { owner: string }; flags?: null | number; online?: null | boolean; privileged?: boolean; profile?: null | { background?: null | { _id: string; content_type: string; deleted?: null | boolean; filename: string; message_id?: null | string; metadata: { type: "File" } | { type: "Text" } | { height: number; type: "Image"; width: number } | { height: number; type: "Video"; width: number } | { type: "Audio" }; object_id?: null | string; reported?: null | boolean; server_id?: null | string; size: number; tag: string; user_id?: null | string }; content?: null | string }; relations?: null | { _id: string; status: "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther" }[]; relationship?: null | "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther"; status?: null | { presence?: null | "Online" | "Idle" | "Focus" | "Busy" | "Invisible"; text?: null | string }; username: string }
      • _id: string
        description

        Unique Id

      • Optional avatar?: null | { _id: string; content_type: string; deleted?: null | boolean; filename: string; message_id?: null | string; metadata: { type: "File" } | { type: "Text" } | { height: number; type: "Image"; width: number } | { height: number; type: "Video"; width: number } | { type: "Audio" }; object_id?: null | string; reported?: null | boolean; server_id?: null | string; size: number; tag: string; user_id?: null | string }
        description

        Avatar attachment

      • Optional badges?: null | number

        Format: int32

        description

        Bitfield of user badges

      • Optional bot?: null | { owner: string }
        description

        Bot information

      • Optional flags?: null | number

        Format: int32

        description

        Enum of user flags

      • Optional online?: null | boolean
        description

        Whether this user is currently online

      • Optional privileged?: boolean
        description

        Whether this user is privileged

      • Optional profile?: null | { background?: null | { _id: string; content_type: string; deleted?: null | boolean; filename: string; message_id?: null | string; metadata: { type: "File" } | { type: "Text" } | { height: number; type: "Image"; width: number } | { height: number; type: "Video"; width: number } | { type: "Audio" }; object_id?: null | string; reported?: null | boolean; server_id?: null | string; size: number; tag: string; user_id?: null | string }; content?: null | string }
        description

        User's profile page

      • Optional relations?: null | { _id: string; status: "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther" }[]
        description

        Relationships with other users

      • Optional relationship?: null | "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther"
        description

        Current session user's relationship with this user

      • Optional status?: null | { presence?: null | "Online" | "Idle" | "Focus" | "Busy" | "Invisible"; text?: null | string }
        description

        User's current status

      • username: string
        description

        Username

    Returns User

    User

delete

  • delete(key: string): boolean
  • Parameters

    • key: string

    Returns boolean

edit

  • edit(data: { avatar?: null | string; profile?: null | { background?: null | string; content?: null | string }; remove?: null | ("Avatar" | "StatusText" | "StatusPresence" | "ProfileContent" | "ProfileBackground")[]; status?: null | { presence?: null | "Online" | "Idle" | "Focus" | "Busy" | "Invisible"; text?: null | string } }): Promise<void>
  • Edit the current user

    Parameters

    • data: { avatar?: null | string; profile?: null | { background?: null | string; content?: null | string }; remove?: null | ("Avatar" | "StatusText" | "StatusPresence" | "ProfileContent" | "ProfileBackground")[]; status?: null | { presence?: null | "Online" | "Idle" | "Focus" | "Busy" | "Invisible"; text?: null | string } }

      User edit data object

      • Optional avatar?: null | string
        description

        Attachment Id for avatar

      • Optional profile?: null | { background?: null | string; content?: null | string }
        description

        New user profile data

        This is applied as a partial.

      • Optional remove?: null | ("Avatar" | "StatusText" | "StatusPresence" | "ProfileContent" | "ProfileBackground")[]
        description

        Fields to remove from user object

      • Optional status?: null | { presence?: null | "Online" | "Idle" | "Focus" | "Busy" | "Invisible"; text?: null | string }
        description

        New user status

    Returns Promise<void>

entries

  • entries(): IterableIterator<IMapEntry<string, User>>
  • Returns IterableIterator<IMapEntry<string, User>>

fetch

  • fetch(id: string, data?: { _id: string; avatar?: null | { _id: string; content_type: string; deleted?: null | boolean; filename: string; message_id?: null | string; metadata: { type: "File" } | { type: "Text" } | { height: number; type: "Image"; width: number } | { height: number; type: "Video"; width: number } | { type: "Audio" }; object_id?: null | string; reported?: null | boolean; server_id?: null | string; size: number; tag: string; user_id?: null | string }; badges?: null | number; bot?: null | { owner: string }; flags?: null | number; online?: null | boolean; privileged?: boolean; profile?: null | { background?: null | { _id: string; content_type: string; deleted?: null | boolean; filename: string; message_id?: null | string; metadata: { type: "File" } | { type: "Text" } | { height: number; type: "Image"; width: number } | { height: number; type: "Video"; width: number } | { type: "Audio" }; object_id?: null | string; reported?: null | boolean; server_id?: null | string; size: number; tag: string; user_id?: null | string }; content?: null | string }; relations?: null | { _id: string; status: "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther" }[]; relationship?: null | "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther"; status?: null | { presence?: null | "Online" | "Idle" | "Focus" | "Busy" | "Invisible"; text?: null | string }; username: string }): Promise<User>
  • Fetch a user

    Parameters

    • id: string

      User ID

    • Optional data: { _id: string; avatar?: null | { _id: string; content_type: string; deleted?: null | boolean; filename: string; message_id?: null | string; metadata: { type: "File" } | { type: "Text" } | { height: number; type: "Image"; width: number } | { height: number; type: "Video"; width: number } | { type: "Audio" }; object_id?: null | string; reported?: null | boolean; server_id?: null | string; size: number; tag: string; user_id?: null | string }; badges?: null | number; bot?: null | { owner: string }; flags?: null | number; online?: null | boolean; privileged?: boolean; profile?: null | { background?: null | { _id: string; content_type: string; deleted?: null | boolean; filename: string; message_id?: null | string; metadata: { type: "File" } | { type: "Text" } | { height: number; type: "Image"; width: number } | { height: number; type: "Video"; width: number } | { type: "Audio" }; object_id?: null | string; reported?: null | boolean; server_id?: null | string; size: number; tag: string; user_id?: null | string }; content?: null | string }; relations?: null | { _id: string; status: "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther" }[]; relationship?: null | "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther"; status?: null | { presence?: null | "Online" | "Idle" | "Focus" | "Busy" | "Invisible"; text?: null | string }; username: string }
      • _id: string
        description

        Unique Id

      • Optional avatar?: null | { _id: string; content_type: string; deleted?: null | boolean; filename: string; message_id?: null | string; metadata: { type: "File" } | { type: "Text" } | { height: number; type: "Image"; width: number } | { height: number; type: "Video"; width: number } | { type: "Audio" }; object_id?: null | string; reported?: null | boolean; server_id?: null | string; size: number; tag: string; user_id?: null | string }
        description

        Avatar attachment

      • Optional badges?: null | number

        Format: int32

        description

        Bitfield of user badges

      • Optional bot?: null | { owner: string }
        description

        Bot information

      • Optional flags?: null | number

        Format: int32

        description

        Enum of user flags

      • Optional online?: null | boolean
        description

        Whether this user is currently online

      • Optional privileged?: boolean
        description

        Whether this user is privileged

      • Optional profile?: null | { background?: null | { _id: string; content_type: string; deleted?: null | boolean; filename: string; message_id?: null | string; metadata: { type: "File" } | { type: "Text" } | { height: number; type: "Image"; width: number } | { height: number; type: "Video"; width: number } | { type: "Audio" }; object_id?: null | string; reported?: null | boolean; server_id?: null | string; size: number; tag: string; user_id?: null | string }; content?: null | string }
        description

        User's profile page

      • Optional relations?: null | { _id: string; status: "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther" }[]
        description

        Relationships with other users

      • Optional relationship?: null | "User" | "None" | "Friend" | "Outgoing" | "Incoming" | "Blocked" | "BlockedOther"
        description

        Current session user's relationship with this user

      • Optional status?: null | { presence?: null | "Online" | "Idle" | "Focus" | "Busy" | "Invisible"; text?: null | string }
        description

        User's current status

      • username: string
        description

        Username

    Returns Promise<User>

    User

forEach

  • forEach(callback: (value: User, key: string, object: Map<string, User>) => void, thisArg?: any): void
  • Parameters

    • callback: (value: User, key: string, object: Map<string, User>) => void
        • (value: User, key: string, object: Map<string, User>): void
        • Parameters

          • value: User
          • key: string
          • object: Map<string, User>

          Returns void

    • Optional thisArg: any

    Returns void

get

  • get(key: string): undefined | User
  • Parameters

    • key: string

    Returns undefined | User

has

  • has(key: string): boolean
  • Parameters

    • key: string

    Returns boolean

intercept_

  • intercept_(handler: IInterceptor<IMapWillChange<string, User>>): Lambda
  • Parameters

    • handler: IInterceptor<IMapWillChange<string, User>>

    Returns Lambda

keys

  • keys(): IterableIterator<string>
  • Returns IterableIterator<string>

merge

  • merge(other: any): ObservableMap<string, User>
  • Merge another object into this object, returns this.

    Parameters

    • other: any

    Returns ObservableMap<string, User>

observe_

  • observe_(listener: (changes: IMapDidChange<string, User>) => void, fireImmediately?: boolean): Lambda

replace

  • replace(values: any): ObservableMap<string, User>
  • Parameters

    • values: any

    Returns ObservableMap<string, User>

set

  • Parameters

    • key: string
    • value: User

    Returns default

toJSON

  • toJSON(): [string, User][]
  • Returns [string, User][]

toString

  • toString(): string
  • Returns string

values

  • values(): IterableIterator<User>
  • Returns IterableIterator<User>

Generated using TypeDoc