interface IAPIErrorResponse { data: null; error: string; } interface IAPISuccessResponse { error: false; data: T; } export type IAPIResponse = IAPIErrorResponse | IAPISuccessResponse; export interface IPhotoJSON { id: number; user: number; hash: string; size: string; format: string; createdAt: number; editedAt: number; shotAt: number; uploaded: boolean; } export interface IPhotoReqJSON extends IPhotoJSON { accessToken: string; } export interface IUserJSON { id: number; username: string; isAdmin: boolean; } export interface IUserJWT extends IUserJSON { ext: number; iat: number; } export interface IUserAuthJSON extends IUserJSON { jwt: string; } export interface IPhotosNewPostBody { hash: string | undefined; size: string | undefined; format: string | undefined; } export type IPhotosNewRespBody = IAPIResponse; export type IPhotosUploadRespBody = IAPIResponse; export type IPhotosListRespBody = IAPIResponse; export type IPhotosByIDGetRespBody = IAPIResponse; export type IPhotoByIDDeleteRespBody = IAPIResponse; export type IPhotosDeleteRespBody = IAPIResponse; export type IUserGetRespBody = IAPIResponse; export type IUserLoginRespBody = IAPIResponse; export interface IUserSignupBody { username: string | undefined; password: string | undefined; email: string | undefined; } export type IUserSignupRespBody = IAPIResponse; export interface IUserEditBody { password: string | undefined; } export type IUserEditRespBody = IAPIResponse; export interface IUserLoginBody { username: string | undefined; password: string | undefined; } export interface IPhotosDeleteBody { photos: IPhotoReqJSON[]; } export const IPhotosListPagination = 50;