@visulima/storage-client 1.0.0-alpha.12 → 1.0.0-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +43 -0
- package/dist/index.d.ts +208 -1
- package/dist/index.js +1 -1
- package/dist/packem_shared/{createAbortAll-CIaZJY9f.js → createAbortAll-BVH_Wo6s.js} +1 -1
- package/dist/packem_shared/{createAbortAll-D3DlfIUX.js → createAbortAll-DMUWUL4C.js} +1 -1
- package/dist/packem_shared/{createAbortBatch-CYc_weio.js → createAbortBatch-C3t-Ho9c.js} +1 -1
- package/dist/packem_shared/{createAbortBatch-r3kaxuh8.js → createAbortBatch-bMvSBu1k.js} +1 -1
- package/dist/packem_shared/{createAbortItem-CDuIUi-c.js → createAbortItem-Bmhqhi8L.js} +1 -1
- package/dist/packem_shared/{createAbortItem-Dvd4L_J4.js → createAbortItem-BsqmmxdZ.js} +1 -1
- package/dist/packem_shared/{createAllAbortListener-DWB1otpM.js → createAllAbortListener-BChF9YcG.js} +1 -1
- package/dist/packem_shared/{createAllAbortListener-BehqWMv-.js → createAllAbortListener-BF9VhxQA.js} +1 -1
- package/dist/packem_shared/{createBatchCancelledListener-c6KcP08b.js → createBatchCancelledListener-DIHrRDNj.js} +1 -1
- package/dist/packem_shared/{createBatchCancelledListener-BXElG-Zl.js → createBatchCancelledListener-FsVlTbYv.js} +1 -1
- package/dist/packem_shared/createBatchDeleteFiles-B8bHItyS.js +1 -0
- package/dist/packem_shared/createBatchDeleteFiles-CN07ubNE.js +1 -0
- package/dist/packem_shared/{createBatchErrorListener-DFJkCUjM.js → createBatchErrorListener-BNXfdSlM.js} +1 -1
- package/dist/packem_shared/{createBatchErrorListener-Qe8LXCAz.js → createBatchErrorListener-CxEJhGOX.js} +1 -1
- package/dist/packem_shared/{createBatchFinalizeListener-Dd2Fiw8Z.js → createBatchFinalizeListener-DOK5uoog.js} +1 -1
- package/dist/packem_shared/{createBatchFinalizeListener-C-VHli8S.js → createBatchFinalizeListener-pjqAl9iM.js} +1 -1
- package/dist/packem_shared/{createBatchFinishListener-m7KNLv_1.js → createBatchFinishListener-BbMzJGlN.js} +1 -1
- package/dist/packem_shared/{createBatchFinishListener-DZHov2gR.js → createBatchFinishListener-DuMOo7Kn.js} +1 -1
- package/dist/packem_shared/{createBatchProgressListener-DXfegOiX.js → createBatchProgressListener-CUpa_7Nv.js} +1 -1
- package/dist/packem_shared/{createBatchProgressListener-C6EL7w7m.js → createBatchProgressListener-D28nm9Xe.js} +1 -1
- package/dist/packem_shared/{createBatchRetry-BnTMC2im.js → createBatchRetry-Bnaf10e9.js} +1 -1
- package/dist/packem_shared/{createBatchRetry-DssYfupW.js → createBatchRetry-DWOdovQt.js} +1 -1
- package/dist/packem_shared/{createBatchStartListener-e0RcceTB.js → createBatchStartListener-BwVzPsCB.js} +1 -1
- package/dist/packem_shared/{createBatchStartListener-D9gG-BHX.js → createBatchStartListener-DejGDAMY.js} +1 -1
- package/dist/packem_shared/{createBatchUpload-DCzjYF4B.js → createBatchUpload-Dm5vSg1j.js} +1 -1
- package/dist/packem_shared/createBatchUpload-Z-8vD9Ql.js +1 -0
- package/dist/packem_shared/createChunkedRestAdapter-CWFhVX6x.js +1 -0
- package/dist/packem_shared/createChunkedRestUpload-BH_5ZAr2.js +1 -0
- package/dist/packem_shared/createChunkedRestUpload-DAoXFznW.js +1 -0
- package/dist/packem_shared/createDeleteFile-D07PU21a.js +1 -0
- package/dist/packem_shared/createDeleteFile-mGIgeCQK.js +1 -0
- package/dist/packem_shared/createFileInput-CERPgCpc.js +1 -0
- package/dist/packem_shared/createFileInput-DyGrmzbc.js +1 -0
- package/dist/packem_shared/createGetFile-cUIB1L1M.js +1 -0
- package/dist/packem_shared/createGetFile-dT-EuNKP.js +1 -0
- package/dist/packem_shared/createGetFileList-C3lYvKGY.js +1 -0
- package/dist/packem_shared/createGetFileList-C_n3HgHG.js +1 -0
- package/dist/packem_shared/createGetFileMeta-CSYB0Oj1.js +1 -0
- package/dist/packem_shared/{createGetFileMeta-50LymNvf.js → createGetFileMeta-DZ46CHse.js} +1 -1
- package/dist/packem_shared/createHeadFile--rl2Ezgb.js +1 -0
- package/dist/packem_shared/{createHeadFile-DR8CwK_B.js → createHeadFile-Ch80NkDO.js} +1 -1
- package/dist/packem_shared/{createMultipartAdapter-BNppwu8z.js → createMultipartAdapter-B17aIZJS.js} +1 -1
- package/dist/packem_shared/{createMultipartUpload-BMu5EO-f.js → createMultipartUpload-BPcFYSwI.js} +1 -1
- package/dist/packem_shared/createMultipartUpload-CFsUjhvG.js +1 -0
- package/dist/packem_shared/createPatchChunk-7y5S60GE.js +1 -0
- package/dist/packem_shared/createPatchChunk-D-N2cYZ7.js +1 -0
- package/dist/packem_shared/createPutFile-BJcLUSQi.js +1 -0
- package/dist/packem_shared/createPutFile-CamOtR__.js +1 -0
- package/dist/packem_shared/{createRetry-2YY79v45.js → createRetry-BInLl1TV.js} +1 -1
- package/dist/packem_shared/{createRetry-DOYZZbrG.js → createRetry-D0eddvNY.js} +1 -1
- package/dist/packem_shared/{createRetryListener-CW4sOuow.js → createRetryListener-59bXI4qF.js} +1 -1
- package/dist/packem_shared/{createRetryListener-ISvMl_3n.js → createRetryListener-hZUkGq7P.js} +1 -1
- package/dist/packem_shared/createTransformFile-BaofH3n5.js +1 -0
- package/dist/packem_shared/createTransformFile-BcoA39lM.js +1 -0
- package/dist/packem_shared/createTransformMetadata-C9lWyhne.js +1 -0
- package/dist/packem_shared/{createTransformMetadata-zyl5UymO.js → createTransformMetadata-CqyCBOXk.js} +1 -1
- package/dist/packem_shared/createTusAdapter-BbFsUNsP.js +1 -0
- package/dist/packem_shared/{createTusUpload-60ceH2dH.js → createTusUpload-DKIIHh2X.js} +1 -1
- package/dist/packem_shared/createTusUpload-rZKMrL5n.js +1 -0
- package/dist/packem_shared/{createUpload-hMh93Gt9.js → createUpload-0qE79TWD.js} +1 -1
- package/dist/packem_shared/createUpload-BF6TujIH.js +1 -0
- package/dist/packem_shared/createUploader-KOsp3cZt.js +1 -0
- package/dist/packem_shared/parseApiError-BiXX3oHJ.js +1 -0
- package/dist/packem_shared/uploader.d-DsC50BbX.d.ts +223 -0
- package/dist/packem_shared/{useAbortAll-Dwl12wn5.js → useAbortAll-DNzPcfOt.js} +1 -1
- package/dist/packem_shared/{useAbortAll-BQ8eXNKW.js → useAbortAll-Xks2z0Rf.js} +1 -1
- package/dist/packem_shared/{useAbortBatch-CyHnX3HT.js → useAbortBatch-Jb37hbXq.js} +1 -1
- package/dist/packem_shared/{useAbortBatch-CZpDT_VG.js → useAbortBatch-y-KZjKTY.js} +1 -1
- package/dist/packem_shared/{useAbortItem-D-5h_Oyx.js → useAbortItem-BhdhRgs8.js} +1 -1
- package/dist/packem_shared/{useAbortItem-D_F-QSoR.js → useAbortItem-DTFUUKVu.js} +1 -1
- package/dist/packem_shared/{useAllAbortListener-BTmWEsU9.js → useAllAbortListener-BBw02ZoD.js} +1 -1
- package/dist/packem_shared/{useAllAbortListener-XvIsxprv.js → useAllAbortListener-Crsmf1kC.js} +1 -1
- package/dist/packem_shared/{useBatchCancelledListener-CYR2wnxk.js → useBatchCancelledListener-C3IW43nC.js} +1 -1
- package/dist/packem_shared/{useBatchCancelledListener-C0LDRfcv.js → useBatchCancelledListener-CVJULtua.js} +1 -1
- package/dist/packem_shared/useBatchDeleteFiles-BSG8D3Do.js +1 -0
- package/dist/packem_shared/useBatchDeleteFiles-DmKXrcBR.js +1 -0
- package/dist/packem_shared/{useBatchErrorListener-Czidx586.js → useBatchErrorListener-BAVIRlQE.js} +1 -1
- package/dist/packem_shared/{useBatchErrorListener-B_6NFnd9.js → useBatchErrorListener-Ck1BwfZA.js} +1 -1
- package/dist/packem_shared/{useBatchFinalizeListener-CHCTeAHu.js → useBatchFinalizeListener-D7TRElSE.js} +1 -1
- package/dist/packem_shared/{useBatchFinalizeListener-DPMYtpeD.js → useBatchFinalizeListener-nA7Qs-Ya.js} +1 -1
- package/dist/packem_shared/{useBatchFinishListener-BU_oqITL.js → useBatchFinishListener-C6zS5OI6.js} +1 -1
- package/dist/packem_shared/{useBatchFinishListener-C757MrUE.js → useBatchFinishListener-VdCzyg4J.js} +1 -1
- package/dist/packem_shared/{useBatchProgressListener-VgV-UnUC.js → useBatchProgressListener-B08x2n9U.js} +1 -1
- package/dist/packem_shared/{useBatchProgressListener-DLvO3sOl.js → useBatchProgressListener-CdcDM2sa.js} +1 -1
- package/dist/packem_shared/{useBatchRetry-DPDRWaAZ.js → useBatchRetry-B3FQ1DdH.js} +1 -1
- package/dist/packem_shared/{useBatchRetry-DgtOIHZS.js → useBatchRetry-DahiIOXJ.js} +1 -1
- package/dist/packem_shared/{useBatchStartListener-BtJWkFZl.js → useBatchStartListener-ByQlcF8F.js} +1 -1
- package/dist/packem_shared/{useBatchStartListener-VhNPXaew.js → useBatchStartListener-DndF1z5v.js} +1 -1
- package/dist/packem_shared/{useBatchUpload-OtoOJPyD.js → useBatchUpload-BJBdu6vh.js} +1 -1
- package/dist/packem_shared/useBatchUpload-IZkU_Gop.js +1 -0
- package/dist/packem_shared/useChunkedRestUpload-C9RhEtUt.js +1 -0
- package/dist/packem_shared/useChunkedRestUpload-tirJ_5VX.js +1 -0
- package/dist/packem_shared/useDeleteFile-BJnTMMUr.js +1 -0
- package/dist/packem_shared/useDeleteFile-Dsw372GL.js +1 -0
- package/dist/packem_shared/useFileInput-BUPBo2m_.js +1 -0
- package/dist/packem_shared/useFileInput-CgqlIlGE.js +1 -0
- package/dist/packem_shared/useGetFile-BkmKk12o.js +1 -0
- package/dist/packem_shared/useGetFile-CNOi9ZIM.js +1 -0
- package/dist/packem_shared/useGetFileList-BIGh4thc.js +1 -0
- package/dist/packem_shared/useGetFileList-CkAmk7lP.js +1 -0
- package/dist/packem_shared/useGetFileMeta-CHee8013.js +1 -0
- package/dist/packem_shared/useGetFileMeta-eKrJc2p1.js +1 -0
- package/dist/packem_shared/useHeadFile-CdIM_Xi1.js +1 -0
- package/dist/packem_shared/{useHeadFile-DBQdkWZG.js → useHeadFile-D5CQQnyf.js} +1 -1
- package/dist/packem_shared/{useMultipartUpload-DmdEn3r3.js → useMultipartUpload-CJMa-_Yo.js} +1 -1
- package/dist/packem_shared/{useMultipartUpload-CIZ1b2I0.js → useMultipartUpload-CbRSpnTb.js} +1 -1
- package/dist/packem_shared/usePatchChunk-B8ZCd9Th.js +1 -0
- package/dist/packem_shared/usePatchChunk-DqZtVBBl.js +1 -0
- package/dist/packem_shared/usePutFile-CFaBgDX4.js +1 -0
- package/dist/packem_shared/usePutFile-Db_uVkqT.js +1 -0
- package/dist/packem_shared/{useRetry-BKB7OLhh.js → useRetry-DHjDuH0H.js} +1 -1
- package/dist/packem_shared/{useRetry-CrCiJNIu.js → useRetry-trYC3K_p.js} +1 -1
- package/dist/packem_shared/{useRetryListener-DJuOCZP7.js → useRetryListener-CAIyK1_Q.js} +1 -1
- package/dist/packem_shared/{useRetryListener-CnCl5adt.js → useRetryListener-DC8G9lmY.js} +1 -1
- package/dist/packem_shared/useTransformFile-BCyX-R_e.js +1 -0
- package/dist/packem_shared/useTransformFile-BMqWIG7J.js +1 -0
- package/dist/packem_shared/useTransformMetadata-CUo8IdKP.js +1 -0
- package/dist/packem_shared/{useTransformMetadata-B0JbX1Ni.js → useTransformMetadata-DjcVDZOc.js} +1 -1
- package/dist/packem_shared/{useTusUpload-BkaFKsSN.js → useTusUpload-B5KsdwDR.js} +1 -1
- package/dist/packem_shared/{useTusUpload-CNRlzFRm.js → useTusUpload-BwF0G1LE.js} +1 -1
- package/dist/packem_shared/{useUpload-DHgLmMri.js → useUpload-7OjscFW6.js} +1 -1
- package/dist/packem_shared/{useUpload-hVpmaxT3.js → useUpload-C5ZiPWFM.js} +1 -1
- package/dist/react/index.d.ts +839 -61
- package/dist/react/index.js +1 -1
- package/dist/solid/index.d.ts +690 -60
- package/dist/solid/index.js +1 -1
- package/dist/svelte/index.d.ts +671 -60
- package/dist/svelte/index.js +1 -1
- package/dist/vue/index.d.ts +804 -60
- package/dist/vue/index.js +1 -1
- package/package.json +26 -26
- package/dist/core/chunked-rest-adapter.d.ts +0 -43
- package/dist/core/index.d.ts +0 -11
- package/dist/core/multipart-adapter.d.ts +0 -34
- package/dist/core/query-client.d.ts +0 -57
- package/dist/core/query-keys.d.ts +0 -34
- package/dist/core/tus-adapter.d.ts +0 -43
- package/dist/core/uploader.d.ts +0 -183
- package/dist/packem_shared/createBatchDeleteFiles-B0SYSdYj.js +0 -1
- package/dist/packem_shared/createBatchDeleteFiles-Z4S-30eN.js +0 -1
- package/dist/packem_shared/createBatchUpload-BAhrDNle.js +0 -1
- package/dist/packem_shared/createChunkedRestAdapter-Df1E_Adn.js +0 -1
- package/dist/packem_shared/createChunkedRestUpload-CJNQp68Z.js +0 -1
- package/dist/packem_shared/createChunkedRestUpload-DZIOry7M.js +0 -1
- package/dist/packem_shared/createDeleteFile-DsUMoSxn.js +0 -1
- package/dist/packem_shared/createDeleteFile-_Znrnika.js +0 -1
- package/dist/packem_shared/createFileInput-B7WPz_-r.js +0 -1
- package/dist/packem_shared/createFileInput-TTI-EsSq.js +0 -1
- package/dist/packem_shared/createGetFile-BOV5S7mX.js +0 -1
- package/dist/packem_shared/createGetFile-CY2ohQF-.js +0 -1
- package/dist/packem_shared/createGetFileList-DZHiTR4D.js +0 -1
- package/dist/packem_shared/createGetFileList-ZF0Luf6h.js +0 -1
- package/dist/packem_shared/createGetFileMeta-DmC_OvP4.js +0 -1
- package/dist/packem_shared/createHeadFile-DHJXsk3i.js +0 -1
- package/dist/packem_shared/createMultipartUpload-D5jXlOpN.js +0 -1
- package/dist/packem_shared/createPatchChunk-DqCMbHjI.js +0 -1
- package/dist/packem_shared/createPatchChunk-Zy6I60LN.js +0 -1
- package/dist/packem_shared/createPutFile-C95UgrTJ.js +0 -1
- package/dist/packem_shared/createPutFile-D8hN-9Ai.js +0 -1
- package/dist/packem_shared/createTransformFile-BlttN909.js +0 -1
- package/dist/packem_shared/createTransformFile-CJXLJEfg.js +0 -1
- package/dist/packem_shared/createTransformMetadata-BImjFF_i.js +0 -1
- package/dist/packem_shared/createTusAdapter-CIQM8UR2.js +0 -1
- package/dist/packem_shared/createTusUpload-DiGPefD0.js +0 -1
- package/dist/packem_shared/createUpload-zv3qcpf1.js +0 -1
- package/dist/packem_shared/createUploader-DzBPRYBP.js +0 -1
- package/dist/packem_shared/parseApiError-CUagSahh.js +0 -1
- package/dist/packem_shared/useBatchDeleteFiles-ASYuAVXn.js +0 -1
- package/dist/packem_shared/useBatchDeleteFiles-KthW4bon.js +0 -1
- package/dist/packem_shared/useBatchUpload-DQPzqa6X.js +0 -1
- package/dist/packem_shared/useChunkedRestUpload-ByEGSmgy.js +0 -1
- package/dist/packem_shared/useChunkedRestUpload-DmXiSpyb.js +0 -1
- package/dist/packem_shared/useDeleteFile-CND-6aNW.js +0 -1
- package/dist/packem_shared/useDeleteFile-CZUMjbYV.js +0 -1
- package/dist/packem_shared/useFileInput-Dvy2fNU7.js +0 -1
- package/dist/packem_shared/useFileInput-hIbzJ_JN.js +0 -1
- package/dist/packem_shared/useGetFile-CuST4rUN.js +0 -1
- package/dist/packem_shared/useGetFile-DvgluPgA.js +0 -1
- package/dist/packem_shared/useGetFileList-BiYDlEAl.js +0 -1
- package/dist/packem_shared/useGetFileList-D0tKDYAc.js +0 -1
- package/dist/packem_shared/useGetFileMeta-C2U1PExr.js +0 -1
- package/dist/packem_shared/useGetFileMeta-Ekre98Sg.js +0 -1
- package/dist/packem_shared/useHeadFile-CCu61b-B.js +0 -1
- package/dist/packem_shared/usePatchChunk-BO3S0Tx4.js +0 -1
- package/dist/packem_shared/usePatchChunk-DoKsCbBH.js +0 -1
- package/dist/packem_shared/usePutFile-B6cFjClD.js +0 -1
- package/dist/packem_shared/usePutFile-bQl10v42.js +0 -1
- package/dist/packem_shared/useTransformFile-DmfsqTjp.js +0 -1
- package/dist/packem_shared/useTransformFile-weII4bx_.js +0 -1
- package/dist/packem_shared/useTransformMetadata-DK1561-K.js +0 -1
- package/dist/react/types.d.ts +0 -65
- package/dist/react/use-abort-all.d.ts +0 -16
- package/dist/react/use-abort-batch.d.ts +0 -16
- package/dist/react/use-abort-item.d.ts +0 -16
- package/dist/react/use-all-abort-listener.d.ts +0 -14
- package/dist/react/use-batch-cancelled-listener.d.ts +0 -14
- package/dist/react/use-batch-delete-files.d.ts +0 -32
- package/dist/react/use-batch-error-listener.d.ts +0 -14
- package/dist/react/use-batch-finalize-listener.d.ts +0 -15
- package/dist/react/use-batch-finish-listener.d.ts +0 -14
- package/dist/react/use-batch-progress-listener.d.ts +0 -14
- package/dist/react/use-batch-retry.d.ts +0 -16
- package/dist/react/use-batch-start-listener.d.ts +0 -14
- package/dist/react/use-batch-upload.d.ts +0 -42
- package/dist/react/use-chunked-rest-upload.d.ts +0 -55
- package/dist/react/use-delete-file.d.ts +0 -25
- package/dist/react/use-file-input.d.ts +0 -32
- package/dist/react/use-get-file-list.d.ts +0 -46
- package/dist/react/use-get-file-meta.d.ts +0 -29
- package/dist/react/use-get-file.d.ts +0 -34
- package/dist/react/use-head-file.d.ts +0 -49
- package/dist/react/use-multipart-upload.d.ts +0 -35
- package/dist/react/use-paste-upload.d.ts +0 -20
- package/dist/react/use-patch-chunk.d.ts +0 -29
- package/dist/react/use-put-file.d.ts +0 -32
- package/dist/react/use-retry-listener.d.ts +0 -15
- package/dist/react/use-retry.d.ts +0 -16
- package/dist/react/use-transform-file.d.ts +0 -48
- package/dist/react/use-transform-metadata.d.ts +0 -33
- package/dist/react/use-tus-upload.d.ts +0 -55
- package/dist/react/use-upload.d.ts +0 -69
- package/dist/solid/create-abort-all.d.ts +0 -8
- package/dist/solid/create-abort-batch.d.ts +0 -8
- package/dist/solid/create-abort-item.d.ts +0 -8
- package/dist/solid/create-all-abort-listener.d.ts +0 -7
- package/dist/solid/create-batch-cancelled-listener.d.ts +0 -7
- package/dist/solid/create-batch-delete-files.d.ts +0 -29
- package/dist/solid/create-batch-error-listener.d.ts +0 -7
- package/dist/solid/create-batch-finalize-listener.d.ts +0 -7
- package/dist/solid/create-batch-finish-listener.d.ts +0 -7
- package/dist/solid/create-batch-progress-listener.d.ts +0 -7
- package/dist/solid/create-batch-retry.d.ts +0 -8
- package/dist/solid/create-batch-start-listener.d.ts +0 -7
- package/dist/solid/create-batch-upload.d.ts +0 -43
- package/dist/solid/create-chunked-rest-upload.d.ts +0 -56
- package/dist/solid/create-delete-file.d.ts +0 -22
- package/dist/solid/create-file-input.d.ts +0 -20
- package/dist/solid/create-get-file-list.d.ts +0 -46
- package/dist/solid/create-get-file-meta.d.ts +0 -29
- package/dist/solid/create-get-file.d.ts +0 -38
- package/dist/solid/create-head-file.d.ts +0 -46
- package/dist/solid/create-multipart-upload.d.ts +0 -36
- package/dist/solid/create-paste-upload.d.ts +0 -11
- package/dist/solid/create-patch-chunk.d.ts +0 -26
- package/dist/solid/create-put-file.d.ts +0 -29
- package/dist/solid/create-retry-listener.d.ts +0 -7
- package/dist/solid/create-retry.d.ts +0 -8
- package/dist/solid/create-transform-file.d.ts +0 -45
- package/dist/solid/create-transform-metadata.d.ts +0 -30
- package/dist/solid/create-tus-upload.d.ts +0 -56
- package/dist/solid/create-upload.d.ts +0 -70
- package/dist/svelte/create-abort-all.d.ts +0 -8
- package/dist/svelte/create-abort-batch.d.ts +0 -8
- package/dist/svelte/create-abort-item.d.ts +0 -8
- package/dist/svelte/create-all-abort-listener.d.ts +0 -7
- package/dist/svelte/create-batch-cancelled-listener.d.ts +0 -7
- package/dist/svelte/create-batch-delete-files.d.ts +0 -29
- package/dist/svelte/create-batch-error-listener.d.ts +0 -7
- package/dist/svelte/create-batch-finalize-listener.d.ts +0 -7
- package/dist/svelte/create-batch-finish-listener.d.ts +0 -7
- package/dist/svelte/create-batch-progress-listener.d.ts +0 -7
- package/dist/svelte/create-batch-retry.d.ts +0 -8
- package/dist/svelte/create-batch-start-listener.d.ts +0 -7
- package/dist/svelte/create-batch-upload.d.ts +0 -23
- package/dist/svelte/create-chunked-rest-upload.d.ts +0 -56
- package/dist/svelte/create-delete-file.d.ts +0 -26
- package/dist/svelte/create-file-input.d.ts +0 -19
- package/dist/svelte/create-get-file-list.d.ts +0 -43
- package/dist/svelte/create-get-file-meta.d.ts +0 -26
- package/dist/svelte/create-get-file.d.ts +0 -41
- package/dist/svelte/create-head-file.d.ts +0 -46
- package/dist/svelte/create-multipart-upload.d.ts +0 -36
- package/dist/svelte/create-paste-upload.d.ts +0 -11
- package/dist/svelte/create-patch-chunk.d.ts +0 -26
- package/dist/svelte/create-put-file.d.ts +0 -29
- package/dist/svelte/create-retry-listener.d.ts +0 -7
- package/dist/svelte/create-retry.d.ts +0 -8
- package/dist/svelte/create-transform-file.d.ts +0 -45
- package/dist/svelte/create-transform-metadata.d.ts +0 -30
- package/dist/svelte/create-tus-upload.d.ts +0 -56
- package/dist/svelte/create-upload.d.ts +0 -68
- package/dist/vue/use-abort-all.d.ts +0 -16
- package/dist/vue/use-abort-batch.d.ts +0 -16
- package/dist/vue/use-abort-item.d.ts +0 -16
- package/dist/vue/use-all-abort-listener.d.ts +0 -14
- package/dist/vue/use-batch-cancelled-listener.d.ts +0 -14
- package/dist/vue/use-batch-delete-files.d.ts +0 -29
- package/dist/vue/use-batch-error-listener.d.ts +0 -14
- package/dist/vue/use-batch-finalize-listener.d.ts +0 -15
- package/dist/vue/use-batch-finish-listener.d.ts +0 -14
- package/dist/vue/use-batch-progress-listener.d.ts +0 -14
- package/dist/vue/use-batch-retry.d.ts +0 -16
- package/dist/vue/use-batch-start-listener.d.ts +0 -14
- package/dist/vue/use-batch-upload.d.ts +0 -43
- package/dist/vue/use-chunked-rest-upload.d.ts +0 -56
- package/dist/vue/use-delete-file.d.ts +0 -22
- package/dist/vue/use-file-input.d.ts +0 -33
- package/dist/vue/use-get-file-list.d.ts +0 -43
- package/dist/vue/use-get-file-meta.d.ts +0 -26
- package/dist/vue/use-get-file.d.ts +0 -35
- package/dist/vue/use-head-file.d.ts +0 -46
- package/dist/vue/use-multipart-upload.d.ts +0 -36
- package/dist/vue/use-paste-upload.d.ts +0 -21
- package/dist/vue/use-patch-chunk.d.ts +0 -26
- package/dist/vue/use-put-file.d.ts +0 -29
- package/dist/vue/use-retry-listener.d.ts +0 -15
- package/dist/vue/use-retry.d.ts +0 -16
- package/dist/vue/use-transform-file.d.ts +0 -45
- package/dist/vue/use-transform-metadata.d.ts +0 -30
- package/dist/vue/use-tus-upload.d.ts +0 -56
- package/dist/vue/use-upload.d.ts +0 -68
package/dist/react/index.d.ts
CHANGED
|
@@ -1,61 +1,839 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
1
|
+
import { c as UploadItem, B as BatchState, U as UploadResult, F as FileMeta, g as UploadMethod } from "../packem_shared/uploader.d-DsC50BbX.js";
|
|
2
|
+
interface UseAbortAllOptions {
|
|
3
|
+
/** Upload endpoint URL (used to create uploader instance) */
|
|
4
|
+
endpoint: string;
|
|
5
|
+
/** Additional metadata to include with the upload */
|
|
6
|
+
metadata?: Record<string, string>;
|
|
7
|
+
}
|
|
8
|
+
interface UseAbortAllReturn {
|
|
9
|
+
/** Abort all active uploads */
|
|
10
|
+
abortAll: () => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* React hook to abort all active uploads.
|
|
14
|
+
* @param options Configuration options
|
|
15
|
+
* @returns Abort all function
|
|
16
|
+
*/
|
|
17
|
+
declare const useAbortAll: (options: UseAbortAllOptions) => UseAbortAllReturn;
|
|
18
|
+
interface UseAbortBatchOptions {
|
|
19
|
+
/** Upload endpoint URL (used to create uploader instance) */
|
|
20
|
+
endpoint: string;
|
|
21
|
+
/** Additional metadata to include with the upload */
|
|
22
|
+
metadata?: Record<string, string>;
|
|
23
|
+
}
|
|
24
|
+
interface UseAbortBatchReturn {
|
|
25
|
+
/** Abort a batch of uploads by batch ID */
|
|
26
|
+
abortBatch: (batchId: string) => void;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* React hook to abort a batch of uploads.
|
|
30
|
+
* @param options Configuration options
|
|
31
|
+
* @returns Abort batch function
|
|
32
|
+
*/
|
|
33
|
+
declare const useAbortBatch: (options: UseAbortBatchOptions) => UseAbortBatchReturn;
|
|
34
|
+
interface UseAbortItemOptions {
|
|
35
|
+
/** Upload endpoint URL (used to create uploader instance) */
|
|
36
|
+
endpoint: string;
|
|
37
|
+
/** Additional metadata to include with the upload */
|
|
38
|
+
metadata?: Record<string, string>;
|
|
39
|
+
}
|
|
40
|
+
interface UseAbortItemReturn {
|
|
41
|
+
/** Abort a specific upload item by ID */
|
|
42
|
+
abortItem: (id: string) => void;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* React hook to abort a specific upload item.
|
|
46
|
+
* @param options Configuration options
|
|
47
|
+
* @returns Abort function
|
|
48
|
+
*/
|
|
49
|
+
declare const useAbortItem: (options: UseAbortItemOptions) => UseAbortItemReturn;
|
|
50
|
+
interface UseAllAbortListenerOptions {
|
|
51
|
+
/** Upload endpoint URL (used to create uploader instance) */
|
|
52
|
+
endpoint: string;
|
|
53
|
+
/** Additional metadata to include with the upload */
|
|
54
|
+
metadata?: Record<string, string>;
|
|
55
|
+
/** Callback when any item is aborted */
|
|
56
|
+
onAbort: (item: UploadItem) => void;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* React hook to listen to all abort events (item aborts).
|
|
60
|
+
* @param options Listener configuration options
|
|
61
|
+
*/
|
|
62
|
+
declare const useAllAbortListener: (options: UseAllAbortListenerOptions) => void;
|
|
63
|
+
interface UseBatchCancelledListenerOptions {
|
|
64
|
+
/** Upload endpoint URL (used to create uploader instance) */
|
|
65
|
+
endpoint: string;
|
|
66
|
+
/** Additional metadata to include with the upload */
|
|
67
|
+
metadata?: Record<string, string>;
|
|
68
|
+
/** Callback when batch is cancelled */
|
|
69
|
+
onBatchCancelled: (batch: BatchState) => void;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* React hook to listen to batch cancelled events.
|
|
73
|
+
* @param options Listener configuration options
|
|
74
|
+
*/
|
|
75
|
+
declare const useBatchCancelledListener: (options: UseBatchCancelledListenerOptions) => void;
|
|
76
|
+
interface BatchDeleteResult {
|
|
77
|
+
/** Number of files that failed to delete */
|
|
78
|
+
failed?: number;
|
|
79
|
+
/** Number of files successfully deleted */
|
|
80
|
+
successful?: number;
|
|
81
|
+
}
|
|
82
|
+
interface UseBatchDeleteFilesOptions {
|
|
83
|
+
/** Base endpoint URL for file operations */
|
|
84
|
+
endpoint: string;
|
|
85
|
+
/** Callback when request fails */
|
|
86
|
+
onError?: (error: Error) => void;
|
|
87
|
+
/** Callback when request succeeds */
|
|
88
|
+
onSuccess?: (result: BatchDeleteResult) => void;
|
|
89
|
+
}
|
|
90
|
+
interface UseBatchDeleteFilesReturn {
|
|
91
|
+
/** Delete multiple files by IDs */
|
|
92
|
+
batchDeleteFiles: (ids: string[]) => Promise<BatchDeleteResult>;
|
|
93
|
+
/** Last request error, if any */
|
|
94
|
+
error: Error | undefined;
|
|
95
|
+
/** Whether a request is currently in progress */
|
|
96
|
+
isLoading: boolean;
|
|
97
|
+
/** Reset mutation state */
|
|
98
|
+
reset: () => void;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* React hook for batch deleting files using TanStack Query.
|
|
102
|
+
* Supports both query parameter and JSON body methods.
|
|
103
|
+
* Automatically invalidates related queries.
|
|
104
|
+
* @param options Hook configuration options
|
|
105
|
+
* @returns Batch file deletion functions and state
|
|
106
|
+
*/
|
|
107
|
+
declare const useBatchDeleteFiles: (options: UseBatchDeleteFilesOptions) => UseBatchDeleteFilesReturn;
|
|
108
|
+
interface UseBatchErrorListenerOptions {
|
|
109
|
+
/** Upload endpoint URL (used to create uploader instance) */
|
|
110
|
+
endpoint: string;
|
|
111
|
+
/** Additional metadata to include with the upload */
|
|
112
|
+
metadata?: Record<string, string>;
|
|
113
|
+
/** Callback when batch encounters an error */
|
|
114
|
+
onBatchError: (batch: BatchState) => void;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* React hook to listen to batch error events.
|
|
118
|
+
* @param options Listener configuration options
|
|
119
|
+
*/
|
|
120
|
+
declare const useBatchErrorListener: (options: UseBatchErrorListenerOptions) => void;
|
|
121
|
+
interface UseBatchFinalizeListenerOptions {
|
|
122
|
+
/** Upload endpoint URL (used to create uploader instance) */
|
|
123
|
+
endpoint: string;
|
|
124
|
+
/** Additional metadata to include with the upload */
|
|
125
|
+
metadata?: Record<string, string>;
|
|
126
|
+
/** Callback when batch finalizes (after all items complete) */
|
|
127
|
+
onBatchFinalize: (batch: BatchState) => void;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* React hook to listen to batch finalize events.
|
|
131
|
+
* This event fires after all items in a batch have completed (successfully or with errors).
|
|
132
|
+
* @param options Listener configuration options
|
|
133
|
+
*/
|
|
134
|
+
declare const useBatchFinalizeListener: (options: UseBatchFinalizeListenerOptions) => void;
|
|
135
|
+
interface UseBatchFinishListenerOptions {
|
|
136
|
+
/** Upload endpoint URL (used to create uploader instance) */
|
|
137
|
+
endpoint: string;
|
|
138
|
+
/** Additional metadata to include with the upload */
|
|
139
|
+
metadata?: Record<string, string>;
|
|
140
|
+
/** Callback when batch finishes successfully */
|
|
141
|
+
onBatchFinish: (batch: BatchState) => void;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* React hook to listen to batch finish events.
|
|
145
|
+
* @param options Listener configuration options
|
|
146
|
+
*/
|
|
147
|
+
declare const useBatchFinishListener: (options: UseBatchFinishListenerOptions) => void;
|
|
148
|
+
interface UseBatchProgressListenerOptions {
|
|
149
|
+
/** Upload endpoint URL (used to create uploader instance) */
|
|
150
|
+
endpoint: string;
|
|
151
|
+
/** Additional metadata to include with the upload */
|
|
152
|
+
metadata?: Record<string, string>;
|
|
153
|
+
/** Callback when batch progress updates */
|
|
154
|
+
onBatchProgress: (batch: BatchState) => void;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* React hook to listen to batch progress events.
|
|
158
|
+
* @param options Listener configuration options
|
|
159
|
+
*/
|
|
160
|
+
declare const useBatchProgressListener: (options: UseBatchProgressListenerOptions) => void;
|
|
161
|
+
interface UseBatchRetryOptions {
|
|
162
|
+
/** Upload endpoint URL (used to create uploader instance) */
|
|
163
|
+
endpoint: string;
|
|
164
|
+
/** Additional metadata to include with the upload */
|
|
165
|
+
metadata?: Record<string, string>;
|
|
166
|
+
}
|
|
167
|
+
interface UseBatchRetryReturn {
|
|
168
|
+
/** Retry all failed items in a batch */
|
|
169
|
+
retryBatch: (batchId: string) => void;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* React hook to retry all failed items in a batch.
|
|
173
|
+
* @param options Configuration options
|
|
174
|
+
* @returns Retry batch function
|
|
175
|
+
*/
|
|
176
|
+
declare const useBatchRetry: (options: UseBatchRetryOptions) => UseBatchRetryReturn;
|
|
177
|
+
interface UseBatchStartListenerOptions {
|
|
178
|
+
/** Upload endpoint URL (used to create uploader instance) */
|
|
179
|
+
endpoint: string;
|
|
180
|
+
/** Additional metadata to include with the upload */
|
|
181
|
+
metadata?: Record<string, string>;
|
|
182
|
+
/** Callback when batch starts */
|
|
183
|
+
onBatchStart: (batch: BatchState) => void;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* React hook to listen to batch start events.
|
|
187
|
+
* @param options Listener configuration options
|
|
188
|
+
*/
|
|
189
|
+
declare const useBatchStartListener: (options: UseBatchStartListenerOptions) => void;
|
|
190
|
+
interface UseBatchUploadOptions {
|
|
191
|
+
/** Upload endpoint URL */
|
|
192
|
+
endpoint: string;
|
|
193
|
+
/** Additional metadata to include with the upload */
|
|
194
|
+
metadata?: Record<string, string>;
|
|
195
|
+
/** Callback when batch fails */
|
|
196
|
+
onError?: (error: Error, batchId: string) => void;
|
|
197
|
+
/** Callback when batch progress updates */
|
|
198
|
+
onProgress?: (progress: number, batchId: string) => void;
|
|
199
|
+
/** Callback when batch starts */
|
|
200
|
+
onStart?: (batchId: string) => void;
|
|
201
|
+
/** Callback when batch completes successfully */
|
|
202
|
+
onSuccess?: (results: UploadResult[], batchId: string) => void;
|
|
203
|
+
}
|
|
204
|
+
interface UseBatchUploadReturn {
|
|
205
|
+
/** Abort a specific batch */
|
|
206
|
+
abortBatch: (batchId: string) => void;
|
|
207
|
+
/** Number of completed items in current batch */
|
|
208
|
+
completedCount: number;
|
|
209
|
+
/** Last batch error, if any */
|
|
210
|
+
error: Error | undefined;
|
|
211
|
+
/** Number of failed items in current batch */
|
|
212
|
+
errorCount: number;
|
|
213
|
+
/** Whether a batch is currently uploading */
|
|
214
|
+
isUploading: boolean;
|
|
215
|
+
/** All upload items in current batch */
|
|
216
|
+
items: UploadItem[];
|
|
217
|
+
/** Current batch progress (0-100) */
|
|
218
|
+
progress: number;
|
|
219
|
+
/** Reset batch state */
|
|
220
|
+
reset: () => void;
|
|
221
|
+
/** Upload multiple files as a batch */
|
|
222
|
+
uploadBatch: (files: File[]) => string[];
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* React hook for batch file uploads using multipart/form-data.
|
|
226
|
+
* @param options Upload configuration options
|
|
227
|
+
* @returns Batch upload functions and state
|
|
228
|
+
*/
|
|
229
|
+
declare const useBatchUpload: (options: UseBatchUploadOptions) => UseBatchUploadReturn;
|
|
230
|
+
interface UseChunkedRestUploadOptions {
|
|
231
|
+
/** Chunk size for chunked REST uploads (default: 5MB) */
|
|
232
|
+
chunkSize?: number;
|
|
233
|
+
/** Chunked REST upload endpoint URL */
|
|
234
|
+
endpoint: string;
|
|
235
|
+
/** Maximum number of retry attempts */
|
|
236
|
+
maxRetries?: number;
|
|
237
|
+
/** Additional metadata to include with the upload */
|
|
238
|
+
metadata?: Record<string, string>;
|
|
239
|
+
/** Callback when upload fails */
|
|
240
|
+
onError?: (error: Error) => void;
|
|
241
|
+
/** Callback when upload is paused */
|
|
242
|
+
onPause?: () => void;
|
|
243
|
+
/** Callback when upload progress updates */
|
|
244
|
+
onProgress?: (progress: number, offset: number) => void;
|
|
245
|
+
/** Callback when upload is resumed */
|
|
246
|
+
onResume?: () => void;
|
|
247
|
+
/** Callback when upload starts */
|
|
248
|
+
onStart?: () => void;
|
|
249
|
+
/** Callback when upload completes successfully */
|
|
250
|
+
onSuccess?: (file: UploadResult) => void;
|
|
251
|
+
/** Enable automatic retry on failure */
|
|
252
|
+
retry?: boolean;
|
|
253
|
+
}
|
|
254
|
+
interface UseChunkedRestUploadReturn {
|
|
255
|
+
/** Abort the current upload */
|
|
256
|
+
abort: () => void;
|
|
257
|
+
/** Last upload error, if any */
|
|
258
|
+
error: Error | undefined;
|
|
259
|
+
/** Whether the upload is paused */
|
|
260
|
+
isPaused: boolean;
|
|
261
|
+
/** Whether an upload is currently in progress */
|
|
262
|
+
isUploading: boolean;
|
|
263
|
+
/** Current upload offset (bytes uploaded) */
|
|
264
|
+
offset: number;
|
|
265
|
+
/** Pause the current upload */
|
|
266
|
+
pause: () => void;
|
|
267
|
+
/** Current upload progress (0-100) */
|
|
268
|
+
progress: number;
|
|
269
|
+
/** Reset upload state */
|
|
270
|
+
reset: () => void;
|
|
271
|
+
/** Last upload result, if any */
|
|
272
|
+
result: UploadResult | undefined;
|
|
273
|
+
/** Resume a paused upload */
|
|
274
|
+
resume: () => Promise<void>;
|
|
275
|
+
/** Upload a file using chunked REST protocol */
|
|
276
|
+
upload: (file: File) => Promise<UploadResult>;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* React hook for chunked REST file uploads.
|
|
280
|
+
* @param options Upload configuration options
|
|
281
|
+
* @returns Upload functions and state
|
|
282
|
+
*/
|
|
283
|
+
declare const useChunkedRestUpload: (options: UseChunkedRestUploadOptions) => UseChunkedRestUploadReturn;
|
|
284
|
+
interface UseDeleteFileOptions {
|
|
285
|
+
/** Base endpoint URL for file operations */
|
|
286
|
+
endpoint: string;
|
|
287
|
+
/** Callback when request fails */
|
|
288
|
+
onError?: (error: Error) => void;
|
|
289
|
+
/** Callback when request succeeds */
|
|
290
|
+
onSuccess?: () => void;
|
|
291
|
+
}
|
|
292
|
+
interface UseDeleteFileReturn {
|
|
293
|
+
/** Delete a file by ID */
|
|
294
|
+
deleteFile: (id: string) => Promise<void>;
|
|
295
|
+
/** Last request error, if any */
|
|
296
|
+
error: Error | undefined;
|
|
297
|
+
/** Whether a request is currently in progress */
|
|
298
|
+
isLoading: boolean;
|
|
299
|
+
/** Reset mutation state */
|
|
300
|
+
reset: () => void;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* React hook for deleting a single file using TanStack Query.
|
|
304
|
+
* Automatically invalidates related queries.
|
|
305
|
+
* @param options Hook configuration options
|
|
306
|
+
* @returns File deletion functions and state
|
|
307
|
+
*/
|
|
308
|
+
declare const useDeleteFile: (options: UseDeleteFileOptions) => UseDeleteFileReturn;
|
|
309
|
+
interface UseFileInputOptions {
|
|
310
|
+
/** Accept file types (e.g., "image/*", ".pdf") */
|
|
311
|
+
accept?: string;
|
|
312
|
+
/** Whether to allow multiple file selection */
|
|
313
|
+
multiple?: boolean;
|
|
314
|
+
/** Callback when files are selected */
|
|
315
|
+
onFilesSelected?: (files: File[]) => void;
|
|
316
|
+
}
|
|
317
|
+
interface UseFileInputReturn {
|
|
318
|
+
/** Currently selected files */
|
|
319
|
+
files: File[];
|
|
320
|
+
/** Handle drag leave event */
|
|
321
|
+
handleDragLeave: (event: React.DragEvent<HTMLElement>) => void;
|
|
322
|
+
/** Handle drag and drop events */
|
|
323
|
+
handleDragOver: (event: React.DragEvent<HTMLElement>) => void;
|
|
324
|
+
/** Handle drop event */
|
|
325
|
+
handleDrop: (event: React.DragEvent<HTMLElement>) => void;
|
|
326
|
+
/** Handle file input change event */
|
|
327
|
+
handleFileChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
328
|
+
/** File input element ref */
|
|
329
|
+
inputRef: React.RefObject<HTMLInputElement | null>;
|
|
330
|
+
/** Open file dialog programmatically */
|
|
331
|
+
openFileDialog: () => void;
|
|
332
|
+
/** Reset selected files */
|
|
333
|
+
reset: () => void;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* React hook for file input handling with drag & drop support.
|
|
337
|
+
* @param options Configuration options
|
|
338
|
+
* @returns File input functions and state
|
|
339
|
+
*/
|
|
340
|
+
declare const useFileInput: (options?: UseFileInputOptions) => UseFileInputReturn;
|
|
341
|
+
interface UseGetFileOptions {
|
|
342
|
+
/** Whether to enable the query */
|
|
343
|
+
enabled?: boolean;
|
|
344
|
+
/** Base endpoint URL for file operations */
|
|
345
|
+
endpoint: string;
|
|
346
|
+
/** File ID to fetch */
|
|
347
|
+
id: string;
|
|
348
|
+
/** Callback when request fails */
|
|
349
|
+
onError?: (error: Error) => void;
|
|
350
|
+
/** Callback when request succeeds */
|
|
351
|
+
onSuccess?: (data: Blob, meta: FileMeta | undefined) => void;
|
|
352
|
+
/** Transformation parameters for media files */
|
|
353
|
+
transform?: Record<string, string | number | boolean>;
|
|
354
|
+
}
|
|
355
|
+
interface UseGetFileReturn {
|
|
356
|
+
/** File data as Blob */
|
|
357
|
+
data: Blob | undefined;
|
|
358
|
+
/** Last request error, if any */
|
|
359
|
+
error: Error | undefined;
|
|
360
|
+
/** Whether a request is currently in progress */
|
|
361
|
+
isLoading: boolean;
|
|
362
|
+
/** File metadata from response headers */
|
|
363
|
+
meta: FileMeta | undefined;
|
|
364
|
+
/** Refetch the file */
|
|
365
|
+
refetch: () => void;
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* React hook for fetching/downloading files using TanStack Query.
|
|
369
|
+
* Supports optional transformation parameters for media files.
|
|
370
|
+
* @param options Hook configuration options.
|
|
371
|
+
* @returns File fetching functions and state.
|
|
372
|
+
*/
|
|
373
|
+
declare const useGetFile: (options: UseGetFileOptions) => UseGetFileReturn;
|
|
374
|
+
interface FileListResponse {
|
|
375
|
+
data: FileMeta[];
|
|
376
|
+
meta?: {
|
|
377
|
+
firstPage?: number;
|
|
378
|
+
firstPageUrl?: string;
|
|
379
|
+
lastPage?: number;
|
|
380
|
+
lastPageUrl?: string;
|
|
381
|
+
nextPageUrl?: string;
|
|
382
|
+
page?: number;
|
|
383
|
+
perPage?: number;
|
|
384
|
+
previousPageUrl?: string;
|
|
385
|
+
total?: number;
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
interface UseGetFileListOptions {
|
|
389
|
+
/** Whether to enable the query */
|
|
390
|
+
enabled?: boolean;
|
|
391
|
+
/** Base endpoint URL for file operations */
|
|
392
|
+
endpoint: string;
|
|
393
|
+
/** Maximum number of elements to retrieve */
|
|
394
|
+
limit?: number;
|
|
395
|
+
/** Callback when request fails */
|
|
396
|
+
onError?: (error: Error) => void;
|
|
397
|
+
/** Callback when request succeeds */
|
|
398
|
+
onSuccess?: (data: FileListResponse) => void;
|
|
399
|
+
/** Page number for pagination */
|
|
400
|
+
page?: number;
|
|
401
|
+
}
|
|
402
|
+
interface UseGetFileListReturn {
|
|
403
|
+
/** File list data */
|
|
404
|
+
data: FileListResponse | undefined;
|
|
405
|
+
/** Last request error, if any */
|
|
406
|
+
error: Error | undefined;
|
|
407
|
+
/** Whether a request is currently in progress */
|
|
408
|
+
isLoading: boolean;
|
|
409
|
+
/** Refetch the file list */
|
|
410
|
+
refetch: () => void;
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* React hook for fetching a list of files using TanStack Query.
|
|
414
|
+
* Supports pagination via query parameters.
|
|
415
|
+
* @param options Hook configuration options
|
|
416
|
+
* @returns File list fetching functions and state
|
|
417
|
+
*/
|
|
418
|
+
declare const useGetFileList: (options: UseGetFileListOptions) => UseGetFileListReturn;
|
|
419
|
+
interface UseGetFileMetaOptions {
|
|
420
|
+
/** Whether to enable the query */
|
|
421
|
+
enabled?: boolean;
|
|
422
|
+
/** Base endpoint URL for file operations */
|
|
423
|
+
endpoint: string;
|
|
424
|
+
/** File ID to fetch metadata for */
|
|
425
|
+
id: string;
|
|
426
|
+
/** Callback when request fails */
|
|
427
|
+
onError?: (error: Error) => void;
|
|
428
|
+
/** Callback when request succeeds */
|
|
429
|
+
onSuccess?: (meta: FileMeta) => void;
|
|
430
|
+
}
|
|
431
|
+
interface UseGetFileMetaReturn {
|
|
432
|
+
/** File metadata */
|
|
433
|
+
data: FileMeta | undefined;
|
|
434
|
+
/** Last request error, if any */
|
|
435
|
+
error: Error | undefined;
|
|
436
|
+
/** Whether a request is currently in progress */
|
|
437
|
+
isLoading: boolean;
|
|
438
|
+
/** Refetch the file metadata */
|
|
439
|
+
refetch: () => void;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* React hook for fetching file metadata using TanStack Query.
|
|
443
|
+
* @param options Hook configuration options
|
|
444
|
+
* @returns File metadata fetching functions and state
|
|
445
|
+
*/
|
|
446
|
+
declare const useGetFileMeta: (options: UseGetFileMetaOptions) => UseGetFileMetaReturn;
|
|
447
|
+
interface FileHeadMetadata {
|
|
448
|
+
/** Whether this is a chunked upload session */
|
|
449
|
+
chunkedUpload?: boolean;
|
|
450
|
+
/** Content length in bytes */
|
|
451
|
+
contentLength?: number;
|
|
452
|
+
/** Content type */
|
|
453
|
+
contentType?: string;
|
|
454
|
+
/** Entity tag for caching */
|
|
455
|
+
etag?: string;
|
|
456
|
+
/** Last modified date */
|
|
457
|
+
lastModified?: string;
|
|
458
|
+
/** Received chunk offsets (chunked uploads) */
|
|
459
|
+
receivedChunks?: number[];
|
|
460
|
+
/** Whether upload is complete (chunked uploads) */
|
|
461
|
+
uploadComplete?: boolean;
|
|
462
|
+
/** Upload expiration date */
|
|
463
|
+
uploadExpires?: string;
|
|
464
|
+
/** Upload offset for chunked uploads */
|
|
465
|
+
uploadOffset?: number;
|
|
466
|
+
}
|
|
467
|
+
interface UseHeadFileOptions {
|
|
468
|
+
/** Whether to enable the query */
|
|
469
|
+
enabled?: boolean;
|
|
470
|
+
/** Base endpoint URL for file operations */
|
|
471
|
+
endpoint: string;
|
|
472
|
+
/** File ID to fetch metadata for */
|
|
473
|
+
id: string;
|
|
474
|
+
/** Callback when request fails */
|
|
475
|
+
onError?: (error: Error) => void;
|
|
476
|
+
/** Callback when request succeeds */
|
|
477
|
+
onSuccess?: (meta: FileHeadMetadata) => void;
|
|
478
|
+
}
|
|
479
|
+
interface UseHeadFileReturn {
|
|
480
|
+
/** File metadata from HEAD request */
|
|
481
|
+
data: FileHeadMetadata | undefined;
|
|
482
|
+
/** Last request error, if any */
|
|
483
|
+
error: Error | undefined;
|
|
484
|
+
/** Whether a request is currently in progress */
|
|
485
|
+
isLoading: boolean;
|
|
486
|
+
/** Refetch the file metadata */
|
|
487
|
+
refetch: () => void;
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* React hook for fetching file metadata via HEAD request using TanStack Query.
|
|
491
|
+
* Useful for checking upload progress and file status without downloading.
|
|
492
|
+
* @param options Hook configuration options
|
|
493
|
+
* @returns File HEAD request functions and state
|
|
494
|
+
*/
|
|
495
|
+
declare const useHeadFile: (options: UseHeadFileOptions) => UseHeadFileReturn;
|
|
496
|
+
interface UseMultipartUploadOptions {
|
|
497
|
+
/** Upload endpoint URL */
|
|
498
|
+
endpoint: string;
|
|
499
|
+
/** Additional metadata to include with the upload */
|
|
500
|
+
metadata?: Record<string, string>;
|
|
501
|
+
/** Callback when upload fails */
|
|
502
|
+
onError?: (error: Error) => void;
|
|
503
|
+
/** Callback when upload progress updates */
|
|
504
|
+
onProgress?: (progress: number) => void;
|
|
505
|
+
/** Callback when upload starts */
|
|
506
|
+
onStart?: () => void;
|
|
507
|
+
/** Callback when upload completes successfully */
|
|
508
|
+
onSuccess?: (file: UploadResult) => void;
|
|
509
|
+
}
|
|
510
|
+
interface UseMultipartUploadReturn {
|
|
511
|
+
/** Last upload error, if any */
|
|
512
|
+
error: Error | undefined;
|
|
513
|
+
/** Whether an upload is currently in progress */
|
|
514
|
+
isUploading: boolean;
|
|
515
|
+
/** Current upload progress (0-100) */
|
|
516
|
+
progress: number;
|
|
517
|
+
/** Reset upload state */
|
|
518
|
+
reset: () => void;
|
|
519
|
+
/** Last upload result, if any */
|
|
520
|
+
result: UploadResult | undefined;
|
|
521
|
+
/** Upload a file using multipart/form-data */
|
|
522
|
+
upload: (file: File) => Promise<UploadResult>;
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* React hook for multipart/form-data file uploads using custom uploader implementation.
|
|
526
|
+
* @param options Upload configuration options
|
|
527
|
+
* @returns Upload functions and state
|
|
528
|
+
*/
|
|
529
|
+
declare const useMultipartUpload: (options: UseMultipartUploadOptions) => UseMultipartUploadReturn;
|
|
530
|
+
interface UsePasteUploadOptions {
|
|
531
|
+
/** Filter function to determine which files to accept */
|
|
532
|
+
filter?: (file: File) => boolean;
|
|
533
|
+
/** Callback when files are pasted */
|
|
534
|
+
onFilesPasted?: (files: File[]) => void;
|
|
535
|
+
}
|
|
536
|
+
interface UsePasteUploadReturn {
|
|
537
|
+
/** Handle paste event */
|
|
538
|
+
handlePaste: (event: React.ClipboardEvent<HTMLElement>) => void;
|
|
539
|
+
/** Files that were pasted */
|
|
540
|
+
pastedFiles: File[];
|
|
541
|
+
/** Reset pasted files */
|
|
542
|
+
reset: () => void;
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* React hook for handling paste uploads from clipboard.
|
|
546
|
+
* @param options Configuration options
|
|
547
|
+
* @returns Paste upload functions and state
|
|
548
|
+
*/
|
|
549
|
+
declare const usePasteUpload: (options?: UsePasteUploadOptions) => UsePasteUploadReturn;
|
|
550
|
+
interface UsePatchChunkOptions {
|
|
551
|
+
/** Base endpoint URL for file operations */
|
|
552
|
+
endpoint: string;
|
|
553
|
+
/** Callback when request fails */
|
|
554
|
+
onError?: (error: Error) => void;
|
|
555
|
+
/** Callback when request succeeds */
|
|
556
|
+
onSuccess?: (result: UploadResult) => void;
|
|
557
|
+
}
|
|
558
|
+
interface UsePatchChunkReturn {
|
|
559
|
+
/** Last upload result, if any */
|
|
560
|
+
data: UploadResult | undefined;
|
|
561
|
+
/** Last request error, if any */
|
|
562
|
+
error: Error | undefined;
|
|
563
|
+
/** Whether a request is currently in progress */
|
|
564
|
+
isLoading: boolean;
|
|
565
|
+
/** Upload a chunk for chunked uploads */
|
|
566
|
+
patchChunk: (id: string, chunk: Blob, offset: number, checksum?: string) => Promise<UploadResult>;
|
|
567
|
+
/** Reset mutation state */
|
|
568
|
+
reset: () => void;
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* React hook for uploading chunks in chunked uploads using TanStack Query.
|
|
572
|
+
* Requires X-Chunk-Offset header and chunk data.
|
|
573
|
+
* Automatically invalidates related queries when upload is complete.
|
|
574
|
+
* @param options Hook configuration options
|
|
575
|
+
* @returns Chunk upload functions and state
|
|
576
|
+
*/
|
|
577
|
+
declare const usePatchChunk: (options: UsePatchChunkOptions) => UsePatchChunkReturn;
|
|
578
|
+
interface UsePutFileOptions {
|
|
579
|
+
/** Base endpoint URL for file operations */
|
|
580
|
+
endpoint: string;
|
|
581
|
+
/** Callback when request fails */
|
|
582
|
+
onError?: (error: Error) => void;
|
|
583
|
+
/** Callback when upload progress updates */
|
|
584
|
+
onProgress?: (progress: number) => void;
|
|
585
|
+
/** Callback when request succeeds */
|
|
586
|
+
onSuccess?: (result: UploadResult) => void;
|
|
587
|
+
}
|
|
588
|
+
interface UsePutFileReturn {
|
|
589
|
+
/** Last upload result, if any */
|
|
590
|
+
data: UploadResult | undefined;
|
|
591
|
+
/** Last request error, if any */
|
|
592
|
+
error: Error | undefined;
|
|
593
|
+
/** Whether a request is currently in progress */
|
|
594
|
+
isLoading: boolean;
|
|
595
|
+
/** Current upload progress (0-100) */
|
|
596
|
+
progress: number;
|
|
597
|
+
/** Create or update a file by ID */
|
|
598
|
+
putFile: (id: string, file: File | Blob) => Promise<UploadResult>;
|
|
599
|
+
/** Reset mutation state */
|
|
600
|
+
reset: () => void;
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* React hook for creating or updating files via PUT request using TanStack Query.
|
|
604
|
+
* Automatically invalidates related queries.
|
|
605
|
+
* @param options Hook configuration options
|
|
606
|
+
* @returns File PUT functions and state
|
|
607
|
+
*/
|
|
608
|
+
declare const usePutFile: (options: UsePutFileOptions) => UsePutFileReturn;
|
|
609
|
+
interface UseRetryOptions {
|
|
610
|
+
/** Upload endpoint URL (used to create uploader instance) */
|
|
611
|
+
endpoint: string;
|
|
612
|
+
/** Additional metadata to include with the upload */
|
|
613
|
+
metadata?: Record<string, string>;
|
|
614
|
+
}
|
|
615
|
+
interface UseRetryReturn {
|
|
616
|
+
/** Retry a failed upload item by ID */
|
|
617
|
+
retryItem: (id: string) => void;
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* React hook to retry a failed upload item.
|
|
621
|
+
* @param options Configuration options
|
|
622
|
+
* @returns Retry function
|
|
623
|
+
*/
|
|
624
|
+
declare const useRetry: (options: UseRetryOptions) => UseRetryReturn;
|
|
625
|
+
interface UseRetryListenerOptions {
|
|
626
|
+
/** Upload endpoint URL (used to create uploader instance) */
|
|
627
|
+
endpoint: string;
|
|
628
|
+
/** Additional metadata to include with the upload */
|
|
629
|
+
metadata?: Record<string, string>;
|
|
630
|
+
/** Callback when an item is retried */
|
|
631
|
+
onRetry: (item: UploadItem) => void;
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* React hook to listen to retry events.
|
|
635
|
+
* Note: This listens to ITEM_START events for items that have been retried (retryCount > 0).
|
|
636
|
+
* @param options Listener configuration options
|
|
637
|
+
*/
|
|
638
|
+
declare const useRetryListener: (options: UseRetryListenerOptions) => void;
|
|
639
|
+
interface TransformOptions {
|
|
640
|
+
/** Additional transformation parameters */
|
|
641
|
+
[key: string]: string | number | boolean | undefined;
|
|
642
|
+
/** Resize fit mode */
|
|
643
|
+
fit?: "cover" | "contain" | "fill" | "inside" | "outside";
|
|
644
|
+
/** Output format (jpeg, png, webp, etc.) */
|
|
645
|
+
format?: string;
|
|
646
|
+
/** Desired height in pixels */
|
|
647
|
+
height?: number;
|
|
648
|
+
/** Quality setting (0-100) */
|
|
649
|
+
quality?: number;
|
|
650
|
+
/** Desired width in pixels */
|
|
651
|
+
width?: number;
|
|
652
|
+
}
|
|
653
|
+
interface UseTransformFileOptions {
|
|
654
|
+
/** Whether to enable the query */
|
|
655
|
+
enabled?: boolean;
|
|
656
|
+
/** Base endpoint URL for transform operations */
|
|
657
|
+
endpoint: string;
|
|
658
|
+
/** File ID to transform */
|
|
659
|
+
id: string;
|
|
660
|
+
/** Callback when request fails */
|
|
661
|
+
onError?: (error: Error) => void;
|
|
662
|
+
/** Callback when request succeeds */
|
|
663
|
+
onSuccess?: (data: Blob, meta: FileMeta | undefined) => void;
|
|
664
|
+
/** Transformation parameters */
|
|
665
|
+
transform: TransformOptions;
|
|
666
|
+
}
|
|
667
|
+
interface UseTransformFileReturn {
|
|
668
|
+
/** Transformed file data as Blob */
|
|
669
|
+
data: Blob | undefined;
|
|
670
|
+
/** Last request error, if any */
|
|
671
|
+
error: Error | undefined;
|
|
672
|
+
/** Whether a request is currently in progress */
|
|
673
|
+
isLoading: boolean;
|
|
674
|
+
/** File metadata from response headers */
|
|
675
|
+
meta: FileMeta | undefined;
|
|
676
|
+
/** Refetch the transformed file */
|
|
677
|
+
refetch: () => void;
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* React hook for fetching transformed files using TanStack Query.
|
|
681
|
+
* Supports image, video, and audio transformation parameters.
|
|
682
|
+
* @param options Hook configuration options
|
|
683
|
+
* @returns Transform file fetching functions and state
|
|
684
|
+
*/
|
|
685
|
+
declare const useTransformFile: (options: UseTransformFileOptions) => UseTransformFileReturn;
|
|
686
|
+
interface TransformMetadata {
|
|
687
|
+
/** Available transformation formats */
|
|
688
|
+
formats?: string[];
|
|
689
|
+
/** Supported transformation parameters */
|
|
690
|
+
parameters?: string[];
|
|
691
|
+
}
|
|
692
|
+
interface UseTransformMetadataOptions {
|
|
693
|
+
/** Whether to enable the query */
|
|
694
|
+
enabled?: boolean;
|
|
695
|
+
/** Base endpoint URL for transform operations */
|
|
696
|
+
endpoint: string;
|
|
697
|
+
/** Callback when request fails */
|
|
698
|
+
onError?: (error: Error) => void;
|
|
699
|
+
/** Callback when request succeeds */
|
|
700
|
+
onSuccess?: (metadata: TransformMetadata) => void;
|
|
701
|
+
}
|
|
702
|
+
interface UseTransformMetadataReturn {
|
|
703
|
+
/** Transform metadata */
|
|
704
|
+
data: TransformMetadata | undefined;
|
|
705
|
+
/** Last request error, if any */
|
|
706
|
+
error: Error | undefined;
|
|
707
|
+
/** Whether a request is currently in progress */
|
|
708
|
+
isLoading: boolean;
|
|
709
|
+
/** Refetch the transform metadata */
|
|
710
|
+
refetch: () => void;
|
|
711
|
+
}
|
|
712
|
+
/**
|
|
713
|
+
* React hook for fetching transformation metadata using TanStack Query.
|
|
714
|
+
* Returns available formats and transformation parameters.
|
|
715
|
+
* @param options Hook configuration options
|
|
716
|
+
* @returns Transform metadata fetching functions and state
|
|
717
|
+
*/
|
|
718
|
+
declare const useTransformMetadata: (options: UseTransformMetadataOptions) => UseTransformMetadataReturn;
|
|
719
|
+
interface UseTusUploadOptions {
|
|
720
|
+
/** Chunk size for TUS uploads (default: 1MB) */
|
|
721
|
+
chunkSize?: number;
|
|
722
|
+
/** TUS upload endpoint URL */
|
|
723
|
+
endpoint: string;
|
|
724
|
+
/** Maximum number of retry attempts */
|
|
725
|
+
maxRetries?: number;
|
|
726
|
+
/** Additional metadata to include with the upload */
|
|
727
|
+
metadata?: Record<string, string>;
|
|
728
|
+
/** Callback when upload fails */
|
|
729
|
+
onError?: (error: Error) => void;
|
|
730
|
+
/** Callback when upload is paused */
|
|
731
|
+
onPause?: () => void;
|
|
732
|
+
/** Callback when upload progress updates */
|
|
733
|
+
onProgress?: (progress: number) => void;
|
|
734
|
+
/** Callback when upload is resumed */
|
|
735
|
+
onResume?: () => void;
|
|
736
|
+
/** Callback when upload starts */
|
|
737
|
+
onStart?: () => void;
|
|
738
|
+
/** Callback when upload completes successfully */
|
|
739
|
+
onSuccess?: (file: UploadResult) => void;
|
|
740
|
+
/** Enable automatic retry on failure */
|
|
741
|
+
retry?: boolean;
|
|
742
|
+
}
|
|
743
|
+
interface UseTusUploadReturn {
|
|
744
|
+
/** Abort the current upload */
|
|
745
|
+
abort: () => void;
|
|
746
|
+
/** Last upload error, if any */
|
|
747
|
+
error: Error | undefined;
|
|
748
|
+
/** Whether the upload is paused */
|
|
749
|
+
isPaused: boolean;
|
|
750
|
+
/** Whether an upload is currently in progress */
|
|
751
|
+
isUploading: boolean;
|
|
752
|
+
/** Current upload offset (bytes uploaded) */
|
|
753
|
+
offset: number;
|
|
754
|
+
/** Pause the current upload */
|
|
755
|
+
pause: () => void;
|
|
756
|
+
/** Current upload progress (0-100) */
|
|
757
|
+
progress: number;
|
|
758
|
+
/** Reset upload state */
|
|
759
|
+
reset: () => void;
|
|
760
|
+
/** Last upload result, if any */
|
|
761
|
+
result: UploadResult | undefined;
|
|
762
|
+
/** Resume a paused upload */
|
|
763
|
+
resume: () => Promise<void>;
|
|
764
|
+
/** Upload a file using TUS protocol */
|
|
765
|
+
upload: (file: File) => Promise<UploadResult>;
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* React hook for TUS resumable file uploads.
|
|
769
|
+
* @param options Upload configuration options
|
|
770
|
+
* @returns Upload functions and state
|
|
771
|
+
*/
|
|
772
|
+
declare const useTusUpload: (options: UseTusUploadOptions) => UseTusUploadReturn;
|
|
773
|
+
interface UseUploadOptions {
|
|
774
|
+
/** Chunk size for TUS and chunked REST uploads (default: 1MB for TUS, 5MB for chunked REST) */
|
|
775
|
+
chunkSize?: number;
|
|
776
|
+
/** Chunked REST upload endpoint URL */
|
|
777
|
+
endpointChunkedRest?: string;
|
|
778
|
+
/** Multipart upload endpoint URL */
|
|
779
|
+
endpointMultipart?: string;
|
|
780
|
+
/** TUS upload endpoint URL */
|
|
781
|
+
endpointTus?: string;
|
|
782
|
+
/** Maximum number of retry attempts (TUS and chunked REST only) */
|
|
783
|
+
maxRetries?: number;
|
|
784
|
+
/** Additional metadata to include with the upload */
|
|
785
|
+
metadata?: Record<string, string>;
|
|
786
|
+
/** Upload method to use: 'multipart', 'tus', 'chunked-rest', or 'auto'. If undefined, auto-detected based on provided endpoints */
|
|
787
|
+
method?: UploadMethod;
|
|
788
|
+
/** Callback when upload fails */
|
|
789
|
+
onError?: (error: Error) => void;
|
|
790
|
+
/** Callback when upload is paused (TUS and chunked REST only) */
|
|
791
|
+
onPause?: () => void;
|
|
792
|
+
/** Callback when upload progress updates */
|
|
793
|
+
onProgress?: (progress: number) => void;
|
|
794
|
+
/** Callback when upload is resumed (TUS and chunked REST only) */
|
|
795
|
+
onResume?: () => void;
|
|
796
|
+
/** Callback when upload starts */
|
|
797
|
+
onStart?: () => void;
|
|
798
|
+
/** Callback when upload completes successfully */
|
|
799
|
+
onSuccess?: (file: UploadResult) => void;
|
|
800
|
+
/** Enable automatic retry on failure (TUS and chunked REST only) */
|
|
801
|
+
retry?: boolean;
|
|
802
|
+
/** File size threshold for auto-selecting TUS (default: 10MB) */
|
|
803
|
+
tusThreshold?: number;
|
|
804
|
+
}
|
|
805
|
+
interface UseUploadReturn {
|
|
806
|
+
/** Abort the current upload */
|
|
807
|
+
abort: () => void;
|
|
808
|
+
/** Current upload method being used */
|
|
809
|
+
currentMethod: UploadMethod;
|
|
810
|
+
/** Last upload error, if any */
|
|
811
|
+
error: Error | undefined;
|
|
812
|
+
/** Whether the upload is paused (TUS and chunked REST only) */
|
|
813
|
+
isPaused?: boolean;
|
|
814
|
+
/** Whether an upload is currently in progress */
|
|
815
|
+
isUploading: boolean;
|
|
816
|
+
/** Current upload offset in bytes (TUS and chunked REST only) */
|
|
817
|
+
offset?: number;
|
|
818
|
+
/** Pause the current upload (TUS and chunked REST only) */
|
|
819
|
+
pause?: () => void;
|
|
820
|
+
/** Current upload progress (0-100) */
|
|
821
|
+
progress: number;
|
|
822
|
+
/** Reset upload state */
|
|
823
|
+
reset: () => void;
|
|
824
|
+
/** Last upload result, if any */
|
|
825
|
+
result: UploadResult | undefined;
|
|
826
|
+
/** Resume a paused upload (TUS and chunked REST only) */
|
|
827
|
+
resume?: () => Promise<void>;
|
|
828
|
+
/** Upload a file using the configured method */
|
|
829
|
+
upload: (file: File) => Promise<UploadResult>;
|
|
830
|
+
}
|
|
831
|
+
/**
|
|
832
|
+
* React hook for file uploads with automatic method selection.
|
|
833
|
+
* Uses custom uploader implementations for multipart, TUS, and chunked REST.
|
|
834
|
+
* Automatically chooses between methods based on file size and method preference.
|
|
835
|
+
* @param options Upload configuration options
|
|
836
|
+
* @returns Upload functions and state
|
|
837
|
+
*/
|
|
838
|
+
declare const useUpload: (options: UseUploadOptions) => UseUploadReturn;
|
|
839
|
+
export { type BatchDeleteResult, type FileHeadMetadata, type FileListResponse, type TransformMetadata, type TransformOptions, type UploadMethod, type UploadResult, type UseAbortAllOptions, type UseAbortAllReturn, type UseAbortBatchOptions, type UseAbortBatchReturn, type UseAbortItemOptions, type UseAbortItemReturn, type UseAllAbortListenerOptions, type UseBatchCancelledListenerOptions, type UseBatchDeleteFilesOptions, type UseBatchDeleteFilesReturn, type UseBatchErrorListenerOptions, type UseBatchFinalizeListenerOptions, type UseBatchFinishListenerOptions, type UseBatchProgressListenerOptions, type UseBatchRetryOptions, type UseBatchRetryReturn, type UseBatchStartListenerOptions, type UseBatchUploadOptions, type UseBatchUploadReturn, type UseChunkedRestUploadOptions, type UseChunkedRestUploadReturn, type UseDeleteFileOptions, type UseDeleteFileReturn, type UseFileInputOptions, type UseFileInputReturn, type UseGetFileListOptions, type UseGetFileListReturn, type UseGetFileMetaOptions, type UseGetFileMetaReturn, type UseGetFileOptions, type UseGetFileReturn, type UseHeadFileOptions, type UseHeadFileReturn, type UseMultipartUploadOptions, type UseMultipartUploadReturn, type UsePasteUploadOptions, type UsePasteUploadReturn, type UsePatchChunkOptions, type UsePatchChunkReturn, type UsePutFileOptions, type UsePutFileReturn, type UseRetryListenerOptions, type UseRetryOptions, type UseRetryReturn, type UseTransformFileOptions, type UseTransformFileReturn, type UseTransformMetadataOptions, type UseTransformMetadataReturn, type UseTusUploadOptions, type UseTusUploadReturn, type UseUploadOptions, type UseUploadReturn, useAbortAll, useAbortBatch, useAbortItem, useAllAbortListener, useBatchCancelledListener, useBatchDeleteFiles, useBatchErrorListener, useBatchFinalizeListener, useBatchFinishListener, useBatchProgressListener, useBatchRetry, useBatchStartListener, useBatchUpload, useChunkedRestUpload, useDeleteFile, useFileInput, useGetFile, useGetFileList, useGetFileMeta, useHeadFile, useMultipartUpload, usePasteUpload, usePatchChunk, usePutFile, useRetry, useRetryListener, useTransformFile, useTransformMetadata, useTusUpload, useUpload };
|