Calendar/src/repositories/IEventRepository.ts

21 lines
642 B
TypeScript
Raw Normal View History

2025-11-03 21:30:50 +01:00
import { ICalendarEvent } from '../types/CalendarTypes';
2025-11-03 14:54:57 +01:00
/**
* IEventRepository - Interface for event data loading
*
* Abstracts the data source for calendar events, allowing easy switching
* between mock data, REST API, GraphQL, or other data sources.
*
* Implementations:
* - MockEventRepository: Loads from local JSON file
* - ApiEventRepository: (Future) Loads from backend API
*/
export interface IEventRepository {
/**
* Load all calendar events from the data source
2025-11-03 21:30:50 +01:00
* @returns Promise resolving to array of ICalendarEvent objects
2025-11-03 14:54:57 +01:00
* @throws Error if loading fails
*/
2025-11-03 21:30:50 +01:00
loadEvents(): Promise<ICalendarEvent[]>;
2025-11-03 14:54:57 +01:00
}