XuqmGroup-RNSDK/src/im/types.ts

37 行
711 B
TypeScript

2026-04-21 22:07:29 +08:00
export type ChatType = 'SINGLE' | 'GROUP'
export type MsgType =
| 'TEXT'
| 'IMAGE'
| 'VIDEO'
| 'AUDIO'
| 'FILE'
| 'CUSTOM'
| 'LOCATION'
| 'NOTIFY'
| 'REVOKED'
| 'FORWARD'
export type MsgStatus = 'SENT' | 'DELIVERED' | 'READ' | 'REVOKED'
export interface ImMessage {
id: string
appId: string
fromUserId: string
toId: string
chatType: ChatType
msgType: MsgType
content: string
status: MsgStatus
mentionedUserIds?: string
createdAt: string
}
export interface ImEventListener {
onConnected?: () => void
onDisconnected?: (reason?: string) => void
onMessage?: (msg: ImMessage) => void
onGroupMessage?: (msg: ImMessage) => void
onError?: (error: string) => void
}