Merge branch 'feat/inda-383-daily-stat' into 'main'
[ProtonMail-WebClient.git] / packages / shared / lib / interfaces / calendar / Import.ts
blob3a05fa6dea6a66afc318de206e99d40b04b93e6d
1 import type { ICAL_METHOD } from '../../calendar/constants';
2 import type { ImportEventError } from '../../calendar/icsSurgery/ImportEventError';
3 import type { ImportFatalError } from '../../calendar/import/ImportFatalError';
4 import type { ImportFileError } from '../../calendar/import/ImportFileError';
5 import type { CalendarCreateEventBlobData } from './Api';
6 import type { VisualCalendar } from './Calendar';
7 import type { SyncMultipleApiSuccessResponses } from './Event';
8 import type { VcalVeventComponent } from './VcalModel';
10 export enum IMPORT_STEPS {
11     ATTACHING,
12     ATTACHED,
13     WARNING_IMPORT_INVITATION,
14     WARNING_PARTIAL_IMPORT,
15     IMPORTING,
16     FINISHED,
19 export interface ImportCalendarModel {
20     step: IMPORT_STEPS;
21     fileAttached?: File;
22     method?: ICAL_METHOD;
23     hashedIcs?: string;
24     eventsParsed: VcalVeventComponent[];
25     totalEncrypted: number;
26     totalImported: number;
27     visibleErrors: ImportEventError[];
28     hiddenErrors: ImportEventError[];
29     failure?: ImportFatalError | ImportFileError | Error;
30     calendar: VisualCalendar;
31     loading: boolean;
34 export interface EncryptedEvent {
35     component: VcalVeventComponent;
36     data: CalendarCreateEventBlobData;
39 export interface ImportedEvent extends EncryptedEvent {
40     response: SyncMultipleApiSuccessResponses;