1
0

feat: Added viewer

This commit is contained in:
2026-02-12 17:45:47 +01:00
parent 5ac84e3690
commit cea8cdf4ee
44 changed files with 16005 additions and 9 deletions

49
viewer/lib/types.ts Normal file
View File

@@ -0,0 +1,49 @@
export interface TeacherReference {
name: string;
code: string;
}
export type AbsenceEntry =
| { type: 'wholeDay'; teacher: string; teacherCode: string }
| { type: 'single'; teacher: string; teacherCode: string; hours: string }
| { type: 'range'; teacher: string; teacherCode: string; hours: { from: string; to: string } }
| { type: 'exkurze'; teacher: string; teacherCode: string }
| { type: 'zastoupen'; teacher: string; teacherCode: string; zastupuje: { teacher: string | null } }
| { type: 'invalid'; original: string; teacher?: null; teacherCode?: null };
export interface ChangeEntry {
text: string;
backgroundColor?: string | null;
foregroundColor?: string | null;
}
export interface SubstitutionDayData {
info: { inWork: boolean };
takesPlace: string;
changes: Record<string, (ChangeEntry | null)[]>;
absence: AbsenceEntry[];
}
export interface SubstitutionData {
status: {
currentUpdateSchedule: number;
lastUpdated: string;
}
schedule: Record<string, SubstitutionDayData>;
}
export interface Hour {
subject: string;
title: string;
teacher: {
code: string;
name: string;
}
group?: string;
room: string;
}
export interface LocalData {
class: string;
timetable: Hour[][][];
}