saltfish
Version:
An interactive video-guided tour system for web applications
76 lines • 2.5 kB
TypeScript
import type { ButtonOverlay, ResettableManager } from '../types';
/**
* Manager class for handling user interactions.
* Now subscribes to store changes for automatic state management.
*/
export declare class InteractionManager implements ResettableManager {
private container;
private buttons;
private buttonContainer;
private scrollIndicator;
private storeUnsubscribe;
private storageManager;
/**
* Creates interaction elements
* @param container - The container element for interactions
*/
create(container: HTMLElement): void;
/**
* Creates interactive buttons positioned within the shadow DOM
* @param buttons - Button configurations
*/
createButtons(buttons: ButtonOverlay[]): void;
/**
* Handles the video90PercentReached event
* @param _event - The custom event dispatched when video reaches 90%
*/
private handleVideo90PercentReached;
/**
* Shows buttons with staggered animation (called when video reaches 90%)
*/
showButtonsAt90Percent(): void;
/**
* Sets up scroll detection to hide arrow when scrolled to bottom
* @param container - The scrollable container element
*/
private setupScrollIndicator;
/**
* Updates center play button position based on button count
* Positions the button centered between the top of the player and the top of the first button
* @param buttonCount - Number of buttons displayed
*/
private updateCenterPlayButtonPosition;
/**
* Clears all interactive buttons
*/
clearButtons(): void;
/**
* Updates button visibility and positions based on player state
*/
updateButtonPositions(): void;
/**
* Handles button clicks
* @param event - The click event
* @param buttonConfig - The button configuration
*/
private handleButtonClick;
/**
* Checks if the current step is the last step in the playlist
* @param store - The current store state
* @returns true if current step is the last step, false otherwise
*/
private isCurrentStepLast;
/**
* Flushes analytics events to ensure they're sent before player destruction
*/
private flushAnalytics;
/**
* Resets the interaction manager to initial state for reuse
*/
reset(): void;
/**
* Cleans up resources used by the interaction manager
*/
destroy(): void;
}
//# sourceMappingURL=InteractionManager.d.ts.map