@dimah-s3/react 1.7.1 → 2.0.0-beta.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.
- package/README.md +53 -13
- package/dist/api.d.ts +24 -15
- package/dist/api.d.ts.map +1 -1
- package/dist/chunk-SPUUNLXI.js +824 -0
- package/dist/chunk-SPUUNLXI.js.map +1 -0
- package/dist/create-s3-client.d.ts +1 -1
- package/dist/create-s3-client.d.ts.map +1 -1
- package/dist/engine.d.ts +15 -1
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +204 -512
- package/dist/engine.js.map +1 -1
- package/dist/helpers/format-accept-labels.d.ts +15 -2
- package/dist/helpers/format-accept-labels.d.ts.map +1 -1
- package/dist/helpers/format-date.d.ts +7 -0
- package/dist/helpers/format-date.d.ts.map +1 -0
- package/dist/helpers/format-dimah-error.d.ts +12 -2
- package/dist/helpers/format-dimah-error.d.ts.map +1 -1
- package/dist/helpers/format-file-size.d.ts +20 -0
- package/dist/helpers/format-file-size.d.ts.map +1 -0
- package/dist/helpers/format-speed.d.ts +1 -1
- package/dist/helpers/format-speed.d.ts.map +1 -1
- package/dist/helpers/format-upload-progress.d.ts +1 -1
- package/dist/helpers/format-upload-progress.d.ts.map +1 -1
- package/dist/helpers/index.d.ts +5 -8
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/load-route-catalog.d.ts +32 -8
- package/dist/helpers/load-route-catalog.d.ts.map +1 -1
- package/dist/helpers/throttled-speed.d.ts +2 -2
- package/dist/helpers/throttled-speed.d.ts.map +1 -1
- package/dist/helpers/to-timestamp.d.ts +5 -0
- package/dist/helpers/to-timestamp.d.ts.map +1 -0
- package/dist/helpers/truncate-file-name.d.ts +8 -0
- package/dist/helpers/truncate-file-name.d.ts.map +1 -0
- package/dist/helpers/use-format-accept-labels.d.ts +12 -0
- package/dist/helpers/use-format-accept-labels.d.ts.map +1 -0
- package/dist/helpers/use-format-eta.d.ts +14 -0
- package/dist/helpers/use-format-eta.d.ts.map +1 -0
- package/dist/helpers/use-format-speed.d.ts +12 -0
- package/dist/helpers/use-format-speed.d.ts.map +1 -0
- package/dist/hooks/use-delete.d.ts +6 -44
- package/dist/hooks/use-delete.d.ts.map +1 -1
- package/dist/hooks/use-download.d.ts +7 -117
- package/dist/hooks/use-download.d.ts.map +1 -1
- package/dist/hooks/use-fetch-download.d.ts +8 -0
- package/dist/hooks/use-fetch-download.d.ts.map +1 -0
- package/dist/hooks/use-file-intake.d.ts +43 -29
- package/dist/hooks/use-file-intake.d.ts.map +1 -1
- package/dist/hooks/use-file-upload.d.ts +38 -34
- package/dist/hooks/use-file-upload.d.ts.map +1 -1
- package/dist/hooks/use-object-list-selection.d.ts +78 -0
- package/dist/hooks/use-object-list-selection.d.ts.map +1 -0
- package/dist/hooks/use-object-list.d.ts +66 -16
- package/dist/hooks/use-object-list.d.ts.map +1 -1
- package/dist/hooks/use-object-url.d.ts +27 -10
- package/dist/hooks/use-object-url.d.ts.map +1 -1
- package/dist/hooks/use-route-upload-policy.d.ts +22 -14
- package/dist/hooks/use-route-upload-policy.d.ts.map +1 -1
- package/dist/hooks/use-upload.d.ts +72 -65
- package/dist/hooks/use-upload.d.ts.map +1 -1
- package/dist/index.d.ts +15 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2420 -2164
- package/dist/index.js.map +1 -1
- package/dist/internal/abortable.d.ts +9 -0
- package/dist/internal/abortable.d.ts.map +1 -0
- package/dist/internal/browser-download.d.ts +15 -0
- package/dist/internal/browser-download.d.ts.map +1 -0
- package/dist/internal/callbacks.d.ts +54 -0
- package/dist/internal/callbacks.d.ts.map +1 -0
- package/dist/internal/client-error.d.ts +15 -0
- package/dist/internal/client-error.d.ts.map +1 -0
- package/dist/internal/hooks.d.ts +27 -0
- package/dist/internal/hooks.d.ts.map +1 -0
- package/dist/internal/lru.d.ts +13 -0
- package/dist/internal/lru.d.ts.map +1 -0
- package/dist/internal/operations.d.ts +74 -0
- package/dist/internal/operations.d.ts.map +1 -0
- package/dist/internal/pool.d.ts +8 -0
- package/dist/internal/pool.d.ts.map +1 -0
- package/dist/list/entries.d.ts +14 -0
- package/dist/list/entries.d.ts.map +1 -0
- package/dist/list/memory-object-source.d.ts +60 -0
- package/dist/list/memory-object-source.d.ts.map +1 -0
- package/dist/list/types.d.ts +123 -11
- package/dist/list/types.d.ts.map +1 -1
- package/dist/s3-provider.d.ts +3 -2
- package/dist/s3-provider.d.ts.map +1 -1
- package/dist/store/local-storage-store.d.ts +5 -4
- package/dist/store/local-storage-store.d.ts.map +1 -1
- package/dist/store/memory-store.d.ts +3 -4
- package/dist/store/memory-store.d.ts.map +1 -1
- package/dist/translations/types.d.ts +105 -23
- package/dist/translations/types.d.ts.map +1 -1
- package/dist/types/delete.d.ts +98 -9
- package/dist/types/delete.d.ts.map +1 -1
- package/dist/types/download.d.ts +152 -23
- package/dist/types/download.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/operation.d.ts +38 -0
- package/dist/types/operation.d.ts.map +1 -0
- package/dist/types/upload-store.d.ts +30 -40
- package/dist/types/upload-store.d.ts.map +1 -1
- package/dist/types/upload.d.ts +177 -130
- package/dist/types/upload.d.ts.map +1 -1
- package/dist/upload/abort.d.ts +10 -0
- package/dist/upload/abort.d.ts.map +1 -0
- package/dist/upload/constants.d.ts +8 -3
- package/dist/upload/constants.d.ts.map +1 -1
- package/dist/upload/index.d.ts +3 -2
- package/dist/upload/index.d.ts.map +1 -1
- package/dist/upload/multipart.d.ts +14 -4
- package/dist/upload/multipart.d.ts.map +1 -1
- package/dist/upload/part-pool.d.ts +16 -0
- package/dist/upload/part-pool.d.ts.map +1 -0
- package/dist/upload/presigned-http.d.ts +5 -14
- package/dist/upload/presigned-http.d.ts.map +1 -1
- package/dist/upload/progress.d.ts +7 -0
- package/dist/upload/progress.d.ts.map +1 -0
- package/dist/upload/request.d.ts +9 -0
- package/dist/upload/request.d.ts.map +1 -0
- package/dist/upload/resume-key.d.ts +7 -3
- package/dist/upload/resume-key.d.ts.map +1 -1
- package/dist/upload/retry.d.ts +27 -2
- package/dist/upload/retry.d.ts.map +1 -1
- package/dist/upload/stored-upload.d.ts +7 -0
- package/dist/upload/stored-upload.d.ts.map +1 -0
- package/dist/upload/upload-file.d.ts +10 -11
- package/dist/upload/upload-file.d.ts.map +1 -1
- package/dist/upload/upload-part.d.ts +6 -3
- package/dist/upload/upload-part.d.ts.map +1 -1
- package/dist/upload/xhr-upload.d.ts +10 -2
- package/dist/upload/xhr-upload.d.ts.map +1 -1
- package/package.json +7 -8
- package/dist/helpers/format-eta.d.ts +0 -13
- package/dist/helpers/format-eta.d.ts.map +0 -1
- package/dist/helpers/format-validate-file-error.d.ts +0 -9
- package/dist/helpers/format-validate-file-error.d.ts.map +0 -1
- package/dist/hooks/index.d.ts +0 -7
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/internal-helpers.d.ts +0 -10
- package/dist/internal-helpers.d.ts.map +0 -1
- package/dist/store/use-immer-state.d.ts +0 -8
- package/dist/store/use-immer-state.d.ts.map +0 -1
- package/dist/types/error.d.ts +0 -27
- package/dist/types/error.d.ts.map +0 -1
- package/dist/upload/upload-files.d.ts +0 -26
- package/dist/upload/upload-files.d.ts.map +0 -1
|
@@ -1,24 +1,32 @@
|
|
|
1
|
-
import type { S3Api, S3RouteName } from "@dimah-s3/core";
|
|
2
|
-
import { type RouteUploadPolicy } from "../helpers/load-route-catalog.js";
|
|
3
|
-
|
|
4
|
-
export type
|
|
1
|
+
import type { APIError, S3Api, S3RouteName } from "@dimah-s3/core";
|
|
2
|
+
import { type RouteUploadPolicy, type RouteUploadPolicyOptions } from "../helpers/load-route-catalog.js";
|
|
3
|
+
/** Where the route catalog (`GET /routes`) is in loading. */
|
|
4
|
+
export type CatalogLoadStatus = "loading" | "ready" | "error";
|
|
5
|
+
/** Options for {@link useRouteUploadPolicy}. */
|
|
6
|
+
export type UseRouteUploadPolicyOptions = RouteUploadPolicyOptions & {
|
|
7
|
+
/** Optional when an `<S3Provider>` is in the tree. */
|
|
5
8
|
api?: S3Api;
|
|
6
9
|
route: S3RouteName;
|
|
7
10
|
};
|
|
11
|
+
/** The route's upload policy narrowed by the options, plus the catalog state. */
|
|
8
12
|
export type UseRouteUploadPolicyReturn = RouteUploadPolicy & {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
catalogError: Error | null;
|
|
13
|
+
status: CatalogLoadStatus;
|
|
14
|
+
/** Why the catalog failed to load, when `status` is `"error"`. */
|
|
15
|
+
error: APIError | null;
|
|
13
16
|
};
|
|
14
17
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* `checksum
|
|
18
|
+
* The upload policy of a named route: the route catalog narrowed by the
|
|
19
|
+
* options. The stricter `accept` and `maxFileSize` win, `multipart` needs the
|
|
20
|
+
* route and an option that is not `false`, and `checksum` follows the route.
|
|
18
21
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* so
|
|
22
|
+
* Until the catalog loads, and when it fails, only the options apply and
|
|
23
|
+
* neither multipart nor checksums are on. The catalog is cached per `S3Api`,
|
|
24
|
+
* so every hook for the same API shares one request.
|
|
22
25
|
*/
|
|
23
26
|
export declare function useRouteUploadPolicy(options: UseRouteUploadPolicyOptions): UseRouteUploadPolicyReturn;
|
|
27
|
+
/**
|
|
28
|
+
* @internal {@link useRouteUploadPolicy} plus a function that loads the
|
|
29
|
+
* catalog again, such as after it failed.
|
|
30
|
+
*/
|
|
31
|
+
export declare function useRouteUploadPolicyState(options: UseRouteUploadPolicyOptions): [policy: UseRouteUploadPolicyReturn, reload: () => void];
|
|
24
32
|
//# sourceMappingURL=use-route-upload-policy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-route-upload-policy.d.ts","sourceRoot":"","sources":["../../src/hooks/use-route-upload-policy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"use-route-upload-policy.d.ts","sourceRoot":"","sources":["../../src/hooks/use-route-upload-policy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,QAAQ,EAER,KAAK,EACL,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC9B,MAAM,8BAA8B,CAAC;AAEtC,6DAA6D;AAC7D,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;AAE9D,gDAAgD;AAChD,MAAM,MAAM,2BAA2B,GAAG,wBAAwB,GAAG;IACnE,sDAAsD;IACtD,GAAG,CAAC,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE,WAAW,CAAC;CACpB,CAAC;AAEF,iFAAiF;AACjF,MAAM,MAAM,0BAA0B,GAAG,iBAAiB,GAAG;IAC3D,MAAM,EAAE,iBAAiB,CAAC;IAC1B,kEAAkE;IAClE,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAC;CACxB,CAAC;AAUF;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,2BAA2B,GACnC,0BAA0B,CAE5B;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,2BAA2B,GACnC,CAAC,MAAM,EAAE,0BAA0B,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC,CAgD1D"}
|
|
@@ -1,91 +1,98 @@
|
|
|
1
|
-
import type { APIError
|
|
2
|
-
import type {
|
|
3
|
-
import {
|
|
1
|
+
import type { APIError } from "@dimah-s3/core";
|
|
2
|
+
import type { TransferProgress } from "../types/operation.js";
|
|
3
|
+
import type { FileRejection, UploadBatchResult, UploadCallOptions, UploadFileState, UploadPhase, UseUploadOptions } from "../types/upload.js";
|
|
4
|
+
import { type DropTargetProps, type DropzoneInputProps, type DropzoneRootProps, type UploadCallInput } from "./use-file-intake";
|
|
4
5
|
import { type UseRouteUploadPolicyReturn } from "./use-route-upload-policy";
|
|
5
|
-
export type { DropzoneInputProps, DropzoneRootProps
|
|
6
|
-
|
|
6
|
+
export type { DropTargetProps, DropzoneInputProps, DropzoneRootProps };
|
|
7
|
+
export type { FileRejection, UseUploadOptions } from "../types/upload.js";
|
|
8
|
+
/**
|
|
9
|
+
* The route's upload policy narrowed by the hook options: the stricter
|
|
10
|
+
* `accept` and `maxFileSize` win, `multipart` needs the route and an option
|
|
11
|
+
* that is not `false`, and `checksum` follows the route.
|
|
12
|
+
*/
|
|
7
13
|
export type UploadPolicy = UseRouteUploadPolicyReturn & {
|
|
8
|
-
/** Max files per
|
|
14
|
+
/** Max files per call. @default 1 */
|
|
9
15
|
maxFiles: number;
|
|
10
16
|
};
|
|
11
|
-
/**
|
|
12
|
-
export type UseUploadOptions = FileUploadConfig & UploadHooks & {
|
|
13
|
-
/** S3Api. Optional when an `<S3Provider>` is present in the tree. */
|
|
14
|
-
api?: S3Api;
|
|
15
|
-
/** Static request options applied to every file. */
|
|
16
|
-
uploadOptions?: UploadRequestOptions;
|
|
17
|
-
/** Per-file request options (overrides `uploadOptions`). */
|
|
18
|
-
getUploadOptions?: (file: File) => UploadRequestOptions;
|
|
19
|
-
/** Disable all intake interactions. */
|
|
20
|
-
disabled?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Disable drag interactions on the root (button-style custom UIs).
|
|
23
|
-
* `UploadButton` does not bind `getRootProps` — it only uses `open()`.
|
|
24
|
-
* @default false
|
|
25
|
-
*/
|
|
26
|
-
noDrag?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Disable click-to-open on the root (when opening via `open()` on a button).
|
|
29
|
-
* @default false
|
|
30
|
-
*/
|
|
31
|
-
noClick?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Disable keyboard activation on the root.
|
|
34
|
-
* @default false
|
|
35
|
-
*/
|
|
36
|
-
noKeyboard?: boolean;
|
|
37
|
-
/** Called when dropzone soft-rejects files (type/size/count). */
|
|
38
|
-
onFileReject?: (rejections: readonly FileRejection[]) => void;
|
|
39
|
-
};
|
|
17
|
+
/** What {@link useUpload} returns. */
|
|
40
18
|
export type UseUploadReturn = {
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
/**
|
|
19
|
+
/** Stable for the life of the component. Toast owners use it. */
|
|
20
|
+
instanceId: string;
|
|
21
|
+
/** Every file in the queue, in the order it was added. */
|
|
22
|
+
files: readonly UploadFileState[];
|
|
23
|
+
/** The first file, or `null`. Handy when `maxFiles` is 1. */
|
|
44
24
|
file: UploadFileState | null;
|
|
45
|
-
/**
|
|
25
|
+
/** `uploading` while a call is preparing or a file is in flight. */
|
|
46
26
|
phase: UploadPhase;
|
|
47
|
-
/**
|
|
48
|
-
progress:
|
|
49
|
-
/**
|
|
27
|
+
/** Bytes sent across every file in the queue. */
|
|
28
|
+
progress: TransferProgress;
|
|
29
|
+
/** The one failed file's error, or `PARTIAL_FAILURE` when several failed. */
|
|
50
30
|
error: APIError | null;
|
|
51
|
-
/** `true` while
|
|
52
|
-
isUploading: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* `true` while the upload is in-flight (`validating`, `presigning`,
|
|
55
|
-
* `uploading`, or `finalizing`).
|
|
56
|
-
*/
|
|
31
|
+
/** `true` while `phase` is `uploading`. */
|
|
57
32
|
isPending: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Resolved client constraints: catalog values plus hook overrides,
|
|
60
|
-
* and `maxFiles` (default 1).
|
|
61
|
-
*/
|
|
62
33
|
policy: UploadPolicy;
|
|
63
|
-
/** `true` when an `uploadStore` is
|
|
34
|
+
/** `true` when an `uploadStore` is set, so multipart uploads can resume. */
|
|
64
35
|
resumable: boolean;
|
|
65
36
|
/**
|
|
66
|
-
*
|
|
37
|
+
* The `disabled` option: the root, drop targets, paste and `open()` do
|
|
38
|
+
* nothing. Render pickers and paste handlers disabled while it is set;
|
|
39
|
+
* `handleFiles` still uploads what it is given.
|
|
40
|
+
*/
|
|
41
|
+
disabled: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Validates and uploads files from a picker, a drop, a paste or your own
|
|
44
|
+
* code. Invalid files are rejected without stopping the others. Resolves
|
|
45
|
+
* once every file has ended.
|
|
67
46
|
*/
|
|
68
|
-
handleFiles: (files: FileList | File[] | File | null) => Promise<
|
|
69
|
-
/**
|
|
70
|
-
open: () => void;
|
|
71
|
-
/** Abort and reset to idle. */
|
|
72
|
-
cancel: () => void;
|
|
47
|
+
handleFiles: (files: FileList | readonly File[] | File | null, call?: UploadCallOptions) => Promise<UploadBatchResult>;
|
|
48
|
+
/** Opens the native file picker. `call` applies to the picked files. */
|
|
49
|
+
open: (call?: UploadCallOptions) => void;
|
|
73
50
|
/**
|
|
74
|
-
*
|
|
75
|
-
*
|
|
51
|
+
* Uploads the failed file `id` again, or every failed file. Each file goes
|
|
52
|
+
* with the options of the call it came from: it is validated again, and
|
|
53
|
+
* `beforeUpload` and `onUploadStart` run again. It keeps its place and
|
|
54
|
+
* `id` in the queue, and a retry never replaces the queue. Resolves like
|
|
55
|
+
* `handleFiles`; with nothing to retry, at once and without callbacks.
|
|
76
56
|
*/
|
|
57
|
+
retry: (id?: string) => Promise<UploadBatchResult>;
|
|
58
|
+
/** Cancels one file by `id`, or every file. */
|
|
59
|
+
cancel: (id?: string) => void;
|
|
60
|
+
/** Stops every file but keeps stored multipart uploads for resuming. */
|
|
77
61
|
detach: () => void;
|
|
62
|
+
/** Removes settled files and rejections. Stable identity. */
|
|
78
63
|
reset: () => void;
|
|
79
|
-
/**
|
|
80
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Spread on a dropzone: drag and drop, paste, click and keyboard to open
|
|
66
|
+
* the picker. `call` applies to the files it takes in.
|
|
67
|
+
*/
|
|
68
|
+
getRootProps: <T extends DropzoneRootProps>(props?: T, call?: UploadCallInput) => T;
|
|
69
|
+
/**
|
|
70
|
+
* Drag and drop handlers only: no `tabIndex`, no click or keyboard, no
|
|
71
|
+
* `role`. For drop targets that keep their own interactions, such as
|
|
72
|
+
* folder rows. A drop on a target inside a dropzone uses the target's
|
|
73
|
+
* `call`.
|
|
74
|
+
*/
|
|
75
|
+
getDropTargetProps: <T extends object = DropTargetProps>(props?: T & DropTargetProps, call?: UploadCallInput) => T & DropTargetProps;
|
|
81
76
|
/** Spread on a hidden `<input type="file">`. */
|
|
82
77
|
getInputProps: <T extends DropzoneInputProps>(props?: T) => T;
|
|
83
|
-
/** `true` while
|
|
78
|
+
/** `true` while files are dragged over a dropzone or drop target. */
|
|
84
79
|
isDragActive: boolean;
|
|
80
|
+
/** `true` while the dragged files match `accept` and `maxFiles`. */
|
|
85
81
|
isDragAccept: boolean;
|
|
82
|
+
/** `true` while the dragged files break `accept` or `maxFiles`. */
|
|
86
83
|
isDragReject: boolean;
|
|
87
|
-
/**
|
|
84
|
+
/** Files the newest call rejected for their type, size or count. */
|
|
88
85
|
fileRejections: readonly FileRejection[];
|
|
89
86
|
};
|
|
87
|
+
/**
|
|
88
|
+
* Uploads files to a named route through a queue.
|
|
89
|
+
*
|
|
90
|
+
* Every call validates its files against the route policy from the catalog
|
|
91
|
+
* and rejects the invalid ones with catalog error codes, so
|
|
92
|
+
* `useFormatDimahError` can show them. Valid files upload `concurrentFiles`
|
|
93
|
+
* at a time, and each one can be cancelled with `cancel(id)`. A call's
|
|
94
|
+
* `uploadOptions` merge over the hook's: call fields win, and `metadata`
|
|
95
|
+
* merges key by key.
|
|
96
|
+
*/
|
|
90
97
|
export declare function useUpload(options: UseUploadOptions): UseUploadReturn;
|
|
91
98
|
//# sourceMappingURL=use-upload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-upload.d.ts","sourceRoot":"","sources":["../../src/hooks/use-upload.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-upload.d.ts","sourceRoot":"","sources":["../../src/hooks/use-upload.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI/C,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UploadPhase, UploadFileInfo, UploadFileState, UploadRequestOptions, UploadHooks, UploadTransport, S3ApiUploadTransport, RetryConfig, FileUploadConfig, } from "./types/upload";
|
|
2
|
-
export type { StoredUpload, UploadStore } from "./types/upload-store";
|
|
3
|
-
export type { DownloadPhase, DownloadHooks, FetchDownloadPhase, FetchDownloadProgress, FetchDownloadHooks, } from "./types/download";
|
|
4
|
-
export type { DeletePhase, DeleteHooks } from "./types/delete";
|
|
5
|
-
export { S3UploadError } from "./types/error";
|
|
6
|
-
export { APIError, S3_ERROR_CODES, buildObjectKey, fileNameFromKey, formatFileSize, resolveInlineDisposition, isAPIError, isS3ErrorCode, sanitizeFileName, validateFile, sha256Base64, sha256File, matchesMagicBytes, sniffContentType, buildPublicObjectUrl, buildContentDisposition, type FormatFileSizeOptions, type S3Api, type S3ErrorCode, type ValidateFileError, type InferS3Routes, type DimahS3Routes, type S3RouteName, type RouteCatalogResponse, } from "@dimah-s3/core";
|
|
7
|
-
export { defineApi } from "./api";
|
|
8
|
-
export { createS3Client, type CreateS3ClientOptions, type CreateS3ClientResult, type ReactS3Client, } from "./create-s3-client";
|
|
9
1
|
export { S3Provider, useApi, type S3ProviderProps } from "./s3-provider";
|
|
10
|
-
|
|
2
|
+
export { createS3Client, type ReactS3Client } from "./create-s3-client";
|
|
3
|
+
/** Generated key map. Use it with `satisfies Partial<Translations>`. */
|
|
11
4
|
export type { Translations } from "./translations";
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export
|
|
16
|
-
export { useUpload, type UseUploadOptions, type UseUploadReturn, type UploadPolicy, type FileRejection, type DropzoneRootProps, type DropzoneInputProps, } from "./hooks/use-upload";
|
|
17
|
-
export { useDownload, isFetchDownload, type UseDownloadOptions, type UseDownloadReturn, type UseNavigateDownloadOptions, type UseNavigateDownloadReturn, type UseFetchDownloadOptions, type UseFetchDownloadState, type UseFetchDownloadReturn, } from "./hooks/use-download";
|
|
18
|
-
export { useDelete, type UseDeleteOptions, type UseDeleteState, type UseDeleteReturn, } from "./hooks/use-delete";
|
|
19
|
-
export { useRouteUploadPolicy, type CatalogLoadStatus, type UseRouteUploadPolicyOptions, type UseRouteUploadPolicyReturn, } from "./hooks/use-route-upload-policy";
|
|
5
|
+
export { useUpload, type DropTargetProps, type DropzoneInputProps, type DropzoneRootProps, type UploadPolicy, type UseUploadReturn, } from "./hooks/use-upload";
|
|
6
|
+
export { useDownload } from "./hooks/use-download";
|
|
7
|
+
export { useFetchDownload } from "./hooks/use-fetch-download";
|
|
8
|
+
export { useDelete } from "./hooks/use-delete";
|
|
20
9
|
export { useObjectUrl, type UseObjectUrlOptions, type UseObjectUrlReturn, } from "./hooks/use-object-url";
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
10
|
+
export { useRouteUploadPolicy, type CatalogLoadStatus, type UseRouteUploadPolicyOptions, type UseRouteUploadPolicyReturn, } from "./hooks/use-route-upload-policy";
|
|
11
|
+
export { useObjectList, type UseObjectListReturn, } from "./hooks/use-object-list";
|
|
12
|
+
export { useObjectListSelection, type ObjectListSelectionMode, type UseObjectListSelectionOptions, type UseObjectListSelectionReturn, } from "./hooks/use-object-list-selection";
|
|
13
|
+
export { useFormatAcceptLabels, useFormatDate, useFormatDimahError, useFormatEta, useFormatFileSize, useFormatNumber, useFormatSpeed, type DateInput, } from "./helpers";
|
|
14
|
+
export type * from "./types";
|
|
15
|
+
export type * from "./list/types";
|
|
16
|
+
export type { RouteUploadPolicy, RouteUploadPolicyOptions, } from "./helpers/load-route-catalog";
|
|
17
|
+
export type { MemoryObjectSourceOptions } from "./list/memory-object-source";
|
|
18
|
+
export type { ObjectListLevel } from "./list/read-object-list-level";
|
|
23
19
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","source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