detect-tab
Version:
A comprehensive tab detection and management library for web applications
39 lines • 1.06 kB
TypeScript
/**
* Utility functions for tab detection
*/
/**
* Check if the Page Visibility API is supported
*/
export declare function isVisibilityAPISupported(): boolean;
/**
* Check if the browser is supported
*/
export declare function isBrowserSupported(): boolean;
/**
* Get the browser-specific visibility property names
*/
export declare function getVisibilityProperties(): {
hidden: string;
visibilityChange: string;
};
/**
* Debounce function to limit rapid event firing
*/
export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void;
/**
* Get current timestamp
*/
export declare function now(): number;
/**
* Format time duration in human-readable format
*/
export declare function formatDuration(milliseconds: number): string;
/**
* Safe JSON parse with fallback
*/
export declare function safeJSONParse<T>(json: string, fallback: T): T;
/**
* Check if localStorage is available
*/
export declare function isStorageAvailable(): boolean;
//# sourceMappingURL=utils.d.ts.map