export interface ExampleBake { dialect: string; js: string; /** * `SiteConfig.exampleModules` (#245): where the example's module is served, which a page * under a strict CSP imports instead of compiling `js`. */ module?: string; /** The module's source, between the example check and the build writing it out. */ moduleSource?: string; } export type ExampleBakes = Map; /** `SiteConfig.accessibility`. One level for now; the name says which standard it targets. */ export type AccessibilityMode = 'wcag22-aa'; /** * The accessibility mode's token rewrites (#3521), exported so the build's report reads exactly * the structure the page renders. */ export declare function accessibleTokens(tokens: any[], title?: string): any[]; export declare function unwrapLoneCustomElements(html: string): string; export declare function renderDocMarkdown(text: string, opts?: { bakes?: ExampleBakes; /** the corpus's `wikilinkTargets`; without it a `[[target]]` is slugified as written */ wikilinks?: Map; /** * The accessibility mode (#3521): figures with captions, and exactly one `

`. `title` is * the page title, rendered as that `

` when the markdown has none. */ accessible?: boolean; title?: string; }): string; /** * A doc's top-level tokens as the page's renderer reads them, with its extensions (footnotes, * wikilinks). `lexCodeTokens` counts examples with this: plain `marked.lexer` read a footnote * definition as a paragraph, where the page renders nothing for it and so groups the fences on * either side into one example, and save-to-source wrote an edit into the wrong one (1.20.0 * review, M2). */ export declare function docTokens(text: string): any[]; export declare function rendersNoElement(token: any): boolean; /** * A doc's tokens as the accessibility mode renders them, for the build's report: the same * lexer and the same rewrites as `renderDocMarkdown`, so the report and the page cannot * disagree about what is a figure or which heading is the `

`. */ export declare function accessibleDocTokens(text: string, title?: string): any[]; /** * Where search engines cut a description (#3563). A derived one is cut to fit, on a sentence * boundary where it can be, and the metadata lint flags a written one that is longer. */ export declare const DESCRIPTION_MAX = 155; /** * Derive a clean from a doc's first prose paragraph. * Skips the title heading, code fences, tables, quotes, html and image/link-only * lines; strips inline markdown; drops low-value "This is a…" leads; and truncates * on a sentence boundary where possible (never mid-clause ending in a comma). * Pages can override this entirely via their JSON metadata `description`. */ export declare function docDescription(text: string, maxLength?: number): string; /** * `docDescription`, saying whether the paragraph had to be cut mid-sentence (it then ends in * "…"), which the metadata lint reports: the useful half of a cut description is usually the * half that was cut. */ export declare function derivedDescription(text: string, maxLength?: number): { text: string; cut: boolean; };