UNPKG

schedule-kernel

Version:

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

70 lines 2.7 kB
import { lessonTarget } from "../types"; export declare class LessonManager { private config; constructor(config: any); /** * 获取今日课程数据(已处理单双周) * @returns {lessonTaget[]} 今日课程数组 */ getTodayLessons(weekMode: string): lessonTarget[]; /** * 索引单个老师的全部课程 */ getTeacherLessons(teacherName: string): any; /** * 索引某个科目的全部课程 */ getSubjectLessons(subjectName: string): any; /** * 编辑周几第几节次的课程 * */ editLesson(dayIndex: 1 | 2 | 3 | 4 | 5 | 6 | 7, lessonIndex: number, subjectName: string, weekMode: string, week?: "odd" | "even"): boolean; /** * 交换两个课程 * @param source 源课程信息,包括星期几、节次和可选的单双周 * @param target 目标课程信息,包括星期几、节次和可选的单双周 * @param date 可选的日期,如果提供,则进行临时课程交换 * @param isTemporary 是否为临时交换,默认为 false * @returns 是否交换成功 */ swapLessons(source: { dayIndex: number; lessonIndex: number; week?: "odd" | "even"; }, target: { dayIndex: number; lessonIndex: number; week?: "odd" | "even"; }, date?: Date, isTemporary?: boolean): boolean; private swapTemporaryLessons; private swapRegularLessons; private updateTemporarySchedules; private getWeekTypeForDate; private getScheduleForDate; /** * 创建新的课节配置 * @param dayIndex 星期几(1-7) * @param subjectName 科目名称 * @param week 可选的周数设置(单周/双周) * @returns 添加的位置索引,失败返回-1 */ createLesson(dayIndex: 1 | 2 | 3 | 4 | 5 | 6 | 7, subjectName: string, week?: "odd" | "even"): number; /** * 在指定课节后添加新课节 * @param dayIndex 星期几(1-7) * @param lessonIndex 在此课节后添加 * @param subjectName 科目名称 * @param week 可选的周数设置(单周/双周) * @returns 是否添加成功 */ insertLessonAfter(dayIndex: 1 | 2 | 3 | 4 | 5 | 6 | 7, lessonIndex: number, subjectName: string, week?: "odd" | "even"): boolean; /** * 删除课节 * @param dayIndex 星期几(1-7) * @param lessonIndex 要删除的课节索引 * @param week 可选的周数设置(单周/双周) * @returns 是否删除成功 */ deleteLesson(dayIndex: 1 | 2 | 3 | 4 | 5 | 6 | 7, lessonIndex: number, week?: "odd" | "even"): boolean; } //# sourceMappingURL=lessonManager.d.ts.map