/** * Platform Detection Utilities * Comprehensive utilities for detecting platform, device, and browser information * These utilities provide detailed information about the user's environment */ import type { PlatformInfo, AppInfo, DeviceInfo } from '@plyaz/types/api'; export declare function detectOS(userAgent?: string): PlatformInfo['os']; export declare function detectRuntime(userAgent?: string): PlatformInfo['runtime']; /** * Detect device type from user agent * * @param userAgent - User agent string or empty string * @returns Device type identifier */ export declare function detectDeviceType(userAgent?: string): PlatformInfo['deviceType']; /** * Check if device is mobile * * @param userAgent - User agent string or empty string * @returns True if mobile device */ export declare function detectIsMobile(userAgent?: string): boolean; /** * Check if device has touch support * * @returns True if touch is supported */ export declare function detectIsTouch(): boolean; /** * Detect screen size category * * @returns Screen size category */ export declare function detectScreenSize(): PlatformInfo['screenSize']; /** * Generate a browser fingerprint for device identification * Creates a semi-unique identifier based on browser characteristics * * @returns Fingerprint string */ export declare function generateBrowserFingerprint(): string; /** * Get user agent string safely * * @returns User agent string or empty string */ export declare function getUserAgent(): string; /** * Detect current platform information * Works in both browser and Node.js environments * * @returns Platform detection results * * @example * ```typescript * const platform = detectPlatform(); * console.log(`Running on ${platform.os} with ${platform.runtime}`); * ``` */ export declare function detectPlatform(): PlatformInfo; /** * Get application version information * Detects version from environment variables and package.json * * @returns Application version information * * @example * ```typescript * const app = getAppVersion(); * console.log(`Version: ${app.version} (${app.environment})`); * ``` */ export declare function getAppVersion(): AppInfo; export declare function getDeviceId(): string; /** * Get comprehensive device information * Combines platform, screen, and system information * * @returns Device information object * * @example * ```typescript * const device = getDeviceInfo(); * console.log(`Device ${device.id} on ${device.platform.os}`); * ``` */ export declare function getDeviceInfo(): DeviceInfo; /** * Get screen resolution * * @returns Screen resolution object or null */ export declare function getScreenResolution(): { width: number; height: number; } | null; /** * Get color depth * * @returns Color depth in bits or null */ export declare function getColorDepth(): number | null; /** * Get pixel ratio * * @returns Device pixel ratio or 1 */ export declare function getPixelRatio(): number; /** * Get browser language * * @returns Browser language code or empty string */ export declare function getBrowserLanguage(): string; /** * Get browser languages * * @returns Array of language codes */ export declare function getBrowserLanguages(): readonly string[]; /** * Check if cookies are enabled * * @returns True if cookies are enabled */ export declare function areCookiesEnabled(): boolean; /** * Check if Do Not Track is enabled * * @returns True if DNT is enabled */ export declare function isDoNotTrackEnabled(): boolean; /** * Get timezone offset in minutes * * @returns Timezone offset in minutes */ export declare function getTimezoneOffset(): number; /** * Get timezone name * * @returns Timezone name */ export declare function getTimezoneName(): string; /** * Export all utilities as a namespace for convenience */ export declare const Platform: { readonly detectOS: typeof detectOS; readonly detectRuntime: typeof detectRuntime; readonly detectDeviceType: typeof detectDeviceType; readonly detectIsMobile: typeof detectIsMobile; readonly detectIsTouch: typeof detectIsTouch; readonly detectScreenSize: typeof detectScreenSize; readonly detectPlatform: typeof detectPlatform; readonly generateBrowserFingerprint: typeof generateBrowserFingerprint; readonly getUserAgent: typeof getUserAgent; readonly getAppVersion: typeof getAppVersion; readonly getDeviceId: typeof getDeviceId; readonly getDeviceInfo: typeof getDeviceInfo; readonly getScreenResolution: typeof getScreenResolution; readonly getColorDepth: typeof getColorDepth; readonly getPixelRatio: typeof getPixelRatio; readonly getBrowserLanguage: typeof getBrowserLanguage; readonly getBrowserLanguages: typeof getBrowserLanguages; readonly areCookiesEnabled: typeof areCookiesEnabled; readonly isDoNotTrackEnabled: typeof isDoNotTrackEnabled; readonly getTimezoneOffset: typeof getTimezoneOffset; readonly getTimezoneName: typeof getTimezoneName; }; //# sourceMappingURL=platform.d.ts.map