import { type DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES, type ScriptHTMLAttributes } from 'react'; import { type FileIdentifier, type MediaBlobUrlAttrs, type MediaStoreGetFileImageParams } from '@atlaskit/media-client'; import { type MediaTraceContext, type SSR } from '@atlaskit/media-common'; import { type SSRStatus } from './analytics'; import { MediaFilePreviewError } from './errors'; import { type MediaFilePreview, type MediaFilePreviewDimensions, type MediaFilePreviewStatus } from './types'; export interface UseFilePreviewParams { /** Instance of file identifier. */ readonly identifier: FileIdentifier; /** Resize the media to 'crop' | 'fit' | 'full-fit' */ readonly resizeMode?: MediaStoreGetFileImageParams['mode']; /** Dimensions to be requested to the server. Will be scaled x2 in Retina Displays */ readonly dimensions?: MediaFilePreviewDimensions; /** Server-Side-Rendering modes are "server" and "client" */ readonly ssr?: SSR; /** Whether to use the srcSet for the preview. */ readonly useSrcSet?: boolean; /** Attributes to attach to the created Blob Url */ readonly mediaBlobUrlAttrs?: MediaBlobUrlAttrs; /** Trace context to be passed to the backend requests */ readonly traceContext?: MediaTraceContext; /** Do not fetch a remote preview. Helpful for lazy loading */ readonly skipRemote?: boolean; /** Define whether an animated image is acceptable to return */ readonly allowAnimated?: boolean; /** Define the upscale strategy for this image. */ readonly upscale?: boolean; /** Make the client receive the response with the given max-age cache control header. Minimum: 0, maximum: 9223372036854776000. */ readonly maxAge?: number; /** Defines the source component */ readonly source?: string; } export declare const useFilePreview: ({ resizeMode, identifier, ssr, dimensions, useSrcSet, traceContext, skipRemote, mediaBlobUrlAttrs, allowAnimated, upscale, maxAge, source, }: UseFilePreviewParams) => { preview: MediaFilePreview | undefined; status: MediaFilePreviewStatus; error: MediaFilePreviewError | undefined; nonCriticalError: MediaFilePreviewError | undefined; ssrReliability: SSRStatus; onImageError: (failedPreview?: MediaFilePreview) => void; onImageLoad: (newPreview?: MediaFilePreview) => void; getSsrScriptProps: (() => ScriptHTMLAttributes) | undefined; copyNodeRef: (instance: HTMLDivElement | HTMLImageElement | null) => void | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]; };