From bb1150590eee2dda75acda2e2cf1c684e4bf3407 Mon Sep 17 00:00:00 2001 From: Matheus Hahn Date: Mon, 6 Dec 2021 17:31:52 -0300 Subject: [PATCH] chore(Parser): update parser interface with missing methods --- index.d.ts | 51 +++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/index.d.ts b/index.d.ts index d95656a..80b7b9c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -34,6 +34,14 @@ declare namespace Bowser { interface Parser { constructor(UA: string, skipParsing?: boolean): Parser.Parser; + /** + * Check if the version is equals the brownser version + * @param version The string to compare with the brownser version + * @returns {boolean} + */ + + compareVersion(version: string): boolean; + /** * Get parsed browser object * @return {BrowserDetails} Browser's details @@ -135,6 +143,39 @@ declare namespace Bowser { is(anything: any): boolean; + /** + * Check if the browser name equals the passed string + * @param browserName The string to compare with the browser name + * @param [includingAlias=false] The flag showing whether alias will be included into comparison + * @returns {boolean} + */ + + isBrowser(browserName: string, includingAlias?: boolean): boolean; + + /** + * Check if the engine name equals the passed string + * @param engineName The string to compare with the engine name + * @returns {boolean} + */ + + isEngine(engineName: string): boolean; + + /** + * Check if the OS name equals the passed string + * @param OSName The string to compare with the OS name + * @returns {boolean} + */ + + isOS(OSName: string): boolean; + + /** + * Check if the platform name equals the passed string + * @param platformName The string to compare with the platform name + * @returns {boolean} + */ + + isPlatform(platformName: string): boolean; + /** * Parse full information about the browser * @returns {Parser.Parser} @@ -191,16 +232,6 @@ declare namespace Bowser { satisfies(checkTree: checkTree): boolean | undefined; - /** - * Check if the browser name equals the passed string - * @param browserName The string to compare with the browser name - * @param [includingAlias=false] The flag showing whether alias will be included into comparison - * @returns {boolean} - */ - - - isBrowser(browserName: string, includingAlias?: boolean): boolean; - /** * Check if any of the given values satifies `.is(anything)` * @param {string[]} anythings