Skip to main content
The Course type represents a parsed course containing a sequence of lessons and labs.

Course

Top-level course structure.
title
string
required
Course title
steps
readonly CourseStep[]
required
Ordered sequence of lessons and labs

CourseStep

Discriminated union representing a single step in the course.

Usage Example

import type { Course } from "@/types/course";

function renderCourse(course: Course) {
  return course.steps.map((step, i) => {
    if (step.kind === "lesson") {
      return <LessonView key={i} lesson={step.lesson} title={step.title} />;
    } else {
      return <LabView key={i} lab={step.lab} title={step.title} />;
    }
  });
}

Build docs developers (and LLMs) love