/**
 * @file 块级语法拓展：Penna 特殊代码块 + Web API 远程渲染
 * @module transformer/extends/block/specialCode
 *
 * 在 GFM 代码块基础上，对 echarts / mermaid 等语言使用专用渲染器。
 * 配置：`syntaxOptions.code`
 */
import { BaseBlockParser } from "../../../transformer/core/ParserBase.js";
import type { MarkdownNode } from "../../../transformer/core/MarkdownNode.js";
/** ECharts 图表渲染 API 基址。 */
export declare const ECHARTS_API_HOST = "https://echarts-api.vercel.app";
/** Mermaid 图表渲染 API 基址。 */
export declare const MERMAID_API_HOST = "https://mermaid.ink";
/** `syntaxOptions.code`（echarts / mermaid 等特殊语言） */
export interface SpecialCodeOptions extends Record<string, unknown> {
    echartsApiHost?: string;
    mermaidApiHost?: string;
    echartsWidth?: number;
    echartsHeight?: number;
}
export interface MermaidImageOptions {
    apiHost?: string;
    theme?: "dark";
}
export interface EchartsImageOptions {
    apiHost?: string;
    theme?: "dark";
    width?: number;
    height?: number;
}
export declare function parseEchartsJson(src: string): Record<string, unknown>;
export declare function base64UrlEncode(text: string): string;
export declare function base64UrlDecode(payload: string): string;
declare class SpecialCodeBlockParser extends BaseBlockParser {
    constructor();
    private cfg;
    buildMermaidImageSrc(code: string, { apiHost, theme }?: MermaidImageOptions): string;
    buildEchartsImageSrc(content: string, { apiHost, theme, width, height }?: EchartsImageOptions): string;
    renderMermaidBlock(content: string, options?: MermaidImageOptions, lineAttrs?: string): string;
    renderEchartsBlock(content: string, options?: EchartsImageOptions, lineAttrs?: string): string;
    /** @inheritdoc */
    canOpenAt(lines: string[], index: number, ctx: Parameters<BaseBlockParser["canOpenAt"]>[2]): boolean;
    /** @inheritdoc */
    parse(lines: string[], index: number, ctx: Parameters<BaseBlockParser["parse"]>[2]): {
        node: MarkdownNode;
        nextIndex: number;
    } | null;
    /** @inheritdoc */
    render(node: Parameters<BaseBlockParser["render"]>[0], ctx: Parameters<BaseBlockParser["render"]>[1]): string;
    private renderPlainGfmCode;
}
declare const specialCodeParser: SpecialCodeBlockParser;
export default specialCodeParser;
export declare function buildMermaidImageSrc(code: string, options?: MermaidImageOptions): string;
export declare function buildEchartsImageSrc(content: string, options?: EchartsImageOptions): string;
export declare function renderMermaidBlock(content: string, options?: MermaidImageOptions): string;
export declare function renderEchartsBlock(content: string, options?: EchartsImageOptions): string;
//# sourceMappingURL=specialCode.d.ts.map