UNPKG

@gailbear/ngx-device-detector

Version:

<a href="https://koderlabs.github.io/ngx-device-detector"> <h1 align="center">ngx-device-detector</h1> </a>

53 lines (52 loc) 1.53 kB
export interface DeviceInfo { userAgent: string; os: string; browser: string; device: string; os_version: string; browser_version: string; } export declare class DeviceDetectorService { private platformId; ua: string; userAgent: string; os: string; browser: string; device: string; os_version: string; browser_version: string; constructor(platformId: any); /** * @author Ahsan Ayaz * @desc Sets the initial value of the device when the service is initiated. * This value is later accessible for usage */ private _setDeviceInfo(); /** * @author Ahsan Ayaz * @desc Returns the device information * @returns the device information object. */ getDeviceInfo(): DeviceInfo; /** * @author Ahsan Ayaz * @desc Compares the current device info with the mobile devices to check * if the current device is a mobile. * @returns whether the current device is a mobile */ isMobile(): boolean; /** * @author Ahsan Ayaz * @desc Compares the current device info with the tablet devices to check * if the current device is a tablet. * @returns whether the current device is a tablet */ isTablet(): boolean; /** * @author Ahsan Ayaz * @desc Compares the current device info with the desktop devices to check * if the current device is a desktop device. * @returns whether the current device is a desktop device */ isDesktop(): boolean; }