71 lines
2.1 KiB
TypeScript
71 lines
2.1 KiB
TypeScript
import { DateService } from '../utils/DateService';
|
|
import { Configuration } from '../configurations/CalendarConfig';
|
|
import { PositionUtils } from '../utils/PositionUtils';
|
|
/**
|
|
* Work hours for a specific day
|
|
*/
|
|
export interface IDayWorkHours {
|
|
start: number;
|
|
end: number;
|
|
}
|
|
/**
|
|
* Work schedule configuration
|
|
*/
|
|
export interface IWorkScheduleConfig {
|
|
weeklyDefault: {
|
|
monday: IDayWorkHours | 'off';
|
|
tuesday: IDayWorkHours | 'off';
|
|
wednesday: IDayWorkHours | 'off';
|
|
thursday: IDayWorkHours | 'off';
|
|
friday: IDayWorkHours | 'off';
|
|
saturday: IDayWorkHours | 'off';
|
|
sunday: IDayWorkHours | 'off';
|
|
};
|
|
dateOverrides: {
|
|
[dateString: string]: IDayWorkHours | 'off';
|
|
};
|
|
}
|
|
/**
|
|
* Manages work hours scheduling with weekly defaults and date-specific overrides
|
|
*/
|
|
export declare class WorkHoursManager {
|
|
private dateService;
|
|
private config;
|
|
private positionUtils;
|
|
private workSchedule;
|
|
constructor(dateService: DateService, config: Configuration, positionUtils: PositionUtils);
|
|
/**
|
|
* Get work hours for a specific date
|
|
*/
|
|
getWorkHoursForDate(date: Date): IDayWorkHours | 'off';
|
|
/**
|
|
* Get work hours for multiple dates (used by GridManager)
|
|
*/
|
|
getWorkHoursForDateRange(dates: Date[]): Map<string, IDayWorkHours | 'off'>;
|
|
/**
|
|
* Calculate CSS custom properties for non-work hour overlays using PositionUtils
|
|
*/
|
|
calculateNonWorkHoursStyle(workHours: IDayWorkHours | 'off'): {
|
|
beforeWorkHeight: number;
|
|
afterWorkTop: number;
|
|
} | null;
|
|
/**
|
|
* Calculate CSS custom properties for work hours overlay using PositionUtils
|
|
*/
|
|
calculateWorkHoursStyle(workHours: IDayWorkHours | 'off'): {
|
|
top: number;
|
|
height: number;
|
|
} | null;
|
|
/**
|
|
* Load work schedule from JSON (future implementation)
|
|
*/
|
|
loadWorkSchedule(jsonData: IWorkScheduleConfig): Promise<void>;
|
|
/**
|
|
* Get current work schedule configuration
|
|
*/
|
|
getWorkSchedule(): IWorkScheduleConfig;
|
|
/**
|
|
* Convert Date to day name key
|
|
*/
|
|
private getDayName;
|
|
}
|