mirror of
https://github.com/lancedikson/bowser
synced 2025-12-05 06:02:14 +00:00
Merge 50faa20258 into eef8480944
This commit is contained in:
commit
d83992aafd
66
index.d.ts
vendored
66
index.d.ts
vendored
@ -2,42 +2,16 @@
|
|||||||
// Project: https://github.com/lancedikson/bowser
|
// Project: https://github.com/lancedikson/bowser
|
||||||
// Definitions by: Alexander P. Cerutti <https://github.com/alexandercerutti>,
|
// Definitions by: Alexander P. Cerutti <https://github.com/alexandercerutti>,
|
||||||
|
|
||||||
export = Bowser;
|
|
||||||
export as namespace Bowser;
|
export as namespace Bowser;
|
||||||
|
|
||||||
export function getParser(UA: string, skipParsing?: boolean): Bowser.Parser.Parser;
|
export function getParser(UA: string, skipParsing?: boolean): Parser.Parser;
|
||||||
export function parse(UA: string): Bowser.Parser.ParsedResult;
|
export function parse(UA: string): Parser.ParsedResult;
|
||||||
export const BROWSER_MAP: Record<string, string>;
|
export const BROWSER_MAP: Record<string, string>;
|
||||||
export const ENGINE_MAP: Record<string, string>;
|
export const ENGINE_MAP: Record<string, string>;
|
||||||
export const OS_MAP: Record<string, string>;
|
export const OS_MAP: Record<string, string>;
|
||||||
export const PLATFORMS_MAP: Record<string, string>;
|
export const PLATFORMS_MAP: Record<string, string>;
|
||||||
|
|
||||||
declare namespace Bowser {
|
export namespace Parser {
|
||||||
/**
|
|
||||||
* Creates a Parser instance
|
|
||||||
* @param {string} UA - User agent string
|
|
||||||
* @param {boolean} skipParsing
|
|
||||||
*/
|
|
||||||
|
|
||||||
function getParser(UA: string, skipParsing?: boolean): Parser.Parser;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a Parser instance and runs Parser.getResult immediately
|
|
||||||
* @param UA - User agent string
|
|
||||||
* @returns {Parser.ParsedResult}
|
|
||||||
*/
|
|
||||||
|
|
||||||
function parse(UA: string): Parser.ParsedResult;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constants exposed via bowser getters
|
|
||||||
*/
|
|
||||||
const BROWSER_MAP: Record<string, string>;
|
|
||||||
const ENGINE_MAP: Record<string, string>;
|
|
||||||
const OS_MAP: Record<string, string>;
|
|
||||||
const PLATFORMS_MAP: Record<string, string>;
|
|
||||||
|
|
||||||
namespace Parser {
|
|
||||||
interface Parser {
|
interface Parser {
|
||||||
constructor(UA: string, skipParsing?: boolean): Parser.Parser;
|
constructor(UA: string, skipParsing?: boolean): Parser.Parser;
|
||||||
|
|
||||||
@ -240,39 +214,6 @@ declare namespace Bowser {
|
|||||||
|
|
||||||
satisfies(checkTree: checkTree): boolean | undefined;
|
satisfies(checkTree: checkTree): boolean | undefined;
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if the browser name equals the passed string
|
|
||||||
* @param {string} 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 {string} engineName The string to compare with the engine name
|
|
||||||
* @returns {boolean}
|
|
||||||
*/
|
|
||||||
|
|
||||||
isEngine(engineName: string): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if the platform type equals the passed string
|
|
||||||
* @param {string} platformType The string to compare with the platform type
|
|
||||||
* @returns {boolean}
|
|
||||||
*/
|
|
||||||
|
|
||||||
isPlatform(platformType: string): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if the OS name equals the passed string
|
|
||||||
* @param {string} osName The string to compare with the OS name
|
|
||||||
* @returns {boolean}
|
|
||||||
*/
|
|
||||||
|
|
||||||
isOS(osName: string): boolean;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if any of the given values satisfies `.is(anything)`
|
* Check if any of the given values satisfies `.is(anything)`
|
||||||
* @param {string[]} anythings
|
* @param {string[]} anythings
|
||||||
@ -319,4 +260,3 @@ declare namespace Bowser {
|
|||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user