ENGLISH·COURSE API
    Preparing search index...
    • Where the current lesson sits inside its own module.

      Parameters

      • lessons: readonly (
            | {
                kind: "reading";
                id: string & $brand<"LessonId">;
                courseId: string & $brand<"CourseId">;
                moduleId: string & $brand<"ModuleId">;
                sequence: number;
                title: string;
                body: string;
            }
            | {
                kind: "video";
                id: string & $brand<"LessonId">;
                courseId: string & $brand<"CourseId">;
                moduleId: string & $brand<"ModuleId">;
                sequence: number;
                title: string;
                description: string;
                source: string;
                durationSeconds: number;
                poster?: string;
                uploadDate?: string;
            }
        )[]

        The course's lessons, in any order

      • currentLessonId: string & $brand<"LessonId">

        The lesson being viewed

      Returns LessonPosition | undefined

      The lesson's position within its module, or undefined when the course holds no such lesson — the caller renders no reading rather than an invented "0 of 27"

      Derived from the course structure alone — never from localStorage — so the reading is available during server rendering and does not appear at hydration the way a watch-progress meter does.

      Ordering comes from sequence rather than the order the caller happens to hold the lessons in, so a caller passing an unsorted list gets the same answer as one passing a sorted one.

      lessonPositionInModule(lessons, currentLessonId); // { position: 13, total: 27 }