diff --git a/web/src/types/api.d.ts b/web/src/types/api.d.ts index 5264f28..fc1b4a8 100644 --- a/web/src/types/api.d.ts +++ b/web/src/types/api.d.ts @@ -97,6 +97,31 @@ export interface BookInfo { cover_image_path: string; } +// Dashboard type definitions +// CRITICAL: Must match Go handler return types EXACTLY +// Source: handlers.SectionData in collections.go (lines 73-81) +// Used in: dashboard API responses, TypeScript dashboard components +export interface SectionData { + id: string; + is_system: boolean; + title: string; + description: string; + icon: string; + items: BookInfo[]; + view_all_url: string; + priority: number; +} + +// Matches database.UserDashboardPreferences and dashboard preferences API +// Source: internal/database/models.go:381-390 +// Used in: dashboard preferences API +export interface DashboardPreferences { + library_id: string; + hidden_collections: string[]; + collection_order: string[]; + items_per_section: number; +} + // Matches handlers.UnlinkedBookData JSON response // Used in: unlinked_books.ts, unlinked_books.templ export interface UnlinkedBookData {