@tinytapanalytics/sdk
Version:
Behavioral psychology platform that detects visitor frustration, predicts abandonment, and helps you save at-risk conversions in real-time
153 lines • 3.55 kB
TypeScript
/**
* Environment Detector for framework, device, and platform detection
* Provides comprehensive environment analysis for adaptive tracking
*/
import { EnvironmentInfo } from '../types/index';
export declare class EnvironmentDetector {
private environmentInfo;
private detectionCache;
constructor();
/**
* Get complete environment information
*/
getEnvironmentInfo(): EnvironmentInfo;
/**
* Check if current environment is a Single Page Application
*/
isSPA(): boolean;
/**
* Check if current environment is Server-Side Rendered
*/
isSSR(): boolean;
/**
* Get detected framework
*/
getFramework(): 'react' | 'vue' | 'angular' | 'vanilla' | undefined;
/**
* Get platform type
*/
getPlatform(): 'web' | 'mobile-web' | 'amp' | 'unknown';
/**
* Get browser information
*/
getBrowserInfo(): EnvironmentInfo['browser'];
/**
* Get device information
*/
getDeviceInfo(): EnvironmentInfo['device'];
/**
* Get network information
*/
getNetworkInfo(): EnvironmentInfo['network'] | undefined;
/**
* Check if device has touch support
*/
hasTouchSupport(): boolean;
/**
* Check if running in mobile browser
*/
isMobile(): boolean;
/**
* Check if running in tablet browser
*/
isTablet(): boolean;
/**
* Check if running in desktop browser
*/
isDesktop(): boolean;
/**
* Check if running in WebView
*/
isWebView(): boolean;
/**
* Check if browser supports modern features
*/
supportsModernFeatures(): boolean;
/**
* Check if browser supports service workers
*/
supportsServiceWorkers(): boolean;
/**
* Check if browser supports local storage
*/
supportsLocalStorage(): boolean;
/**
* Check if running in private/incognito mode
*/
isPrivateMode(): Promise<boolean>;
/**
* Get viewport dimensions
*/
getViewportDimensions(): {
width: number;
height: number;
};
/**
* Get screen dimensions
*/
getScreenDimensions(): {
width: number;
height: number;
};
/**
* Get pixel density
*/
getPixelDensity(): number;
/**
* Detect complete environment
*/
private detectEnvironment;
/**
* Detect JavaScript framework
*/
private detectFramework;
/**
* Detect if running as Single Page Application
*/
private detectSPA;
/**
* Detect if Server-Side Rendered
*/
private detectSSR;
/**
* Detect platform type
*/
private detectPlatform;
/**
* Detect browser information
*/
private detectBrowser;
/**
* Detect device information
*/
private detectDevice;
/**
* Detect network information
*/
private detectNetwork;
/**
* Extract version from user agent string
*/
private extractVersion;
/**
* Cache detection results
*/
private getCachedResult;
/**
* Update environment info (useful for dynamic changes)
*/
updateEnvironmentInfo(): void;
/**
* Get performance timing information
*/
getPerformanceTiming(): Record<string, number> | null;
/**
* Get First Paint time
*/
private getFirstPaintTime;
/**
* Get First Contentful Paint time
*/
private getFirstContentfulPaintTime;
}
//# sourceMappingURL=EnvironmentDetector.d.ts.map