Some ignored filles was missing
This commit is contained in:
parent
7db22245e2
commit
fd5ab6bc0d
268 changed files with 31970 additions and 4 deletions
97
wwwroot/js/storage/IndexedDBService.d.ts
vendored
Normal file
97
wwwroot/js/storage/IndexedDBService.d.ts
vendored
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
import { ICalendarEvent } from '../types/CalendarTypes';
|
||||
/**
|
||||
* Operation for the sync queue
|
||||
*/
|
||||
export interface IQueueOperation {
|
||||
id: string;
|
||||
type: 'create' | 'update' | 'delete';
|
||||
eventId: string;
|
||||
data: Partial<ICalendarEvent> | ICalendarEvent;
|
||||
timestamp: number;
|
||||
retryCount: number;
|
||||
}
|
||||
/**
|
||||
* IndexedDB Service for Calendar App
|
||||
* Handles local storage of events and sync queue
|
||||
*/
|
||||
export declare class IndexedDBService {
|
||||
private static readonly DB_NAME;
|
||||
private static readonly DB_VERSION;
|
||||
private static readonly EVENTS_STORE;
|
||||
private static readonly QUEUE_STORE;
|
||||
private static readonly SYNC_STATE_STORE;
|
||||
private db;
|
||||
private initialized;
|
||||
/**
|
||||
* Initialize and open the database
|
||||
*/
|
||||
initialize(): Promise<void>;
|
||||
/**
|
||||
* Check if database is initialized
|
||||
*/
|
||||
isInitialized(): boolean;
|
||||
/**
|
||||
* Ensure database is initialized
|
||||
*/
|
||||
private ensureDB;
|
||||
/**
|
||||
* Get a single event by ID
|
||||
*/
|
||||
getEvent(id: string): Promise<ICalendarEvent | null>;
|
||||
/**
|
||||
* Get all events
|
||||
*/
|
||||
getAllEvents(): Promise<ICalendarEvent[]>;
|
||||
/**
|
||||
* Save an event (create or update)
|
||||
*/
|
||||
saveEvent(event: ICalendarEvent): Promise<void>;
|
||||
/**
|
||||
* Delete an event
|
||||
*/
|
||||
deleteEvent(id: string): Promise<void>;
|
||||
/**
|
||||
* Add operation to queue
|
||||
*/
|
||||
addToQueue(operation: Omit<IQueueOperation, 'id'>): Promise<void>;
|
||||
/**
|
||||
* Get all queue operations (sorted by timestamp)
|
||||
*/
|
||||
getQueue(): Promise<IQueueOperation[]>;
|
||||
/**
|
||||
* Remove operation from queue
|
||||
*/
|
||||
removeFromQueue(id: string): Promise<void>;
|
||||
/**
|
||||
* Clear entire queue
|
||||
*/
|
||||
clearQueue(): Promise<void>;
|
||||
/**
|
||||
* Save sync state value
|
||||
*/
|
||||
setSyncState(key: string, value: any): Promise<void>;
|
||||
/**
|
||||
* Get sync state value
|
||||
*/
|
||||
getSyncState(key: string): Promise<any | null>;
|
||||
/**
|
||||
* Serialize event for IndexedDB storage (convert Dates to ISO strings)
|
||||
*/
|
||||
private serializeEvent;
|
||||
/**
|
||||
* Deserialize event from IndexedDB (convert ISO strings to Dates)
|
||||
*/
|
||||
private deserializeEvent;
|
||||
/**
|
||||
* Close database connection
|
||||
*/
|
||||
close(): void;
|
||||
/**
|
||||
* Delete entire database (for testing/reset)
|
||||
*/
|
||||
static deleteDatabase(): Promise<void>;
|
||||
/**
|
||||
* Seed IndexedDB with mock data if empty
|
||||
*/
|
||||
seedIfEmpty(mockDataUrl?: string): Promise<void>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue