react-chrono
Version:
A Modern Timeline component for React
17 lines (16 loc) • 604 B
TypeScript
import { MediaState } from '@models/TimelineMediaModel';
interface UseMediaLoadResult {
loadFailed: boolean;
mediaLoaded: boolean;
handleMediaLoaded: () => void;
handleError: () => void;
}
/**
* Custom hook to handle media loading state and error handling
*
* @param id - The ID of the media element
* @param onMediaStateChange - Callback to notify parent component of media state changes
* @returns Object with loading state and handler functions
*/
export declare const useMediaLoad: (id: string, onMediaStateChange: (state: MediaState) => void) => UseMediaLoadResult;
export {};