@read-frog/definitions 0.3.2 → 0.3.3
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/index.d.ts +14 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/types/card.ts +15 -2
- package/src/types/srs.ts +6 -4
package/package.json
CHANGED
package/src/types/card.ts
CHANGED
|
@@ -7,17 +7,30 @@ export const CARD_STATE_VALUES = [
|
|
|
7
7
|
"relearning",
|
|
8
8
|
] as const
|
|
9
9
|
|
|
10
|
-
export const
|
|
10
|
+
export const ACTIVE_SCHEDULE_STATUS_VALUES = [
|
|
11
11
|
"new",
|
|
12
12
|
"learning",
|
|
13
13
|
"review",
|
|
14
|
+
] as const
|
|
15
|
+
|
|
16
|
+
export const SCHEDULE_STATUS_VALUES = [
|
|
17
|
+
...ACTIVE_SCHEDULE_STATUS_VALUES,
|
|
14
18
|
"suspended",
|
|
15
19
|
"buried",
|
|
16
20
|
] as const
|
|
17
21
|
|
|
22
|
+
export const EMPTY_SCHEDULE_STATUS_COUNTS = {
|
|
23
|
+
learning: 0,
|
|
24
|
+
new: 0,
|
|
25
|
+
review: 0,
|
|
26
|
+
} satisfies Record<ActiveScheduleStatus, number>
|
|
27
|
+
|
|
18
28
|
export const cardStateSchema = z.enum(CARD_STATE_VALUES)
|
|
19
29
|
export type CardState = z.infer<typeof cardStateSchema>
|
|
20
30
|
|
|
31
|
+
export const activeScheduleStatusSchema = z.enum(ACTIVE_SCHEDULE_STATUS_VALUES)
|
|
32
|
+
export type ActiveScheduleStatus = z.infer<typeof activeScheduleStatusSchema>
|
|
33
|
+
|
|
21
34
|
export const scheduleStatusSchema = z.enum(SCHEDULE_STATUS_VALUES)
|
|
22
35
|
export type ScheduleStatus = z.infer<typeof scheduleStatusSchema>
|
|
23
36
|
|
|
@@ -26,7 +39,7 @@ export const CARD_STATE_TO_SCHEDULE_STATUS = {
|
|
|
26
39
|
learning: "learning",
|
|
27
40
|
relearning: "learning",
|
|
28
41
|
review: "review",
|
|
29
|
-
} satisfies Record<CardState,
|
|
42
|
+
} satisfies Record<CardState, ActiveScheduleStatus>
|
|
30
43
|
|
|
31
44
|
export const basicCardTemplateConfigSchema = z.object({
|
|
32
45
|
type: z.literal("basic"),
|
package/src/types/srs.ts
CHANGED
|
@@ -26,9 +26,11 @@ export type SrsStep = z.infer<typeof srsStepSchema>
|
|
|
26
26
|
|
|
27
27
|
export const srsWeightsSchema = z.array(z.number())
|
|
28
28
|
|
|
29
|
+
export const UNLIMITED_DAILY_LIMIT = -1
|
|
30
|
+
|
|
29
31
|
export const schedulingParamsShape = {
|
|
30
|
-
newPerDay: z.number().int().gte(
|
|
31
|
-
reviewsPerDay: z.number().int().gte(
|
|
32
|
+
newPerDay: z.number().int().gte(UNLIMITED_DAILY_LIMIT),
|
|
33
|
+
reviewsPerDay: z.number().int().gte(UNLIMITED_DAILY_LIMIT),
|
|
32
34
|
desiredRetention: z.number().gt(0).lte(1),
|
|
33
35
|
enableShortTerm: z.boolean(),
|
|
34
36
|
maximumInterval: z.number().int().positive(),
|
|
@@ -43,8 +45,8 @@ export const schedulingParamsSchema = z.object(schedulingParamsShape).strict()
|
|
|
43
45
|
export type SchedulingParams = z.infer<typeof schedulingParamsSchema>
|
|
44
46
|
|
|
45
47
|
export const DEFAULT_SRS_SCHEDULING_PARAMS = {
|
|
46
|
-
newPerDay:
|
|
47
|
-
reviewsPerDay:
|
|
48
|
+
newPerDay: UNLIMITED_DAILY_LIMIT,
|
|
49
|
+
reviewsPerDay: UNLIMITED_DAILY_LIMIT,
|
|
48
50
|
desiredRetention: 0.9,
|
|
49
51
|
enableShortTerm: true,
|
|
50
52
|
maximumInterval: 36500,
|