import * as _storyteller_platform_ghost_story from '@storyteller-platform/ghost-story'; import { TimelineEntry } from '@storyteller-platform/ghost-story'; import { SegmentationResult } from '@echogarden/text-segmentation'; import { Mapping } from '@storyteller-platform/mapping'; type StorytellerTimelineEntry = TimelineEntry & { audiofile: string; }; type StorytellerTranscription = { transcript: string; timeline: StorytellerTimelineEntry[]; }; type SentenceRange = { id: number; chapterId: string; start: number; end: number; audiofile: string; }; type WordRange = { id: number; chapterId: string; sentenceId: number; start: number; end: number; audiofile: string; }; declare function findEndTimestamp(matchEndIndex: number, timeline: MappedTimeline): { start: number; end: number; audiofile: string; } | null; declare function mapTranscriptionTimeline(transcription: StorytellerTranscription, mapping: Mapping): { mappedStartOffsetUtf16: number; mappedEndOffsetUtf16: number; type: _storyteller_platform_ghost_story.TimelineEntryType; text: string; startTime: number; endTime: number; startOffsetUtf16?: number; endOffsetUtf16?: number; startOffsetUtf32?: number; endOffsetUtf32?: number; confidence?: number; id?: number; timeline?: _storyteller_platform_ghost_story.Timeline; audiofile: string; }[]; type MappedTimeline = ReturnType; declare function getSentenceRanges(transcriptionText: string, mappedTimeline: MappedTimeline, sentences: SegmentationResult["sentences"], chapterId: string, chapterOffset: number, chapterEndOffset: number, granularity: "sentence" | "word", locale: Intl.Locale): Promise<{ sentenceRanges: SentenceRange[]; wordRanges: WordRange[][]; transcriptionOffset: number; firstFoundSentence: number; lastFoundSentence: number; }>; /** * Whisper sometimes provides words with no time information, * or start and end timestamps that are equal. EpubCheck complains * about these, so we nudge them out a bit to make sure that they're * not truly equal. */ declare function expandEmptySentenceRanges(sentenceRanges: Range[]): Range[]; declare function collapseSentenceRangeGaps(sentenceRanges: SentenceRange[]): Promise; declare function getChapterDuration(sentenceRanges: SentenceRange[]): number; export { type MappedTimeline, type SentenceRange, type StorytellerTimelineEntry, type StorytellerTranscription, type WordRange, collapseSentenceRangeGaps, expandEmptySentenceRanges, findEndTimestamp, getChapterDuration, getSentenceRanges, mapTranscriptionTimeline };