pronounsfu/frontend/src/lib/types.ts

44 lines
798 B
TypeScript
Raw Normal View History

2022-05-05 07:33:44 -07:00
export interface MeUser {
id: string;
username: string;
display_name: string | null;
bio: string | null;
avatar_source: string | null;
avatar_url: string | null;
links: string[] | null;
discord: string | null;
discord_username: string | null;
}
2022-05-10 07:33:29 -07:00
export interface User {
id: string;
username: string;
display_name: string | null;
bio: string | null;
avatar_source: string | null;
links: string[] | null;
members: PartialMember[];
}
export interface PartialMember {
id: string;
name: string;
avatar_url: string | null;
}
2022-05-05 07:33:44 -07:00
export interface APIError {
code: ErrorCode;
message?: string;
}
export enum ErrorCode {
BadRequest = 400,
Forbidden = 403,
InternalServerError = 500,
InvalidState = 1001,
InvalidOAuthCode = 1002,
UserNotFound = 2001,
}