diff --git a/src/fsrs/default.ts b/src/fsrs/default.ts index d737236..c341da7 100644 --- a/src/fsrs/default.ts +++ b/src/fsrs/default.ts @@ -32,7 +32,7 @@ export const default_enable_fuzz = envParams.FSRS_ENABLE_FUZZ || false; export const FSRSVersion: string = "3.0.4"; -export const generatorParameters = (props?: Partial) => { +export const generatorParameters = (props?: Partial): FSRSParameters => { return { request_retention: props?.request_retention || default_request_retention, maximum_interval: props?.maximum_interval || default_maximum_interval, @@ -54,6 +54,6 @@ export const createEmptyCard = (now?: Date): Card => { }; }; -export const fsrs = (params?: Partial) => { +export const fsrs = (params?: Partial): FSRS => { return new FSRS(params || {}); }; diff --git a/src/fsrs/fsrs.ts b/src/fsrs/fsrs.ts index 5391665..46fbb23 100644 --- a/src/fsrs/fsrs.ts +++ b/src/fsrs/fsrs.ts @@ -1,6 +1,6 @@ import { SchedulingCard } from "./index"; import { fixDate, fixState } from "./help"; -import { FSRSParameters, Card, State, CardInput, DateInput } from "./models"; +import { FSRSParameters, Card, State, CardInput, DateInput, RecordLog } from "./models"; import type { int } from "./type"; import { FSRSAlgorithm } from "./algorithm"; @@ -20,7 +20,7 @@ export class FSRS extends FSRSAlgorithm { return { card, now }; } - repeat = (card: CardInput, now: DateInput) => { + repeat = (card: CardInput, now: DateInput): RecordLog => { const process = this.preProcess(card, now); card = process.card; now = process.now; diff --git a/src/fsrs/index.ts b/src/fsrs/index.ts index 56d19df..b329752 100644 --- a/src/fsrs/index.ts +++ b/src/fsrs/index.ts @@ -22,6 +22,8 @@ export type { FSRSParameters, Card, ReviewLog, + RecordLog, + RecordLogItem, StateType, RatingType, CardInput,