@airplane/views
Version:
A React library for building Airplane views. Views components are optimized in style and functionality to produce internal apps that are easy to build and maintain.
26 lines (25 loc) • 996 B
TypeScript
import { AirplaneFile } from "airplane";
/**
* This hook manages the state of a set of file uploads. It returns an object
* containing `onDrop`, which accepts a list of `File`, and `uploads`, which
* contains information about the upload progress and the resulting `AirplaneFile`
* objects. Callbacks that fire during different stages of the upload can be
* passed as arguments to the hook.
*/
export declare const useUploadAirplaneFiles: ({ onChange, onLoad, onLoadEnd, onError, getUploadURL, }: {
onChange: (v: AirplaneFile[]) => void;
onLoad?: ((f: File) => void) | undefined;
onLoadEnd?: ((f: File) => void) | undefined;
onError?: ((f: File, e: unknown) => void) | undefined;
getUploadURL?: ((filename: string, sizeBytes: number) => Promise<{
uploadID: string;
readURL: string;
writeURL: string;
}>) | undefined;
}) => {
onDrop: (files: File[]) => void;
uploads: {
percent: number;
file: AirplaneFile;
}[];
};