1
0
Files
jecnarozvrh/viewer/lib/types.ts
2026-02-12 17:45:47 +01:00

50 lines
1.2 KiB
TypeScript

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[][][];
}