Open neaumusic opened 5 months ago
The types via node_modules/bowser/index.d.ts aren't extremely useful
node_modules/bowser/index.d.ts
Most variables are just string rather than explaining what the actual values could be (eg 'MacOS' | 'Windows' or 'macos' | 'windows')
string
'MacOS' | 'Windows'
'macos' | 'windows'
I believe the source code probably has explicit values for these, and that the types could be defined better:
const BROWSER_MAP: Record<string, string>; const ENGINE_MAP: Record<string, string>; const OS_MAP: Record<string, string>; const PLATFORMS_MAP: Record<string, string>;
Hi @neaumusic! Thanks for the feedback! I have an idea to refactor it on Typescript to provide a better and native way to support types.
The types via
node_modules/bowser/index.d.ts
aren't extremely usefulMost variables are just
string
rather than explaining what the actual values could be (eg'MacOS' | 'Windows'
or'macos' | 'windows'
)I believe the source code probably has explicit values for these, and that the types could be defined better: