/** * Pure, DOM-free chapter helpers. Extracted so the seek-bar marker math and the * active-chapter tracking that drives `vz-chapter-change` can be unit-tested * without a renderer or a real media element. */ export interface PlayerChapter { id: string; title: string; /** Start offset in seconds. Chapters are contiguous (end = next start). */ startTime: number; sortOrder: number; } export interface ChapterMarker { id: string; title: string; startTime: number; /** Fractional position along the seek bar in [0, 1]. */ position: number; } /** A chapter as parsed from the DOM/delivery, before ids/order are normalized. */ export interface RawChapter { id?: string | null; title: string; startTime: number; sortOrder?: number | null; } /** * Turn raw parsed chapters (from `` children or a delivery config) * into a sorted, fully-populated list: sort by startTime, then fill any missing * id with a stable `chapter-` index and default sortOrder from position. */ export declare function normalizeChapters(raw: RawChapter[]): PlayerChapter[]; /** Return a new array sorted by startTime ascending (input untouched). */ export declare function sortChapters(chapters: PlayerChapter[]): PlayerChapter[]; /** * The chapter active at `currentTime`: the last chapter whose startTime is at or * before it (chapters are contiguous). Returns null when the time precedes the * first chapter or the list is empty. Accepts unsorted input. */ export declare function resolveActiveChapter(chapters: PlayerChapter[], currentTime: number): PlayerChapter | null; /** * Map each chapter to a fractional seek-bar position (startTime / duration), * clamped to [0, 1] and sorted by startTime. Returns [] until the duration is * known (0 or negative), so callers can re-run when `duration` resolves. */ export declare function chapterMarkerPositions(chapters: PlayerChapter[], duration: number): ChapterMarker[]; //# sourceMappingURL=chapter-logic.d.ts.map