import React from 'react'; import { UploadFile } from './FileUpload'; import { CSSValueWithLength } from '../../styles'; export interface ImageFile extends Omit { key?: string; value?: File | null; src?: string; removable?: boolean; label?: string; } export interface ImageUploadProps { className?: string; objectFit?: 'contain' | 'cover' | 'fill'; size?: 'medium' | 'small'; /** * size가 'medium'일 경우 width, height를 변경할 수 있습니다. * 최소 width: 60, height: 60 */ width?: number; height?: number; /** * 허용되는 이미지 확장자를 지정합니다. * * @example * accept="*" // 모든 이미지 타입, 기본값 * accept="png" * accept="png, jpg, gif" * accept=".png, .jpg, .gif" * accept="image/png, image/jpg" * * @default '*' */ accept?: string; readOnly?: boolean; disabled?: boolean; loading?: boolean; backgroundDark?: boolean; /** * HTMLInputElement['multiple'] */ multiple?: boolean; /** * 최대 업로드 파일 갯수 */ maxCount?: number; /** * FileList내 삭제버튼 사용 유무 * @default true */ showRemoveButton?: boolean; /** * FileList를 노출하려면 지정된 UploadFile 타입으로 전달해야합니다. */ fileList?: ImageFile[]; /** * draggable이 true인 경우 ImageUploadPreview 컴포넌트를 드래그하여 재정렬할 수 있습니다. * @default false */ draggable?: boolean; /** @default border_radius_styles_with_size.small */ borderRadius?: CSSValueWithLength; /** * 드래그 중인 아이템의 z-index를 지정합니다. * @default getZIndex('draggable') */ z_index?: number; onChange?: (file: File | File[]) => void; /** * 파일 업로드 버튼 클릭시 실행되는 이벤트 */ onClick?: React.MouseEventHandler; /** * FileList 클릭시 인덱스 정보와 함께 전달합니다. 드래그시에는 실행되지 않습니다. */ onClickFile?: (image_url: string, index: number) => void; /** * 삭제 버튼 클릭시 인덱스 정보와 함께 전달합니다. 드래그시에는 실행되지 않습니다. */ onClickFileRemove?: (file: ImageFile, index: number) => void; /** * 드래그 종료시 재정렬된 파일리스트를 전달합니다. */ onDragEnd?: (fileList: ImageFile[]) => void; } export declare const ImageUpload: ({ className, size, width, height, accept, objectFit, readOnly, disabled, loading, backgroundDark, multiple, maxCount, showRemoveButton, fileList, draggable, z_index, borderRadius, onChange, onClick, onClickFile, onClickFileRemove, onDragEnd, }: ImageUploadProps) => import("@emotion/react/jsx-runtime").JSX.Element;