1
0
mirror of https://github.com/lancedikson/bowser synced 2024-10-27 20:34:22 +00:00

Export Parser types

- Move the Parser namespace into the Bowser namespace
- Make the Parser class an interface so consumers can't construct a Parser class (this is not exported by bowser)
This commit is contained in:
Jace 2019-01-30 16:20:56 -07:00
parent 13e178ccce
commit 96510405be
No known key found for this signature in database
GPG Key ID: 270028FF4C46FF51

9
index.d.ts vendored
View File

@ -6,7 +6,6 @@ export = Bowser;
export as namespace Bowser; export as namespace Bowser;
declare namespace Bowser { declare namespace Bowser {
/** /**
* Creates a Parser instance * Creates a Parser instance
* @param {string} UA - User agent string * @param {string} UA - User agent string
@ -22,11 +21,10 @@ declare namespace Bowser {
*/ */
function parse(UA: string): Parser.ParsedResult; function parse(UA: string): Parser.ParsedResult;
}
declare namespace Parser { namespace Parser {
class Parser { interface Parser {
constructor(UA: string, skipParsing?: boolean); constructor(UA: string, skipParsing?: boolean): Parser.Parser;
/** /**
* Get parsed browser object * Get parsed browser object
@ -221,4 +219,5 @@ declare namespace Parser {
interface checkTree { interface checkTree {
[key: string]: any; [key: string]: any;
} }
}
} }