ts-fsrs 3.0.3 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/default.js CHANGED
@@ -29,7 +29,7 @@ exports.default_w = exports.envParams.FSRS_W || [
29
29
  0.34, 1.26, 0.29, 2.61,
30
30
  ];
31
31
  exports.default_enable_fuzz = exports.envParams.FSRS_ENABLE_FUZZ || false;
32
- exports.FSRSVersion = "3.0.3";
32
+ exports.FSRSVersion = "3.0.4";
33
33
  const generatorParameters = (props) => {
34
34
  return {
35
35
  request_retention: props?.request_retention || exports.default_request_retention,
package/dist/fsrs.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { SchedulingCard } from "./index";
2
- import { FSRSParameters, Card, State, Rating, CardInput, DateInput } from "./models";
2
+ import { FSRSParameters, Card, Rating, CardInput, DateInput } from "./models";
3
3
  import type { int } from "./type";
4
4
  export declare class FSRS {
5
5
  private param;
@@ -10,48 +10,7 @@ export declare class FSRS {
10
10
  card: Card;
11
11
  now: Date;
12
12
  };
13
- repeat: (card: CardInput, now: DateInput) => {
14
- 1: {
15
- card: Card;
16
- log: {
17
- rating: Rating;
18
- state: State;
19
- elapsed_days: number;
20
- scheduled_days: number;
21
- review: Date;
22
- };
23
- };
24
- 2: {
25
- card: Card;
26
- log: {
27
- rating: Rating;
28
- state: State;
29
- elapsed_days: number;
30
- scheduled_days: number;
31
- review: Date;
32
- };
33
- };
34
- 3: {
35
- card: Card;
36
- log: {
37
- rating: Rating;
38
- state: State;
39
- elapsed_days: number;
40
- scheduled_days: number;
41
- review: Date;
42
- };
43
- };
44
- 4: {
45
- card: Card;
46
- log: {
47
- rating: Rating;
48
- state: State;
49
- elapsed_days: number;
50
- scheduled_days: number;
51
- review: Date;
52
- };
53
- };
54
- };
13
+ repeat: (card: CardInput, now: DateInput) => import("./models").RecordLog;
55
14
  get_retrievability: (card: Card, now: Date) => undefined | string;
56
15
  init_ds(s: SchedulingCard): void;
57
16
  /**
package/dist/models.d.ts CHANGED
@@ -19,6 +19,12 @@ export interface ReviewLog {
19
19
  scheduled_days: number;
20
20
  review: Date;
21
21
  }
22
+ export type RecordLog = {
23
+ [key in Rating]: {
24
+ card: Card;
25
+ log: ReviewLog;
26
+ };
27
+ };
22
28
  export interface Card {
23
29
  due: Date;
24
30
  stability: number;
@@ -1,4 +1,4 @@
1
- import { Card, Rating, State } from "./models";
1
+ import { Card, RecordLog, State } from "./models";
2
2
  export declare class SchedulingCard {
3
3
  again: Card;
4
4
  hard: Card;
@@ -8,46 +8,5 @@ export declare class SchedulingCard {
8
8
  constructor(card: Card);
9
9
  update_state(state: State): this;
10
10
  schedule(now: Date, hard_interval: number, good_interval: number, easy_interval: number): SchedulingCard;
11
- record_log(card: Card, now: Date): {
12
- 1: {
13
- card: Card;
14
- log: {
15
- rating: Rating;
16
- state: State;
17
- elapsed_days: number;
18
- scheduled_days: number;
19
- review: Date;
20
- };
21
- };
22
- 2: {
23
- card: Card;
24
- log: {
25
- rating: Rating;
26
- state: State;
27
- elapsed_days: number;
28
- scheduled_days: number;
29
- review: Date;
30
- };
31
- };
32
- 3: {
33
- card: Card;
34
- log: {
35
- rating: Rating;
36
- state: State;
37
- elapsed_days: number;
38
- scheduled_days: number;
39
- review: Date;
40
- };
41
- };
42
- 4: {
43
- card: Card;
44
- log: {
45
- rating: Rating;
46
- state: State;
47
- elapsed_days: number;
48
- scheduled_days: number;
49
- review: Date;
50
- };
51
- };
52
- };
11
+ record_log(card: Card, now: Date): RecordLog;
53
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-fsrs",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
4
4
  "description": "ts-fsrs is a TypeScript package used to implement the Free Spaced Repetition Scheduler (FSRS) algorithm. It helps developers apply FSRS to their flashcard applications, thereby improving the user learning experience.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",