import { AsyncResult } from 'awaitly'; import { U as UrlGeneratorOptions, a8 as UrlGenerator, W as WorkflowIR } from '../url-CKfrOJ3y.cjs'; /** * Kroki Fetch (Node-only) * * Downloads rendered diagrams from Kroki as SVG or PNG. * This is a separate subpath entry to avoid bundling Node-only code in browser builds. */ /** * Error types for Kroki fetch operations. */ type KrokiError = "FETCH_ERROR" | "TIMEOUT" | "INVALID_RESPONSE"; /** * Options for fetching from Kroki. */ interface FetchKrokiOptions extends UrlGeneratorOptions { /** Optional custom URL generator */ generator?: UrlGenerator; /** Request timeout in milliseconds (default: 30000) */ timeout?: number; } /** * Fetch SVG content from Kroki. * * @param ir - Workflow intermediate representation * @param options - Fetch options * @returns Result with SVG content or KrokiError * * @example * ```typescript * import { fetchKrokiSvg } from 'awaitly-visualizer/kroki-fetch'; * * const result = await fetchKrokiSvg(workflowIR); * if (result.ok) { * // Write to file or embed in HTML * console.log(result.value); * } else { * console.error('Failed:', result.error); * } * ``` */ declare function fetchKrokiSvg(ir: WorkflowIR, options?: FetchKrokiOptions): AsyncResult; /** * Fetch PNG content from Kroki. * * @param ir - Workflow intermediate representation * @param options - Fetch options * @returns Result with PNG content as Buffer or KrokiError * * @example * ```typescript * import { fetchKrokiPng } from 'awaitly-visualizer/kroki-fetch'; * import fs from 'node:fs'; * * const result = await fetchKrokiPng(workflowIR); * if (result.ok) { * fs.writeFileSync('workflow.png', result.value); * } * ``` */ declare function fetchKrokiPng(ir: WorkflowIR, options?: FetchKrokiOptions): AsyncResult; /** * Fetch PDF content from Kroki. * * @param ir - Workflow intermediate representation * @param options - Fetch options * @returns Result with PDF content as Buffer or KrokiError * * @example * ```typescript * import { fetchKrokiPdf } from 'awaitly-visualizer/kroki-fetch'; * import fs from 'node:fs'; * * const result = await fetchKrokiPdf(workflowIR); * if (result.ok) { * fs.writeFileSync('workflow.pdf', result.value); * } * ``` */ declare function fetchKrokiPdf(ir: WorkflowIR, options?: FetchKrokiOptions): AsyncResult; export { type FetchKrokiOptions, type KrokiError, fetchKrokiPdf, fetchKrokiPng, fetchKrokiSvg };