-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathtypes.ts
57 lines (48 loc) · 1.27 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import { FastifyInstance } from "fastify";
import { Server } from "socket.io";
export interface IDOMUtils {
getSelectors(): ISelectorConfig;
getChatContainer(): Element | null;
getMessageText(node: Element): string;
getMessageEmojis(node: Element): string[];
getMessageAuthor(node: Element): string;
getMessageBadges(node: Element): string[];
}
export interface IDateTimeUtils {
getFriendlyTime(): string;
}
export interface IStringUtils {
makeId(length: number): string;
getPlatformNameByHostname(): string;
}
export interface IChromeUtils {
setBadgeStatus(status: boolean): void;
}
export interface IWebRTCUtils {
initWebRTCConnection(): Promise<RTCDataChannel>;
}
export interface ISelectorConfig {
chatContainer: string;
messageAuthor: string;
messageAuthorBadge: string;
messageText: string;
chatEmojis: string;
}
export interface IMessage {
sessionId: string;
id: string;
platform: string;
timestamp: string;
content: string;
emojis: string[];
author: string;
badges: string[];
authorColor?: string;
}
export enum SocketType {
REACT = "SOCKET_TYPE_REACT",
EXTENSION = "SOCKET_TYPE_EXTENSION",
}
export interface CustomFastifyInstance extends FastifyInstance {
io?: Server;
}