StudE-Frontend/src/interfaces/Interfaces.tsx

164 lines
3 KiB
TypeScript
Raw Normal View History

2023-08-07 14:55:44 +08:00
import * as Location from "expo-location";
2023-08-15 14:15:33 +08:00
import { GetStudentStatus } from "../components/Api/Api";
2023-08-07 14:55:44 +08:00
export interface IconProps {
size: number;
2023-07-03 21:22:31 +08:00
}
export interface ResponsiveIconProps {
size: number;
color: string;
}
export interface RootDrawerParamList {
navigate: any;
}
// Redux Interfaces
export interface LoginState {
Login: { logged_in: boolean };
}
export interface LoggedInUserState {
LoggedInUser: {
value: {
email: string;
id: number;
username: string;
};
};
}
// API Interfaces
export interface RegistrationType {
email: string;
username: string;
password: string;
2023-07-03 21:22:31 +08:00
first_name: string;
last_name: string;
student_id_number: string;
}
export interface LoginType {
username: string;
password: string;
}
export interface ActivationType {
uid: string;
token: string;
}
2023-07-18 17:20:11 +08:00
export interface OptionType {
label: string;
value: string;
}
// Semester
export interface SemesterType {
id: string;
name: string;
shortname: string;
}
export type SemestersType = Array<SemesterType>;
2023-07-17 22:44:50 +08:00
export type SemesterReturnType = [boolean, SemestersType];
// Year Level
export interface YearLevelType {
id: string;
name: string;
shortname: string;
}
export type YearLevelsType = Array<YearLevelType>;
export type YearLevelReturnType = [boolean, YearLevelsType];
// Course
export interface CourseType {
id: string;
name: string;
shortname: string;
}
export type CoursesType = Array<CourseType>;
export type CourseReturnType = [boolean, CoursesType];
2023-07-06 20:29:04 +08:00
// Subject
export interface SubjectType {
id: number;
name: string;
code: string;
course: string;
year_level: string;
semester: string;
}
2023-07-18 17:20:11 +08:00
export type SubjectsType = Array<SubjectType>;
export type SubjectsReturnType = [boolean, SubjectsType];
export type AvatarType = {
2023-07-27 16:00:31 +08:00
uri: string;
type: string;
name: string;
};
2023-07-18 17:20:11 +08:00
// For dropdown menu
export interface OnboardingType {
2023-07-06 20:29:04 +08:00
year_level: string;
course: string;
semester: string;
}
2023-07-17 15:10:44 +08:00
export interface PatchUserInfoType {
course?: string;
first_name?: string;
last_name?: string;
semester?: string;
subjects?: string[];
year_level?: string;
irregular?: boolean;
avatar?: string;
2023-07-17 18:45:25 +08:00
}
2023-08-10 17:23:12 +08:00
interface Location {
latitude: number;
longitude: number;
}
export interface StudentStatusType {
2023-08-10 17:23:12 +08:00
user?: string;
subject?: string;
location?: Location;
landmark?: string | null;
active?: boolean;
}
export type StudentStatusReturnType = [boolean, StudentStatusType];
2023-08-10 17:23:12 +08:00
2023-08-15 14:15:33 +08:00
export type StudentStatusListType = Array<StudentStatusType>;
export type StudentStatusListReturnType = [boolean, StudentStatusListType];
2023-08-10 17:23:12 +08:00
export type LocationType = Location.LocationObject;
export interface UserInfoType {
2023-07-17 15:10:44 +08:00
first_name: string;
last_name: string;
email: string;
avatar: string;
2023-07-17 15:10:44 +08:00
student_id_number: string;
irregular: boolean;
semester: string;
semester_shortname: string;
course: string;
course_shortname: string;
year_level: string;
yearlevel_shortname: string;
2023-08-10 17:23:12 +08:00
subjects: string[];
2023-07-17 15:10:44 +08:00
username: string;
}
export type UserInfoReturnType = [boolean, UserInfoType];