saltfish
Version:
An interactive video-guided tour system for web applications
80 lines • 2.7 kB
TypeScript
import type { Step } from '../types';
import type { TriggerManager } from './TriggerManager';
/**
* Manages transitions between steps in the Saltfish playlist Player
* Serves as a single source of truth for determining when to move to the next step
*/
export declare class TransitionManager {
private activeTransitions;
private waitingForInteraction;
private triggerManager;
constructor();
/**
* Sets the TriggerManager reference for coordinating autoStart triggers
* @param triggerManager - The TriggerManager instance
*/
setTriggerManager(triggerManager: TriggerManager): void;
/**
* Monitors history pushState and replaceState methods to detect SPA navigation
*/
private monitorHistoryChanges;
/**
* Handles URL changes by checking active URL path transitions and autoStart triggers
*/
private handleURLChange;
/**
* Sets up transitions for a step
* @param step - The step to set up transitions for
* @param triggerImmediately - Whether to immediately trigger non-interaction transitions
*/
setupTransitions(step: Step, triggerImmediately?: boolean): void;
/**
* Sets up DOM click transitions
* @param transition - The transition configuration
*/
private setupDOMClickTransition;
/**
* Sets up timeout transitions
* @param transition - The transition configuration
* @param triggerImmediately - Whether to trigger immediately
*/
private setupTimeoutTransition;
/**
* Sets up URL path transitions
* @param transition - The transition configuration
*/
private setupURLPathTransition;
/**
* Checks if the current URL path matches a pattern
*/
private isURLPathMatch;
/**
* Triggers a transition to a new step
* @param nextStepId - The ID of the step to transition to
*/
triggerTransition(nextStepId: string): void;
/**
* Cleans up all active transitions
*/
cleanupTransitions(): void;
/**
* Sets the waiting for interaction state
* @param isWaiting - Whether the player is waiting for interaction
*/
setWaitingForInteraction(isWaiting: boolean): void;
/**
* Checks if the player is waiting for interaction
* @returns Whether the player is waiting for interaction
*/
isWaitingForInteraction(): boolean;
/**
* Destroys the transition manager and cleans up resources
*/
destroy(): void;
/**
* Sets up DOM element visible transitions
* @param transition - The transition configuration
*/
private setupDOMElementVisibleTransition;
}
//# sourceMappingURL=TransitionManager.d.ts.map