Add Typing Message
This commit is contained in:
parent
4c698768de
commit
b245e6a813
1 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||||
|
}
|
||||||
|
|
Reference in a new issue