mirror of
https://github.com/lancedikson/bowser
synced 2025-12-05 06:02:14 +00:00
Fix TypeScript definitions to resolve TS2309 and TS2451 errors
Co-authored-by: naorpeled <6171622+naorpeled@users.noreply.github.com>
This commit is contained in:
parent
8d01b928c5
commit
759ec75e33
33
index.d.ts
vendored
33
index.d.ts
vendored
@ -2,42 +2,16 @@
|
||||
// Project: https://github.com/lancedikson/bowser
|
||||
// Definitions by: Alexander P. Cerutti <https://github.com/alexandercerutti>,
|
||||
|
||||
export = Bowser;
|
||||
export as namespace Bowser;
|
||||
|
||||
export function getParser(UA: string, skipParsing?: boolean): Bowser.Parser.Parser;
|
||||
export function parse(UA: string): Bowser.Parser.ParsedResult;
|
||||
export function getParser(UA: string, skipParsing?: boolean): Parser.Parser;
|
||||
export function parse(UA: string): Parser.ParsedResult;
|
||||
export const BROWSER_MAP: Record<string, string>;
|
||||
export const ENGINE_MAP: Record<string, string>;
|
||||
export const OS_MAP: Record<string, string>;
|
||||
export const PLATFORMS_MAP: Record<string, string>;
|
||||
|
||||
declare namespace Bowser {
|
||||
/**
|
||||
* 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 {
|
||||
export namespace Parser {
|
||||
interface Parser {
|
||||
constructor(UA: string, skipParsing?: boolean): Parser.Parser;
|
||||
|
||||
@ -319,4 +293,3 @@ declare namespace Bowser {
|
||||
[key: string]: any;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user