> ## Documentation Index
> Fetch the complete documentation index at: https://docs.edpire.com/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript Catalog

> Every exported type and which subpath it comes from.

The SDK is fully typed. This page maps each public type to the entry point that exports it, so you always know where to import from.

## Quick map

| Type                                                                                                     | Import from                                          |
| -------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| `RuntimeAnswer` and variants                                                                             | `@edpire/sdk` or `@edpire/sdk/react`                 |
| `MountOptions`, `EmbedInstance`, `EmbedResult`, `EmbedError`                                             | `@edpire/sdk`                                        |
| `RenderQuestionOptions`, `QuestionInstance`                                                              | `@edpire/sdk`                                        |
| `FlatStep`                                                                                               | `@edpire/sdk`                                        |
| `StoredAnswer`                                                                                           | `@edpire/sdk` (also `@edpire/sdk/client`)            |
| `EdpireQuestionProps`, `AssessmentShellProps`                                                            | `@edpire/sdk/react`                                  |
| `TakeBranding`, `SubmitResult`, `ExerciseFeedbackData`, `QuestionFeedback`, `NodeFeedback`, `NodeDetail` | `@edpire/sdk/react` (subset also from `@edpire/sdk`) |
| `OverlayConfig`, `SpinnerTheme`                                                                          | `@edpire/sdk` or `@edpire/sdk/react`                 |
| `ShellLocale`                                                                                            | `@edpire/sdk` or `@edpire/sdk/react`                 |
| Server response types (`Assessment`, `CheckResult`, …)                                                   | `@edpire/sdk/client`                                 |

## Answer types

The core answer shape and its concrete variants. These come from the underlying runtime but are **re-exported by the SDK** so you never import `@youssefalmia/*` directly.

```typescript theme={null}
import type {
  RuntimeAnswer,        // union of all answer types
  ChoiceSetAnswer,
  BlankChoiceAnswer,
  TypedBlankAnswer,
  MatchingSetAnswer,
  MatchingConnection,
  OpenResponseAnswer,
} from "@edpire/sdk"
```

`RuntimeAnswer[]` is what `EdpireQuestion`'s `onAnswersChange` gives you and what `/check` and `submit` accept.

## Embedded Player types

```typescript theme={null}
import type {
  MountOptions,     // options for EdpireAssessment.mount()
  EmbedInstance,    // { unmount() }
  EmbedResult,      // passed to onComplete
  EmbedError,       // passed to onError
} from "@edpire/sdk"
```

Full shapes: see [Embedded Player](/developer/sdk/embedded-player#embedresult).

## Custom Flow helpers

```typescript theme={null}
import type {
  FlatStep,             // one step from flattenAssessment()
  RenderQuestionOptions,// options for renderQuestion()
  QuestionInstance,     // returned by renderQuestion()
  StoredAnswer,         // { exerciseId, questionId, answers: RuntimeAnswer[] }
} from "@edpire/sdk"
```

`buildSubmitPayload(stored: StoredAnswer[])` converts a flat array into the nested `{ exerciseAnswers: [...] }` format. (`client.submit()` also accepts the flat array directly, so you rarely need to call this yourself.)

## React component prop types

```typescript theme={null}
import type { EdpireQuestionProps, AssessmentShellProps } from "@edpire/sdk/react"
```

See [React Components](/developer/sdk/react-components) for both tables.

## Feedback types

The per-node feedback shapes used by `AssessmentShell` (`SubmitResult.exerciseFeedback`).

```typescript theme={null}
import type {
  SubmitResult,
  ExerciseFeedbackData,
  QuestionFeedback,
  NodeFeedback,
  NodeDetail,
} from "@edpire/sdk/react"
```

```typescript theme={null}
interface ExerciseFeedbackData {
  exerciseId: string
  questions: QuestionFeedback[]
}

interface QuestionFeedback {
  questionId: string
  nodeResults: NodeFeedback[]
}

interface NodeFeedback {
  nodeId: string
  status: "correct" | "partial" | "incorrect" | "awaiting_review"
  score: number
  maxScore: number
  feedback?: string
  displayAnswer?: string
  detail?: NodeDetail
  teacherFeedback?: RichContent[]
}

type NodeDetail =
  | { type: "choiceSet"; correctChoiceIds: string[] }
  | {
      type: "matchingSet"
      pairFeedback: Array<{ leftId: string; rightId: string; correct: boolean }>
      correctPairings: Array<{ leftId: string; rightId: string }>
    }
```

<Note>
  `EmbedResult.exercise_feedback` (Embedded Player) is the **snake\_case** equivalent of this same structure. `AssessmentShell`'s `SubmitResult` uses camelCase because you construct it in your own `onSubmit` handler.
</Note>

## Branding & theming types

```typescript theme={null}
import type { TakeBranding, OverlayConfig, SpinnerTheme, ShellLocale } from "@edpire/sdk"
// (also available from "@edpire/sdk/react")
```

See [Branding](/developer/sdk/branding-theming).

## Server Client types

All exported from `@edpire/sdk/client`:

```typescript theme={null}
import type {
  EdpireClientOptions,
  AssessmentSummary, Assessment, AssessmentExercise, AssessmentQuestion,
  PaginatedResponse,
  SubmitOptions, GradeResult,
  CheckOptions, CheckResult,
  Submission,
  Collection, CollectionDetail,
  Webhook, WebhookWithSecret,
  EmbedToken,
} from "@edpire/sdk/client"
```
