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

Typescript support #51

Open
atlanteh opened this issue Jan 14, 2023 · 2 comments
Open

Typescript support #51

atlanteh opened this issue Jan 14, 2023 · 2 comments

Comments

@atlanteh
Copy link

Since the UdgerParser class is not exposed, but only a default function that instantiate the class, there's no way to reference it in a typescript project and take advantage of static analysis.
For example:

class MyClass {
  constructor(private _uaParser: UdgerParser) {}
  
  getUserAgentInfo(req: Request) {
    const ua = req.headers['user-agent']
    return this._uaParser.parseUa(ua);
  }
}

Can you please expose the class (and maybe add correct types as well?)

@atlanteh
Copy link
Author

@eviltik can you please help?

@eviltik
Copy link
Member

eviltik commented Jan 22, 2023

No, i'm not typescript compliant :( PR welcome !

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

No branches or pull requests

2 participants