Files
readlater/src/lib/types.ts
Gemini Agent 513576b90e v2.0: Major feature update
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>
2026-01-17 12:19:57 +00:00

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",
};