fullscreen-toggle
Version:
A lightweight utility to toggle fullscreen mode in web applications. Works with all JavaScript frameworks including React, Angular, Vue, and vanilla JS.
24 lines (23 loc) • 955 B
TypeScript
/**
* Toggles fullscreen mode for web applications
* @param goFullScreen - true to enter fullscreen, false to exit fullscreen
* @returns Promise<boolean> - resolves to true if successful, false otherwise
*/
export declare function toggleFullScreen(goFullScreen: boolean): Promise<boolean>;
/**
* Checks if the browser is currently in fullscreen mode
* @returns boolean - true if in fullscreen, false otherwise
*/
export declare function isFullScreen(): boolean;
/**
* Checks if fullscreen API is supported by the browser
* @returns boolean - true if supported, false otherwise
*/
export declare function isFullScreenSupported(): boolean;
/**
* Adds an event listener for fullscreen changes
* @param callback - function to call when fullscreen state changes
* @returns function to remove the event listener
*/
export declare function onFullScreenChange(callback: (isFullScreen: boolean) => void): () => void;
export default toggleFullScreen;