/** * Facade for browser information provided by [ua-parser-js](https://www.npmjs.com/package/ua-parser-js). * Ported from https://github.com/optimizely/client-js/blob/92589a0adef089556ab986ee79345342be339116/src/core/lib/detect.js * @module */ /** * @typedef {Object} DetectionResults * A subset of the data returned by `ua-parser-js`, with some normalizations applied. * * @property {Object} browser * @property {string} browser.id * A short code naming the browser. * One of `['gc', 'ie', 'ff', 'edge', 'opera', 'safari', 'uc browser', 'samsung', 'facebook', 'unknown']`. * @property {string=} browser.version * @property {Object} platform * @property {string} platform.name * OS name. Result from ua-parser-js, lowercased. (default: 'unknown') * See https://github.com/faisalman/ua-parser-js/#methods for full list. * @property {string=} platform.version * @property {Object} device * @property {string} device.model, * One of `['iphone', 'ipad', 'unknown']`. * @property {string} device.type * One of `['console', 'desktop_laptop', 'mobile', 'tablet', 'smarttv', 'wearable', 'embedded', 'unknown']`. * 1. If a [type](https://github.com/faisalman/ua-parser-js/tree/0.7.12#methods) was parsed by ua-parser-js, use that. * 2. Else if `isMobile` is true, assume 'mobile' (many generic Androids are phones). * 3. Else if `browser.id === 'unknown'`, 'unknown' (probably a bot). * 4. Else, assume 'desktop_laptop'. * @property {boolean} device.isMobile * True iff the device is a phone, tablet, or running an OS that is one of * `['android', 'blackberry', 'ios', 'windows phone']`. */ export type DetectionResults = { browser: { id: string; version?: string; }; engine: { name: string; version?: string; }; platform: { name: string; version?: string; }; device: { model: string; type: string; isMobile: boolean; }; }; /** * Parse the userAgent string and return a subset of the data. * * @param {string} userAgent User agent string * @returns {module:lib/detect~DetectionResults} */ export declare function parseUA(userAgent: string): DetectionResults; declare const _default: { parseUA: typeof parseUA; }; export default _default;