import type { ToolWidgetStatus } from './toolWidgetUtils'; /** * SVG artifacts need an HTML shell. Trust an explicit `type` arg; sniff the * markup only when the type is missing. */ export declare function isSvgArtifact(type: string | undefined, source: string): boolean; /** * Wrap artifact markup in the host-controlled preview document (CSP first, * theme vars + Tailwind for HTML, minimal centering shell for SVG). The result * must ONLY ever be rendered inside the sandboxed artifact WebView. */ export declare function buildArtifactPreviewHtml(markup: string, { isDark, isSvg }: { isDark: boolean; isSvg?: boolean; }): string; /** Live preview only for settled successful artifacts with content. */ export declare function canPreviewArtifact(status: ToolWidgetStatus, source: string | null | undefined): boolean; /** * Whether a recorded WebView load failure still applies. Failures are keyed * to the markup that failed (mirroring the per-html navigation guard), so a * later `client_artifact` update on the same tool call gets a fresh render * attempt instead of a permanently dead preview. */ export declare function previewFailureApplies(failedSource: string | null, currentSource: string | null | undefined): boolean; /** * Per-WebView, platform-aware `onShouldStartLoadWithRequest` guard (pass * `Platform.OS`). iOS: exactly one admission — the first callback, and only * when it is the initial inline document reported as `about:blank`. Android * (and any other platform): the initial load never consults the guard, so * every callback is already artifact-initiated and the guard starts CLOSED — * a platform-blind single admission would let scripted * `window.location = 'about:blank'` mint a CSP-less document there. Once * closed, everything is blocked: http(s), file, custom schemes, `data:` * documents, `about:` re-navs — any of which would produce a document * without our CSP shell, escaping `connect-src 'none'`. */ export declare function createArtifactNavigationGuard(platform: string): (url: string) => boolean; //# sourceMappingURL=artifactPreviewUtils.d.ts.map