import { Component } from 'react'; import { WrappedComponentProps } from 'react-intl'; import { Size } from '../common'; import { PostDataFetcher, PostDataHTTPOptions } from './utils/postData/postData'; export declare const MAX_SIZE_DEFAULT = 5000000; export declare enum UploadStep { UPLOAD_IMAGE_STEP = "uploadImageStep" } export interface UploadProps extends WrappedComponentProps { /** @default 300 */ animationDelay?: number; csButtonText?: string; csFailureText?: string; csSuccessText?: string; csTooLargeMessage?: string; csWrongTypeMessage?: string; httpOptions?: PostDataHTTPOptions & { fileInputName?: string; data?: Record; }; /** * You can provide a fetcher function with the same interface as the global fetch function, which is used by default. * `function fetcher(input: RequestInfo, init?: RequestInit): Promise` */ fetcher?: PostDataFetcher; /** * Filesize expressed in B.
If set to `null`, no size limit will be applied. * @default 5000000 (5 MB) */ maxSize?: number | null; psButtonText?: string; /** @default false */ psButtonDisabled?: boolean; psProcessingText?: string; /** @default 'md' */ size?: `${Size.SMALL | Size.MEDIUM | Size.LARGE}`; /** * You can provide multiple rules separated by comma, e.g.: "application/pdf,image/*". * Using "*" will allow every file type to be uploaded. * @default 'image/*' */ usAccept?: string; usButtonText?: string; usButtonRetryText?: string; /** @default false */ usDisabled?: boolean; usDropMessage?: string; usHelpImage?: React.ReactNode; /** @default '' */ usLabel?: string; usPlaceholder?: string; /** * Override for the [InlinePrompt icon's default, accessible name](/?path=/docs/other-statusicon-accessibility--docs) * announced by the screen readers * */ errorIconLabel?: string; /** @deprecated Only a single variant exists, please remove this prop. */ uploadStep?: `${UploadStep}`; onCancel?: () => void; onFailure?: (error: unknown) => void; onStart?: (file: File) => void; onSuccess?: (response: string | Response, fileName: string) => void; } interface UploadState { fileName: string; isDroppable: boolean; isComplete: boolean; isError: boolean; isImage: boolean; isProcessing: boolean; isSuccess: boolean; response: unknown; uploadedImage: string | undefined; } export declare class Upload extends Component { props: UploadProps & Required>; static defaultProps: { animationDelay: number; maxSize: number; psButtonDisabled: false; size: "md"; usAccept: string; usDisabled: false; usLabel: string; }; dragCounter: number; timeouts: number; constructor(props: UploadProps); getErrorMessage(status?: number): string; onDragLeave(event: React.DragEvent): void; onDragEnter(event: React.DragEvent): void; onDrop(event: React.DragEvent): Promise; asyncPost: (file: File) => Promise; handleUploadComplete: (type: "success" | "error", response: unknown) => void; asyncResponse: (response: unknown, type: "success" | "error") => void; handleOnClear: React.MouseEventHandler; reset: () => void; showDataImage: (dataUrl: string) => void; fileDropped: (file: File) => Promise; render(): import("react").JSX.Element; } declare const _default: import("react").FC> & { WrappedComponent: import("react").ComponentType; }; export default _default; //# sourceMappingURL=Upload.d.ts.map