/**
 * @file 块级语法拓展：增强围栏代码块
 * @module transformer/extends/block/enhancedCode
 *
 * 解析 info string、行高亮、折叠与顶栏渲染。
 * 代码体保持完整 `<code>` 文本；行号用旁路 gutter，行高亮用 CSS 渐变。
 * 语法高亮由 renderer hydrate 后处理。
 */
import { BaseBlockParser, ParserOptions } from "../../../transformer/core/ParserBase.js";
import type { MarkdownNode } from "../../../transformer/core/MarkdownNode.js";
import type { RenderContext } from "../../../transformer/core/context/RenderContext.js";
/** `syntaxOptions.code`（增强围栏代码块） */
export interface CodeOptions extends ParserOptions {
    enable?: boolean;
    highlightJs?: (code: string, lang: string) => string;
}
/** 无 `...` 标记时的默认可见行数 */
export declare const DEFAULT_COLLAPSED_VISIBLE_LINES = 10;
export interface CollapsedCodeAnalysis {
    enabled: boolean;
    hasMore: boolean;
    visibleCount: number;
    markerLine: number | null;
    maxLines: number;
}
export declare function parseLineHighlightSpec(spec: string): number[];
export declare function mergeLineHighlightSpecs(...specs: Array<number[] | string>): number[];
export declare function parseHighlightLinesAttr(raw: string | undefined): number[];
export declare function formatHighlightLinesAttr(lines: number[]): string;
export declare function buildLineHighlightRanges(lines: number[]): Array<{
    start: number;
    end: number;
}>;
/** 生成行高亮背景渐变（配合 `--cb-line-step` / `--cb-body-pad-y` 使用） */
export declare function buildLineHighlightGradient(highlightLines: number[]): string;
export declare function isCollapseMarkerLine(line: string): boolean;
export declare function analyzeCollapsedCode(content: string, options?: {
    enabled?: boolean;
    maxLines?: number;
}): CollapsedCodeAnalysis;
/** 折叠标记行替换为空行，保持行号与行高亮对齐 */
export declare function normalizeCodeLines(content: string): string[];
export declare function buildGutterText(lineCount: number): string;
export declare function buildCodeBodyStyle(highlightLines: number[], collapse: CollapsedCodeAnalysis | null, lineCount: number): string;
/** 渲染普通 GFM 代码块内部 HTML：有高亮函数时内联高亮，否则转义纯文本。 */
export declare function renderCodeInnerHtml(content: string, lang: string, highlightJs?: (code: string, lang: string) => string): string;
export declare function renderCodeBlockBodyHtml(content: string, langClass: string, highlightLines?: number[], collapse?: CollapsedCodeAnalysis | null, highlighter?: (code: string, lang: string) => string): {
    html: string;
    collapse: CollapsedCodeAnalysis;
    lineCount: number;
};
export declare function parseFenceMeta(line: string): {
    lang: string;
    title: string;
    highlightLines: number[];
    collapsedLines: boolean;
    collapsedMaxLines?: number;
} | null;
declare class EnhancedCodeBlockParser extends BaseBlockParser {
    constructor();
    canOpenAt(lines: string[], index: number, ctx: Parameters<BaseBlockParser["canOpenAt"]>[2]): boolean;
    parse(lines: string[], index: number, ctx: Parameters<BaseBlockParser["parse"]>[2]): {
        node: MarkdownNode;
        nextIndex: number;
    } | null;
    private renderEnhancedHtml;
    private renderPlainGfmCode;
    render(node: MarkdownNode, ctx: RenderContext): string;
}
declare const enhancedCodeParser: EnhancedCodeBlockParser;
export default enhancedCodeParser;
export { enhancedCodeParser };
//# sourceMappingURL=enhancedCode.d.ts.map