@@ -0,0 +1,12 @@ | |||||
import { Shelf } from "./shelf"; | |||||
export interface Category { //_id is not needed as it is created by default | |||||
name: string, | |||||
icon: string, | |||||
shelves?: Array<Shelf>, | |||||
isArchived: boolean, | |||||
} | |||||
export interface MongoCategory extends Omit<Category, 'shelves'> { | |||||
shelves?: Array<string>, // Shelf IDs | |||||
} |
@@ -0,0 +1,8 @@ | |||||
export interface RecollectionHistory { | |||||
userId: string, | |||||
wordId: string, | |||||
history: Array<{ | |||||
timeStamp: Date, | |||||
wasRecallSuccessful: boolean | |||||
}> | |||||
} |
@@ -0,0 +1,26 @@ | |||||
import { viewPermissionType } from "./variables"; | |||||
import { Word } from "./word"; | |||||
interface ShelfWord { | |||||
word: Word, | |||||
notes: Array<string>, | |||||
nextRevisionDateTime: Date, | |||||
spaceBetweenRecall: number, // in Days | |||||
isArchived: boolean, | |||||
} | |||||
export interface Shelf { | |||||
name: string, | |||||
description?: string, | |||||
viewType: viewPermissionType, | |||||
isArchived: boolean, | |||||
words?: Array<ShelfWord> | |||||
} | |||||
export interface MongoShelfWord extends Omit<ShelfWord, "word"> { | |||||
word: string, | |||||
} | |||||
export interface MongoShelf extends Omit<Shelf, "words"> { | |||||
words?: Array<MongoShelfWord> | |||||
} |
@@ -0,0 +1,18 @@ | |||||
import { Category } from "./category"; | |||||
import { Word } from "./word"; | |||||
export interface User { | |||||
_id: string, | |||||
name: string, | |||||
email: string, | |||||
password: string, | |||||
isVerified: boolean, | |||||
otp: number, | |||||
categories?: Array<Category>, | |||||
favouriteWords?: Array<Word>, | |||||
} | |||||
export interface MongoUser extends Omit<User, "categories" | "favouriteWords"> { | |||||
categories?: Array<string> // Category IDs, | |||||
favouriteWords?: Array<string> // Favourite Words ID | |||||
} |
@@ -0,0 +1,3 @@ | |||||
export type grammarType = 'NOUN' | 'PRONOUN' | 'ADJECTIVE' | 'VERB' | 'ADVERB' | 'PREPOSITION' | 'CONJUNCTION' | 'INTERJECTION'; | |||||
export type viewPermissionType = 'PUBLIC' | 'PRIVATE' | 'FRIENDS' | 'FOLLOWERS'; | |||||
export type LanguageType = 'ENGLISH' | 'KANNADA' | 'HINDI' | 'TAMIL' | 'TELUGU'; |
@@ -0,0 +1,21 @@ | |||||
import { grammarType, LanguageType } from "./variables"; | |||||
export interface gramaticalDetail { | |||||
type: grammarType, | |||||
description: string, | |||||
context: Array<string>, | |||||
examples: Array<string>, | |||||
} | |||||
export interface Word { | |||||
//_id is present by default in the DB | |||||
name: string, | |||||
languageType: LanguageType, | |||||
pronounciation?: { | |||||
text: string, | |||||
audio?: string, | |||||
}, | |||||
similarWords?: Array<string>, | |||||
oppositeWords?: Array<string>, | |||||
grammaticalDetails: Array<gramaticalDetail>, | |||||
} |