From 31b9240aec357889b64b5716158b231a3ae90032 Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Sun, 8 Jul 2018 12:31:23 +0300 Subject: [PATCH] Fix docs --- README.md | 7 +----- docs/Bowser.html | 2 +- docs/Parser.html | 40 ++++++++++++++++----------------- docs/bowser.js.html | 2 +- docs/global.html | 54 ++++++++++++++++++++++++++++++++++++--------- docs/index.html | 11 ++------- docs/parser.js.html | 27 ++++++++++++++--------- docs/utils.js.html | 2 +- src/parser.js | 25 ++++++++++++--------- 9 files changed, 100 insertions(+), 70 deletions(-) diff --git a/README.md b/README.md index 98180ba..c54e5ea 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ const isValidBrowser = bowser.compare({ }); ``` -As you can see, settings for any particular OS has more priority and redefines settings of `any` property. +Settings for any particular OS has more priority and redefines settings of standalone browsers. ### new Bowser(`:Object`) Use it to get object with detected flags of your current browser. @@ -170,11 +170,6 @@ For unknown browsers, Bowser makes a best guess from the UA string. So, these m ### Rendering engine flags If detected, one of these flags may be set to true: - * `webkit` - Chrome 0-27, Android <4.4, iOs, BB, etc. - * `blink` - Chrome >=28, Android >=4.4, Opera, etc. - * `gecko` - Firefox, etc. - * `msie` - IE <= 11 - * `msedge` - IE > 11 Safari, Chrome and some other minor browsers will report that they have `webkit` engines. Firefox and Seamonkey will report that they have `gecko` engines. diff --git a/docs/Bowser.html b/docs/Bowser.html index bc5929f..3ea379b 100644 --- a/docs/Bowser.html +++ b/docs/Bowser.html @@ -559,7 +559,7 @@ bowser.getResult()
diff --git a/docs/Parser.html b/docs/Parser.html index 61b5139..e3aa923 100644 --- a/docs/Parser.html +++ b/docs/Parser.html @@ -277,7 +277,7 @@ like Parser#parseBrowser or Source:
@@ -379,7 +379,7 @@ like Parser#parseBrowser or Source:
@@ -485,7 +485,7 @@ like Parser#parseBrowser or Source:
@@ -591,7 +591,7 @@ like Parser#parseBrowser or Source:
@@ -693,7 +693,7 @@ like Parser#parseBrowser or Source:
@@ -804,7 +804,7 @@ like Parser#parseBrowser or Source:
@@ -971,7 +971,7 @@ like Parser#parseBrowser or Source:
@@ -1077,7 +1077,7 @@ like Parser#parseBrowser or Source:
@@ -1179,7 +1179,7 @@ like Parser#parseBrowser or Source:
@@ -1350,7 +1350,7 @@ like Parser#parseBrowser or Source:
@@ -1452,7 +1452,7 @@ like Parser#parseBrowser or Source:
@@ -1558,7 +1558,7 @@ like Parser#parseBrowser or Source:
@@ -1710,7 +1710,7 @@ the OS called "anything" or the platform called "anything"Source:
@@ -1794,7 +1794,7 @@ the OS called "anything" or the platform called "anything"Source:
@@ -1896,7 +1896,7 @@ the OS called "anything" or the platform called "anything"Source:
@@ -1998,7 +1998,7 @@ the OS called "anything" or the platform called "anything"Source:
@@ -2103,7 +2103,7 @@ the OS called "anything" or the platform called "anything"Source:
@@ -2205,7 +2205,7 @@ the OS called "anything" or the platform called "anything"Source:
@@ -2376,7 +2376,7 @@ Returns undefined when the browser is no described in the checkTree
Source:
@@ -2528,7 +2528,7 @@ Returns undefined when the browser is no described in the checkTree
diff --git a/docs/bowser.js.html b/docs/bowser.js.html index 5796c9c..dd826b2 100644 --- a/docs/bowser.js.html +++ b/docs/bowser.js.html @@ -96,7 +96,7 @@ export default Bowser;
diff --git a/docs/global.html b/docs/global.html index 84f748d..4f08f8c 100644 --- a/docs/global.html +++ b/docs/global.html @@ -238,6 +238,9 @@ String +| + +undefined @@ -255,7 +258,7 @@ - +

Browser name, like "Chrome" or "Internet Explorer"

@@ -269,6 +272,9 @@ String +| + +undefined @@ -286,7 +292,7 @@ - +

Browser version as a String "12.01.45334.10"

@@ -350,6 +356,9 @@ String +| + +undefined @@ -367,7 +376,7 @@ - +

OS name, like "Windows" or "macOS"

@@ -381,6 +390,9 @@ String +| + +undefined @@ -398,7 +410,7 @@ - +

OS version, like "NT 5.1" or "10.11.1"

@@ -412,6 +424,9 @@ String +| + +undefined @@ -429,7 +444,7 @@ - +

OS name, like "XP" or "High Sierra"

@@ -493,6 +508,9 @@ String +| + +undefined @@ -510,7 +528,7 @@ - +

platform type, can be either "desktop", "tablet" or "mobile"

@@ -524,6 +542,9 @@ String +| + +undefined @@ -541,7 +562,8 @@ - +

Vendor of the device, +like "Apple" or "Samsung"

@@ -555,6 +577,9 @@ String +| + +undefined @@ -572,7 +597,8 @@ - +

Device model, +like "iPhone" or "Kindle Fire HD 7"

@@ -636,6 +662,9 @@ String +| + +undefined @@ -653,7 +682,7 @@ - +

Can be any of this: WebKit, Blink, Gecko, Trident, Presto, EdgeHTML

@@ -667,6 +696,9 @@ String +| + +undefined @@ -684,7 +716,7 @@ - +

String version of the engine

@@ -726,7 +758,7 @@
diff --git a/docs/index.html b/docs/index.html index 11dc9a0..782952a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -113,7 +113,7 @@ const isValidBrowser = bowser.compare({ chrome: ">20.1.1432", firefox: ">31", opera: ">22" -});

As you can see, settings for any particular OS has more priority and redefines settings of any property.

+});

Settings for any particular OS has more priority and redefines settings of standalone browsers.

new Bowser(:Object)

Use it to get object with detected flags of your current browser.

bowser._detect(ua :String):Object

Use it to get object with detected flags from User Agent string.

bowser.check(minVersions:Object, strictMode:Boolean, [ua]:String):Boolean

Use it to check if browser is supported. In default non-strict mode any browser family not present in minVersions will pass the check (like Chrome in the third call in the sample bellow). When strict mode is enabled then any not specified browser family in minVersions will cause check to return false (in the sample it is the fourth call, the last one).

@@ -145,13 +145,6 @@ bowser.check({chrome: "45"}, true, window.navigator.userAgent); // fal

For unknown browsers, Bowser makes a best guess from the UA string. So, these may not be set.

Rendering engine flags

If detected, one of these flags may be set to true:

-

Safari, Chrome and some other minor browsers will report that they have webkit engines. Firefox and Seamonkey will report that they have gecko engines.

if (bowser.webkit) {
@@ -243,7 +236,7 @@ check if all tests are still passing.


- Documentation generated by JSDoc 3.5.5 on Sun Jul 08 2018 12:09:12 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Sun Jul 08 2018 12:30:49 GMT+0300 (EEST) using the docdash theme.
diff --git a/docs/parser.js.html b/docs/parser.js.html index ecdb0a7..beb24a5 100644 --- a/docs/parser.js.html +++ b/docs/parser.js.html @@ -69,19 +69,24 @@ class Parser { /** * @typedef ParsedResult * @property {Object} browser - * @property {String} [browser.name] - * @property {String} [browser.version] + * @property {String|undefined} [browser.name] + * Browser name, like `"Chrome"` or `"Internet Explorer"` + * @property {String|undefined} [browser.version] Browser version as a String `"12.01.45334.10"` * @property {Object} os - * @property {String} [os.name] - * @property {String} [os.version] - * @property {String} [os.versionName] + * @property {String|undefined} [os.name] OS name, like `"Windows"` or `"macOS"` + * @property {String|undefined} [os.version] OS version, like `"NT 5.1"` or `"10.11.1"` + * @property {String|undefined} [os.versionName] OS name, like `"XP"` or `"High Sierra"` * @property {Object} platform - * @property {String} [platform.type] - * @property {String} [platform.vendor] - * @property {String} [platform.model] + * @property {String|undefined} [platform.type] + * platform type, can be either `"desktop"`, `"tablet"` or `"mobile"` + * @property {String|undefined} [platform.vendor] Vendor of the device, + * like `"Apple"` or `"Samsung"` + * @property {String|undefined} [platform.model] Device model, + * like `"iPhone"` or `"Kindle Fire HD 7"` * @property {Object} engine - * @property {String} [engine.name] - * @property {String} [engine.version] + * @property {String|undefined} [engine.name] + * Can be any of this: `WebKit`, `Blink`, `Gecko`, `Trident`, `Presto`, `EdgeHTML` + * @property {String|undefined} [engine.version] String version of the engine */ this.parsedResult = {}; @@ -476,7 +481,7 @@ export default Parser;
- Documentation generated by JSDoc 3.5.5 on Sun Jul 08 2018 12:09:12 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Sun Jul 08 2018 12:30:48 GMT+0300 (EEST) using the docdash theme.
diff --git a/docs/utils.js.html b/docs/utils.js.html index a6490dc..04d2e11 100644 --- a/docs/utils.js.html +++ b/docs/utils.js.html @@ -186,7 +186,7 @@ module.exports = Utils;
- Documentation generated by JSDoc 3.5.5 on Sun Jul 08 2018 12:09:12 GMT+0300 (EEST) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Sun Jul 08 2018 12:30:48 GMT+0300 (EEST) using the docdash theme.
diff --git a/src/parser.js b/src/parser.js index 6fb6541..2ce0fc9 100644 --- a/src/parser.js +++ b/src/parser.js @@ -30,19 +30,24 @@ class Parser { /** * @typedef ParsedResult * @property {Object} browser - * @property {String} [browser.name] - * @property {String} [browser.version] + * @property {String|undefined} [browser.name] + * Browser name, like `"Chrome"` or `"Internet Explorer"` + * @property {String|undefined} [browser.version] Browser version as a String `"12.01.45334.10"` * @property {Object} os - * @property {String} [os.name] - * @property {String} [os.version] - * @property {String} [os.versionName] + * @property {String|undefined} [os.name] OS name, like `"Windows"` or `"macOS"` + * @property {String|undefined} [os.version] OS version, like `"NT 5.1"` or `"10.11.1"` + * @property {String|undefined} [os.versionName] OS name, like `"XP"` or `"High Sierra"` * @property {Object} platform - * @property {String} [platform.type] - * @property {String} [platform.vendor] - * @property {String} [platform.model] + * @property {String|undefined} [platform.type] + * platform type, can be either `"desktop"`, `"tablet"` or `"mobile"` + * @property {String|undefined} [platform.vendor] Vendor of the device, + * like `"Apple"` or `"Samsung"` + * @property {String|undefined} [platform.model] Device model, + * like `"iPhone"` or `"Kindle Fire HD 7"` * @property {Object} engine - * @property {String} [engine.name] - * @property {String} [engine.version] + * @property {String|undefined} [engine.name] + * Can be any of this: `WebKit`, `Blink`, `Gecko`, `Trident`, `Presto`, `EdgeHTML` + * @property {String|undefined} [engine.version] String version of the engine */ this.parsedResult = {};