Files
news-reader-actions-test/types.ts
Anthony 43435166f8 feat: Update dependencies and add new voice
- Updates project dependencies to latest versions for improved performance and security.
- Adds a new voice option, 'Aoede', to the available voices.
- Modifies the voice change handler to force re-generation of future audio segments for the selected article.
- Updates Vite configuration to align with newer Vite versions and load environment variables correctly.
- Adjusts TypeScript configuration for a more modern setup.
- Removes unnecessary configuration from Nginx file.
2025-11-19 20:46:02 +08:00

57 lines
1.2 KiB
TypeScript

export enum VoiceName {
Puck = 'Puck',
Charon = 'Charon',
Kore = 'Kore',
Fenrir = 'Fenrir',
Zephyr = 'Zephyr',
Aoede = 'Aoede',
}
export enum PlaybackStatus {
IDLE = 'IDLE',
LOADING_TEXT = 'LOADING_TEXT',
LOADING_AUDIO = 'LOADING_AUDIO',
READY = 'READY',
PLAYING = 'PLAYING',
PAUSED = 'PAUSED',
ERROR = 'ERROR',
COMPLETED = 'COMPLETED'
}
export interface AudioSegment {
id: string;
text: string;
audioUrl?: string; // Blob URL for this specific segment
isLoading: boolean;
hasError: boolean;
}
export interface Article {
id: string;
url: string;
title: string;
// We keep the full text for display/reference
text: string;
// We split content into segments for faster playback
segments: AudioSegment[];
currentSegmentIndex: number;
status: PlaybackStatus;
errorMessage?: string;
}
export interface PlayerState {
isPlaying: boolean;
playbackRate: number;
currentArticleId: string | null;
selectedVoice: VoiceName;
}
export interface ReaderSettings {
isDarkMode: boolean;
fontSize: 'sm' | 'base' | 'lg' | 'xl' | '2xl';
lineHeight: 'normal' | 'relaxed' | 'loose';
fontFamily: 'sans' | 'serif' | 'mono';
autoScroll: boolean;
}