47 lines
1.2 KiB
JavaScript
47 lines
1.2 KiB
JavaScript
/**
|
|
* @typedef {Object} UserConsent
|
|
* @property {boolean} analytics
|
|
* @property {boolean} marketing
|
|
*/
|
|
|
|
/**
|
|
* @typedef {Object} RegionDefault
|
|
* @property {string[]} regions
|
|
* @property {"granted"|"denied"} [ad_storage]
|
|
* @property {"granted"|"denied"} [analytics_storage]
|
|
* @property {"granted"|"denied"} [ad_user_data]
|
|
* @property {"granted"|"denied"} [ad_personalization]
|
|
* @property {"granted"|"denied"} [functionality_storage]
|
|
* @property {"granted"|"denied"} [personalization_storage]
|
|
* @property {"granted"|"denied"} [security_storage]
|
|
*/
|
|
|
|
/**
|
|
* @typedef {Object} ConsentConfig
|
|
* @property {string} [storageKey]
|
|
* @property {number} [waitForUpdateMs]
|
|
* @property {boolean} [adsDataRedaction]
|
|
* @property {boolean} [urlPassthrough]
|
|
* @property {RegionDefault[]} [regionDefaults]
|
|
* @property {boolean} [debug]
|
|
* @property {(error: { reason: string, detail?: unknown }) => void} [onStorageError]
|
|
*/
|
|
|
|
/**
|
|
* @typedef {Object} ConsentResult
|
|
* @property {true} ok
|
|
* @property {UserConsent} consent
|
|
*/
|
|
|
|
/**
|
|
* @typedef {Object} ConsentError
|
|
* @property {false} ok
|
|
* @property {"invalid"|"storage"} reason
|
|
*/
|
|
|
|
/**
|
|
* @typedef {ConsentResult|ConsentError} PersistResult
|
|
*/
|
|
|
|
export {};
|