/** * Platform Detection Utilities * * Provides functions to detect user's platform (iOS, Android, Desktop), * browser information, and WebAuthn API support. * * @module utils/platform */ /** * Supported platform types */ export type Platform = 'iOS' | 'Android' | 'Desktop' | 'Unknown'; /** * Browser information including name, version, and detected platform */ export interface BrowserInfo { /** * Browser name (e.g., 'Chrome', 'Safari', 'Firefox') */ name: string; /** * Browser version string */ version: string; /** * Detected platform */ platform: Platform; } /** * Detects the user's platform based on the user agent string * * This function checks the navigator.userAgent and navigator.vendor * to determine if the user is on iOS, Android, Desktop, or Unknown platform. * * @returns The detected platform type * * @example * ```typescript * const platform = detectPlatform(); * if (platform === 'iOS') { * // iOS-specific logic * } * ``` */ export declare function detectPlatform(): Platform; /** * Extracts detailed browser information including name, version, and platform * * This function parses the user agent string to determine the browser * name and version. It supports detection of major browsers including * Chrome, Safari, Firefox, Edge, and Opera. * * @returns Browser information object * * @example * ```typescript * const info = getBrowserInfo(); * console.log(`${info.name} ${info.version} on ${info.platform}`); * // Output: "Chrome 120.0 on Desktop" * ``` */ export declare function getBrowserInfo(): BrowserInfo; /** * Checks if the WebAuthn API is supported in the current browser environment * * This function verifies that the required WebAuthn API is available: * - window.PublicKeyCredential (existence) * - navigator.credentials.create and .get methods * * Note: We use a lenient check that works across all platforms including * Android browsers where PublicKeyCredential might not be a constructor function. * * @returns true if WebAuthn is supported, false otherwise * * @example * ```typescript * if (!checkWebAuthnSupport()) { * console.error('WebAuthn is not supported in this browser'); * return; * } * // Proceed with WebAuthn operations * ``` */ export declare function checkWebAuthnSupport(): boolean; /** * Checks if the browser supports specific WebAuthn extensions * * This function verifies support for optional WebAuthn extensions like * PRF (Pseudo-Random Function) and largeBlob. * * @param _extension - The extension name to check (e.g., 'prf', 'largeBlob') * @returns Promise that resolves to true if the extension is supported * * @example * ```typescript * const prfSupported = await checkWebAuthnExtensionSupport('prf'); * if (prfSupported) { * console.log('PRF extension is supported'); * } * ``` */ export declare function checkWebAuthnExtensionSupport(_extension: string): Promise; /** * Gets a human-readable description of the current platform * * @returns A descriptive string about the platform * * @example * ```typescript * const description = getPlatformDescription(); * // Returns: "Chrome 120.0 on iOS" * ``` */ export declare function getPlatformDescription(): string; //# sourceMappingURL=platform.d.ts.map