mirror of
https://github.com/Tony0410/readlater.git
synced 2026-05-24 13:52:03 +08:00
New Features: - API key authentication for external access - Apple Shortcuts integration endpoint (/api/v1/add) - Full-text search across all articles - Folders for organizing articles - Highlights and notes on articles - Reading stats with streaks - Reading goals (daily/weekly/monthly) - Import from Pocket/Instapaper - RSS feed output - PWA support for mobile - Auto theme scheduling (day/night) - Settings page with all configuration API Endpoints: - /api/v1/add - Add articles via API key - /api/keys - Manage API keys - /api/search - Full-text search - /api/folders - Folder management - /api/highlights - Highlights/notes - /api/stats - Reading statistics - /api/goals - Reading goals - /api/import - Pocket/Instapaper import - /api/rss - RSS feed Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
97 lines
1.9 KiB
TypeScript
97 lines
1.9 KiB
TypeScript
export interface Article {
|
|
id: string;
|
|
url: string;
|
|
title: string;
|
|
author: string | null;
|
|
siteName: string | null;
|
|
excerpt: string | null;
|
|
content: string;
|
|
textContent: string;
|
|
leadImage: string | null;
|
|
wordCount: number;
|
|
readingProgress: number;
|
|
readingTimeSeconds: number;
|
|
isFavorite: boolean;
|
|
isArchived: boolean;
|
|
folderId: string | null;
|
|
tags: string;
|
|
createdAt: string;
|
|
updatedAt: string;
|
|
readAt: string | null;
|
|
finishedAt: string | null;
|
|
}
|
|
|
|
export interface Folder {
|
|
id: string;
|
|
name: string;
|
|
color: string;
|
|
icon: string;
|
|
parentId: string | null;
|
|
sortOrder: number;
|
|
createdAt: string;
|
|
}
|
|
|
|
export interface Highlight {
|
|
id: string;
|
|
articleId: string;
|
|
text: string;
|
|
note: string | null;
|
|
color: string;
|
|
startOffset: number | null;
|
|
endOffset: number | null;
|
|
createdAt: string;
|
|
}
|
|
|
|
export interface ReaderSettings {
|
|
fontSize: number; // 14-32
|
|
fontFamily: "system" | "serif" | "sans" | "mono";
|
|
lineHeight: number; // 1.4-2.2
|
|
maxWidth: number; // 500-900
|
|
theme: "dark" | "light" | "sepia";
|
|
autoTheme: boolean;
|
|
dayTheme: "dark" | "light" | "sepia";
|
|
nightTheme: "dark" | "light" | "sepia";
|
|
}
|
|
|
|
export interface TTSSettings {
|
|
engine: "browser" | "kokoro";
|
|
speed: number; // 0.5-3.0
|
|
voice: string;
|
|
kokoroUrl: string;
|
|
}
|
|
|
|
export interface ReadingStats {
|
|
date: string;
|
|
articlesRead: number;
|
|
articlesAdded: number;
|
|
wordsRead: number;
|
|
timeSpentSeconds: number;
|
|
streak: number;
|
|
}
|
|
|
|
export interface ReadingGoal {
|
|
id: string;
|
|
type: "daily" | "weekly" | "monthly";
|
|
metric: "articles" | "words" | "time";
|
|
target: number;
|
|
isActive: boolean;
|
|
}
|
|
|
|
export const defaultReaderSettings: ReaderSettings = {
|
|
fontSize: 18,
|
|
fontFamily: "serif",
|
|
lineHeight: 1.8,
|
|
maxWidth: 700,
|
|
theme: "dark",
|
|
autoTheme: false,
|
|
dayTheme: "light",
|
|
nightTheme: "dark",
|
|
};
|
|
|
|
export const defaultTTSSettings: TTSSettings = {
|
|
engine: "browser",
|
|
speed: 1.0,
|
|
voice: "",
|
|
kokoroUrl: "http://localhost:8880",
|
|
};
|