diff --git a/packages/site/components/carte/CarteContainer.tsx b/packages/site/components/carte/CarteContainer.tsx index 9e9e66e2b5..990ee3c11e 100644 --- a/packages/site/components/carte/CarteContainer.tsx +++ b/packages/site/components/carte/CarteContainer.tsx @@ -13,7 +13,6 @@ import './style.css'; */ function Debugger() { const map = useMap(); - // @ts-expect-error erreur non gérée window['map'] = map; return null; } diff --git a/packages/ui/src/components/tracking/Consent.tsx b/packages/ui/src/components/tracking/Consent.tsx index 06de4127aa..bb78425c0b 100644 --- a/packages/ui/src/components/tracking/Consent.tsx +++ b/packages/ui/src/components/tracking/Consent.tsx @@ -1,4 +1,9 @@ -import React from 'react'; +declare global { + interface Window { + axeptioSettings: { clientId: string }; + _axcb: { push: (callback: (sdk: unknown) => void) => void }; + } +} /** * Une partie des props du composant Script de Next. @@ -45,18 +50,16 @@ export function Consent({ consentId: string; }) { if (typeof window !== 'undefined') { - // @ts-expect-error typage dynamique window.axeptioSettings = { clientId: consentId }; } return ( <> {script({ - src: 'https://static.axept.io/sdk.js', + src: 'https://static.axept.io/sdk-slim.js', onLoad: () => { - // @ts-expect-error typage dynamique - window._axcb.push(function (sdk: unknown) { - // @ts-expect-error typage dynamique + window._axcb.push((sdk) => { + // @ts-expect-error type unknown sdk.on('consent:saved', function () { onConsentSave(); });