- Replace client-side IndexedDB with server-first document storage - Add document caching layer for offline capability and performance - Implement document transfer during anonymous-to-authenticated account linking - Add database indexes for improved query performance - Update document contexts to use new caching system - Refactor document upload and deletion APIs - Add audiobook pruning for missing files - Improve test isolation with namespace support - Add unit tests for document cache and transfer functions
74 lines
1.8 KiB
TypeScript
74 lines
1.8 KiB
TypeScript
import type { DocumentListState } from '@/types/documents';
|
|
|
|
const isDev = process.env.NEXT_PUBLIC_NODE_ENV !== 'production' || process.env.NODE_ENV == null;
|
|
|
|
export type ViewType = 'single' | 'dual' | 'scroll';
|
|
|
|
export type SavedVoices = Record<string, string>;
|
|
|
|
export interface AppConfigValues {
|
|
apiKey: string;
|
|
baseUrl: string;
|
|
viewType: ViewType;
|
|
voiceSpeed: number;
|
|
audioPlayerSpeed: number;
|
|
voice: string;
|
|
skipBlank: boolean;
|
|
epubTheme: boolean;
|
|
headerMargin: number;
|
|
footerMargin: number;
|
|
leftMargin: number;
|
|
rightMargin: number;
|
|
ttsProvider: string;
|
|
ttsModel: string;
|
|
ttsInstructions: string;
|
|
savedVoices: SavedVoices;
|
|
smartSentenceSplitting: boolean;
|
|
pdfHighlightEnabled: boolean;
|
|
pdfWordHighlightEnabled: boolean;
|
|
epubHighlightEnabled: boolean;
|
|
epubWordHighlightEnabled: boolean;
|
|
firstVisit: boolean;
|
|
documentListState: DocumentListState;
|
|
privacyAccepted: boolean;
|
|
documentsMigrationPrompted: boolean;
|
|
}
|
|
|
|
export const APP_CONFIG_DEFAULTS: AppConfigValues = {
|
|
apiKey: '',
|
|
baseUrl: '',
|
|
viewType: 'single',
|
|
voiceSpeed: 1,
|
|
audioPlayerSpeed: 1,
|
|
voice: '',
|
|
skipBlank: true,
|
|
epubTheme: false,
|
|
headerMargin: 0,
|
|
footerMargin: 0,
|
|
leftMargin: 0,
|
|
rightMargin: 0,
|
|
ttsProvider: isDev ? 'custom-openai' : 'deepinfra',
|
|
ttsModel: isDev ? 'kokoro' : 'hexgrad/Kokoro-82M',
|
|
ttsInstructions: '',
|
|
savedVoices: {},
|
|
smartSentenceSplitting: true,
|
|
pdfHighlightEnabled: true,
|
|
pdfWordHighlightEnabled: isDev,
|
|
epubHighlightEnabled: true,
|
|
epubWordHighlightEnabled: isDev,
|
|
firstVisit: false,
|
|
documentListState: {
|
|
sortBy: 'name',
|
|
sortDirection: 'asc',
|
|
folders: [],
|
|
collapsedFolders: [],
|
|
showHint: true,
|
|
viewMode: 'grid',
|
|
},
|
|
privacyAccepted: false,
|
|
documentsMigrationPrompted: false,
|
|
};
|
|
|
|
export interface AppConfigRow extends AppConfigValues {
|
|
id: string;
|
|
}
|