1
0
mirror of https://github.com/lancedikson/bowser synced 2026-09-24 21:14:32 +00:00

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.
This commit is contained in:
naorpeled
2026-08-29 23:50:17 +03:00
parent 11a78f50b2
commit 5cfd97ed08

View File

@@ -17,10 +17,10 @@ export default Bowser;
export declare const parse: typeof Bowser.parse; export declare const parse: typeof Bowser.parse;
export declare const getParser: typeof Bowser.getParser; export declare const getParser: typeof Bowser.getParser;
export declare const BROWSER_MAP: typeof Bowser.BROWSER_MAP; // BROWSER_MAP / ENGINE_MAP / OS_MAP / PLATFORMS_MAP are *not* named exports of
export declare const ENGINE_MAP: typeof Bowser.ENGINE_MAP; // bowser.mjs — they exist only as static getters on the class. Declaring them
export declare const OS_MAP: typeof Bowser.OS_MAP; // here would let TypeScript accept `import { BROWSER_MAP } from 'bowser'`,
export declare const PLATFORMS_MAP: typeof Bowser.PLATFORMS_MAP; // which throws at runtime. Reach them via the default export instead.
export type ClientHints = Bowser.ClientHints; export type ClientHints = Bowser.ClientHints;
export type Parser = Bowser.Parser.Parser; export type Parser = Bowser.Parser.Parser;
@@ -31,5 +31,3 @@ export type EngineDetails = Bowser.Parser.EngineDetails;
export type OSDetails = Bowser.Parser.OSDetails; export type OSDetails = Bowser.Parser.OSDetails;
export type PlatformDetails = Bowser.Parser.PlatformDetails; export type PlatformDetails = Bowser.Parser.PlatformDetails;
export type checkTree = Bowser.Parser.checkTree; export type checkTree = Bowser.Parser.checkTree;
export { Bowser };