const getConsentState:()

in libs/@guardian/libs/src/consent-management-platform/onConsentChange.ts [95:109]


const getConsentState: () => Promise<ConsentState> = async () => {
	switch (getCurrentFramework()) {
		case 'aus':
			return enhanceConsentState({ aus: await getAUSConsentState() });
		case 'usnat': {
			return enhanceConsentState({
				usnat: await getUSNATConsentState(),
			});
		}
		case 'tcfv2':
			return enhanceConsentState({ tcfv2: await getTCFv2ConsentState() });
		default:
			throw new Error('no IAB consent framework found on the page');
	}
};