/** * @file mdx = markdown × data. A markdown document renders DYNAMICALLY * against a data document: inline interpolation, conditional sections * and repeated sections, all driven by the data — still a pure * `(doc, data) → doc` transform over the parsed AST, so everything * downstream (`mdToVnode`, `toMarkdown`, the plugins) works unchanged. * * The template vocabulary reuses the suite's own query expressions — * no new mini-language: * * - `{$.path}` inline in TEXT interpolates a query expression over the * data (`$` is the data document; `$name` externals come from the * frontmatter and the enclosing `each` bindings). Code spans, code * blocks and raw HTML never interpolate. * - a paragraph of exactly `{#if }` … `{/if}` keeps its section * only when the expression is truthy (the query engine's boolean * view: null/false/''/0/[] are false). * - a paragraph of exactly `{#each as }` … `{/each}` * repeats its section once per item, binding each as the external * `$`. Sections nest. * * A directive must form its OWN paragraph — surround it with blank * lines, or markdown's lazy continuation folds the next line into it * and the directive reads as plain text. * * The expression COMPILER is injected (`compileJsonQuery` from * `@jarenjs/json`), so this package's engine layer keeps its * core+view-only dependency contract — the same seam philosophy the * play surface uses for its renderers. */ /** * Build the mdx transformer around an injected expression compiler. * @param {{ compileQuery: (expr: string) => (data: any, externals?: any) => any }} options * `compileQuery` compiles one query expression (e.g. `compileJsonQuery` * from `@jarenjs/json`); compiled expressions are cached per source text * @returns {{ transform: (doc: any, data: any) => any }} * `transform(doc, data)` — a parsed markdown doc + a data document in, * a NEW doc (directives resolved, text interpolated) out; never throws * on a bad expression — the error message renders in place, honestly */ export declare function createMdx(options: { compileQuery: (expr: string) => (data: any, externals?: any) => any; }): { transform: (doc: any, data: any) => any; };