@chatscope/use-chat
Version:
React hook for state management in chat applications
31 lines (27 loc) • 795 B
text/typescript
import { ChatEventType } from "../enums";
import { ChatEvent } from "./ChatEvent";
import { ConversationId, UserId } from "../Types";
export interface UserTypingEventParams {
readonly userId: UserId;
readonly conversationId: ConversationId;
readonly content: string;
readonly isTyping: boolean;
}
export class UserTypingEvent implements ChatEvent<ChatEventType.UserTyping> {
readonly type = ChatEventType.UserTyping;
readonly userId: UserId;
readonly conversationId: ConversationId;
readonly content: string;
readonly isTyping: boolean;
constructor({
userId,
conversationId,
content,
isTyping,
}: UserTypingEventParams) {
this.userId = userId;
this.conversationId = conversationId;
this.content = content;
this.isTyping = isTyping;
}
}