Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export Parser types #289

Merged
merged 1 commit into from
Apr 14, 2019

Conversation

JaceHensley
Copy link
Contributor

@JaceHensley JaceHensley commented Jan 30, 2019

Ultimate Problem

You could not use any of the Parser types in your own TS files.

Solution

  • Export the types as part of the Bowser namespace

Usage

import Bowser from 'bowser'
// import * as Bowser from 'bowser' also works

const parsedResults: Bowser.Parser.ParsedResults = Bowser.parse(...);

- 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)
@JaceHensley
Copy link
Contributor Author

I don't seem to have permission to add a reviewer but @alexandercerutti you may wanna take a look at this since you did the first PR for types 😄

@coveralls
Copy link

Pull Request Test Coverage Report for Build 439

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 88.712%

Totals Coverage Status
Change from base Build 438: 0.0%
Covered Lines: 469
Relevant Lines: 484

💛 - Coveralls

@alexandercerutti
Copy link
Contributor

Hi! The fact is that we decided to not export them but I was thinking that too.
I cannot review them too. Anyway I was trying to apply your changes and I wasn't able to access to the types...

@lancedikson lancedikson merged commit 5c47015 into bowser-js:master Apr 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants