/** Thrown when an external tool is missing or a conversion fails. Deliberate
 *  exception to plot's never-throw rule: I/O and missing tools must surface. */
declare class PlotRenderError extends Error {
    readonly missingTool?: string | undefined;
    constructor(message: string, missingTool?: string | undefined);
}
interface RenderOptions {
    tool?: string;
    timeoutMs?: number;
    density?: number;
    background?: string;
    /** Enable LaTeX \write18 shell-escape. UNSAFE for untrusted TeX — allows
     *  arbitrary command execution during compile. Default false. */
    shellEscape?: boolean;
}
interface RunResult {
    code: number | null;
    stdout: Buffer;
    stderr: string;
}
/** Spawn a command, feeding optional stdin, collecting stdout/stderr. Rejects
 *  with PlotRenderError(ENOENT) if the binary is not found. */
declare function runTool(cmd: string, args: string[], opts?: {
    timeoutMs?: number;
    input?: string;
}): Promise<RunResult>;
/** True if `name` responds to a version probe (i.e. is on PATH). */
declare function hasTool(name: string): Promise<boolean>;
/** SVG string → file. Extension of `outPath` selects the target: `.svg` writes
 *  the SVG through; `.png`/`.pdf` convert via rsvg-convert (preferred) or resvg.
 *  Rejects with PlotRenderError naming the tool to install if none is present. */
declare function renderToFile(svg: string, outPath: string, opts?: RenderOptions): Promise<void>;
/** Build the CLI args for a LaTeX engine. Shell-escape (\write18) is OFF unless
 *  `shellEscape` is true — enabling it is UNSAFE for untrusted TeX (arbitrary
 *  command execution during compile). */
declare function latexArgs(engine: string, workDir: string, texPath: string, shellEscape: boolean): string[];
/** Standalone LaTeX/TikZ source → PDF via pdflatex (preferred) or tectonic.
 *  Compiles in an OS temp dir and copies the resulting PDF to `outPath`.
 *  Rejects with PlotRenderError naming the engine to install if none is found. */
declare function latexToPdf(texSource: string, outPath: string, opts?: RenderOptions): Promise<void>;

export { PlotRenderError, type RenderOptions, hasTool, latexArgs, latexToPdf, renderToFile, runTool };
