@developer.notchatbot/webchat
Version:
A beautiful React chatbot widget with single-file bundle
30 lines (29 loc) • 1.07 kB
TypeScript
/**
* Device detection utilities for WebChat
*/
/**
* Detects if the current device is mobile based on user agent and screen size
* @returns {boolean} true if mobile, false if desktop
*/
export declare const isMobileDevice: () => boolean;
/**
* Gets the current device type
* @returns {'mobile' | 'desktop'}
*/
export declare const getDeviceType: () => "mobile" | "desktop";
/**
* Adds a resize listener to detect device type changes
* @param callback Function to call when device type changes
* @returns Cleanup function to remove the listener
*/
export declare const onDeviceTypeChange: (callback: (deviceType: "mobile" | "desktop") => void) => (() => void);
/**
* Gets the browser's language preference
* @returns Browser language code (e.g., 'en-US', 'es-ES')
*/
export declare const getBrowserLanguage: () => string;
/**
* Gets the browser's region/location information based on timezone and locale
* @returns Region string in format "Country/City" (e.g., "US/New_York", "AR/Buenos_Aires")
*/
export declare const getBrowserRegion: () => string;