-
Notifications
You must be signed in to change notification settings - Fork 0
/
interfaces.ts
105 lines (91 loc) · 1.72 KB
/
interfaces.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import { CourseCategory } from "./constants";
export interface Course {
category: CourseCategory;
title: string;
description: string;
courseVideoName: string;
forumId: string;
}
export interface CourseUser {
email: string;
name: string;
courses: string[];
}
export interface ForumDetails {
id: string;
title: string;
messages: ForumMessage[];
}
export interface ForumMessage {
content: string;
author: string;
}
export enum LiveBroadcastEvent {
JoinEvent = "JoinEvent",
RoomEvent = "RoomEvent",
ReactionEvent = "ReactionEvent",
}
export type RoomEvent = {
x: number;
y: number;
value: string;
};
// The type of custom events broadcasted and listened for in this
// room. Must be JSON-serializable.
export type Event =
| {
type: "RoomEvent";
data: RoomEvent;
}
| {
type: "JoinEvent";
data: JoinEvent;
}
| {
type: "ReactionEvent";
data: ReactionEvent;
};
export type Reaction = {
value: string;
timestamp: number;
point: { x: number; y: number };
};
export type JoinEvent = {
userId: string;
};
export type ReactionEvent = {
x: number;
y: number;
value: string;
};
export const CURSOR_COLORS = [
"#DC2626",
"#D97706",
"#059669",
"#7C3AED",
"#DB2777",
];
export type cursor = { x: number; y: number; message?: string } | null;
export enum CursorMode {
ChatHidden,
Chat,
ReactionSelector,
Reaction,
}
export type CursorState =
| {
mode: CursorMode.ChatHidden;
}
| {
mode: CursorMode.Chat;
message: string;
previousMessage: string | null;
}
| {
mode: CursorMode.ReactionSelector;
}
| {
mode: CursorMode.Reaction;
reaction: string;
isPressed: boolean;
};