ironmark 1.12.3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ironmark",
3
- "version": "1.12.3",
3
+ "version": "2.0.0",
4
4
  "description": "Very fast markdown parser in Rust, consumable from JavaScript/TypeScript via WebAssembly",
5
5
  "keywords": [
6
6
  "markdown",
package/wasm/cli.js CHANGED
@@ -1,49 +1,68 @@
1
1
  #!/usr/bin/env node
2
2
  import { readFileSync } from "node:fs";
3
- import { renderAnsi } from "./node.js";
3
+ import {
4
+ renderHtml,
5
+ parseMarkdown,
6
+ renderAnsiTerminal,
7
+ getCapabilities,
8
+ getDefaultOptions,
9
+ getPresets,
10
+ } from "./node.js";
4
11
 
5
12
  const VERSION = JSON.parse(
6
13
  readFileSync(new URL("../package.json", import.meta.url), "utf8"),
7
14
  ).version;
8
15
 
9
- const HELP = `ironmark — render Markdown as coloured terminal output
16
+ const HELP = `ironmark — render Markdown in various output formats
10
17
 
11
18
  USAGE:
12
- ironmark --ansi [OPTIONS] [FILE...]
19
+ ironmark [--format <html|ansi|ast>] [OPTIONS] [FILE...]
13
20
 
14
21
  When no FILE is given, reads from stdin. Use '-' for stdin explicitly.
22
+ Default format is html.
15
23
 
16
- OPTIONS:
17
- --ansi Render as ANSI-coloured terminal output (required)
24
+ OPTIONS (all formats):
25
+ --format <html|ansi|ast> Output format; ast also accepts 'json' (default: html)
26
+ --preset <name> Apply a named option preset: default, safe, strict, llm
27
+ --safe Alias for --preset safe (disable raw HTML, enable tag filter)
28
+ --no-hard-breaks Don't turn soft newlines into hard line breaks
29
+ --no-tables Disable pipe table syntax
30
+ --no-highlight Disable ==highlight== syntax
31
+ --no-strikethrough Disable ~~strikethrough~~ syntax
32
+ --no-underline Disable ++underline++ syntax
33
+ --no-autolink Disable bare URL auto-linking
34
+ --no-task-lists Disable - [x] task list syntax
35
+ --math Enable $inline$ and $$display$$ math
36
+ --wiki-links Enable [[wiki link]] syntax
37
+ --capabilities Print machine-readable capabilities JSON and exit
38
+ --default-options Print resolved default options JSON and exit
39
+ --list-presets Print all preset names and their options and exit
40
+ -h, --help Print this help and exit
41
+ -V, --version Print version and exit
42
+
43
+ OPTIONS (ansi format only):
18
44
  --width N Terminal column width (default: auto-detect, fallback 80)
19
45
  --no-color Disable ANSI escape codes (plain text)
20
46
  -n, --line-numbers Show line numbers in fenced code blocks
21
47
  --padding N Horizontal padding on both sides of output (default: 0)
22
- --no-hard-breaks Don't turn soft newlines into hard line breaks
23
- --no-tables Disable pipe table syntax
24
- --no-highlight Disable ==highlight== syntax
25
- --no-strikethrough Disable ~~strikethrough~~ syntax
26
- --no-underline Disable ++underline++ syntax
27
- --no-autolink Disable bare URL auto-linking
28
- --no-task-lists Disable - [x] task list syntax
29
- --math Enable $inline$ and $$display$$ math
30
- --wiki-links Enable [[wiki link]] syntax
31
- -h, --help Print this help and exit
32
- -V, --version Print version and exit
33
48
 
34
49
  EXAMPLES:
35
- npx ironmark --ansi README.md
36
- npx ironmark --ansi --width 120 README.md
37
- npx ironmark --ansi --no-color README.md | less
38
- echo '# Hello' | npx ironmark --ansi
39
- cat doc.md | npx ironmark --ansi --math --wiki-links
50
+ echo '# Hello' | npx ironmark
51
+ echo '# Hello' | npx ironmark --format html
52
+ npx ironmark --format ansi README.md
53
+ npx ironmark --format ast README.md
54
+ npx ironmark --format ansi --width 120 --no-color README.md | less
55
+ cat doc.md | npx ironmark --format ansi --math --wiki-links
56
+ npx ironmark --safe README.md
57
+ npx ironmark --preset llm README.md
58
+ npx ironmark --capabilities
40
59
  `;
41
60
 
42
61
  const args = process.argv.slice(2);
43
62
  const files = [];
44
63
  const parseOptions = {};
45
64
  const ansiOptions = {};
46
- let ansiMode = false;
65
+ let format = null;
47
66
 
48
67
  for (let i = 0; i < args.length; i++) {
49
68
  switch (args[i]) {
@@ -57,8 +76,38 @@ for (let i = 0; i < args.length; i++) {
57
76
  console.log(`ironmark ${VERSION}`);
58
77
  process.exit(0);
59
78
  break;
60
- case "--ansi":
61
- ansiMode = true;
79
+ case "--capabilities":
80
+ process.stdout.write(JSON.stringify(getCapabilities(), null, 2) + "\n");
81
+ process.exit(0);
82
+ break;
83
+ case "--default-options":
84
+ process.stdout.write(JSON.stringify(getDefaultOptions(), null, 2) + "\n");
85
+ process.exit(0);
86
+ break;
87
+ case "--list-presets":
88
+ process.stdout.write(JSON.stringify(getPresets(), null, 2) + "\n");
89
+ process.exit(0);
90
+ break;
91
+ case "--format": {
92
+ const val = args[++i];
93
+ if (val === undefined) {
94
+ console.error("error: --format requires a value");
95
+ process.exit(2);
96
+ }
97
+ format = val;
98
+ break;
99
+ }
100
+ case "--preset": {
101
+ const val = args[++i];
102
+ if (val === undefined) {
103
+ console.error("error: --preset requires a value (default, safe, strict, llm)");
104
+ process.exit(2);
105
+ }
106
+ parseOptions.preset = val;
107
+ break;
108
+ }
109
+ case "--safe":
110
+ parseOptions.safe = true;
62
111
  break;
63
112
  case "--no-color":
64
113
  case "--no-colour":
@@ -114,7 +163,9 @@ for (let i = 0; i < args.length; i++) {
114
163
  parseOptions.enableWikiLinks = true;
115
164
  break;
116
165
  default:
117
- if (args[i].startsWith("--width=")) {
166
+ if (args[i].startsWith("--format=")) {
167
+ format = args[i].slice("--format=".length);
168
+ } else if (args[i].startsWith("--width=")) {
118
169
  const val = Number(args[i].slice("--width=".length));
119
170
  if (Number.isNaN(val)) {
120
171
  console.error("error: --width requires a numeric value");
@@ -138,13 +189,20 @@ for (let i = 0; i < args.length; i++) {
138
189
  }
139
190
  }
140
191
 
141
- if (!ansiMode) {
142
- console.error("error: --ansi flag is required");
192
+ const fmt = format ?? "html";
193
+
194
+ if (fmt !== "html" && fmt !== "ansi" && fmt !== "ast" && fmt !== "json") {
195
+ console.error(`error: unknown format '${fmt}' — use html, ansi, or ast`);
196
+ process.exit(2);
197
+ }
198
+
199
+ if (files.length === 0 && process.stdin.isTTY) {
200
+ console.error("error: no input provided");
143
201
  console.error("Run 'ironmark --help' for usage.");
144
202
  process.exit(2);
145
203
  }
146
204
 
147
- // Auto-detect terminal width
205
+ // Auto-detect terminal width for ansi format
148
206
  if (ansiOptions.width === undefined) {
149
207
  ansiOptions.width = process.stdout.columns || 80;
150
208
  }
@@ -168,4 +226,10 @@ if (files.length === 0) {
168
226
  }
169
227
  }
170
228
 
171
- process.stdout.write(renderAnsi(input, parseOptions, ansiOptions));
229
+ if (fmt === "html") {
230
+ process.stdout.write(renderHtml(input, parseOptions));
231
+ } else if (fmt === "ansi") {
232
+ process.stdout.write(renderAnsiTerminal(input, parseOptions, ansiOptions));
233
+ } else {
234
+ process.stdout.write(JSON.stringify(parseMarkdown(input, parseOptions), null, 2) + "\n");
235
+ }
package/wasm/index.d.ts CHANGED
@@ -1,6 +1,48 @@
1
+ // ─── Input types ─────────────────────────────────────────────────────────────
2
+
1
3
  export type MarkdownInput = string | Uint8Array | ArrayBuffer | ArrayBufferView;
2
4
 
5
+ // ─── Preset names ─────────────────────────────────────────────────────────────
6
+
7
+ /**
8
+ * Named option presets for common use cases.
9
+ *
10
+ * - `"default"` — Default ironmark behavior; all extensions enabled.
11
+ * - `"safe"` — Disables raw HTML and enables the GFM tag filter. Use for untrusted input.
12
+ * - `"strict"` — CommonMark-only; disables extensions and restricts permissive behaviors.
13
+ * - `"llm"` — Deterministic, structure-first output optimized for AI pipelines and agents.
14
+ * Disables autolink, wiki links, math, hard breaks, and raw HTML; enables heading IDs
15
+ * and whitespace normalization.
16
+ */
17
+ export type PresetName = "default" | "safe" | "strict" | "llm";
18
+
19
+ // ─── Parse options ────────────────────────────────────────────────────────────
20
+
3
21
  export interface ParseOptions {
22
+ /**
23
+ * Apply a named preset before applying any explicit options.
24
+ * Explicit options always override the preset.
25
+ */
26
+ preset?: PresetName;
27
+
28
+ /**
29
+ * Enable safe rendering. Equivalent to `{ disableRawHtml: true, tagFilter: true }`.
30
+ * Explicit `disableRawHtml` / `tagFilter` values override this.
31
+ */
32
+ safe?: boolean;
33
+
34
+ /**
35
+ * When true, output is normalized for deterministic comparison:
36
+ * whitespace is collapsed and output is stable across runs.
37
+ */
38
+ deterministic?: boolean;
39
+
40
+ /**
41
+ * Reserved for future use. When true, the AST will include source position
42
+ * metadata. Has no effect in the current version.
43
+ */
44
+ stableAst?: boolean;
45
+
4
46
  /** When true, every newline in a paragraph becomes a hard line break (`<br />`). Default: true. */
5
47
  hardBreaks?: boolean;
6
48
  /** Enable ==highlight== syntax for `<mark>`. Default: true. */
@@ -39,37 +81,13 @@ export interface ParseOptions {
39
81
  enableLatexMath?: boolean;
40
82
  }
41
83
 
42
- /**
43
- * Initialize the WASM module.
44
- *
45
- * - **Node.js**: This is a no-op — WASM is embedded and loaded synchronously at import time.
46
- * - **Browser/Bundler**: Must be called (and awaited) before using `parse()`.
47
- * Optionally pass a URL or `WebAssembly.Module` to override the default WASM location.
48
- * Calling `init()` multiple times is safe (subsequent calls are no-ops).
49
- */
50
- export declare function init(input?: string | URL | WebAssembly.Module): Promise<void>;
84
+ // ─── Render-specific option aliases ──────────────────────────────────────────
51
85
 
52
- /**
53
- * Parse Markdown to HTML.
54
- *
55
- * @param markdown - Markdown source (string or binary).
56
- * @param options - Optional parsing options.
57
- * @returns HTML string.
58
- */
59
- export declare function parse(markdown: MarkdownInput, options?: ParseOptions): string;
86
+ /** Options for `renderHtml()`. Same as `ParseOptions`. */
87
+ export type RenderHtmlOptions = ParseOptions;
60
88
 
61
- /**
62
- * Parse Markdown and return the block-level AST as a JSON string.
63
- *
64
- * @param markdown - Markdown source (string or binary).
65
- * @param options - Optional parsing options.
66
- * @returns JSON string representing the AST.
67
- */
68
- export declare function parseToAst(markdown: MarkdownInput, options?: ParseOptions): string;
89
+ // ─── ANSI options ─────────────────────────────────────────────────────────────
69
90
 
70
- /**
71
- * Options for the ANSI terminal renderer.
72
- */
73
91
  export interface AnsiOptions {
74
92
  /**
75
93
  * Terminal column width for word-wrap, heading underlines, and thematic breaks.
@@ -88,99 +106,267 @@ export interface AnsiOptions {
88
106
  lineNumbers?: boolean;
89
107
  /**
90
108
  * Horizontal padding to add on both sides of every output line.
91
- * The output width remains `width`; padding reduces the available text area.
92
109
  * Also adds `ceil(padding / 2)` blank lines at the top. Default: `0`.
93
110
  */
94
111
  padding?: number;
95
112
  }
96
113
 
114
+ // ─── HTML parse options ───────────────────────────────────────────────────────
115
+
116
+ export interface HtmlParseOptions {
117
+ /**
118
+ * If true, unknown HTML tags (like `<sup>`, `<sub>`, `<abbr>`) are preserved
119
+ * as raw HTML in the Markdown output. If false (default), unknown tags are
120
+ * stripped but their text content is kept.
121
+ */
122
+ preserveUnknownAsHtml?: boolean;
123
+ }
124
+
125
+ // ─── AST node types ───────────────────────────────────────────────────────────
126
+
127
+ /**
128
+ * A single AST node. The `t` field is the type discriminant.
129
+ * Child nodes are in `c`; leaf text content is in `text`.
130
+ */
131
+ export interface AstNode {
132
+ t: string;
133
+ c?: AstNode[];
134
+ text?: string;
135
+ [key: string]: unknown;
136
+ }
137
+
138
+ /** Parsed AST: an array of top-level block nodes returned by `parseMarkdown()`. */
139
+ export type MarkdownAst = AstNode[];
140
+
141
+ // ─── Introspection return types ───────────────────────────────────────────────
142
+
143
+ export interface Capabilities {
144
+ astSchemaVersion: string;
145
+ formats: string[];
146
+ presets: PresetName[];
147
+ extensions: string[];
148
+ security: string[];
149
+ }
150
+
151
+ export interface HeadingInfo {
152
+ level: number;
153
+ text: string;
154
+ id: string;
155
+ }
156
+
157
+ export interface AstSummary {
158
+ blockCount: number;
159
+ nodeCounts: Record<string, number>;
160
+ }
161
+
162
+ // ─── Initialization ───────────────────────────────────────────────────────────
163
+
164
+ /**
165
+ * Initialize the WASM module.
166
+ *
167
+ * - **Node.js**: no-op — WASM is embedded and loaded synchronously at import time.
168
+ * - **Browser/Bundler**: must be awaited before calling any other function.
169
+ * Accepts a URL or `WebAssembly.Module` to override the default WASM location.
170
+ * Safe to call multiple times.
171
+ *
172
+ * @example
173
+ * ```ts
174
+ * import { init, renderHtml } from "ironmark";
175
+ * await init();
176
+ * const html = renderHtml("# Hello");
177
+ * ```
178
+ */
179
+ export declare function init(input?: string | URL | WebAssembly.Module): Promise<void>;
180
+
181
+ // ─── Core API ─────────────────────────────────────────────────────────────────
182
+
183
+ /**
184
+ * Parse Markdown and return the structured AST as a JavaScript object.
185
+ *
186
+ * The recommended entry point for AI pipelines, agents, and any workflow
187
+ * that needs to inspect or transform document structure.
188
+ *
189
+ * @param input - Markdown source.
190
+ * @param options - Optional parse options or preset.
191
+ * @returns Parsed AST — a JavaScript array, no `JSON.parse()` needed.
192
+ *
193
+ * @example
194
+ * ```ts
195
+ * import { parseMarkdown } from "ironmark";
196
+ *
197
+ * const ast = parseMarkdown("# Hello\n\n**World**");
198
+ * ```
199
+ *
200
+ * @example With a preset
201
+ * ```ts
202
+ * const ast = parseMarkdown(userInput, { preset: "llm" });
203
+ * ```
204
+ */
205
+ export declare function parseMarkdown(input: MarkdownInput, options?: ParseOptions): MarkdownAst;
206
+
207
+ /**
208
+ * Render Markdown to an HTML string.
209
+ *
210
+ * Use `safe: true` or `preset: "safe"` for any untrusted input.
211
+ *
212
+ * @param input - Markdown source.
213
+ * @param options - Optional render options.
214
+ * @returns HTML string.
215
+ *
216
+ * @example
217
+ * ```ts
218
+ * import { renderHtml } from "ironmark";
219
+ *
220
+ * const html = renderHtml("# Hello");
221
+ * const safeHtml = renderHtml(userInput, { safe: true });
222
+ * ```
223
+ */
224
+ export declare function renderHtml(input: MarkdownInput, options?: RenderHtmlOptions): string;
225
+
226
+ /**
227
+ * Render an AST back to a Markdown string.
228
+ *
229
+ * Pass the result of `parseMarkdown()` directly — accepts an AST object or
230
+ * a JSON string. Useful for normalizing Markdown or round-trip conversion.
231
+ *
232
+ * @param ast - AST from `parseMarkdown()`, or a JSON string.
233
+ * @returns Markdown string.
234
+ *
235
+ * @example
236
+ * ```ts
237
+ * import { parseMarkdown, renderMarkdown } from "ironmark";
238
+ *
239
+ * const ast = parseMarkdown("**Hello**");
240
+ * const md = renderMarkdown(ast);
241
+ * ```
242
+ */
243
+ export declare function renderMarkdown(ast: MarkdownAst | string): string;
244
+
97
245
  /**
98
246
  * Render Markdown as ANSI-coloured terminal output.
99
247
  *
100
- * Produces a string containing ANSI 256-colour escape codes suitable for
101
- * display in a terminal emulator. Headings, code blocks, inline code,
102
- * blockquotes, tables, and inline formatting are all styled distinctly.
248
+ * Produces a string with ANSI 256-colour escape codes suitable for TTY display.
103
249
  *
104
- * @param markdown - Markdown source (string or binary).
105
- * @param options - Optional parse options (same flags as `parse()`).
106
- * @param ansiOptions - Optional ANSI rendering options (width, color, lineNumbers).
107
- * @returns String with ANSI escape codes (or plain text when `color: false`).
250
+ * @param input - Markdown source.
251
+ * @param options - Optional parse options.
252
+ * @param ansiOptions - Optional ANSI rendering options.
253
+ * @returns String with ANSI escape codes.
108
254
  *
109
255
  * @example
110
256
  * ```ts
111
- * import { renderAnsi } from "ironmark";
112
- * const out = renderAnsi("# Hello\n\n**bold** and `code`");
113
- * process.stdout.write(out);
257
+ * import { renderAnsiTerminal } from "ironmark";
258
+ *
259
+ * process.stdout.write(renderAnsiTerminal("# Hello\n\n**bold**"));
114
260
  * ```
115
261
  */
116
- export declare function renderAnsi(
117
- markdown: MarkdownInput,
262
+ export declare function renderAnsiTerminal(
263
+ input: MarkdownInput,
118
264
  options?: ParseOptions,
119
265
  ansiOptions?: AnsiOptions,
120
266
  ): string;
121
267
 
122
268
  /**
123
- * Options for HTML-to-Markdown parsing.
124
- */
125
- export interface HtmlParseOptions {
126
- /**
127
- * If true, unknown HTML tags (like `<sup>`, `<sub>`, `<abbr>`) are preserved
128
- * as raw HTML in the Markdown output. If false (default), unknown tags are
129
- * stripped but their text content is kept.
130
- */
131
- preserveUnknownAsHtml?: boolean;
132
- }
133
-
134
- /**
135
- * Parse an HTML string and return the AST as a JSON string.
269
+ * Parse an HTML string and return the AST as a JavaScript object.
136
270
  *
137
- * This converts HTML back into the same AST structure used by the Markdown parser,
138
- * enabling HTML-to-Markdown conversion.
271
+ * Converts HTML into the same AST structure used by the Markdown parser,
272
+ * enabling HTMLMarkdown conversion via `renderMarkdown()`.
139
273
  *
140
274
  * @param html - HTML source string.
141
275
  * @param preserveUnknownAsHtml - If true, unknown HTML tags are preserved as raw HTML.
142
- * @returns JSON string representing the AST.
276
+ * @returns Parsed AST object.
143
277
  *
144
278
  * @example
145
279
  * ```ts
146
- * import { parseHtmlToAst } from "ironmark";
280
+ * import { parseHtmlToAst, renderMarkdown } from "ironmark";
281
+ *
147
282
  * const ast = parseHtmlToAst("<h1>Hello</h1><p>World</p>");
148
- * console.log(JSON.parse(ast));
283
+ * const md = renderMarkdown(ast);
149
284
  * ```
150
285
  */
151
- export declare function parseHtmlToAst(html: string, preserveUnknownAsHtml?: boolean): string;
286
+ export declare function parseHtmlToAst(html: string, preserveUnknownAsHtml?: boolean): MarkdownAst;
152
287
 
153
288
  /**
154
289
  * Convert HTML to Markdown.
155
290
  *
156
- * This parses HTML and renders it as Markdown syntax.
157
- *
158
291
  * @param html - HTML source string.
159
- * @param preserveUnknownAsHtml - If true, unknown HTML tags are preserved as raw HTML in output.
292
+ * @param preserveUnknownAsHtml - If true, unknown HTML tags are preserved as raw HTML.
160
293
  * @returns Markdown string.
161
294
  *
162
295
  * @example
163
296
  * ```ts
164
297
  * import { htmlToMarkdown } from "ironmark";
298
+ *
165
299
  * const md = htmlToMarkdown("<p><strong>Bold</strong> text</p>");
166
300
  * // Returns: "**Bold** text"
167
301
  * ```
168
302
  */
169
303
  export declare function htmlToMarkdown(html: string, preserveUnknownAsHtml?: boolean): string;
170
304
 
305
+ // ─── Introspection helpers ────────────────────────────────────────────────────
306
+
307
+ /**
308
+ * Return machine-readable metadata about this ironmark build.
309
+ *
310
+ * @example
311
+ * ```ts
312
+ * import { getCapabilities } from "ironmark";
313
+ * const caps = getCapabilities();
314
+ * // { astSchemaVersion: "2", formats: [...], presets: [...], ... }
315
+ * ```
316
+ */
317
+ export declare function getCapabilities(): Capabilities;
318
+
319
+ /**
320
+ * Return the current AST schema version string.
321
+ * An increment signals a breaking change to the AST node shape.
322
+ */
323
+ export declare function getAstSchemaVersion(): string;
324
+
325
+ /**
326
+ * Return the resolved default `ParseOptions` — the effective value of every
327
+ * option when none are specified.
328
+ */
329
+ export declare function getDefaultOptions(): Required<
330
+ Omit<ParseOptions, "preset" | "safe" | "deterministic" | "stableAst">
331
+ >;
332
+
171
333
  /**
172
- * Render an AST (as JSON) to Markdown.
334
+ * Return all named presets and their resolved option objects.
173
335
  *
174
- * This takes a JSON string representing an ironmark AST and renders it as Markdown.
336
+ * @example
337
+ * ```ts
338
+ * import { getPresets } from "ironmark";
339
+ * const { llm } = getPresets();
340
+ * ```
341
+ */
342
+ export declare function getPresets(): Record<PresetName, Partial<ParseOptions>>;
343
+
344
+ // ─── Utility functions ────────────────────────────────────────────────────────
345
+
346
+ /**
347
+ * Extract all headings from a parsed AST.
175
348
  *
176
- * @param astJson - JSON string representing the AST (as returned by `parseToAst` or `parseHtmlToAst`).
177
- * @returns Markdown string.
349
+ * Returns level, plain-text content, and a slugified `id` for each heading.
178
350
  *
179
351
  * @example
180
352
  * ```ts
181
- * import { parseToAst, renderMarkdown } from "ironmark";
182
- * const ast = parseToAst("# Hello\n\n**World**");
183
- * const md = renderMarkdown(ast);
353
+ * import { parseMarkdown, extractHeadings } from "ironmark";
354
+ *
355
+ * const headings = extractHeadings(parseMarkdown("# Hello\n\n## World"));
356
+ * // [{ level: 1, text: "Hello", id: "hello" }, { level: 2, text: "World", id: "world" }]
357
+ * ```
358
+ */
359
+ export declare function extractHeadings(ast: MarkdownAst): HeadingInfo[];
360
+
361
+ /**
362
+ * Summarize an AST: count top-level blocks and all node types.
363
+ *
364
+ * @example
365
+ * ```ts
366
+ * import { parseMarkdown, summarizeAst } from "ironmark";
367
+ *
368
+ * const summary = summarizeAst(parseMarkdown("# Hello\n\nA paragraph.\n\n- item"));
369
+ * // { blockCount: 3, nodeCounts: { Heading: 1, Paragraph: 1, List: 1, ... } }
184
370
  * ```
185
371
  */
186
- export declare function renderMarkdown(astJson: string): string;
372
+ export declare function summarizeAst(ast: MarkdownAst): AstSummary;