From 5cfd97ed08d31e421d515dca15f24a2a98a83afd Mon Sep 17 00:00:00 2001 From: naorpeled Date: Sat, 29 Aug 2026 23:50:17 +0300 Subject: [PATCH] fix(types): drop ESM named exports that bowser.mjs does not provide BROWSER_MAP / ENGINE_MAP / OS_MAP / PLATFORMS_MAP and the named Bowser binding were declared in index.d.mts but never exported by the runtime module, so TypeScript accepted imports that throw at load time. They remain reachable as static getters on the default export. --- index.d.mts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/index.d.mts b/index.d.mts index d5e9a0b..756db0c 100644 --- a/index.d.mts +++ b/index.d.mts @@ -17,10 +17,10 @@ export default Bowser; export declare const parse: typeof Bowser.parse; export declare const getParser: typeof Bowser.getParser; -export declare const BROWSER_MAP: typeof Bowser.BROWSER_MAP; -export declare const ENGINE_MAP: typeof Bowser.ENGINE_MAP; -export declare const OS_MAP: typeof Bowser.OS_MAP; -export declare const PLATFORMS_MAP: typeof Bowser.PLATFORMS_MAP; +// BROWSER_MAP / ENGINE_MAP / OS_MAP / PLATFORMS_MAP are *not* named exports of +// bowser.mjs — they exist only as static getters on the class. Declaring them +// here would let TypeScript accept `import { BROWSER_MAP } from 'bowser'`, +// which throws at runtime. Reach them via the default export instead. export type ClientHints = Bowser.ClientHints; export type Parser = Bowser.Parser.Parser; @@ -31,5 +31,3 @@ export type EngineDetails = Bowser.Parser.EngineDetails; export type OSDetails = Bowser.Parser.OSDetails; export type PlatformDetails = Bowser.Parser.PlatformDetails; export type checkTree = Bowser.Parser.checkTree; - -export { Bowser };