import { FileItemRef, FileUploadMachine, FileUploadState, StorageUploadFileParams, UploadFileHandlerResult } from '@nhost/nhost-js'; import { ToRefs } from 'vue'; import { InterpreterFrom } from 'xstate'; export interface FileUploadComposableResult extends ToRefs { /** * Add the file without uploading it. */ add: (params: StorageUploadFileParams) => void; /** * Upload the file given as a parameter, or that has been previously added. */ upload: (params: Partial) => Promise; /** * Cancel the ongoing upload. */ cancel: () => void; /** * @internal - used by the MultipleFilesUpload component to notice the file should be removed from the list. */ destroy: () => void; } export type { FileItemRef }; /** * Use the composable `useFileUploadItem` to control the file upload of a file in a multiple file upload. * * * @example * ```vue * * * * * * * ``` */ export declare const useFileUploadItem: (ref: FileItemRef | InterpreterFrom) => FileUploadComposableResult; /** * Use the composable `useFileUpload` to upload a file. * * @example * ```ts * const { add, * upload, * cancel, * isUploaded, * isUploading, * isError, * progress, * id, * bucketId, * name * } = useFileUpload(); * * * const handleFormSubmit = async (e) => { * e.preventDefault(); * * await upload({ file }) * } * ``` * * @docs https://docs.nhost.io/reference/vue/use-file-upload */ export declare const useFileUpload: () => FileUploadComposableResult; //# sourceMappingURL=useFileUpload.d.ts.map