import type { DesignDocument, DocumentDiagnostic, DocumentNode, DocumentValue } from './contracts.js'; export type ExportFormat = 'svg' | 'png' | 'jpg' | 'webp'; export interface ExportSetting { format: ExportFormat; constraint: { type: 'scale' | 'width' | 'height'; value: number; }; suffix: string; contentsOnly?: boolean; } export declare const DEFAULT_EXPORT_SETTING: ExportSetting; export declare function isExportSetting(value: unknown): value is ExportSetting; export declare function nodeExportSettings(node: Pick): ExportSetting[]; export declare function exportSettingsProperties(properties: Record, settings: readonly ExportSetting[]): Record; export declare function exportDimensions(node: Pick, setting: ExportSetting): { width: number; height: number; scale: number; }; export interface SvgExportResult { markup: string; width: number; height: number; diagnostics: DocumentDiagnostic[]; } /** Safe SVG export of document geometry. Any unsupported visual is reported and prevents export. */ export declare function exportNodeSvg(document: DesignDocument, nodeId: string, setting?: ExportSetting): SvgExportResult; export interface RasterExportRequest { document: DesignDocument; nodeId: string; format: 'png' | 'jpg' | 'webp'; width: number; height: number; scale: number; contentsOnly: boolean; signal?: AbortSignal; } export type RasterExportRenderer = ((request: RasterExportRequest) => Promise) & { /** Optional synchronous eligibility check. Throw for known unsupported output; do not render, mutate, or load resources. */ preflight?(request: RasterExportRequest): void; }; export interface DesignExportArtifact { fileName: string; mediaType: string; bytes: Uint8Array; } /** Raster bytes come only from an explicit host renderer; no hidden capture or network access. */ export declare function exportDesignNode(document: DesignDocument, nodeId: string, setting: ExportSetting, renderer?: RasterExportRenderer, options?: { signal?: AbortSignal; }): Promise;