Closed
Description
Marked version: 14.0.0
Describe the bug
marked.d.ts
marks both block
and inline
as export declare const ...
, implying they are available for import. However, neither symbol is actually available (in neither CJS, ESM, or UMD form).
Note marked.d.ts
declares both as exported:
export declare const block: {
...
export declare const inline: {
...
But marked.esm.js
(or .cjs
& .umd.js
files) do not in fact export it:
export { _Hooks as Hooks, _Lexer as Lexer, Marked, _Parser as Parser, _Renderer as Renderer, _TextRenderer as TextRenderer, _Tokenizer as Tokenizer, _defaults as defaults, _getDefaults as getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };
To Reproduce
Simply install [email protected]
, and write the following (TypeScript!) file:
// Okay as per TypeScript/tsc, but we get a runtime error: `SyntaxError: The requested module 'marked' does not provide an export named 'block'`
import { block, inline } from 'marked';
console.log(block, inline); // is *not* available
Expected behavior
The type declarations should match the actual exports --- either marked.d.ts
should not declare those types as export
, or (ideally) block
& inline
should actually be exported.