diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-12-06 17:05:21 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-12-06 17:37:04 +0900 |
| commit | 811458427593a4172a2cd535cc768db375350dca (patch) | |
| tree | 6c4f46c96b6f29392dc19d591e39e03c187033a1 /pkgs/shared/src/types | |
| parent | 9736a8981fbd6c6defbd67517ca23904fc844629 (diff) | |
| download | kioku-811458427593a4172a2cd535cc768db375350dca.tar.gz kioku-811458427593a4172a2cd535cc768db375350dca.tar.zst kioku-811458427593a4172a2cd535cc768db375350dca.zip | |
feat(dev): change architecture and directory structure
Diffstat (limited to 'pkgs/shared/src/types')
| -rw-r--r-- | pkgs/shared/src/types/index.ts | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/pkgs/shared/src/types/index.ts b/pkgs/shared/src/types/index.ts deleted file mode 100644 index bfba06f..0000000 --- a/pkgs/shared/src/types/index.ts +++ /dev/null @@ -1,79 +0,0 @@ -// Card states for FSRS algorithm -export const CardState = { - New: 0, - Learning: 1, - Review: 2, - Relearning: 3, -} as const; - -export type CardState = (typeof CardState)[keyof typeof CardState]; - -// Rating values for reviews -export const Rating = { - Again: 1, - Hard: 2, - Good: 3, - Easy: 4, -} as const; - -export type Rating = (typeof Rating)[keyof typeof Rating]; - -// User -export interface User { - id: string; - username: string; - passwordHash: string; - createdAt: Date; - updatedAt: Date; -} - -// Deck -export interface Deck { - id: string; - userId: string; - name: string; - description: string | null; - newCardsPerDay: number; - createdAt: Date; - updatedAt: Date; - deletedAt: Date | null; - syncVersion: number; -} - -// Card with FSRS fields -export interface Card { - id: string; - deckId: string; - front: string; - back: string; - - // FSRS fields - state: CardState; - due: Date; - stability: number; - difficulty: number; - elapsedDays: number; - scheduledDays: number; - reps: number; - lapses: number; - lastReview: Date | null; - - createdAt: Date; - updatedAt: Date; - deletedAt: Date | null; - syncVersion: number; -} - -// ReviewLog (append-only) -export interface ReviewLog { - id: string; - cardId: string; - userId: string; - rating: Rating; - state: CardState; - scheduledDays: number; - elapsedDays: number; - reviewedAt: Date; - durationMs: number | null; - syncVersion: number; -} |
