feat: add TypeScript types for highlights and sync system
Added highlight system types with strict color and sync status validation: - HighlightColor type with 4 valid colors (yellow, orange, pink, blue) - SyncStatus type for tracking sync state (pending, syncing, synced, error) - BibleHighlight interface with full metadata support - HighlightSyncQueueItem for offline sync queue management - CrossReference interface for verse cross-referencing Includes comprehensive test coverage validating type constraints. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -94,3 +94,33 @@ export interface CacheEntry {
|
||||
timestamp: number
|
||||
expiresAt: number
|
||||
}
|
||||
|
||||
// Highlight system types
|
||||
export type HighlightColor = 'yellow' | 'orange' | 'pink' | 'blue'
|
||||
export type SyncStatus = 'pending' | 'syncing' | 'synced' | 'error'
|
||||
|
||||
export interface BibleHighlight {
|
||||
id: string // UUID
|
||||
verseId: string
|
||||
userId?: string // Optional, added by backend
|
||||
color: HighlightColor
|
||||
createdAt: number // timestamp
|
||||
updatedAt: number // timestamp
|
||||
syncStatus: SyncStatus
|
||||
syncErrorMsg?: string
|
||||
}
|
||||
|
||||
export interface HighlightSyncQueueItem {
|
||||
highlightId: string
|
||||
action: 'create' | 'update' | 'delete'
|
||||
highlight: BibleHighlight
|
||||
retryCount: number
|
||||
}
|
||||
|
||||
export interface CrossReference {
|
||||
refVerseId: string
|
||||
bookName: string
|
||||
chapter: number
|
||||
verse: number
|
||||
preview: string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user