/** Where an inline run is being rendered; controls which characters can be syntax there. */ export type InlineContext = 'block' | 'heading' | 'tableCell'; /** Fine-grained escaping context beyond InlineContext. */ export interface EscapeOpts { /** The run begins at the start of an output line. */ atLineStart: boolean; /** The run is wrapped in emphasis delimiters. */ styled: boolean; /** The character following the run is unknown or active markup. */ trailingActive: boolean; /** Inside a link label / image alt. */ inLabel: boolean; } export declare const DEFAULT_ESCAPE_OPTS: EscapeOpts; export declare function escapeOpts(partial?: Partial): EscapeOpts; /** Escape Markdown syntax in document text. */ export declare function escapeText(text: string, ctx: InlineContext, opts: EscapeOpts): string; /** Format a link destination, angle-bracketing when needed. */ export declare function formatUrl(url: string): string; export declare function escapeUrlAsText(url: string, ctx: InlineContext): string; /** Shortest backtick fence longer than any backtick run in `text`. */ export declare function backtickFence(text: string, min: number): string; /** * Escape a source-derived composite marker label for literal use: control * characters collapse to spaces and Markdown syntax is neutralized so a * crafted label cannot alter document structure. */ export declare function escapeMarkerLabel(label: string, ctx: InlineContext): string;