-
Notifications
You must be signed in to change notification settings - Fork 4
/
types.ts
63 lines (54 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
58
59
60
61
62
63
import { User, Post, Tags, Blog, Repo, File, Messages, Conversations } from '@prisma/client';
import { Request } from 'express';
export interface RequestWithUser extends Request {
user: User;
}
export interface UserProfile extends User {
posts: PostWithRelations[];
tags: Tags[];
blogs: Blog[];
followedBy: User[];
following: User[];
aboutMe: string;
bio: string;
}
export interface SimpleUser {
id: number;
name: string;
username: string;
picture: string | null;
}
export interface Comment {
id: number,
body: string,
author: SimpleUser,
createdAt: Date,
liked: {id: number}[],
likedByUser?: boolean,
}
export interface PostWithRelations extends Post {
author: SimpleUser;
tags: Tags[];
repo?: RepoWithFiles | null;
liked: { id: number }[];
likedByUser?: boolean;
comments?: Comment[]
}
export interface RepoWithFiles extends Repo {
files: File[];
}
export interface MessageWithMetadata extends Messages {
sender: User;
}
export interface ConversationWithParticipants extends Conversations {
participants: User[];
}
export interface BlogPosts {
devId: User[];
mediumId: User[];
id: number;
title: string;
url: string;
cover_image: string;
description: string;
}