/** * Pure image-proxy URL builder + helpers. * * Lib-side replacement for the hub's `lib/utils/image-proxy.ts`. The * hub used to hardcode `/api/image-proxy` + an `openmsp.ai` skip-domain; * this version takes BOTH as parameters so embedded apps (and other * platforms that host the lib) can wire their own proxy prefix + skip * list at the runtime layer. * * Pure function — no side effects, no env reads. Callers thread the * proxy config through (typically from `ChatRuntime.endpoints.imageProxyUrlPrefix`). */ export type GetProxiedImageUrlOptions = { /** * URL prefix for the image proxy (`?url=`). When unset, * `getProxiedImageUrl` returns the original URL unchanged — relative * URLs always pass through. Hub default: `/api/image-proxy`. */ proxyPrefix?: string; /** * Domains that should bypass the proxy (e.g. own-CDN hosts whose * `Content-Type` is reliable and that already serve CORS-permitting * headers). Matched as `imageUrl.includes(domain)` so subdomains * inherit. Default: `[]`. */ skipDomains?: string[]; /** * Return the original `https://` URL so the browser loads it directly * (no proxy). Use when upstream `Content-Type` breaks the proxy (common * with SVG on some CDNs) or you want the origin to see the client * request. HTTP stays proxied (mixed content / legacy). */ directHttps?: boolean; }; /** * Resolve an external image URL through (or around) the image proxy. * * Resolution order: * 1. `imageUrl` already contains `proxyPrefix` → return unchanged * (self-skip — prevents double-wrap). * 2. `directHttps` set AND `imageUrl` starts with `https://` → return * unchanged. * 3. `imageUrl` doesn't start with `http://` or `https://` → return * unchanged (relative URLs pass through). * 4. `proxyPrefix` unset → return unchanged. * 5. `skipDomains` matches the URL's host → return unchanged. * 6. Else return `?url=`. */ export declare function getProxiedImageUrl(imageUrl: string | null, options?: GetProxiedImageUrlOptions): string | null; /** * Heuristic: URL path looks like an SVG. Useful with `{ directHttps: true }` * when only SVGs misbehave through the proxy; raster images can stay * proxied if you prefer. */ export declare function urlPathLooksLikeSvg(imageUrl: string): boolean; /** * Check if an image URL needs to be proxied. `proxyPrefix` is the same * value passed to `getProxiedImageUrl` — used to short-circuit the * self-skip case. */ export declare function shouldProxyImage(imageUrl: string | null, proxyPrefix?: string): boolean; /** * Generate a responsive `sizes` attribute for `` / `` tags. * Pure utility — kept here for backwards-compatibility with the previous * stub. */ export declare function generateImageSizes(_url: string): string; //# sourceMappingURL=image-proxy.d.ts.map