Add study data client adapter

This commit is contained in:
2026-07-15 16:13:51 -05:00
parent 7f917b9560
commit de383596c7
4 changed files with 132 additions and 37 deletions
+26
View File
@@ -0,0 +1,26 @@
import type {
AudioBibleContext,
AudioBibleSegment,
CommentaryEntry,
DictionaryEntry,
Footnote,
LibraryState,
MapContext,
TranslationResource,
Verse,
} from './types'
export type TranslationNotesByVerse = Map<string, { footnotes: Footnote[]; studyNotes: Footnote[] }>
export type StudyDataClient = {
getTranslations(): Promise<TranslationResource[]>
getLibraryState(translationId?: string): Promise<LibraryState>
getTranslationNotesForVerses(translationId: string, verses: Verse[]): Promise<TranslationNotesByVerse>
searchVerses(query: string, translationId?: string): Promise<Verse[]>
addTagToVerse(verseId: number, label: string, color: string, translationId?: string): Promise<Verse>
getCommentaryForVerse(verse: Verse): Promise<CommentaryEntry[]>
getDictionaryEntriesForTerms(terms: string[]): Promise<DictionaryEntry[]>
getMapContextForVerses(selectedVerse: Verse, pageVerses: Verse[]): Promise<MapContext>
getAudioContextForVerse(translationId: string, verse: Verse): Promise<AudioBibleContext | null>
getAudioObjectUrl(segment: AudioBibleSegment): Promise<string>
}