initial commit
This commit is contained in:
45
shared/lessons.d.ts
vendored
Normal file
45
shared/lessons.d.ts
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
interface LessonLike {
|
||||
day: number;
|
||||
date: string | null;
|
||||
start: string;
|
||||
end: string | null;
|
||||
subject: string;
|
||||
teacher: string;
|
||||
room: string;
|
||||
type: string;
|
||||
condition: string;
|
||||
variant: "all" | "upper" | "lower";
|
||||
groups: string[];
|
||||
subgroups: { group: string; label: string }[];
|
||||
}
|
||||
export interface FieldChange {
|
||||
field: string;
|
||||
label: string;
|
||||
from: string | number;
|
||||
to: string | number;
|
||||
}
|
||||
export interface ScheduleDiff<L> {
|
||||
added: L[];
|
||||
removed: L[];
|
||||
changed: { before: L; after: L; fields: FieldChange[] }[];
|
||||
}
|
||||
export interface PersonalPrefs {
|
||||
subgroup?: string | null;
|
||||
hidden?: string[];
|
||||
}
|
||||
export function lessonKey(lesson: LessonLike, group: string): string;
|
||||
export function diffSchedules<L extends LessonLike>(
|
||||
before: { lessons: L[] } | null | undefined,
|
||||
after: { lessons: L[] } | null | undefined,
|
||||
group: string,
|
||||
): ScheduleDiff<L>;
|
||||
export function changeCount(diff: ScheduleDiff<unknown> | null | undefined): number;
|
||||
export function personalFilter(
|
||||
lesson: LessonLike,
|
||||
group: string,
|
||||
prefs: PersonalPrefs | null | undefined,
|
||||
): "shown" | "hidden" | "other-subgroup";
|
||||
export function subgroupsOf(
|
||||
schedule: { lessons: LessonLike[] } | null | undefined,
|
||||
group: string,
|
||||
): string[];
|
||||
Reference in New Issue
Block a user