feature/share-libs
ts 36 lines 723 Bytes
Raw
1 export default interface User {
2 id: number,
3 email: string,
4 username: string,
5 name: string,
6 gravatar_url: string,
7 followers_count: number,
8 following_count: number,
9 about: string,
10 access_token: string | null,
11 }
12
13 export function usernameOrId(user: User): string {
14 const usernameOrId = user.username ? user.username : `${user.id}`
15 return `${usernameOrId}`
16 }
17
18 export interface ProfileResponse {
19 code: number,
20 message: string,
21 user: User
22 }
23
24 export interface FollowingResponse {
25 code: number,
26 message: string,
27 user: User,
28 following: User[]
29 }
30
31 export interface FollowersResponse {
32 code: number,
33 message: string,
34 user: User,
35 followers: User[]
36 }