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)
pull/289/head
Jace 5 years ago
parent 13e178ccce
commit 96510405be
No known key found for this signature in database
GPG Key ID: 270028FF4C46FF51

9
index.d.ts vendored

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

Loading…
Cancel
Save