1 import type { ImportContactError } from '../../contacts/errors/ImportContactError';
2 import type { ImportFatalError } from '../../contacts/errors/ImportFatalError';
3 import type { ImportFileError } from '../../contacts/errors/ImportFileError';
4 import type { ContactCard, ContactGroup, ContactValue } from './Contact';
5 import type { VCardContact, VCardKey } from './VCard';
7 export enum IMPORT_STEPS {
17 export enum IMPORT_GROUPS_ACTION {
23 export enum EXTENSION {
28 export type ACCEPTED_EXTENSIONS = EXTENSION.CSV | EXTENSION.VCF;
30 export interface ParsedCsvContacts {
35 export interface ImportCategories {
37 totalContacts: number;
39 contactEmailIDs: string[];
40 action: IMPORT_GROUPS_ACTION;
41 targetGroup: ContactGroup;
46 export interface ImportContactsModel {
49 extension?: ACCEPTED_EXTENSIONS;
50 preVcardsContacts?: PreVcardsContact[];
51 parsedVcardContacts: VCardContact[];
52 importedContacts: ImportedContact[];
53 totalEncrypted: number;
54 totalImported: number;
55 errors: ImportContactError[];
56 failure?: ImportFatalError | ImportFileError | Error;
58 contactGroups?: ContactGroup[];
59 categories: ImportCategories[];
62 export interface SimpleEncryptedContact {
63 contact: { Cards: ContactCard[]; error?: Error };
67 export interface EncryptedContact extends SimpleEncryptedContact {
68 contactEmails: { email: string; group?: string }[];
69 categories: { name: string; group?: string }[];
72 export interface ImportedContact {
74 contactEmailIDs: string[];
75 categories: { name: string; contactEmailIDs?: string[] }[];
78 export interface Combine {
79 [key: string]: (preVcards: PreVcardsProperty) => any;
82 export interface Display {
83 [key: string]: (preVcards: PreVcardsProperty) => string;
86 export interface PreVcardProperty {
94 combineIndex?: number;
98 export type PreVcardsProperty = PreVcardProperty[];
100 export type PreVcardsContact = PreVcardsProperty[];