From e642b0fa3e5f7a47b48510cd77081fc52fc54f96 Mon Sep 17 00:00:00 2001 From: Stephen Adamson Date: Sun, 5 Jul 2026 11:55:45 +0100 Subject: [PATCH] fix: move BookingFlow window type to app.d.ts and fix authHeaders typing Move __bookingFlowCountdownInterval from inline declare global in BookingFlow.svelte to global app.d.ts. Fix authHeaders type from {} to undefined to satisfy TypeScript. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- frontend/src/app.d.ts | 1 + frontend/src/lib/components/booking/BookingFlow.svelte | 10 ++-------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/frontend/src/app.d.ts b/frontend/src/app.d.ts index e5e13f7..99ea21c 100644 --- a/frontend/src/app.d.ts +++ b/frontend/src/app.d.ts @@ -13,6 +13,7 @@ declare global { __walkInCountdownInterval?: ReturnType; __walkInModalCountdownInterval?: ReturnType; __bookingCreateCountdownInterval?: ReturnType; + __bookingFlowCountdownInterval?: ReturnType | null; } } diff --git a/frontend/src/lib/components/booking/BookingFlow.svelte b/frontend/src/lib/components/booking/BookingFlow.svelte index 62cb08b..5049d4c 100644 --- a/frontend/src/lib/components/booking/BookingFlow.svelte +++ b/frontend/src/lib/components/booking/BookingFlow.svelte @@ -27,12 +27,6 @@ import { onDestroy } from 'svelte'; import { SvelteDate } from 'svelte/reactivity'; - declare global { - interface Window { - __bookingFlowCountdownInterval?: ReturnType | null; - } - } - // Components import BookingActions from '$lib/components/booking/BookingActions.svelte'; import BookingSummary from '$lib/components/booking/BookingSummary.svelte'; @@ -688,7 +682,7 @@ loadingAvailableHours = true; try { - const authHeaders = authStore.currentToken ? { Authorization: `Bearer ${authStore.currentToken}` } : {}; + const authHeaders: RequestInit['headers'] = authStore.currentToken ? { Authorization: `Bearer ${authStore.currentToken}` } : undefined; const [whRes, ahRes] = await Promise.all([ fetch(`/api/scheduling/working-hours?start=${startStr}&end=${endStr}`, { headers: authHeaders }), fetch(`/api/scheduling/available-hours?start=${startStr}&end=${endStr}`, { headers: authHeaders }) @@ -782,7 +776,7 @@ const startStr = startOfMonth.toString(); const endStr = endOfMonth.toString(); - const authHeaders = authStore.currentToken ? { Authorization: `Bearer ${authStore.currentToken}` } : {}; + const authHeaders: RequestInit['headers'] = authStore.currentToken ? { Authorization: `Bearer ${authStore.currentToken}` } : undefined; // Fetch working hours const workingHoursResponse = await fetch(