webdev-power-kit
Version:
A powerful toolkit that simplifies access to browser features like clipboard, notifications, battery, vibration, and more — perfect for modern web developers.
21 lines (20 loc) • 570 B
TypeScript
/**
* @fileoverview Get browser network connection details using the Network Information API.
* Provides type, speed estimate, save-data preference, etc.
*/
interface ConnectionInfo {
type?: string;
effectiveType?: string;
downlink?: number;
rtt?: number;
saveData?: boolean;
isSupported: boolean;
}
/**
* Returns current network connection information.
* Falls back gracefully if API is not supported.
*
* @returns An object with network type, speed, and flags.
*/
export declare function getConnectionInfo(): ConnectionInfo;
export {};