saltfish
Version:
An interactive video-guided tour system for web applications
61 lines • 2.38 kB
TypeScript
import type { IPlayerInitializationService, IUserManagementService, IPlaylistOrchestrator, ManagedManagers } from './ServiceInterfaces';
import type { SaltfishConfig, WatchedPlaylists } from '../../types';
/**
* Service for handling player initialization logic
*/
export declare class PlayerInitializationService implements IPlayerInitializationService {
private managers;
private userManagementService?;
private playlistOrchestrator?;
private shareLinkService;
private lastConfig;
constructor(managers: ManagedManagers);
/**
* Set the user management service for dependency
*/
setUserManagementService(service: IUserManagementService): void;
/**
* Set the playlist orchestrator for dependency
*/
setPlaylistOrchestrator(orchestrator: IPlaylistOrchestrator): void;
/**
* Get the last config for restoration
*/
getLastConfig(): SaltfishConfig | null;
/**
* Initialize the player with configuration
*/
initialize(config: SaltfishConfig): Promise<void>;
/**
* Fetch user data from backend
*/
fetchUserData(userId: string, userData?: Record<string, unknown>): Promise<void>;
/**
* Load anonymous user data from localStorage
*/
loadAnonymousUserData(userId: string, userData?: Record<string, unknown>): Promise<void>;
/**
* Check for in-progress playlists and resume them
*/
checkAndResumeInProgressPlaylist(watchedPlaylists: WatchedPlaylists): Promise<boolean>;
/**
* Check for pending navigation from cross-page URL transitions and auto-start the playlist
* This handles the case where user navigated to a new page (hard refresh)
* and we need to resume from the step that was waiting for that URL
* @returns true if a playlist was started from pending navigation
*/
private checkAndResumeFromPendingNavigation;
/**
* Checks if the current URL path matches a pattern
* Uses the same logic as TransitionManager for consistency
* @param pattern - The URL pattern to match (supports wildcards)
* @returns true if the current URL matches the pattern
*/
private isURLPathMatch;
/**
* Get or create persistent anonymous user ID
*/
getOrCreateAnonymousUserId(): string;
destroy(): void;
}
//# sourceMappingURL=PlayerInitializationService.d.ts.map