@amsterdam/bmi-component-library
Version:
A React component library based on ASC and Material-UI aimed at repurposing and sharing components across BMI projects
20 lines • 937 B
TypeScript
import { FileRejection } from 'react-dropzone';
export interface CustomFile extends File {
tmpId: number;
progress?: number;
uploadXhrError?: boolean;
response?: string;
preview?: string;
}
export type CustomFileOrRejection = CustomFile & FileRejection;
export type Files = CustomFileOrRejection[];
export declare const useFileUpload: (getPostUrl: (file: CustomFile) => Promise<string>, getHeaders: () => Promise<{
[key: string]: string;
}>, httpMethod?: 'POST' | 'PUT', storedFiles?: CustomFileOrRejection[], lastTmpId?: number, onFileSuccess?: ((file: CustomFile) => void) | undefined) => {
handleOnDrop: (acceptedFiles: File[], fileRejections: FileRejection[]) => void;
handleOnCancel: (file: CustomFileOrRejection) => void;
handleOnFileRemove: (file: CustomFileOrRejection) => void;
handleOnRemoveAllFiles: () => void;
files: CustomFileOrRejection[];
};
//# sourceMappingURL=hooks.d.ts.map