Skip to content

Commit

Permalink
build(site): Fix les erreurs Typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
farnoux authored and mariheck committed Oct 2, 2024
1 parent 393f8cc commit eafe57a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
1 change: 0 additions & 1 deletion packages/site/components/carte/CarteContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
15 changes: 9 additions & 6 deletions packages/ui/src/components/tracking/Consent.tsx
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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();
});
Expand Down

0 comments on commit eafe57a

Please sign in to comment.