saltfish
Version:
An interactive video-guided tour system for web applications
58 lines • 2.24 kB
TypeScript
import type { PlaylistManifest, PlaylistOptions } from '../types';
export interface ManifestLoadResult {
manifest: PlaylistManifest;
startStepId: string;
}
export interface ManifestLoadOptions {
manifestPath: string;
playlistOptions: PlaylistOptions;
savedProgress?: Record<string, Record<string, unknown>>;
}
/**
* Handles loading and processing of playlist manifests
* Separates manifest fetching logic from store management
*/
export declare class PlaylistLoader {
/**
* Loads a playlist manifest from the given path
* @param options - Load configuration including path and options
* @returns Promise resolving to manifest and determined start step
*/
loadManifest(options: ManifestLoadOptions): Promise<ManifestLoadResult>;
/**
* Fetches manifest from URL
* @param manifestPath - Path to manifest file
* @returns Promise resolving to manifest object
*/
private fetchManifest;
/**
* Validates that the manifest has required structure
* @param manifest - Manifest object to validate
* @throws Error if manifest is invalid
*/
private validateManifest;
/**
* Determines which step to start from based on persistence and saved progress
* @param manifest - The loaded playlist manifest
* @param options - Playlist configuration options
* @param savedProgress - Previously saved progress data
* @returns The step ID to start from
*/
private determineStartStep;
/**
* Checks for pending navigation from a cross-page URL transition
* 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
* @param manifest - The loaded playlist manifest
* @returns The pending navigation data if valid, null otherwise
*/
private checkPendingNavigation;
/**
* 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;
}
//# sourceMappingURL=PlaylistLoader.d.ts.map