import { FileInputErrorType as ImageFileInputErrorType, type InvalidFile } from '../file-input/FileInput'; import type { InputBaseProps } from '../input-base/InputBase'; /** * An image already stored on the server, identified by its URL. * * Mirrors the vanilla implementation's `UploadedFile` * (assets/scripts/imageFileInput/const/types.ts), with two deliberate differences: * the name is prefixed because this one is re-exported from the package root, * and `fileImageUrl` is required — a preview entry without a URL has nothing to render. */ export type ImageUploadedFile = { fileName: string; fileImageUrl: string; }; export interface ImageFileInputProps extends Omit { /** * Accepted file types * e.g. '.jpg,.png,.pdf' or 'image/*' */ accept?: string; /** * Maximum number of files */ maxFileCount?: number; /** * Maximum file size in bytes */ maxFileSize?: number; /** * Current files (controlled mode) */ value?: File[]; /** * Callback when files change (controlled mode) */ onChange?: (files: File[]) => void; /** * Images already stored on the server, shown before newly selected files. * Rendered straight from their URL, so no fetch or CORS handling is needed. */ uploadedFiles?: ImageUploadedFile[]; /** * Callback when a stored image is removed. Receives the remaining list. * * `uploadedFiles` is a controlled prop — just like `value`/`onChange`, removal * only takes effect once the caller applies this list back. Passing * `uploadedFiles` without this callback leaves the previews frozen. */ onUploadedFilesChange?: (uploadedFiles: ImageUploadedFile[]) => void; /** * Callback when files are selected (uncontrolled mode) */ onFileSelect?: (files: File[]) => void; /** * Callback when file selection fails */ onFail?: (files: InvalidFile[]) => void; /** * Label shown on the button */ buttonLabel?: string; /** * Label shown on the image preview */ imagePreviewTooltipLabel?: string; /** * Hint text items to display as a list */ hintItems?: string[]; /** * Whether the input is required */ isRequired?: boolean; /** * Whether to show the help icon */ showHelpIcon?: boolean; /** * Hint text to display */ hintText?: string; /** * Whether to show the file tag list */ showFileTagList?: boolean; /** * Whether to show the hint text */ showHintText?: boolean; /** * Whether to show the file input section */ showFileInput?: boolean; } export declare const ImageFileInput: import("react").ForwardRefExoticComponent>; /** * Rejection reasons reported through `onFail`. * * Re-exported under the ImageFileInput name so callers do not have to reach * into FileInput for it. Same enum, same values. */ export { ImageFileInputErrorType };