/** * Utility Helper Functions * * Common utility functions used throughout the UniFi MCP server. */ /** * Sleep for specified milliseconds */ export declare function sleep(ms: number): Promise; /** * Generate a random ID */ export declare function generateId(prefix?: string): string; /** * Format bytes to human readable string */ export declare function formatBytes(bytes: number, decimals?: number): string; /** * Format duration in milliseconds to human readable string */ export declare function formatDuration(ms: number): string; /** * Deep clone an object */ export declare function deepClone(obj: T): T; /** * Debounce function calls */ export declare function debounce any>(func: T, wait: number): (...args: Parameters) => void; /** * Throttle function calls */ export declare function throttle any>(func: T, limit: number): (...args: Parameters) => void; /** * Safely parse JSON */ export declare function safeJsonParse(json: string, defaultValue?: T): T | null; /** * Check if value is empty */ export declare function isEmpty(value: any): boolean; /** * Truncate string with ellipsis */ export declare function truncate(str: string, length: number, suffix?: string): string; /** * Convert camelCase to snake_case */ export declare function camelToSnake(str: string): string; /** * Convert snake_case to camelCase */ export declare function snakeToCamel(str: string): string; /** * Capitalize first letter */ export declare function capitalize(str: string): string; /** * Generate a hash from string */ export declare function simpleHash(str: string): number; /** * Chunk array into smaller arrays */ export declare function chunk(array: T[], size: number): T[][]; /** * Remove duplicates from array */ export declare function unique(array: T[]): T[]; /** * Group array by key */ export declare function groupBy(array: T[], key: keyof T): Record; /** * Pick specific properties from object */ export declare function pick(obj: T, keys: K[]): Pick; /** * Omit specific properties from object */ export declare function omit(obj: T, keys: K[]): Omit; /** * Retry function with exponential backoff */ export declare function retry(fn: () => Promise, options?: { retries?: number; delay?: number; backoff?: number; maxDelay?: number; }): Promise; /** * Create a timeout promise */ export declare function timeout(promise: Promise, ms: number): Promise; /** * Measure execution time of a function */ export declare function measureTime(fn: () => Promise): Promise<{ result: T; duration: number; }>; /** * Create a simple cache with TTL */ export declare function createCache(ttlMs?: number): { get(key: string): T | undefined; set(key: string, value: T): void; delete(key: string): boolean; clear(): void; size(): number; }; //# sourceMappingURL=helpers.d.ts.map