-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost.ts
107 lines (93 loc) · 1.93 KB
/
post.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
106
107
import { CreationSettings, GenerationSetting, RecreationSettings } from "./ai";
import { UserBaseInfo } from "./user";
export type Image = {
url: string;
width: number;
height: number;
blurhash: string;
description?: string | null;
};
type RepostedBy = {
userId: string;
userName: string;
};
export type GeneratedFrom = {
postId: string | null;
modelId: string | null;
};
type Counts = {
like: number;
comment: number;
repost: number;
recreation: number;
view: number;
};
type UserActivity = {
isLiked: boolean;
isCommented: boolean;
isReposted: boolean;
isViewed: boolean;
isAccessToViewPrompt: boolean;
};
export type Post = {
rank?: number;
postId: string;
postedBy: UserBaseInfo;
caption: string | null;
category: string[];
image: Image[];
repostedBy: RepostedBy | null;
generatedFrom: GeneratedFrom | null;
allowGenerations: boolean;
counts: Counts;
createdAt: string;
updatedAt: string;
isPromptAvailable: boolean;
userActivity: UserActivity;
searchScore?: number;
};
export type OtherUserPost = {
blockedBy: string | null;
postData: Post[];
};
export type DiscoverPost = {
postId: string;
category: string[];
image: Image[];
searchScore?: number;
};
export type Tag = {
userId: string;
userName: string;
};
export type PostComment = {
commentId: string;
postId: string;
comment: string;
tag: Tag[];
commenter: UserBaseInfo;
createdAt: string;
updatedAt: string;
};
export type PostPrompt = {
prompt: string;
creationSettings: null;
recreationSettings: null;
modelName: string;
};
export type PromptDetail = {
prompt: string;
modelName: string;
creditPerPromptView: number;
allowPromptView: boolean;
generationId: string;
} & GenerationSetting;
export type ImageState = {
imagePreview: string;
file: File;
};
export type OwnerPost = Post & {
parentId: string | null;
promptDetails: Partial<PromptDetail>;
prompt: string | null;
};