LoopKitType Reference
Results & Sessions
GradeResult, SessionSummary, SessionQueue, ImportResult, and Grade types
Grade
The four possible grades for a flashcard review:
type Grade = 'again' | 'hard' | 'good' | 'easy';
const GRADES: readonly Grade[] = ['again', 'hard', 'good', 'easy'] as const;| Grade | Meaning | Effect on Ease |
|---|---|---|
again | Forgot the answer | -0.2 (lapse) |
hard | Recalled with difficulty | -0.15 |
good | Recalled correctly | No change |
easy | Recalled effortlessly | +0.15 |
GradeResult
Returned by ReviewSessionService.gradeCard():
interface GradeResult {
card: CardBase; // Updated card with new SRS state
reviewLog: ReviewLog; // Immutable record of this review
nextIntervals: Record<Grade, string>; // Preview intervals for next review
}The nextIntervals values are human-readable strings like "1m", "6h", "10d", "2mo".
SessionQueue
Returned by ReviewSessionService.buildQueue():
interface SessionQueue {
cards: CardBase[]; // Ordered: learning → review → new
counts: {
new: number; // New cards in queue
learning: number; // Learning/relearning cards
review: number; // Due review cards
};
}SessionSummary
Summary statistics for a completed study session:
interface SessionSummary {
totalReviewed: number;
correctCount: number; // grade !== 'again'
incorrectCount: number; // grade === 'again'
averageTimeMsPerCard: number;
gradeDistribution: Record<Grade, number>; // Count per grade
newCardsStudied: number; // Cards that were in 'new' state
reviewsCompleted: number; // Cards that were in 'review' state
}ImportResult
Returned by CSV and JSON import operations:
interface ImportResult {
notesCreated: number;
cardsCreated: number;
errors: string[]; // Per-row error messages (import continues on error)
}LoopKitExportData
Full export format for JSON import/export:
interface LoopKitExportData {
version: string; // Schema version (e.g., "1.0.0")
exportedAt: string; // ISO 8601 timestamp
decks: DeckBase[];
noteTypes: NoteType[];
notes: NoteBase[];
cards: CardBase[];
presets: DeckPreset[];
reviewLogs?: ReviewLog[]; // Optional, included when requested
}FieldMapping
Maps CSV column names to note field names for import:
type FieldMapping = { [csvColumn: string]: string };
// Example: { "question": "Front", "answer": "Back" }