@visulima/storage-client 1.0.0-alpha.1

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.
Files changed (268) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/LICENSE.md +27 -0
  3. package/README.md +71 -0
  4. package/dist/core/chunked-rest-adapter.d.ts +43 -0
  5. package/dist/core/index.d.ts +11 -0
  6. package/dist/core/multipart-adapter.d.ts +34 -0
  7. package/dist/core/query-client.d.ts +57 -0
  8. package/dist/core/query-keys.d.ts +34 -0
  9. package/dist/core/tus-adapter.d.ts +43 -0
  10. package/dist/core/uploader.d.ts +183 -0
  11. package/dist/index.d.ts +1 -0
  12. package/dist/index.js +1 -0
  13. package/dist/packem_shared/createAbortAll-B5vFFliA.js +1 -0
  14. package/dist/packem_shared/createAbortAll-D-x-LWNg.js +1 -0
  15. package/dist/packem_shared/createAbortBatch-CYtSbWfz.js +1 -0
  16. package/dist/packem_shared/createAbortBatch-zA0PTnOB.js +1 -0
  17. package/dist/packem_shared/createAbortItem-0f0bigbq.js +1 -0
  18. package/dist/packem_shared/createAbortItem-CIRlRD4X.js +1 -0
  19. package/dist/packem_shared/createAllAbortListener-CDrnG87k.js +1 -0
  20. package/dist/packem_shared/createAllAbortListener-CYLEWan0.js +1 -0
  21. package/dist/packem_shared/createBatchCancelledListener-Deq8lrIn.js +1 -0
  22. package/dist/packem_shared/createBatchCancelledListener-l9c0mi15.js +1 -0
  23. package/dist/packem_shared/createBatchDeleteFiles-B0SYSdYj.js +1 -0
  24. package/dist/packem_shared/createBatchDeleteFiles-Z4S-30eN.js +1 -0
  25. package/dist/packem_shared/createBatchErrorListener-CGJPEngL.js +1 -0
  26. package/dist/packem_shared/createBatchErrorListener-CJQFdXW2.js +1 -0
  27. package/dist/packem_shared/createBatchFinalizeListener-B2rEps7g.js +1 -0
  28. package/dist/packem_shared/createBatchFinalizeListener-Og0rELSL.js +1 -0
  29. package/dist/packem_shared/createBatchFinishListener-BeE6-b6E.js +1 -0
  30. package/dist/packem_shared/createBatchFinishListener-D9AOd6Cl.js +1 -0
  31. package/dist/packem_shared/createBatchProgressListener-1KpCpw7e.js +1 -0
  32. package/dist/packem_shared/createBatchProgressListener-BWW_tnse.js +1 -0
  33. package/dist/packem_shared/createBatchRetry-6E_Ivzh4.js +1 -0
  34. package/dist/packem_shared/createBatchRetry-D_F4v9oA.js +1 -0
  35. package/dist/packem_shared/createBatchStartListener-CkcMX3tq.js +1 -0
  36. package/dist/packem_shared/createBatchStartListener-DBHjoANG.js +1 -0
  37. package/dist/packem_shared/createBatchUpload-8yahZiID.js +1 -0
  38. package/dist/packem_shared/createBatchUpload-DWcVWF9h.js +1 -0
  39. package/dist/packem_shared/createChunkedRestAdapter-Df1E_Adn.js +1 -0
  40. package/dist/packem_shared/createChunkedRestUpload-CJNQp68Z.js +1 -0
  41. package/dist/packem_shared/createChunkedRestUpload-DZIOry7M.js +1 -0
  42. package/dist/packem_shared/createDeleteFile-DsUMoSxn.js +1 -0
  43. package/dist/packem_shared/createDeleteFile-_Znrnika.js +1 -0
  44. package/dist/packem_shared/createFileInput-B7WPz_-r.js +1 -0
  45. package/dist/packem_shared/createFileInput-TTI-EsSq.js +1 -0
  46. package/dist/packem_shared/createGetFile-BOV5S7mX.js +1 -0
  47. package/dist/packem_shared/createGetFile-CY2ohQF-.js +1 -0
  48. package/dist/packem_shared/createGetFileList-DGZQymc5.js +1 -0
  49. package/dist/packem_shared/createGetFileList-ZF0Luf6h.js +1 -0
  50. package/dist/packem_shared/createGetFileMeta-50LymNvf.js +1 -0
  51. package/dist/packem_shared/createGetFileMeta-DmC_OvP4.js +1 -0
  52. package/dist/packem_shared/createHeadFile-CGD6bHDS.js +1 -0
  53. package/dist/packem_shared/createHeadFile-DYb9FeQ1.js +1 -0
  54. package/dist/packem_shared/createMultipartAdapter-CoJpvX9z.js +1 -0
  55. package/dist/packem_shared/createMultipartUpload-CTats5BN.js +1 -0
  56. package/dist/packem_shared/createMultipartUpload-DF3XyOX3.js +1 -0
  57. package/dist/packem_shared/createPasteUpload-BS7pMOvb.js +1 -0
  58. package/dist/packem_shared/createPasteUpload-DemCREgp.js +1 -0
  59. package/dist/packem_shared/createPatchChunk-DqCMbHjI.js +1 -0
  60. package/dist/packem_shared/createPatchChunk-Zy6I60LN.js +1 -0
  61. package/dist/packem_shared/createPutFile-D8hN-9Ai.js +1 -0
  62. package/dist/packem_shared/createPutFile-DJraow7z.js +1 -0
  63. package/dist/packem_shared/createRetry-DPaN9i_a.js +1 -0
  64. package/dist/packem_shared/createRetry-D_fXIQUj.js +1 -0
  65. package/dist/packem_shared/createRetryListener-DonB2P-g.js +1 -0
  66. package/dist/packem_shared/createRetryListener-bMqMm13Y.js +1 -0
  67. package/dist/packem_shared/createTransformFile-C2fVfiwL.js +1 -0
  68. package/dist/packem_shared/createTransformFile-CJXLJEfg.js +1 -0
  69. package/dist/packem_shared/createTransformMetadata-BImjFF_i.js +1 -0
  70. package/dist/packem_shared/createTransformMetadata-zyl5UymO.js +1 -0
  71. package/dist/packem_shared/createTusAdapter-DM31lujI.js +1 -0
  72. package/dist/packem_shared/createTusUpload-BoM0S0Or.js +1 -0
  73. package/dist/packem_shared/createTusUpload-ClmXqmcz.js +1 -0
  74. package/dist/packem_shared/createUpload-CuZqq0nu.js +1 -0
  75. package/dist/packem_shared/createUpload-LRQ4N_cF.js +1 -0
  76. package/dist/packem_shared/createUploader-B_IjjBxw.js +1 -0
  77. package/dist/packem_shared/parseApiError-CUagSahh.js +1 -0
  78. package/dist/packem_shared/storageQueryKeys-cD4rL4b1.js +1 -0
  79. package/dist/packem_shared/useAbortAll-DeTTc8gX.js +1 -0
  80. package/dist/packem_shared/useAbortAll-DrHBz3kQ.js +1 -0
  81. package/dist/packem_shared/useAbortBatch-BoXLZH9d.js +1 -0
  82. package/dist/packem_shared/useAbortBatch-gVI48Gqa.js +1 -0
  83. package/dist/packem_shared/useAbortItem-Blw0eI13.js +1 -0
  84. package/dist/packem_shared/useAbortItem-DOVDiZFG.js +1 -0
  85. package/dist/packem_shared/useAllAbortListener-CadZ6Ohd.js +1 -0
  86. package/dist/packem_shared/useAllAbortListener-DiliYPra.js +1 -0
  87. package/dist/packem_shared/useBatchCancelledListener-CADhAnT8.js +1 -0
  88. package/dist/packem_shared/useBatchCancelledListener-CD0CULd_.js +1 -0
  89. package/dist/packem_shared/useBatchDeleteFiles-ASYuAVXn.js +1 -0
  90. package/dist/packem_shared/useBatchDeleteFiles-KthW4bon.js +1 -0
  91. package/dist/packem_shared/useBatchErrorListener-C3KwlH_D.js +1 -0
  92. package/dist/packem_shared/useBatchErrorListener-D-M1xGbQ.js +1 -0
  93. package/dist/packem_shared/useBatchFinalizeListener-BjnW3Lst.js +1 -0
  94. package/dist/packem_shared/useBatchFinalizeListener-CuVe9PGl.js +1 -0
  95. package/dist/packem_shared/useBatchFinishListener-4RjAPVhl.js +1 -0
  96. package/dist/packem_shared/useBatchFinishListener-DedP4Rm_.js +1 -0
  97. package/dist/packem_shared/useBatchProgressListener-CBAjGzmu.js +1 -0
  98. package/dist/packem_shared/useBatchProgressListener-CoYeF3Zj.js +1 -0
  99. package/dist/packem_shared/useBatchRetry-C53msBuL.js +1 -0
  100. package/dist/packem_shared/useBatchRetry-CAqFm7V8.js +1 -0
  101. package/dist/packem_shared/useBatchStartListener-BAOxxo1Y.js +1 -0
  102. package/dist/packem_shared/useBatchStartListener-DwAzFph7.js +1 -0
  103. package/dist/packem_shared/useBatchUpload-DLQNW410.js +1 -0
  104. package/dist/packem_shared/useBatchUpload-xPQlYOIK.js +1 -0
  105. package/dist/packem_shared/useChunkedRestUpload-DmXiSpyb.js +1 -0
  106. package/dist/packem_shared/useChunkedRestUpload-cKHvYQN3.js +1 -0
  107. package/dist/packem_shared/useDeleteFile-CND-6aNW.js +1 -0
  108. package/dist/packem_shared/useDeleteFile-CZUMjbYV.js +1 -0
  109. package/dist/packem_shared/useFileInput-Dvy2fNU7.js +1 -0
  110. package/dist/packem_shared/useFileInput-hIbzJ_JN.js +1 -0
  111. package/dist/packem_shared/useGetFile-CuST4rUN.js +1 -0
  112. package/dist/packem_shared/useGetFile-DvgluPgA.js +1 -0
  113. package/dist/packem_shared/useGetFileList-BiYDlEAl.js +1 -0
  114. package/dist/packem_shared/useGetFileList-D0tKDYAc.js +1 -0
  115. package/dist/packem_shared/useGetFileMeta-C2U1PExr.js +1 -0
  116. package/dist/packem_shared/useGetFileMeta-Ekre98Sg.js +1 -0
  117. package/dist/packem_shared/useHeadFile-CCu61b-B.js +1 -0
  118. package/dist/packem_shared/useHeadFile-DBQdkWZG.js +1 -0
  119. package/dist/packem_shared/useMultipartUpload-B9Vi7f5z.js +1 -0
  120. package/dist/packem_shared/useMultipartUpload-CIp4NLzf.js +1 -0
  121. package/dist/packem_shared/usePasteUpload-COdUC9xU.js +1 -0
  122. package/dist/packem_shared/usePasteUpload-_YqkCkrL.js +1 -0
  123. package/dist/packem_shared/usePatchChunk-BO3S0Tx4.js +1 -0
  124. package/dist/packem_shared/usePatchChunk-DoKsCbBH.js +1 -0
  125. package/dist/packem_shared/usePutFile-B6cFjClD.js +1 -0
  126. package/dist/packem_shared/usePutFile-bQl10v42.js +1 -0
  127. package/dist/packem_shared/useRetry-Dsq4jvkt.js +1 -0
  128. package/dist/packem_shared/useRetry-mkTUERYR.js +1 -0
  129. package/dist/packem_shared/useRetryListener-B45dL00Q.js +1 -0
  130. package/dist/packem_shared/useRetryListener-BEONt1sx.js +1 -0
  131. package/dist/packem_shared/useTransformFile-DmfsqTjp.js +1 -0
  132. package/dist/packem_shared/useTransformFile-sIkJLAwo.js +1 -0
  133. package/dist/packem_shared/useTransformMetadata-B0JbX1Ni.js +1 -0
  134. package/dist/packem_shared/useTransformMetadata-DK1561-K.js +1 -0
  135. package/dist/packem_shared/useTusUpload-CDRjQl0e.js +1 -0
  136. package/dist/packem_shared/useTusUpload-Cn1UeWo4.js +1 -0
  137. package/dist/packem_shared/useUpload-B_RxNnHC.js +1 -0
  138. package/dist/packem_shared/useUpload-CjLWLpyn.js +1 -0
  139. package/dist/react/index.d.ts +61 -0
  140. package/dist/react/index.js +1 -0
  141. package/dist/react/types.d.ts +65 -0
  142. package/dist/react/use-abort-all.d.ts +16 -0
  143. package/dist/react/use-abort-batch.d.ts +16 -0
  144. package/dist/react/use-abort-item.d.ts +16 -0
  145. package/dist/react/use-all-abort-listener.d.ts +14 -0
  146. package/dist/react/use-batch-cancelled-listener.d.ts +14 -0
  147. package/dist/react/use-batch-delete-files.d.ts +32 -0
  148. package/dist/react/use-batch-error-listener.d.ts +14 -0
  149. package/dist/react/use-batch-finalize-listener.d.ts +15 -0
  150. package/dist/react/use-batch-finish-listener.d.ts +14 -0
  151. package/dist/react/use-batch-progress-listener.d.ts +14 -0
  152. package/dist/react/use-batch-retry.d.ts +16 -0
  153. package/dist/react/use-batch-start-listener.d.ts +14 -0
  154. package/dist/react/use-batch-upload.d.ts +42 -0
  155. package/dist/react/use-chunked-rest-upload.d.ts +55 -0
  156. package/dist/react/use-delete-file.d.ts +25 -0
  157. package/dist/react/use-file-input.d.ts +32 -0
  158. package/dist/react/use-get-file-list.d.ts +46 -0
  159. package/dist/react/use-get-file-meta.d.ts +29 -0
  160. package/dist/react/use-get-file.d.ts +34 -0
  161. package/dist/react/use-head-file.d.ts +49 -0
  162. package/dist/react/use-multipart-upload.d.ts +35 -0
  163. package/dist/react/use-paste-upload.d.ts +20 -0
  164. package/dist/react/use-patch-chunk.d.ts +29 -0
  165. package/dist/react/use-put-file.d.ts +32 -0
  166. package/dist/react/use-retry-listener.d.ts +15 -0
  167. package/dist/react/use-retry.d.ts +16 -0
  168. package/dist/react/use-transform-file.d.ts +48 -0
  169. package/dist/react/use-transform-metadata.d.ts +33 -0
  170. package/dist/react/use-tus-upload.d.ts +55 -0
  171. package/dist/react/use-upload.d.ts +69 -0
  172. package/dist/solid/create-abort-all.d.ts +8 -0
  173. package/dist/solid/create-abort-batch.d.ts +8 -0
  174. package/dist/solid/create-abort-item.d.ts +8 -0
  175. package/dist/solid/create-all-abort-listener.d.ts +7 -0
  176. package/dist/solid/create-batch-cancelled-listener.d.ts +7 -0
  177. package/dist/solid/create-batch-delete-files.d.ts +29 -0
  178. package/dist/solid/create-batch-error-listener.d.ts +7 -0
  179. package/dist/solid/create-batch-finalize-listener.d.ts +7 -0
  180. package/dist/solid/create-batch-finish-listener.d.ts +7 -0
  181. package/dist/solid/create-batch-progress-listener.d.ts +7 -0
  182. package/dist/solid/create-batch-retry.d.ts +8 -0
  183. package/dist/solid/create-batch-start-listener.d.ts +7 -0
  184. package/dist/solid/create-batch-upload.d.ts +43 -0
  185. package/dist/solid/create-chunked-rest-upload.d.ts +56 -0
  186. package/dist/solid/create-delete-file.d.ts +22 -0
  187. package/dist/solid/create-file-input.d.ts +20 -0
  188. package/dist/solid/create-get-file-list.d.ts +46 -0
  189. package/dist/solid/create-get-file-meta.d.ts +29 -0
  190. package/dist/solid/create-get-file.d.ts +38 -0
  191. package/dist/solid/create-head-file.d.ts +46 -0
  192. package/dist/solid/create-multipart-upload.d.ts +36 -0
  193. package/dist/solid/create-paste-upload.d.ts +11 -0
  194. package/dist/solid/create-patch-chunk.d.ts +26 -0
  195. package/dist/solid/create-put-file.d.ts +29 -0
  196. package/dist/solid/create-retry-listener.d.ts +7 -0
  197. package/dist/solid/create-retry.d.ts +8 -0
  198. package/dist/solid/create-transform-file.d.ts +45 -0
  199. package/dist/solid/create-transform-metadata.d.ts +30 -0
  200. package/dist/solid/create-tus-upload.d.ts +56 -0
  201. package/dist/solid/create-upload.d.ts +70 -0
  202. package/dist/solid/index.d.ts +60 -0
  203. package/dist/solid/index.js +1 -0
  204. package/dist/svelte/create-abort-all.d.ts +8 -0
  205. package/dist/svelte/create-abort-batch.d.ts +8 -0
  206. package/dist/svelte/create-abort-item.d.ts +8 -0
  207. package/dist/svelte/create-all-abort-listener.d.ts +7 -0
  208. package/dist/svelte/create-batch-cancelled-listener.d.ts +7 -0
  209. package/dist/svelte/create-batch-delete-files.d.ts +29 -0
  210. package/dist/svelte/create-batch-error-listener.d.ts +7 -0
  211. package/dist/svelte/create-batch-finalize-listener.d.ts +7 -0
  212. package/dist/svelte/create-batch-finish-listener.d.ts +7 -0
  213. package/dist/svelte/create-batch-progress-listener.d.ts +7 -0
  214. package/dist/svelte/create-batch-retry.d.ts +8 -0
  215. package/dist/svelte/create-batch-start-listener.d.ts +7 -0
  216. package/dist/svelte/create-batch-upload.d.ts +23 -0
  217. package/dist/svelte/create-chunked-rest-upload.d.ts +56 -0
  218. package/dist/svelte/create-delete-file.d.ts +26 -0
  219. package/dist/svelte/create-file-input.d.ts +19 -0
  220. package/dist/svelte/create-get-file-list.d.ts +43 -0
  221. package/dist/svelte/create-get-file-meta.d.ts +26 -0
  222. package/dist/svelte/create-get-file.d.ts +41 -0
  223. package/dist/svelte/create-head-file.d.ts +46 -0
  224. package/dist/svelte/create-multipart-upload.d.ts +36 -0
  225. package/dist/svelte/create-paste-upload.d.ts +11 -0
  226. package/dist/svelte/create-patch-chunk.d.ts +26 -0
  227. package/dist/svelte/create-put-file.d.ts +29 -0
  228. package/dist/svelte/create-retry-listener.d.ts +7 -0
  229. package/dist/svelte/create-retry.d.ts +8 -0
  230. package/dist/svelte/create-transform-file.d.ts +45 -0
  231. package/dist/svelte/create-transform-metadata.d.ts +30 -0
  232. package/dist/svelte/create-tus-upload.d.ts +56 -0
  233. package/dist/svelte/create-upload.d.ts +68 -0
  234. package/dist/svelte/index.d.ts +60 -0
  235. package/dist/svelte/index.js +1 -0
  236. package/dist/vue/index.d.ts +60 -0
  237. package/dist/vue/index.js +1 -0
  238. package/dist/vue/use-abort-all.d.ts +16 -0
  239. package/dist/vue/use-abort-batch.d.ts +16 -0
  240. package/dist/vue/use-abort-item.d.ts +16 -0
  241. package/dist/vue/use-all-abort-listener.d.ts +14 -0
  242. package/dist/vue/use-batch-cancelled-listener.d.ts +14 -0
  243. package/dist/vue/use-batch-delete-files.d.ts +29 -0
  244. package/dist/vue/use-batch-error-listener.d.ts +14 -0
  245. package/dist/vue/use-batch-finalize-listener.d.ts +15 -0
  246. package/dist/vue/use-batch-finish-listener.d.ts +14 -0
  247. package/dist/vue/use-batch-progress-listener.d.ts +14 -0
  248. package/dist/vue/use-batch-retry.d.ts +16 -0
  249. package/dist/vue/use-batch-start-listener.d.ts +14 -0
  250. package/dist/vue/use-batch-upload.d.ts +43 -0
  251. package/dist/vue/use-chunked-rest-upload.d.ts +56 -0
  252. package/dist/vue/use-delete-file.d.ts +22 -0
  253. package/dist/vue/use-file-input.d.ts +33 -0
  254. package/dist/vue/use-get-file-list.d.ts +43 -0
  255. package/dist/vue/use-get-file-meta.d.ts +26 -0
  256. package/dist/vue/use-get-file.d.ts +35 -0
  257. package/dist/vue/use-head-file.d.ts +46 -0
  258. package/dist/vue/use-multipart-upload.d.ts +36 -0
  259. package/dist/vue/use-paste-upload.d.ts +21 -0
  260. package/dist/vue/use-patch-chunk.d.ts +26 -0
  261. package/dist/vue/use-put-file.d.ts +29 -0
  262. package/dist/vue/use-retry-listener.d.ts +15 -0
  263. package/dist/vue/use-retry.d.ts +16 -0
  264. package/dist/vue/use-transform-file.d.ts +45 -0
  265. package/dist/vue/use-transform-metadata.d.ts +30 -0
  266. package/dist/vue/use-tus-upload.d.ts +56 -0
  267. package/dist/vue/use-upload.d.ts +68 -0
  268. package/package.json +101 -0
@@ -0,0 +1,46 @@
1
+ import type { FileMeta } from "./types.d.ts";
2
+ export interface FileListResponse {
3
+ data: FileMeta[];
4
+ meta?: {
5
+ firstPage?: number;
6
+ firstPageUrl?: string;
7
+ lastPage?: number;
8
+ lastPageUrl?: string;
9
+ nextPageUrl?: string | undefined;
10
+ page?: number;
11
+ perPage?: number;
12
+ previousPageUrl?: string | undefined;
13
+ total?: number;
14
+ };
15
+ }
16
+ export interface UseGetFileListOptions {
17
+ /** Whether to enable the query */
18
+ enabled?: boolean;
19
+ /** Base endpoint URL for file operations */
20
+ endpoint: string;
21
+ /** Maximum number of elements to retrieve */
22
+ limit?: number;
23
+ /** Callback when request fails */
24
+ onError?: (error: Error) => void;
25
+ /** Callback when request succeeds */
26
+ onSuccess?: (data: FileListResponse) => void;
27
+ /** Page number for pagination */
28
+ page?: number;
29
+ }
30
+ export interface UseGetFileListReturn {
31
+ /** File list data */
32
+ data: FileListResponse | undefined;
33
+ /** Last request error, if any */
34
+ error: Error | undefined;
35
+ /** Whether a request is currently in progress */
36
+ isLoading: boolean;
37
+ /** Refetch the file list */
38
+ refetch: () => void;
39
+ }
40
+ /**
41
+ * React hook for fetching a list of files using TanStack Query.
42
+ * Supports pagination via query parameters.
43
+ * @param options Hook configuration options
44
+ * @returns File list fetching functions and state
45
+ */
46
+ export declare const useGetFileList: (options: UseGetFileListOptions) => UseGetFileListReturn;
@@ -0,0 +1,29 @@
1
+ import type { FileMeta } from "./types.d.ts";
2
+ export interface UseGetFileMetaOptions {
3
+ /** Whether to enable the query */
4
+ enabled?: boolean;
5
+ /** Base endpoint URL for file operations */
6
+ endpoint: string;
7
+ /** File ID to fetch metadata for */
8
+ id: string;
9
+ /** Callback when request fails */
10
+ onError?: (error: Error) => void;
11
+ /** Callback when request succeeds */
12
+ onSuccess?: (meta: FileMeta) => void;
13
+ }
14
+ export interface UseGetFileMetaReturn {
15
+ /** File metadata */
16
+ data: FileMeta | undefined;
17
+ /** Last request error, if any */
18
+ error: Error | undefined;
19
+ /** Whether a request is currently in progress */
20
+ isLoading: boolean;
21
+ /** Refetch the file metadata */
22
+ refetch: () => void;
23
+ }
24
+ /**
25
+ * React hook for fetching file metadata using TanStack Query.
26
+ * @param options Hook configuration options
27
+ * @returns File metadata fetching functions and state
28
+ */
29
+ export declare const useGetFileMeta: (options: UseGetFileMetaOptions) => UseGetFileMetaReturn;
@@ -0,0 +1,34 @@
1
+ import type { FileMeta } from "./types.d.ts";
2
+ export interface UseGetFileOptions {
3
+ /** Whether to enable the query */
4
+ enabled?: boolean;
5
+ /** Base endpoint URL for file operations */
6
+ endpoint: string;
7
+ /** File ID to fetch */
8
+ id: string;
9
+ /** Callback when request fails */
10
+ onError?: (error: Error) => void;
11
+ /** Callback when request succeeds */
12
+ onSuccess?: (data: Blob, meta: FileMeta | undefined) => void;
13
+ /** Transformation parameters for media files */
14
+ transform?: Record<string, string | number | boolean>;
15
+ }
16
+ export interface UseGetFileReturn {
17
+ /** File data as Blob */
18
+ data: Blob | undefined;
19
+ /** Last request error, if any */
20
+ error: Error | undefined;
21
+ /** Whether a request is currently in progress */
22
+ isLoading: boolean;
23
+ /** File metadata from response headers */
24
+ meta: FileMeta | undefined;
25
+ /** Refetch the file */
26
+ refetch: () => void;
27
+ }
28
+ /**
29
+ * React hook for fetching/downloading files using TanStack Query.
30
+ * Supports optional transformation parameters for media files.
31
+ * @param options Hook configuration options.
32
+ * @returns File fetching functions and state.
33
+ */
34
+ export declare const useGetFile: (options: UseGetFileOptions) => UseGetFileReturn;
@@ -0,0 +1,49 @@
1
+ export interface FileHeadMetadata {
2
+ /** Whether this is a chunked upload session */
3
+ chunkedUpload?: boolean;
4
+ /** Content length in bytes */
5
+ contentLength?: number;
6
+ /** Content type */
7
+ contentType?: string;
8
+ /** Entity tag for caching */
9
+ etag?: string;
10
+ /** Last modified date */
11
+ lastModified?: string;
12
+ /** Received chunk offsets (chunked uploads) */
13
+ receivedChunks?: number[];
14
+ /** Whether upload is complete (chunked uploads) */
15
+ uploadComplete?: boolean;
16
+ /** Upload expiration date */
17
+ uploadExpires?: string;
18
+ /** Upload offset for chunked uploads */
19
+ uploadOffset?: number;
20
+ }
21
+ export interface UseHeadFileOptions {
22
+ /** Whether to enable the query */
23
+ enabled?: boolean;
24
+ /** Base endpoint URL for file operations */
25
+ endpoint: string;
26
+ /** File ID to fetch metadata for */
27
+ id: string;
28
+ /** Callback when request fails */
29
+ onError?: (error: Error) => void;
30
+ /** Callback when request succeeds */
31
+ onSuccess?: (meta: FileHeadMetadata) => void;
32
+ }
33
+ export interface UseHeadFileReturn {
34
+ /** File metadata from HEAD request */
35
+ data: FileHeadMetadata | undefined;
36
+ /** Last request error, if any */
37
+ error: Error | undefined;
38
+ /** Whether a request is currently in progress */
39
+ isLoading: boolean;
40
+ /** Refetch the file metadata */
41
+ refetch: () => void;
42
+ }
43
+ /**
44
+ * React hook for fetching file metadata via HEAD request using TanStack Query.
45
+ * Useful for checking upload progress and file status without downloading.
46
+ * @param options Hook configuration options
47
+ * @returns File HEAD request functions and state
48
+ */
49
+ export declare const useHeadFile: (options: UseHeadFileOptions) => UseHeadFileReturn;
@@ -0,0 +1,35 @@
1
+ import type { UploadResult } from "./types.d.ts";
2
+ export interface UseMultipartUploadOptions {
3
+ /** Upload endpoint URL */
4
+ endpoint: string;
5
+ /** Additional metadata to include with the upload */
6
+ metadata?: Record<string, string>;
7
+ /** Callback when upload fails */
8
+ onError?: (error: Error) => void;
9
+ /** Callback when upload progress updates */
10
+ onProgress?: (progress: number) => void;
11
+ /** Callback when upload starts */
12
+ onStart?: () => void;
13
+ /** Callback when upload completes successfully */
14
+ onSuccess?: (file: UploadResult) => void;
15
+ }
16
+ export interface UseMultipartUploadReturn {
17
+ /** Last upload error, if any */
18
+ error: Error | undefined;
19
+ /** Whether an upload is currently in progress */
20
+ isUploading: boolean;
21
+ /** Current upload progress (0-100) */
22
+ progress: number;
23
+ /** Reset upload state */
24
+ reset: () => void;
25
+ /** Last upload result, if any */
26
+ result: UploadResult | undefined;
27
+ /** Upload a file using multipart/form-data */
28
+ upload: (file: File) => Promise<UploadResult>;
29
+ }
30
+ /**
31
+ * React hook for multipart/form-data file uploads using custom uploader implementation.
32
+ * @param options Upload configuration options
33
+ * @returns Upload functions and state
34
+ */
35
+ export declare const useMultipartUpload: (options: UseMultipartUploadOptions) => UseMultipartUploadReturn;
@@ -0,0 +1,20 @@
1
+ export interface UsePasteUploadOptions {
2
+ /** Filter function to determine which files to accept */
3
+ filter?: (file: File) => boolean;
4
+ /** Callback when files are pasted */
5
+ onFilesPasted?: (files: File[]) => void;
6
+ }
7
+ export interface UsePasteUploadReturn {
8
+ /** Handle paste event */
9
+ handlePaste: (event: React.ClipboardEvent<HTMLElement>) => void;
10
+ /** Files that were pasted */
11
+ pastedFiles: File[];
12
+ /** Reset pasted files */
13
+ reset: () => void;
14
+ }
15
+ /**
16
+ * React hook for handling paste uploads from clipboard.
17
+ * @param options Configuration options
18
+ * @returns Paste upload functions and state
19
+ */
20
+ export declare const usePasteUpload: (options?: UsePasteUploadOptions) => UsePasteUploadReturn;
@@ -0,0 +1,29 @@
1
+ import type { UploadResult } from "./types.d.ts";
2
+ export interface UsePatchChunkOptions {
3
+ /** Base endpoint URL for file operations */
4
+ endpoint: string;
5
+ /** Callback when request fails */
6
+ onError?: (error: Error) => void;
7
+ /** Callback when request succeeds */
8
+ onSuccess?: (result: UploadResult) => void;
9
+ }
10
+ export interface UsePatchChunkReturn {
11
+ /** Last upload result, if any */
12
+ data: UploadResult | undefined;
13
+ /** Last request error, if any */
14
+ error: Error | undefined;
15
+ /** Whether a request is currently in progress */
16
+ isLoading: boolean;
17
+ /** Upload a chunk for chunked uploads */
18
+ patchChunk: (id: string, chunk: Blob, offset: number, checksum?: string) => Promise<UploadResult>;
19
+ /** Reset mutation state */
20
+ reset: () => void;
21
+ }
22
+ /**
23
+ * React hook for uploading chunks in chunked uploads using TanStack Query.
24
+ * Requires X-Chunk-Offset header and chunk data.
25
+ * Automatically invalidates related queries when upload is complete.
26
+ * @param options Hook configuration options
27
+ * @returns Chunk upload functions and state
28
+ */
29
+ export declare const usePatchChunk: (options: UsePatchChunkOptions) => UsePatchChunkReturn;
@@ -0,0 +1,32 @@
1
+ import type { UploadResult } from "./types.d.ts";
2
+ export interface UsePutFileOptions {
3
+ /** Base endpoint URL for file operations */
4
+ endpoint: string;
5
+ /** Callback when request fails */
6
+ onError?: (error: Error) => void;
7
+ /** Callback when upload progress updates */
8
+ onProgress?: (progress: number) => void;
9
+ /** Callback when request succeeds */
10
+ onSuccess?: (result: UploadResult) => void;
11
+ }
12
+ export interface UsePutFileReturn {
13
+ /** Last upload result, if any */
14
+ data: UploadResult | undefined;
15
+ /** Last request error, if any */
16
+ error: Error | undefined;
17
+ /** Whether a request is currently in progress */
18
+ isLoading: boolean;
19
+ /** Current upload progress (0-100) */
20
+ progress: number;
21
+ /** Create or update a file by ID */
22
+ putFile: (id: string, file: File | Blob) => Promise<UploadResult>;
23
+ /** Reset mutation state */
24
+ reset: () => void;
25
+ }
26
+ /**
27
+ * React hook for creating or updating files via PUT request using TanStack Query.
28
+ * Automatically invalidates related queries.
29
+ * @param options Hook configuration options
30
+ * @returns File PUT functions and state
31
+ */
32
+ export declare const usePutFile: (options: UsePutFileOptions) => UsePutFileReturn;
@@ -0,0 +1,15 @@
1
+ import type { UploadItem } from "../core/uploader.d.ts";
2
+ export interface UseRetryListenerOptions {
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
+ /** Callback when an item is retried */
8
+ onRetry: (item: UploadItem) => void;
9
+ }
10
+ /**
11
+ * React hook to listen to retry events.
12
+ * Note: This listens to ITEM_START events for items that have been retried (retryCount > 0).
13
+ * @param options Listener configuration options
14
+ */
15
+ export declare const useRetryListener: (options: UseRetryListenerOptions) => void;
@@ -0,0 +1,16 @@
1
+ export interface UseRetryOptions {
2
+ /** Upload endpoint URL (used to create uploader instance) */
3
+ endpoint: string;
4
+ /** Additional metadata to include with the upload */
5
+ metadata?: Record<string, string>;
6
+ }
7
+ export interface UseRetryReturn {
8
+ /** Retry a failed upload item by ID */
9
+ retryItem: (id: string) => void;
10
+ }
11
+ /**
12
+ * React hook to retry a failed upload item.
13
+ * @param options Configuration options
14
+ * @returns Retry function
15
+ */
16
+ export declare const useRetry: (options: UseRetryOptions) => UseRetryReturn;
@@ -0,0 +1,48 @@
1
+ import type { FileMeta } from "./types.d.ts";
2
+ export interface TransformOptions {
3
+ /** Additional transformation parameters */
4
+ [key: string]: string | number | boolean | undefined;
5
+ /** Resize fit mode */
6
+ fit?: "cover" | "contain" | "fill" | "inside" | "outside";
7
+ /** Output format (jpeg, png, webp, etc.) */
8
+ format?: string;
9
+ /** Desired height in pixels */
10
+ height?: number;
11
+ /** Quality setting (0-100) */
12
+ quality?: number;
13
+ /** Desired width in pixels */
14
+ width?: number;
15
+ }
16
+ export interface UseTransformFileOptions {
17
+ /** Whether to enable the query */
18
+ enabled?: boolean;
19
+ /** Base endpoint URL for transform operations */
20
+ endpoint: string;
21
+ /** File ID to transform */
22
+ id: string;
23
+ /** Callback when request fails */
24
+ onError?: (error: Error) => void;
25
+ /** Callback when request succeeds */
26
+ onSuccess?: (data: Blob, meta: FileMeta | undefined) => void;
27
+ /** Transformation parameters */
28
+ transform: TransformOptions;
29
+ }
30
+ export interface UseTransformFileReturn {
31
+ /** Transformed file data as Blob */
32
+ data: Blob | undefined;
33
+ /** Last request error, if any */
34
+ error: Error | undefined;
35
+ /** Whether a request is currently in progress */
36
+ isLoading: boolean;
37
+ /** File metadata from response headers */
38
+ meta: FileMeta | undefined;
39
+ /** Refetch the transformed file */
40
+ refetch: () => void;
41
+ }
42
+ /**
43
+ * React hook for fetching transformed files using TanStack Query.
44
+ * Supports image, video, and audio transformation parameters.
45
+ * @param options Hook configuration options
46
+ * @returns Transform file fetching functions and state
47
+ */
48
+ export declare const useTransformFile: (options: UseTransformFileOptions) => UseTransformFileReturn;
@@ -0,0 +1,33 @@
1
+ export interface TransformMetadata {
2
+ /** Available transformation formats */
3
+ formats?: string[];
4
+ /** Supported transformation parameters */
5
+ parameters?: string[];
6
+ }
7
+ export interface UseTransformMetadataOptions {
8
+ /** Whether to enable the query */
9
+ enabled?: boolean;
10
+ /** Base endpoint URL for transform operations */
11
+ endpoint: string;
12
+ /** Callback when request fails */
13
+ onError?: (error: Error) => void;
14
+ /** Callback when request succeeds */
15
+ onSuccess?: (metadata: TransformMetadata) => void;
16
+ }
17
+ export interface UseTransformMetadataReturn {
18
+ /** Transform metadata */
19
+ data: TransformMetadata | undefined;
20
+ /** Last request error, if any */
21
+ error: Error | undefined;
22
+ /** Whether a request is currently in progress */
23
+ isLoading: boolean;
24
+ /** Refetch the transform metadata */
25
+ refetch: () => void;
26
+ }
27
+ /**
28
+ * React hook for fetching transformation metadata using TanStack Query.
29
+ * Returns available formats and transformation parameters.
30
+ * @param options Hook configuration options
31
+ * @returns Transform metadata fetching functions and state
32
+ */
33
+ export declare const useTransformMetadata: (options: UseTransformMetadataOptions) => UseTransformMetadataReturn;
@@ -0,0 +1,55 @@
1
+ import type { UploadResult } from "./types.d.ts";
2
+ export interface UseTusUploadOptions {
3
+ /** Chunk size for TUS uploads (default: 1MB) */
4
+ chunkSize?: number;
5
+ /** TUS upload endpoint URL */
6
+ endpoint: string;
7
+ /** Maximum number of retry attempts */
8
+ maxRetries?: number;
9
+ /** Additional metadata to include with the upload */
10
+ metadata?: Record<string, string>;
11
+ /** Callback when upload fails */
12
+ onError?: (error: Error) => void;
13
+ /** Callback when upload is paused */
14
+ onPause?: () => void;
15
+ /** Callback when upload progress updates */
16
+ onProgress?: (progress: number) => void;
17
+ /** Callback when upload is resumed */
18
+ onResume?: () => void;
19
+ /** Callback when upload starts */
20
+ onStart?: () => void;
21
+ /** Callback when upload completes successfully */
22
+ onSuccess?: (file: UploadResult) => void;
23
+ /** Enable automatic retry on failure */
24
+ retry?: boolean;
25
+ }
26
+ export interface UseTusUploadReturn {
27
+ /** Abort the current upload */
28
+ abort: () => void;
29
+ /** Last upload error, if any */
30
+ error: Error | undefined;
31
+ /** Whether the upload is paused */
32
+ isPaused: boolean;
33
+ /** Whether an upload is currently in progress */
34
+ isUploading: boolean;
35
+ /** Current upload offset (bytes uploaded) */
36
+ offset: number;
37
+ /** Pause the current upload */
38
+ pause: () => void;
39
+ /** Current upload progress (0-100) */
40
+ progress: number;
41
+ /** Reset upload state */
42
+ reset: () => void;
43
+ /** Last upload result, if any */
44
+ result: UploadResult | undefined;
45
+ /** Resume a paused upload */
46
+ resume: () => Promise<void>;
47
+ /** Upload a file using TUS protocol */
48
+ upload: (file: File) => Promise<UploadResult>;
49
+ }
50
+ /**
51
+ * React hook for TUS resumable file uploads.
52
+ * @param options Upload configuration options
53
+ * @returns Upload functions and state
54
+ */
55
+ export declare const useTusUpload: (options: UseTusUploadOptions) => UseTusUploadReturn;
@@ -0,0 +1,69 @@
1
+ import type { UploadMethod, UploadResult } from "./types.d.ts";
2
+ interface UseUploadOptions {
3
+ /** Chunk size for TUS and chunked REST uploads (default: 1MB for TUS, 5MB for chunked REST) */
4
+ chunkSize?: number;
5
+ /** Chunked REST upload endpoint URL */
6
+ endpointChunkedRest?: string;
7
+ /** Multipart upload endpoint URL */
8
+ endpointMultipart?: string;
9
+ /** TUS upload endpoint URL */
10
+ endpointTus?: string;
11
+ /** Maximum number of retry attempts (TUS and chunked REST only) */
12
+ maxRetries?: number;
13
+ /** Additional metadata to include with the upload */
14
+ metadata?: Record<string, string>;
15
+ /** Upload method to use: 'multipart', 'tus', 'chunked-rest', or 'auto'. If undefined, auto-detected based on provided endpoints */
16
+ method?: UploadMethod;
17
+ /** Callback when upload fails */
18
+ onError?: (error: Error) => void;
19
+ /** Callback when upload is paused (TUS and chunked REST only) */
20
+ onPause?: () => void;
21
+ /** Callback when upload progress updates */
22
+ onProgress?: (progress: number) => void;
23
+ /** Callback when upload is resumed (TUS and chunked REST only) */
24
+ onResume?: () => void;
25
+ /** Callback when upload starts */
26
+ onStart?: () => void;
27
+ /** Callback when upload completes successfully */
28
+ onSuccess?: (file: UploadResult) => void;
29
+ /** Enable automatic retry on failure (TUS and chunked REST only) */
30
+ retry?: boolean;
31
+ /** File size threshold for auto-selecting TUS (default: 10MB) */
32
+ tusThreshold?: number;
33
+ }
34
+ interface UseUploadReturn {
35
+ /** Abort the current upload */
36
+ abort: () => void;
37
+ /** Current upload method being used */
38
+ currentMethod: UploadMethod;
39
+ /** Last upload error, if any */
40
+ error: Error | undefined;
41
+ /** Whether the upload is paused (TUS and chunked REST only) */
42
+ isPaused?: boolean;
43
+ /** Whether an upload is currently in progress */
44
+ isUploading: boolean;
45
+ /** Current upload offset in bytes (TUS and chunked REST only) */
46
+ offset?: number;
47
+ /** Pause the current upload (TUS and chunked REST only) */
48
+ pause?: () => void;
49
+ /** Current upload progress (0-100) */
50
+ progress: number;
51
+ /** Reset upload state */
52
+ reset: () => void;
53
+ /** Last upload result, if any */
54
+ result: UploadResult | undefined;
55
+ /** Resume a paused upload (TUS and chunked REST only) */
56
+ resume?: () => Promise<void>;
57
+ /** Upload a file using the configured method */
58
+ upload: (file: File) => Promise<UploadResult>;
59
+ }
60
+ /**
61
+ * React hook for file uploads with automatic method selection.
62
+ * Uses custom uploader implementations for multipart, TUS, and chunked REST.
63
+ * Automatically chooses between methods based on file size and method preference.
64
+ * @param options Upload configuration options
65
+ * @returns Upload functions and state
66
+ */
67
+ declare const useUpload: (options: UseUploadOptions) => UseUploadReturn;
68
+ export type { UseUploadOptions, UseUploadReturn };
69
+ export { useUpload };
@@ -0,0 +1,8 @@
1
+ export interface CreateAbortAllOptions {
2
+ endpoint: string;
3
+ metadata?: Record<string, string>;
4
+ }
5
+ export interface CreateAbortAllReturn {
6
+ abortAll: () => void;
7
+ }
8
+ export declare const createAbortAll: (options: CreateAbortAllOptions) => CreateAbortAllReturn;
@@ -0,0 +1,8 @@
1
+ export interface CreateAbortBatchOptions {
2
+ endpoint: string;
3
+ metadata?: Record<string, string>;
4
+ }
5
+ export interface CreateAbortBatchReturn {
6
+ abortBatch: (batchId: string) => void;
7
+ }
8
+ export declare const createAbortBatch: (options: CreateAbortBatchOptions) => CreateAbortBatchReturn;
@@ -0,0 +1,8 @@
1
+ export interface CreateAbortItemOptions {
2
+ endpoint: string;
3
+ metadata?: Record<string, string>;
4
+ }
5
+ export interface CreateAbortItemReturn {
6
+ abortItem: (id: string) => void;
7
+ }
8
+ export declare const createAbortItem: (options: CreateAbortItemOptions) => CreateAbortItemReturn;
@@ -0,0 +1,7 @@
1
+ import type { UploadItem } from "../core/uploader.d.ts";
2
+ export interface CreateAllAbortListenerOptions {
3
+ endpoint: string;
4
+ metadata?: Record<string, string>;
5
+ onAbort: (item: UploadItem) => void;
6
+ }
7
+ export declare const createAllAbortListener: (options: CreateAllAbortListenerOptions) => void;
@@ -0,0 +1,7 @@
1
+ import type { BatchState } from "../core/uploader.d.ts";
2
+ export interface CreateBatchCancelledListenerOptions {
3
+ endpoint: string;
4
+ metadata?: Record<string, string>;
5
+ onBatchCancelled: (batch: BatchState) => void;
6
+ }
7
+ export declare const createBatchCancelledListener: (options: CreateBatchCancelledListenerOptions) => void;
@@ -0,0 +1,29 @@
1
+ import type { Accessor } from "solid-js";
2
+ export interface BatchDeleteResult {
3
+ /** Number of files that failed to delete */
4
+ failed?: number;
5
+ /** Number of files successfully deleted */
6
+ successful?: number;
7
+ }
8
+ export interface CreateBatchDeleteFilesOptions {
9
+ /** Base endpoint URL for file operations */
10
+ endpoint: string;
11
+ }
12
+ export interface CreateBatchDeleteFilesReturn {
13
+ /** Delete multiple files by IDs */
14
+ batchDeleteFiles: (ids: string[]) => Promise<BatchDeleteResult>;
15
+ /** Last request error, if any */
16
+ error: Accessor<Error | undefined>;
17
+ /** Whether a request is currently in progress */
18
+ isLoading: Accessor<boolean>;
19
+ /** Reset mutation state */
20
+ reset: () => void;
21
+ }
22
+ /**
23
+ * Solid.js primitive for batch deleting files using TanStack Query.
24
+ * Supports both query parameter and JSON body methods.
25
+ * Automatically invalidates related queries.
26
+ * @param options Hook configuration options
27
+ * @returns Batch file deletion functions and state signals
28
+ */
29
+ export declare const createBatchDeleteFiles: (options: CreateBatchDeleteFilesOptions) => CreateBatchDeleteFilesReturn;
@@ -0,0 +1,7 @@
1
+ import type { BatchState } from "../core/uploader.d.ts";
2
+ export interface CreateBatchErrorListenerOptions {
3
+ endpoint: string;
4
+ metadata?: Record<string, string>;
5
+ onBatchError: (batch: BatchState) => void;
6
+ }
7
+ export declare const createBatchErrorListener: (options: CreateBatchErrorListenerOptions) => void;
@@ -0,0 +1,7 @@
1
+ import type { BatchState } from "../core/uploader.d.ts";
2
+ export interface CreateBatchFinalizeListenerOptions {
3
+ endpoint: string;
4
+ metadata?: Record<string, string>;
5
+ onBatchFinalize: (batch: BatchState) => void;
6
+ }
7
+ export declare const createBatchFinalizeListener: (options: CreateBatchFinalizeListenerOptions) => void;
@@ -0,0 +1,7 @@
1
+ import type { BatchState } from "../core/uploader.d.ts";
2
+ export interface CreateBatchFinishListenerOptions {
3
+ endpoint: string;
4
+ metadata?: Record<string, string>;
5
+ onBatchFinish: (batch: BatchState) => void;
6
+ }
7
+ export declare const createBatchFinishListener: (options: CreateBatchFinishListenerOptions) => void;
@@ -0,0 +1,7 @@
1
+ import type { BatchState } from "../core/uploader.d.ts";
2
+ export interface CreateBatchProgressListenerOptions {
3
+ endpoint: string;
4
+ metadata?: Record<string, string>;
5
+ onBatchProgress: (batch: BatchState) => void;
6
+ }
7
+ export declare const createBatchProgressListener: (options: CreateBatchProgressListenerOptions) => void;
@@ -0,0 +1,8 @@
1
+ export interface CreateBatchRetryOptions {
2
+ endpoint: string;
3
+ metadata?: Record<string, string>;
4
+ }
5
+ export interface CreateBatchRetryReturn {
6
+ retryBatch: (batchId: string) => void;
7
+ }
8
+ export declare const createBatchRetry: (options: CreateBatchRetryOptions) => CreateBatchRetryReturn;
@@ -0,0 +1,7 @@
1
+ import type { BatchState } from "../core/uploader.d.ts";
2
+ export interface CreateBatchStartListenerOptions {
3
+ endpoint: string;
4
+ metadata?: Record<string, string>;
5
+ onBatchStart: (batch: BatchState) => void;
6
+ }
7
+ export declare const createBatchStartListener: (options: CreateBatchStartListenerOptions) => void;