Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improved TypeScript support for 2.x #702

kalyons11 started this conversation in General
Discussion options

Wanted to see if there were plans for improved TS support in 2.x, namely a re-write to TS. We have a use case where we'd like to utilize a type for named constants, for example, and having more built-out TS support would make this easier.

We went down the path of updating the exports entries in package.json to handle multiple module systems, but stopped short because we still don't have access to enum types. (Related issue: #692)

https://github.com/faisalman/ua-parser-js/compare/master...kalyons11:ua-parser-js:fix-module-typings?expand=1

if a TS re-write is a long ways off then we could contribute redundant typings for enums that have a union over all of the object values in each frozen object. The downside is that adding a new field to an enum would require a change in 2 places - 1 in the module file and 1 in the type declaration.

You must be logged in to vote

Replies: 1 comment

Comment options

Hi, sure we're very open for any contributions, please open a PR if you want

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /