schedule-kernel
Version:
The back-end core module used for storing/displaying the course schedule
79 lines • 2.25 kB
TypeScript
import { UUID } from "crypto";
/**
* 表示一节课程,包括开始时间、结束时间和关联的科目UUID。
*
* @property subjectUuid - 课程对应科目的唯一标识符(UUID)。
* @property timeUuid - 课程时间段的唯一标识符(UUID)。
* @property cachedName - 可选属性,缓存的课程名称。
* @property cachedShortName - 可选属性,缓存的课程短名称。
*/
export interface lessonTarget {
subjectName: string;
}
/**
* 表示一个科目,包括唯一标识符、名称、教师姓名和额外信息。
*
* @property uuid - 科目的唯一标识符(UUID)。
* @property name - 科目名称。
* @property type - 科目类型,可以是 "subject" 或 "activity"。
* @property shortName - 可选属性,科目的短名称。
* @property teacherName - 教师姓名。
* @property extra - 额外信息,如是否为户外课程。
*/
export interface subjectTarget {
name: string;
type: "subject" | "activity";
shortName?: string;
teacherName?: string;
extra?: {
outdoor?: boolean;
};
}
/**
* 表示一个时间段,包括开始时间和结束时间。
* 时间格式为 "HH:mm:ss"。
* @property startTime - 开始时间,格式为 "HH:mm:ss"。
* @property endTime - 结束时间,格式为 "HH:mm:ss"。
*/
export interface timeTarget {
startTime: string;
endTime: string;
}
/**
* 临时课程安排,用于特定日期的临时换课
*/
export interface temporarySchedule {
date: string;
lessons: lessonTarget[];
originalDayIndex: number;
originalWeek: number;
}
/**
* 表示一个课程表,包括课程列表和日期模式等信息。
*/
export interface scheduleType {
dateMode: boolean;
activeDate?: Date;
activeDay?: number;
activeWeek?: number;
timeUuid?: UUID;
lessons: lessonTarget[];
}
export interface timeTargets {
id: UUID;
name: string;
targets: timeTarget[];
}
/**
* 课程表配置类型
*/
export interface configType {
version: string;
groupName?: string;
startDate: Date;
schedules: scheduleType[];
subjects: subjectTarget[];
timeTargets: timeTargets[];
temporarySchedules?: temporarySchedule[];
}
//# sourceMappingURL=types.d.ts.map