-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.d.ts
55 lines (46 loc) · 953 Bytes
/
types.d.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
/** @format */
import { JwtPayload } from "jsonwebtoken";
export type User = {
userid: string;
username: string;
email: string;
dob: Date;
passwordhash: string;
accesslevel: AccessLevel;
};
export type UserBearer = {
userID: string;
email: string;
AccessLevel: AccessLevel;
};
export type Tweet = {
content: string;
tweetID: string;
writtenBy: User;
tweetComment: Comments[];
likes: number;
Retweets: number;
createdAt: Date;
};
export type Comments = User & {
comment: string;
};
export type AccessLevel = "Admin" | "User" | "Anonymous";
declare global {
namespace Express {
interface Request {
User: User;
}
}
namespace NodeJS {
interface ProcessEnv {
JwtEncryptionKey: string;
Node_env: "development" | "production";
}
}
}
export type Follow = {
UserID: string;
FollowedBy: User[];
Followers: User[];
};