saltfish
Version:
An interactive video-guided tour system for web applications
30 lines • 1.42 kB
TypeScript
/**
* Maximum age in milliseconds for saved progress to be considered valid
* Progress older than this will be ignored and playlists will start from beginning
*/
export declare const MAX_PROGRESS_AGE_MS = 6000;
/**
* Parses a timestamp from various formats (Firestore, number, etc.)
* @param progressData - The progress data object containing timestamp information
* @returns Timestamp in milliseconds, or null if no valid timestamp found
*/
export declare function parseProgressTimestamp(progressData: any): number | null;
/**
* Checks if saved progress is recent enough to be used for resuming playback
* @param progressData - The progress data object containing timestamp information
* @param maxAgeMs - Maximum age in milliseconds (defaults to MAX_PROGRESS_AGE_MS)
* @returns Object with isValid boolean and ageMs number
*/
export declare function isProgressRecent(progressData: any, maxAgeMs?: number): {
isValid: boolean;
ageMs: number | null;
timestampMs: number | null;
};
/**
* Logs progress validation details for debugging
* @param playlistId - The playlist ID being checked
* @param progressData - The progress data object
* @param context - Context string for the log (e.g., 'PlaylistLoader', 'PlayerInitializationService')
*/
export declare function logProgressValidation(playlistId: string, progressData: any, context: string): void;
//# sourceMappingURL=progressUtils.d.ts.map