/** * Watch Progress Utilities * Centralized constants and helper functions for watch progress calculations */ /** * Completion threshold - content is marked as "completed" when reaching this percentage */ export declare const COMPLETION_THRESHOLD = 0.9; /** * Minimum progress threshold - don't save progress below this to avoid accidental saves */ export declare const MIN_PROGRESS_THRESHOLD = 0.05; /** * Significant position change threshold in seconds * Used to detect seeks and trigger saves */ export declare const SIGNIFICANT_POSITION_CHANGE = 30; /** * Backup save interval in milliseconds * How often to save progress during continuous playback */ export declare const BACKUP_SAVE_INTERVAL = 30000; /** * Calculate progress percentage from current position and total duration * @param currentSeconds Current playback position in seconds * @param totalSeconds Total content duration in seconds * @returns Progress percentage (0-100) */ export declare function calculateProgressPercentage(currentSeconds: number, totalSeconds: number): number; /** * Check if content is considered completed based on progress percentage * @param percentage Progress percentage (0-100) * @returns true if content is completed */ export declare function isCompleted(percentage: number): boolean; /** * Check if content is considered completed based on position and duration * @param currentSeconds Current playback position in seconds * @param totalSeconds Total content duration in seconds * @returns true if content is completed */ export declare function isContentCompleted(currentSeconds: number, totalSeconds: number): boolean; /** * Check if progress should be saved based on current percentage * @param percentage Progress percentage (0-100) * @returns true if progress should be saved */ export declare function shouldSaveProgress(percentage: number): boolean; /** * Check if progress should be saved based on position and duration * @param currentSeconds Current playback position in seconds * @param totalSeconds Total content duration in seconds * @returns true if progress should be saved */ export declare function shouldSaveProgressByPosition(currentSeconds: number, totalSeconds: number): boolean; /** * Format seconds into human-readable time string * @param seconds Duration in seconds * @returns Formatted time string (e.g., "1h 23m", "45m", "2m 30s") */ export declare function formatDuration(seconds: number): string; /** * Format remaining time for continue watching display * @param remainingSeconds Remaining duration in seconds * @returns Formatted string (e.g., "23 min left", "1 hr 10 min left") */ export declare function formatRemainingTime(remainingSeconds: number): string; /** * Calculate remaining time from progress and total duration * @param currentSeconds Current playback position in seconds * @param totalSeconds Total content duration in seconds * @returns Remaining seconds */ export declare function calculateRemainingTime(currentSeconds: number, totalSeconds: number): number; /** * Generate a unique key for progress entry (for Map lookups) * @param contentId Content ID * @param episodeId Optional episode ID for series * @returns Unique key string */ export declare function getProgressKey(contentId: string, episodeId?: string): string; /** * Generate a unique ID for a progress entry * @param contentId Content ID * @param episodeId Optional episode ID for series * @returns Unique ID string */ export declare function generateProgressId(contentId: string, episodeId?: string): string; /** * Check if position change is significant enough to trigger a save * @param previousPosition Previous playback position in seconds * @param currentPosition Current playback position in seconds * @returns true if change is significant (likely a seek) */ export declare function isSignificantPositionChange(previousPosition: number, currentPosition: number): boolean; //# sourceMappingURL=watchProgress.d.ts.map