XuqmGroup-RNSDK/src/im/types.ts
XuqmGroup 3d488250ee feat(rn): add xuqm_release Node.js script, expand IM SDK with friends/groups/conversations
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 00:37:10 +08:00

59 行
1.1 KiB
TypeScript

export type ChatType = 'SINGLE' | 'GROUP'
export type MsgType =
| 'TEXT'
| 'IMAGE'
| 'VIDEO'
| 'AUDIO'
| 'FILE'
| 'CUSTOM'
| 'LOCATION'
| 'NOTIFY'
| 'RICH_TEXT'
| 'CALL_AUDIO'
| 'CALL_VIDEO'
| '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
editedAt?: string | null
}
export interface ImEventListener {
onConnected?: () => void
onDisconnected?: (reason?: string) => void
onMessage?: (msg: ImMessage) => void
onGroupMessage?: (msg: ImMessage) => void
onError?: (error: string) => void
}
export interface SendMessageParams {
toId: string
chatType: ChatType
msgType: MsgType
content: string
mentionedUserIds?: string
}
export interface ImGroup {
id: string
appId: string
name: string
creatorId: string
memberIds: string
adminIds: string
createdAt: string
}