Files
bookhoard/web/src/types
john-okeefe 9ef94efeb5 feat(dashboard): implement Phase 6 TypeScript type definitions
Add TypeScript interfaces for Carousel-style dashboard to api.d.ts:

New Interfaces:
1. SectionData
   - Matches handlers.SectionData in collections.go (lines 73-81)
   - id: Collection name (string)
   - is_system: Boolean flag (true for system collections, false for user)
   - title: Display title
   - description: Collection description
   - icon: Emoji icon
   - items: Array of BookInfo objects
   - view_all_url: URL to view all items (system collections only)
   - priority: Display order (lower numbers first)

2. DashboardPreferences
   - Matches database.UserDashboardPreferences (models.go:381-390)
   - library_id: Library UUID
   - hidden_collections: Array of collection names to hide
   - collection_order: Array of collection names for custom ordering
   - items_per_section: Number of items per section

Existing Interface:
- BookInfo: Already defined (media_item_id, title, author, cover_image_path)
  - Reused by SectionData for items array
  - No duplicate definitions needed

Key Compliance:
- is_system: boolean matches database is_system_collection field
- media_item_id matches Go BookInfo.MediaItemID field
- Uses existing BookInfo struct (no duplicates)
- Added to existing api.d.ts file (follows established pattern)
2026-02-19 21:05:59 -05:00
..