Add Typing Message

This commit is contained in:
Tobias Berger 2022-01-14 14:29:42 +01:00
parent 4c698768de
commit b245e6a813

View file

@ -2,6 +2,7 @@ export enum MessageType {
ACK = 0, ACK = 0,
TEXT = 1, TEXT = 1,
ID_RESPONSE = 3, ID_RESPONSE = 3,
TYPING = 4,
} }
export type ServerMessage = { export type ServerMessage = {
@ -87,3 +88,10 @@ export function isIdResponseMessage(obj: unknown): obj is IdResponseMessage {
} }
return true; return true;
} }
export type TypingMessage = ServerMessage & {
type: MessageType.TYPING;
}
export function isTypingMessage(obj: unknown): obj is TypingMessage {
return isServerMessage(obj, MessageType.TYPING);
}