UNPKG

schedule-kernel

Version:

The back-end core module used for storing/displaying the course schedule

50 lines 1.56 kB
import { configType } from "./types"; import { LessonManager } from "./managers/lessonManager"; import { SubjectManager } from "./managers/subjectManager"; import { TimeManager } from "./managers/timeManager"; /** * 课程表内核类,用于加载和管理课程表配置。 * * @remarks * 构造函数会尝试读取并解析指定路径下的配置文件内容。 * 如果文件读取失败或格式错误,会抛出异常。 * 配置对象会与默认配置合并,确保 `timetables` 和 `subjects` 字段为数组,`startDate` 字段为 `Date` 类型。 * 根据当前日期与配置中的 `startDate` 的天数差,自动设置 `weekMode` 属性为 "all"、"even" 或 "odd"。 */ export declare class ScheduleKernel { configPath: string; /** * 当前课程表配置对象。 */ config: configType; /** * 当前周模式,可为 "odd"(单周)、"even"(双周)、"all"(全部)。 */ weekMode: "odd" | "even" | "all"; /** * 课程管理器 */ lessonManager: LessonManager; /** * 科目管理器 */ subjectManager: SubjectManager; /** * 时间管理器 */ timeManager: TimeManager; /** * 构造函数,初始化配置文件路径并加载配置。 */ constructor(configPath: string); /** * 设定单双周状态 */ setWeekMode(date: Date): void; emptyConfig(): boolean; /** * 保存当前配置到本地文件 */ saveConfig(): boolean; } //# sourceMappingURL=scheduleKernel.d.ts.map