Skip to content

Conversation

mikehuebner
Copy link
Contributor

@mikehuebner mikehuebner commented Dec 9, 2024

Introduce TypeScript type definitions for UAParser.js version 2.0.0. This fixes a typescript issue I was seeing when trying to use the us-parser-js/enums submodule, as Typescript could not detect that it was a real directory without the .d.ts file. So I added in the missing pieces! I don't think there is a test case I can add for this though. If I'm wrong please thread!

Prerequisites

Type of Change

Bug fix for type definitions when importing the enums submodule.

Description

This was the original issue I found when I was trying to figure out why the types weren't getting picked up: #736

Test

Please describe the tests that you ran to verify your changes.

I don't think there are tests I can write for this specific case, if I'm wrong please let me know.

Impact

Does this PR introduce a breaking change? What changes might users need to make due to this PR?

Hopefully, no

Other Info

Introduce TypeScript type definitions for UAParser.js version 2.0.0. 
This enhances type safety and autocompletion for enums related to 
browsers, CPUs, devices, vendors, engines, and operating systems in 
the project. These changes are made to improve developer experience 
and ensure consistent usage of the enums throughout the codebase.
@faisalman faisalman merged commit f854f26 into faisalman:master Dec 10, 2024
5 checks passed
@mikehuebner mikehuebner deleted the add-enum-submodule-typescript-definitions branch December 10, 2024 17:56
nanalucky pushed a commit to nanalucky/ua-parser-js that referenced this pull request Feb 18, 2025
Introduce TypeScript type definitions for UAParser.js version 2.0.0. 
This enhances type safety and autocompletion for enums related to 
browsers, CPUs, devices, vendors, engines, and operating systems in 
the project. These changes are made to improve developer experience 
and ensure consistent usage of the enums throughout the codebase.
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.

2 participants