import{type HtmlSanitizer}from'../../../internal/optional-peer-capabilities.js';
/**
* The configurable parser capability exposed by both Markdown variants' `marked` getter.
* It is intentionally owned by Lyra so core declarations remain usable when
* the optional `marked` peer is not installed.
*/
export interface LyraMarkedParser{readonly defaults:Record;
/** Installs one or more Marked extensions on the shared parser. */
use(...extensions:MarkedExtension[]):LyraMarkedParser;parse(source:string,options:Record &{async:false;}):string;parse(source:string,options?:Record):string|Promise;}export interface MarkedParserContext{parser:{parse(tokens:unknown[]):string;parseInline(tokens:unknown[],renderer?:unknown):string;textRenderer:unknown;};listitem(token:unknown):string;tablecell(token:unknown):string;tablerow(token:{text:string;}):string;}interface MarkedTokenBase{tokens:unknown[];}export interface MarkedRenderer{heading(this:MarkedParserContext,token:MarkedTokenBase&{depth:number;}):string;paragraph(this:MarkedParserContext,token:MarkedTokenBase):string;list(this:MarkedParserContext,token:{ordered:boolean;start:number;items:unknown[];}):string;code(this:MarkedParserContext,token:{lang?:string;text:string;escaped:boolean;}):string;codespan(this:MarkedParserContext,token:{text:string;}):string;blockquote(this:MarkedParserContext,token:MarkedTokenBase):string;table(this:MarkedParserContext,token:{header:Array;rows:Array>;}):string;link(this:MarkedParserContext,token:MarkedTokenBase&{href:string;title?:string|null;}):string;image(this:MarkedParserContext,token:MarkedTokenBase&{href:string;title?:string|null;}):string;html(this:MarkedParserContext,token:{text:string;}):string;}
/** Peer-neutral configuration accepted by the subset of `Marked#use()` Lyra invokes. */
export interface MarkedExtension{renderer?:Partial;extensions?:unknown[];[key:string]:unknown;}
/** The constructor capability Lyra consumes from the optional `marked` peer. */
export interface MarkedModule{Marked:new()=>LyraMarkedParser;}
/**
* The two optional peers `` needs, loaded independently (see
* `loadMarkdownAndSanitizer()`). Either half can be `undefined` on its own —
* a consumer who only installs `marked` (having explicitly selected
* `html-mode="trusted"`) is a valid, supported combination.
*/
export interface MarkdownDeps{marked:MarkedModule|undefined;DOMPurify:HtmlSanitizer|undefined;}
/**
* Independently loads the optional peer dependencies `marked` (Markdown
* parsing) and `dompurify` (HTML sanitizing), mirroring `chart-feature-loader.ts`'s
* `loadChartAndZoom()` shape for two independent optional peers. A partial
* install — most usefully `marked` alone, for a consumer who has explicitly
* set `html-mode="trusted"` and doesn't need `dompurify` at all — degrades to
* "that one half is missing" rather than failing outright. Exported (in
* addition to the cached `loadMarkdownDeps()` below) so both failure paths —
* and their development diagnostics — are directly testable without
* needing to actually uninstall either package.
*/
export declare function loadMarkdownAndSanitizer(importMarked?:()=>Promise,importDompurify?:()=>Promise):Promise;
/**
* Lazily loads `marked` + `dompurify` once per page (see
* `loadMarkdownAndSanitizer()` for why each is loaded and caught
* independently). Cached the same way `chart-core-loader.ts`/`map-loader.ts`
* cache their promise, so every `` instance on a page shares
* one load.
*
* The dynamic `import()` inside `loadMarkdownAndSanitizer()` is always
* asynchronous — even when both peers are already installed and resolve
* without error — so every `` that calls this from
* `connectedCallback()` paints its plain-text fallback (`data-fallback` on
* the `content` part) for at least one microtask before the real rendered
* output replaces it. That window is unconditional, not just a failure
* path: it ends only once this promise settles. A consumer that wants to avoid it can call the
* public `preloadMarkdown()` helper before mounting the first instance. Every later instance
* adopts the settled cache synchronously.
*/
export declare function loadMarkdownDeps():Promise;
/**
* Synchronous companion to `loadMarkdownDeps()`: returns the same
* module-level cached `MarkdownDeps` if some earlier call to
* `loadMarkdownDeps()` — from any `` instance on the page, or
* a consumer priming it directly at startup — has already settled by the
* time this is called, or `undefined` if the cache isn't warm yet (nothing
* has called `loadMarkdownDeps()` before, or it's still in flight). Used by
* every instance to skip the dynamic `import()`'s async hop once the peers are already loaded. It
* cannot make the *very first* `` on a page synchronous unless a consumer called
* `preloadMarkdown()` first.
*/
export declare function getMarkdownDepsIfLoaded():MarkdownDeps|undefined;export{};