type ConsentModifyMode = 'read' | 'write'; type PreferenceType = 'terms' | 'privacy' | 'other'; type ConsentId = string; interface CustomDataItem { key: string; value: string; } type ConsentRead = { actionTimestamp: string; lastConsentModified: string; language: string; docVersion: number; docDate: string; customData: CustomDataItem[]; }; type ConsentWrite = { isConsentGranted: boolean; tags?: string[]; entitlements?: string[]; }; type Consent = TMode extends 'read' ? ConsentRead & ConsentWrite : TMode extends 'write' ? ConsentWrite : never; interface Preferences { [key: ConsentId]: Consent; } export type { Consent, ConsentId, ConsentModifyMode, CustomDataItem, PreferenceType, Preferences, Preferences as default };