lastwebnovel-app/app/types/index.d.ts
2026-04-11 22:55:16 +02:00

121 lines
2.2 KiB
TypeScript

import type { AvatarProps } from '@nuxt/ui'
export type UserStatus = 'subscribed' | 'unsubscribed' | 'bounced'
export type SaleStatus = 'paid' | 'failed' | 'refunded'
export interface User {
id: number
name: string
email: string
avatar?: AvatarProps
status: UserStatus
location: string
}
export interface Mail {
id: number
unread?: boolean
from: User
subject: string
body: string
date: string
}
export interface Member {
name: string
username: string
role: 'member' | 'owner'
avatar: AvatarProps
}
export interface Stat {
title: string
icon: string
value: number | string
variation: number
formatter?: (value: number) => string
}
export interface Sale {
id: string
date: string
status: SaleStatus
email: string
amount: number
}
export interface Notification {
id: number
unread?: boolean
sender: User
body: string
date: string
}
export type Period = 'daily' | 'weekly' | 'monthly'
export interface Range {
start: Date
end: Date
}
// WebNovel types
export type NovelStatus = 'ongoing' | 'completed' | 'hiatus'
export type NovelGenre = 'fantasy' | 'romance' | 'sci-fi' | 'mystery' | 'slice-of-life' | 'action' | 'adventure' | 'horror' | 'comedy' | 'drama'
export interface Author {
id: string
name: string
avatar: string
bio?: string
}
export interface WebNovel {
id: string
slug: string
title: string
author: Author
description: string
cover: string
status: NovelStatus
genres: NovelGenre[]
rating: number
views: number
followers: number
chapters: number
language: string
tags: string[]
createdAt: string
updatedAt: string
}
export interface Chapter {
id: string
novelId: string
number: number
title: string
content: string
views: number
likes: number
createdAt: string
updatedAt: string
}
export interface ReadingProgress {
novelId: string
chapterId: string
chapterNumber: number
progress: number // 0-100
lastReadAt: string
}
export interface ReaderPreferences {
fontSize: number // 12-24
fontFamily: 'serif' | 'sans-serif' | 'monospace'
lineHeight: number // 1.5-2.5
backgroundColor: 'white' | 'cream' | 'gray' | 'black'
textColor: 'black' | 'white' | 'gray'
theme: 'light' | 'dark' | 'sepia'
textJustify: boolean
}