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.
17 lines (16 loc) • 532 B
TypeScript
/**
* @fileoverview Performs a ping to a given URL by making a HEAD request.
* Useful for checking server/API availability and latency.
*/
export interface PingResult {
success: boolean;
status?: number;
time?: number;
error?: string;
}
/**
* Sends a HEAD request to the specified URL and measures the response time.
* @param url - The URL to ping (must support HEAD method)
* @returns A promise that resolves with result, status, and timing
*/
export declare function ping(url: string): Promise<PingResult>;