fsrs-algorithm
Version:
Free Spaced Repetition Scheduler (FSRS) algorithm implementation in TypeScript
74 lines • 1.74 kB
TypeScript
export declare enum Rating {
Again = 1,// "I forgot this"
Hard = 2,// "Difficult to remember"
Good = 3,// "Normal recall"
Easy = 4
}
export declare enum State {
New = 0,// card is new
Learning = 1,//
Review = 2,
Relearning = 3
}
export interface FSRSParameters {
requestRetention: number;
maximumInterval: number;
w: number[];
}
export interface Card {
due: Date;
stability: number;
difficulty: number;
elapsedDays: number;
scheduledDays: number;
reps: number;
lapses: number;
state: State;
lastReview?: Date;
}
export interface ReviewLog {
due: Date;
stability: number;
difficulty: number;
elapsedDays: number;
scheduledDays: number;
state: State;
rating: Rating;
lastElapsedDays: number;
review: Date;
}
export interface SchedulingInfo {
card: Card;
reviewLog: ReviewLog;
}
export interface SchedulingCards {
again: SchedulingInfo;
hard: SchedulingInfo;
good: SchedulingInfo;
easy: SchedulingInfo;
}
export interface FSRSWeights {
initialStabilityAgain: number;
initialStabilityHard: number;
initialStabilityGood: number;
initialStabilityEasy: number;
initialDifficulty: number;
difficultyWeight: number;
}
export interface RawCardData {
id?: string;
userId?: string;
cardId?: string;
due: string | Date;
stability: number | string;
difficulty: number | string;
elapsedDays: number | string;
scheduledDays?: number | string;
reps: number | string;
lapses: number | string;
state: string;
lastReview?: string | Date | null;
createdAt?: string | Date;
updatedAt?: string | Date;
}
//# sourceMappingURL=types.d.ts.map