import { UploadcareImage } from '@prezly/uploadcare'; import type { RefObject } from 'react'; /** * Whether an image may contain transparent pixels, judging by its file type. * GIFs are rendered as videos, so they are excluded. */ export declare function mayHaveTransparency(image: Pick): boolean; /** * The tiny PNG used to inspect an image's pixels. It keeps effects that change the shown * area (crops), but drops scaling ones, so every rendered size of an image shares one sample. * * The sample always comes from the Uploadcare CDN host, which sends CORS headers. Custom CDN * domains (e.g. `cdn.assets.prezly.com`) redirect there without them, and a canvas cannot read * pixels through such a redirect. */ export declare function getTransparencySampleUrl(image: UploadcareImage): string; /** * Returns `true` when `image` has transparent areas that would blend into the colour * behind `elementRef`, so a checkerboard backdrop is needed to keep it visible. * * The check runs in the browser once the element is near the viewport, using a 64px PNG * sample from the CDN. Opaque formats (JPEG) and GIFs are never checked. */ export declare function useTransparencyBackdrop(image: UploadcareImage | null | undefined, elementRef: RefObject): boolean;