Some ignored filles was missing
This commit is contained in:
parent
7db22245e2
commit
fd5ab6bc0d
268 changed files with 31970 additions and 4 deletions
51
wwwroot/js/repositories/IEventRepository.d.ts
vendored
Normal file
51
wwwroot/js/repositories/IEventRepository.d.ts
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
import { ICalendarEvent } from '../types/CalendarTypes';
|
||||
/**
|
||||
* Update source type
|
||||
* - 'local': Changes made by the user locally (needs sync)
|
||||
* - 'remote': Changes from API/SignalR (already synced)
|
||||
*/
|
||||
export type UpdateSource = 'local' | 'remote';
|
||||
/**
|
||||
* IEventRepository - Interface for event data access
|
||||
*
|
||||
* Abstracts the data source for calendar events, allowing easy switching
|
||||
* between IndexedDB, REST API, GraphQL, or other data sources.
|
||||
*
|
||||
* Implementations:
|
||||
* - IndexedDBEventRepository: Local storage with offline support
|
||||
* - MockEventRepository: (Legacy) Loads from local JSON file
|
||||
* - ApiEventRepository: (Future) Loads from backend API
|
||||
*/
|
||||
export interface IEventRepository {
|
||||
/**
|
||||
* Load all calendar events from the data source
|
||||
* @returns Promise resolving to array of ICalendarEvent objects
|
||||
* @throws Error if loading fails
|
||||
*/
|
||||
loadEvents(): Promise<ICalendarEvent[]>;
|
||||
/**
|
||||
* Create a new event
|
||||
* @param event - Event to create (without ID, will be generated)
|
||||
* @param source - Source of the update ('local' or 'remote')
|
||||
* @returns Promise resolving to the created event with generated ID
|
||||
* @throws Error if creation fails
|
||||
*/
|
||||
createEvent(event: Omit<ICalendarEvent, 'id'>, source?: UpdateSource): Promise<ICalendarEvent>;
|
||||
/**
|
||||
* Update an existing event
|
||||
* @param id - ID of the event to update
|
||||
* @param updates - Partial event data to update
|
||||
* @param source - Source of the update ('local' or 'remote')
|
||||
* @returns Promise resolving to the updated event
|
||||
* @throws Error if update fails or event not found
|
||||
*/
|
||||
updateEvent(id: string, updates: Partial<ICalendarEvent>, source?: UpdateSource): Promise<ICalendarEvent>;
|
||||
/**
|
||||
* Delete an event
|
||||
* @param id - ID of the event to delete
|
||||
* @param source - Source of the update ('local' or 'remote')
|
||||
* @returns Promise resolving when deletion is complete
|
||||
* @throws Error if deletion fails or event not found
|
||||
*/
|
||||
deleteEvent(id: string, source?: UpdateSource): Promise<void>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue