nexus-react-core
Version:
A comprehensive React toolkit with services, hooks, and Redux store management
40 lines • 1.06 kB
TypeScript
declare global {
interface Window {
Telegram?: {
WebApp?: any;
};
}
}
interface DeviceInfo {
type: 'desktop' | 'mobile' | 'tablet';
os: string;
browser: string;
version: string;
}
interface PlatformData {
platform: 'web' | 'mobile' | 'telegram';
userAgent: string;
deviceInfo: DeviceInfo;
ipAddress: string;
}
/**
* Detects the current platform and device information
* Returns platform data to send with auth requests
*/
export declare const detectPlatformData: () => Promise<PlatformData>;
/**
* Simple function to check if user is on Telegram
*/
export declare const isTelegramPlatform: () => boolean;
/**
* Simple function to check if user is on mobile
*/
export declare const isMobilePlatform: () => boolean;
/**
* Synchronous version for immediate checks (without IP address)
*/
export declare const detectPlatformDataSync: () => Omit<PlatformData, "ipAddress"> & {
ipAddress?: string;
};
export type { DeviceInfo, PlatformData };
//# sourceMappingURL=platformDetection.d.ts.map