react-chrono
Version:
A Modern Timeline component for React
40 lines • 1.25 kB
TypeScript
import { RefObject } from 'react';
/**
* Hook return type
*/
interface UseFullscreenReturn {
isFullscreen: boolean;
isSupported: boolean;
toggleFullscreen: () => Promise<void>;
enterFullscreen: () => Promise<void>;
exitFullscreen: () => Promise<void>;
error: string | null;
}
/**
* Hook options
*/
interface UseFullscreenOptions {
onEnter?: () => void;
onExit?: () => void;
onError?: (error: string) => void;
}
/**
* Custom hook for managing fullscreen functionality
* Provides cross-browser compatible fullscreen API with proper error handling
*
* @param elementRef - Ref to the element to make fullscreen
* @param options - Optional callbacks for fullscreen events
* @returns Object with fullscreen state and control functions
*
* @example
* ```tsx
* const containerRef = useRef<HTMLDivElement>(null);
* const { isFullscreen, toggleFullscreen, isSupported } = useFullscreen(containerRef, {
* onEnter: () => console.log('Entered fullscreen'),
* onExit: () => console.log('Exited fullscreen'),
* });
* ```
*/
export declare const useFullscreen: (elementRef: RefObject<HTMLElement>, options?: UseFullscreenOptions) => UseFullscreenReturn;
export {};
//# sourceMappingURL=useFullscreen.d.ts.map