-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
56 lines (49 loc) · 1.3 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
export class ApiError implements Error {
name : string = 'ApiError'
message : string
statusCode : number
constructor(statusCode : number, message? : string) {
this.message = message || 'Failed to send request to the server'
this.statusCode = statusCode
}
}
export interface Account {
id : number
username : string,
avatarUrl : string
}
export interface ExtendedAccountInfo extends Account {
collections : CollectionItem[],
publishedPictures : FeedPicture[]
}
export type DropDownItem = {
title : string,
value : string,
iconFilename : string,
iconAltText : string
}
export interface Picture {
id : number,
title : string,
description : string,
tags : string[],
imageUrl : string,
comments : Comment[]
author : Account
}
export type FeedPicture = Omit<Picture, 'comments'>
export type PictureForm = Omit<Picture, 'id' | 'comments' | 'author'>
export interface Comment {
id : number,
text : string,
creationDate : string
authorAccount : Account
}
export interface Collection {
id : number,
name : string,
thumbnailUrl : string | null,
savedPictures : Picture[]
}
export type CollectionItem = Omit<Collection, 'savedPictures'>
export type CollectionForm = Omit<Collection, 'id' | 'savedPictures'>