UNPKG

react-blurish-image

Version:

A lightweight, optimized React image component with blur placeholders and lazy loading

20 lines 1.41 kB
/** * Handles the loading process of an image element, including blur effects and event handling * @param img - The image element with additional data properties * @param placeholder - The placeholder value determining loading behavior * @param onLoadRef - React ref containing the onLoad event handler * @param onLoadingCompleteRef - React ref containing the callback for when loading completes * @param setBlurComplete - Function to update the blur completion state * @param unoptimized - Boolean flag indicating if the image is unoptimized * @returns void */ /** * Validates an image element for required properties and displays warnings if enabled * @param img - The HTML image element to validate * @param src - The source URL of the image * @throws Console errors if required properties are missing (when warnings are enabled) */ import type { ImgElementWithDataProp, PlaceholderValue } from './types'; export declare function handleLoading(img: ImgElementWithDataProp, placeholder: PlaceholderValue, onLoadRef: React.MutableRefObject<((event: React.SyntheticEvent<HTMLImageElement>) => void) | undefined>, onLoadingCompleteRef: React.MutableRefObject<((image: HTMLImageElement) => void) | undefined>, setBlurComplete: (b: boolean) => void, unoptimized: boolean): void; export declare function validateImage(img: HTMLImageElement, src: string): void; //# sourceMappingURL=image-loading.d.ts.map