-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
33 lines (33 loc) · 930 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
type Difficulty = number;
type Stability = number;
type IntervalDays = number;
export type DifficultyAndStability = {
D: Difficulty;
S: Stability;
};
export interface Card extends DifficultyAndStability {
I: IntervalDays;
}
export declare enum Grade {
AGAIN = 1,
HARD = 2,
GOOD = 3,
EASY = 4
}
export type DeckParams = {
/** Percentage of cards that will succeed upon review.
* Default value is 0.9.
* Lower numbers mean fewer reviews but more more failures. */
requestedRetentionRate: number;
w: number[];
};
/** A deck creates functions that share the same configuration options,
* such as a 'w' param and requested retention rate. */
export declare function createDeck(params?: {
requestedRetentionRate: number;
w: number[];
}): {
newCard(grade: Grade): Card;
gradeCard(card: DifficultyAndStability, daysSinceReview: number, grade: Grade): Card;
};
export {};