@uploadista/react-native-core 0.0.20-beta.9 → 0.1.0-beta.5

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/dist/index.d.mts CHANGED
@@ -4,7 +4,7 @@ import * as _uploadista_client_core3 from "@uploadista/client-core";
4
4
  import { Base64Service, ConnectionMetrics, ConnectionPoolConfig, ConnectionPoolConfig as ConnectionPoolConfig$1, DetailedConnectionMetrics, FileReaderService, FlowManager, FlowManagerCallbacks, FlowUploadOptions, FlowUploadState, FlowUploadState as FlowUploadState$1, FlowUploadStatus, FlowUploadStatus as FlowUploadStatus$1, HttpClient, IdGenerationService, InputExecutionState, InputExecutionState as InputExecutionState$1, ServiceContainer, ServiceContainer as ServiceContainer$1, StorageService, UploadState, UploadStatus, UploadistaClientOptions, UploadistaEvent } from "@uploadista/client-core";
5
5
  import { TypedOutput } from "@uploadista/core/flow";
6
6
  import { UploadFile } from "@uploadista/core/types";
7
- import * as react_jsx_runtime12 from "react/jsx-runtime";
7
+ import * as react_jsx_runtime13 from "react/jsx-runtime";
8
8
  import * as _uploadista_core0 from "@uploadista/core";
9
9
 
10
10
  //#region src/types/types.d.ts
@@ -138,7 +138,7 @@ type UploadState$1 = "idle" | "pending" | "uploading" | "success" | "error" | "c
138
138
  /**
139
139
  * Upload progress information
140
140
  */
141
- interface UploadProgress$1 {
141
+ interface UploadProgress$2 {
142
142
  /** Current state of upload */
143
143
  state: UploadState$1;
144
144
  /** Progress percentage (0-100) */
@@ -157,13 +157,13 @@ interface UploadProgress$1 {
157
157
  /**
158
158
  * Multi-file upload item
159
159
  */
160
- interface UploadItem {
160
+ interface UploadItem$1 {
161
161
  /** Unique identifier for this upload */
162
162
  id: string;
163
163
  /** File information */
164
164
  file: FilePickResult;
165
165
  /** Upload progress */
166
- progress: UploadProgress$1;
166
+ progress: UploadProgress$2;
167
167
  /** Result from server if successful */
168
168
  result?: UploadFile;
169
169
  }
@@ -283,7 +283,7 @@ declare function CameraUploadButton({
283
283
  onError,
284
284
  onCancel,
285
285
  showProgress
286
- }: CameraUploadButtonProps): react_jsx_runtime12.JSX.Element;
286
+ }: CameraUploadButtonProps): react_jsx_runtime13.JSX.Element;
287
287
  //#endregion
288
288
  //#region src/components/FileUploadButton.d.ts
289
289
  interface FileUploadButtonProps {
@@ -314,75 +314,7 @@ declare function FileUploadButton({
314
314
  onError,
315
315
  onCancel,
316
316
  showProgress
317
- }: FileUploadButtonProps): react_jsx_runtime12.JSX.Element;
318
- //#endregion
319
- //#region src/components/GalleryUploadButton.d.ts
320
- interface GalleryUploadButtonProps {
321
- /** Options for gallery upload */
322
- options?: UseGalleryUploadOptions;
323
- /** Button label text */
324
- label?: string;
325
- /** Custom button content */
326
- children?: ReactNode;
327
- /** Callback when all uploads complete successfully */
328
- onSuccess?: (results: unknown[]) => void;
329
- /** Callback when any upload fails */
330
- onError?: (error: Error) => void;
331
- /** Callback when upload is cancelled */
332
- onCancel?: () => void;
333
- /** Whether to show individual progress for each file */
334
- showProgress?: boolean;
335
- }
336
- /**
337
- * Button component for gallery selection and batch upload
338
- * Triggers gallery picker on press and handles concurrent uploads
339
- */
340
- declare function GalleryUploadButton({
341
- options,
342
- label,
343
- children,
344
- onSuccess,
345
- onError,
346
- onCancel,
347
- showProgress
348
- }: GalleryUploadButtonProps): react_jsx_runtime12.JSX.Element;
349
- //#endregion
350
- //#region src/components/UploadList.d.ts
351
- interface UploadListProps {
352
- /** List of upload items to display */
353
- items: UploadItem[];
354
- /** Callback when remove item is pressed */
355
- onRemove?: (id: string) => void;
356
- /** Callback when item is pressed */
357
- onItemPress?: (item: UploadItem) => void;
358
- /** Whether to show remove button */
359
- showRemoveButton?: boolean;
360
- }
361
- /**
362
- * Component to display a list of upload items with individual progress
363
- * Shows status indicators and allows removal of items
364
- */
365
- declare function UploadList({
366
- items,
367
- onRemove,
368
- onItemPress,
369
- showRemoveButton
370
- }: UploadListProps): react_jsx_runtime12.JSX.Element;
371
- //#endregion
372
- //#region src/components/UploadProgress.d.ts
373
- interface UploadProgressProps {
374
- /** Upload state information */
375
- state: UploadState;
376
- /** Optional custom label */
377
- label?: string;
378
- }
379
- /**
380
- * Component to display upload progress with percentage, size, and speed
381
- */
382
- declare function UploadProgress({
383
- state,
384
- label
385
- }: UploadProgressProps): react_jsx_runtime12.JSX.Element;
317
+ }: FileUploadButtonProps): react_jsx_runtime13.JSX.Element;
386
318
  //#endregion
387
319
  //#region src/hooks/use-flow.d.ts
388
320
  /**
@@ -727,7 +659,7 @@ declare function FlowRoot({
727
659
  onProgress,
728
660
  onFlowComplete,
729
661
  children
730
- }: FlowProps): react_jsx_runtime12.JSX.Element;
662
+ }: FlowProps): react_jsx_runtime13.JSX.Element;
731
663
  /**
732
664
  * Render props for Flow.Inputs component.
733
665
  */
@@ -764,7 +696,7 @@ interface FlowInputsProps {
764
696
  */
765
697
  declare function FlowInputs({
766
698
  children
767
- }: FlowInputsProps): react_jsx_runtime12.JSX.Element;
699
+ }: FlowInputsProps): react_jsx_runtime13.JSX.Element;
768
700
  /**
769
701
  * Props for Flow.Input component.
770
702
  */
@@ -794,7 +726,7 @@ interface FlowInputProps {
794
726
  declare function FlowInput({
795
727
  nodeId,
796
728
  children
797
- }: FlowInputProps): react_jsx_runtime12.JSX.Element | null;
729
+ }: FlowInputProps): react_jsx_runtime13.JSX.Element | null;
798
730
  /**
799
731
  * Render props for Flow.Input.FilePicker component.
800
732
  */
@@ -829,7 +761,7 @@ interface FlowInputFilePickerProps {
829
761
  */
830
762
  declare function FlowInputFilePicker({
831
763
  children
832
- }: FlowInputFilePickerProps): react_jsx_runtime12.JSX.Element;
764
+ }: FlowInputFilePickerProps): react_jsx_runtime13.JSX.Element;
833
765
  /**
834
766
  * Render props for Flow.Input.Preview component.
835
767
  */
@@ -861,7 +793,7 @@ interface FlowInputPreviewProps {
861
793
  */
862
794
  declare function FlowInputPreview({
863
795
  children
864
- }: FlowInputPreviewProps): react_jsx_runtime12.JSX.Element;
796
+ }: FlowInputPreviewProps): react_jsx_runtime13.JSX.Element;
865
797
  /**
866
798
  * Render props for Flow.Progress component.
867
799
  */
@@ -887,7 +819,7 @@ interface FlowProgressProps {
887
819
  */
888
820
  declare function FlowProgress({
889
821
  children
890
- }: FlowProgressProps): react_jsx_runtime12.JSX.Element;
822
+ }: FlowProgressProps): react_jsx_runtime13.JSX.Element;
891
823
  /**
892
824
  * Render props for Flow.Status component.
893
825
  */
@@ -919,7 +851,7 @@ interface FlowStatusProps {
919
851
  */
920
852
  declare function FlowStatus({
921
853
  children
922
- }: FlowStatusProps): react_jsx_runtime12.JSX.Element;
854
+ }: FlowStatusProps): react_jsx_runtime13.JSX.Element;
923
855
  /**
924
856
  * Render props for Flow.Error component.
925
857
  */
@@ -945,7 +877,7 @@ interface FlowErrorProps {
945
877
  */
946
878
  declare function FlowError({
947
879
  children
948
- }: FlowErrorProps): react_jsx_runtime12.JSX.Element;
880
+ }: FlowErrorProps): react_jsx_runtime13.JSX.Element;
949
881
  /**
950
882
  * Render props for Flow.Submit component.
951
883
  */
@@ -974,7 +906,7 @@ interface FlowSubmitProps {
974
906
  declare function FlowSubmit({
975
907
  children,
976
908
  disabled
977
- }: FlowSubmitProps): react_jsx_runtime12.JSX.Element;
909
+ }: FlowSubmitProps): react_jsx_runtime13.JSX.Element;
978
910
  /**
979
911
  * Render props for Flow.Cancel component.
980
912
  */
@@ -996,7 +928,7 @@ interface FlowCancelProps {
996
928
  */
997
929
  declare function FlowCancel({
998
930
  children
999
- }: FlowCancelProps): react_jsx_runtime12.JSX.Element;
931
+ }: FlowCancelProps): react_jsx_runtime13.JSX.Element;
1000
932
  /**
1001
933
  * Render props for Flow.Reset component.
1002
934
  */
@@ -1018,7 +950,7 @@ interface FlowResetProps {
1018
950
  */
1019
951
  declare function FlowReset({
1020
952
  children
1021
- }: FlowResetProps): react_jsx_runtime12.JSX.Element;
953
+ }: FlowResetProps): react_jsx_runtime13.JSX.Element;
1022
954
  /**
1023
955
  * Render props for Flow.QuickUpload component.
1024
956
  */
@@ -1059,7 +991,7 @@ interface FlowQuickUploadProps {
1059
991
  */
1060
992
  declare function FlowQuickUpload({
1061
993
  children
1062
- }: FlowQuickUploadProps): react_jsx_runtime12.JSX.Element;
994
+ }: FlowQuickUploadProps): react_jsx_runtime13.JSX.Element;
1063
995
  /**
1064
996
  * Flow compound component for flow-based file uploads on React Native.
1065
997
  *
@@ -1122,6 +1054,748 @@ declare const Flow: typeof FlowRoot & {
1122
1054
  QuickUpload: typeof FlowQuickUpload;
1123
1055
  };
1124
1056
  //#endregion
1057
+ //#region src/components/GalleryUploadButton.d.ts
1058
+ interface GalleryUploadButtonProps {
1059
+ /** Options for gallery upload */
1060
+ options?: UseGalleryUploadOptions;
1061
+ /** Button label text */
1062
+ label?: string;
1063
+ /** Custom button content */
1064
+ children?: ReactNode;
1065
+ /** Callback when all uploads complete successfully */
1066
+ onSuccess?: (results: unknown[]) => void;
1067
+ /** Callback when any upload fails */
1068
+ onError?: (error: Error) => void;
1069
+ /** Callback when upload is cancelled */
1070
+ onCancel?: () => void;
1071
+ /** Whether to show individual progress for each file */
1072
+ showProgress?: boolean;
1073
+ }
1074
+ /**
1075
+ * Button component for gallery selection and batch upload
1076
+ * Triggers gallery picker on press and handles concurrent uploads
1077
+ */
1078
+ declare function GalleryUploadButton({
1079
+ options,
1080
+ label,
1081
+ children,
1082
+ onSuccess,
1083
+ onError,
1084
+ onCancel,
1085
+ showProgress
1086
+ }: GalleryUploadButtonProps): react_jsx_runtime13.JSX.Element;
1087
+ //#endregion
1088
+ //#region src/components/UploadList.d.ts
1089
+ interface UploadListProps {
1090
+ /** List of upload items to display */
1091
+ items: UploadItem$1[];
1092
+ /** Callback when remove item is pressed */
1093
+ onRemove?: (id: string) => void;
1094
+ /** Callback when item is pressed */
1095
+ onItemPress?: (item: UploadItem$1) => void;
1096
+ /** Whether to show remove button */
1097
+ showRemoveButton?: boolean;
1098
+ }
1099
+ /**
1100
+ * Component to display a list of upload items with individual progress
1101
+ * Shows status indicators and allows removal of items
1102
+ */
1103
+ declare function UploadList({
1104
+ items,
1105
+ onRemove,
1106
+ onItemPress,
1107
+ showRemoveButton
1108
+ }: UploadListProps): react_jsx_runtime13.JSX.Element;
1109
+ //#endregion
1110
+ //#region src/components/UploadProgress.d.ts
1111
+ interface UploadProgressProps$1 {
1112
+ /** Upload state information */
1113
+ state: UploadState;
1114
+ /** Optional custom label */
1115
+ label?: string;
1116
+ }
1117
+ /**
1118
+ * Component to display upload progress with percentage, size, and speed
1119
+ */
1120
+ declare function UploadProgress({
1121
+ state,
1122
+ label
1123
+ }: UploadProgressProps$1): react_jsx_runtime13.JSX.Element;
1124
+ //#endregion
1125
+ //#region src/hooks/use-multi-upload.d.ts
1126
+ interface UploadItemState {
1127
+ id: string;
1128
+ file: Extract<FilePickResult, {
1129
+ status: "success";
1130
+ }>;
1131
+ status: "idle" | "uploading" | "success" | "error" | "aborted";
1132
+ progress: number;
1133
+ bytesUploaded: number;
1134
+ totalBytes: number;
1135
+ error: Error | null;
1136
+ result: UploadFile | null;
1137
+ }
1138
+ interface MultiUploadState {
1139
+ items: UploadItemState[];
1140
+ totalProgress: number;
1141
+ totalUploaded: number;
1142
+ totalBytes: number;
1143
+ activeCount: number;
1144
+ completedCount: number;
1145
+ failedCount: number;
1146
+ }
1147
+ /**
1148
+ * Hook for managing multiple concurrent file uploads with progress tracking.
1149
+ * Each file is uploaded independently using the core upload client.
1150
+ *
1151
+ * Must be used within an UploadistaProvider.
1152
+ *
1153
+ * @param options - Multi-upload configuration options
1154
+ * @returns Multi-upload state and control methods
1155
+ *
1156
+ * @example
1157
+ * ```tsx
1158
+ * function MyComponent() {
1159
+ * const multiUpload = useMultiUpload({
1160
+ * maxConcurrent: 3,
1161
+ * onSuccess: (result) => console.log('File uploaded:', result),
1162
+ * onError: (error) => console.error('Upload failed:', error),
1163
+ * });
1164
+ *
1165
+ * const handlePickFiles = async () => {
1166
+ * const files = await fileSystemProvider.pickImage({ allowMultiple: true });
1167
+ * multiUpload.addFiles(files);
1168
+ * await multiUpload.startUploads();
1169
+ * };
1170
+ *
1171
+ * return (
1172
+ * <View>
1173
+ * <Button title="Pick Files" onPress={handlePickFiles} />
1174
+ * <Text>Progress: {multiUpload.state.totalProgress}%</Text>
1175
+ * <Text>Active: {multiUpload.state.activeCount}</Text>
1176
+ * <Text>Completed: {multiUpload.state.completedCount}/{multiUpload.state.items.length}</Text>
1177
+ * </View>
1178
+ * );
1179
+ * }
1180
+ * ```
1181
+ */
1182
+ declare function useMultiUpload(options?: UseMultiUploadOptions): {
1183
+ state: MultiUploadState;
1184
+ addFiles: (files: FilePickResult[]) => string[];
1185
+ startUploads: (itemIds?: string[]) => Promise<void>;
1186
+ removeItem: (id: string) => void;
1187
+ abortItem: (id: string) => void;
1188
+ retryItem: (id: string) => Promise<void>;
1189
+ clear: () => void;
1190
+ };
1191
+ //#endregion
1192
+ //#region src/components/upload-primitives.d.ts
1193
+ /**
1194
+ * Context value provided by the Upload component root.
1195
+ * Contains all upload state and actions.
1196
+ */
1197
+ interface UploadContextValue {
1198
+ /** Whether in multi-file mode */
1199
+ mode: "single" | "multi";
1200
+ /** Current multi-upload state (aggregate) */
1201
+ state: MultiUploadState;
1202
+ /** Whether auto-start is enabled */
1203
+ autoStart: boolean;
1204
+ /** Add files to the upload queue */
1205
+ addFiles: (files: FilePickResult[]) => string[];
1206
+ /** Remove an item from the queue */
1207
+ removeItem: (id: string) => void;
1208
+ /** Start all pending uploads */
1209
+ startAll: (itemIds?: string[]) => Promise<void>;
1210
+ /** Abort a specific upload by ID */
1211
+ abortItem: (id: string) => void;
1212
+ /** Retry a specific failed upload by ID */
1213
+ retryItem: (id: string) => Promise<void>;
1214
+ /** Clear all items and reset state */
1215
+ clear: () => void;
1216
+ /** Internal handler for files received from picker */
1217
+ handleFilesReceived: (files: FilePickResult[]) => void;
1218
+ /** Pick a file using the file system provider */
1219
+ pickFile: () => Promise<FilePickResult | null>;
1220
+ /** Pick an image using the file system provider */
1221
+ pickImage: () => Promise<FilePickResult | null>;
1222
+ /** Take a photo using the camera */
1223
+ takePhoto: () => Promise<FilePickResult | null>;
1224
+ }
1225
+ /**
1226
+ * Hook to access upload context from within an Upload component.
1227
+ * @throws Error if used outside of an Upload component
1228
+ */
1229
+ declare function useUploadContext(): UploadContextValue;
1230
+ /**
1231
+ * Context value for a specific upload item within an Upload.
1232
+ */
1233
+ interface UploadItemContextValue {
1234
+ /** Item ID */
1235
+ id: string;
1236
+ /** The file being uploaded */
1237
+ file: Extract<FilePickResult, {
1238
+ status: "success";
1239
+ }>;
1240
+ /** Current upload state */
1241
+ state: {
1242
+ status: UploadItemState["status"];
1243
+ progress: number;
1244
+ bytesUploaded: number;
1245
+ totalBytes: number;
1246
+ error: Error | null;
1247
+ result: UploadFile | null;
1248
+ };
1249
+ /** Abort this upload */
1250
+ abort: () => void;
1251
+ /** Retry this upload */
1252
+ retry: () => Promise<void>;
1253
+ /** Remove this item from the queue */
1254
+ remove: () => void;
1255
+ }
1256
+ /**
1257
+ * Hook to access upload item context from within an Upload.Item component.
1258
+ * @throws Error if used outside of an Upload.Item component
1259
+ */
1260
+ declare function useUploadItemContext(): UploadItemContextValue;
1261
+ /**
1262
+ * Render props for the Upload root component.
1263
+ */
1264
+ interface UploadRenderProps extends UploadContextValue {}
1265
+ /**
1266
+ * Props for the Upload root component.
1267
+ */
1268
+ interface UploadProps {
1269
+ /** Whether to allow multiple file uploads (default: false) */
1270
+ multiple?: boolean;
1271
+ /** Maximum concurrent uploads (default: 3, only used in multi mode) */
1272
+ maxConcurrent?: number;
1273
+ /** Whether to auto-start uploads when files are received (default: true) */
1274
+ autoStart?: boolean;
1275
+ /** Metadata to attach to uploads */
1276
+ metadata?: Record<string, string>;
1277
+ /** Called when a single file upload succeeds */
1278
+ onSuccess?: (result: UploadFile) => void;
1279
+ /** Called when an upload fails */
1280
+ onError?: (error: Error) => void;
1281
+ /** Called when all uploads complete (multi mode) */
1282
+ onComplete?: (results: {
1283
+ successful: number;
1284
+ failed: number;
1285
+ total: number;
1286
+ }) => void;
1287
+ /** Children to render (can be render function or ReactNode) */
1288
+ children: ReactNode | ((props: UploadRenderProps) => ReactNode);
1289
+ }
1290
+ /**
1291
+ * Root component for file uploads on React Native.
1292
+ * Provides context for all Upload sub-components.
1293
+ * Supports both single-file and multi-file modes via the `multiple` prop.
1294
+ *
1295
+ * @example Single file upload
1296
+ * ```tsx
1297
+ * <Upload onSuccess={handleSuccess}>
1298
+ * <Upload.FilePicker>
1299
+ * {({ pick, isLoading }) => (
1300
+ * <Pressable onPress={pick}>
1301
+ * <Text>Select File</Text>
1302
+ * </Pressable>
1303
+ * )}
1304
+ * </Upload.FilePicker>
1305
+ * <Upload.Progress>
1306
+ * {({ progress, isUploading }) => (
1307
+ * isUploading && <Text>{progress}%</Text>
1308
+ * )}
1309
+ * </Upload.Progress>
1310
+ * </Upload>
1311
+ * ```
1312
+ *
1313
+ * @example Multi-file upload
1314
+ * ```tsx
1315
+ * <Upload multiple maxConcurrent={3} onComplete={handleComplete}>
1316
+ * <Upload.GalleryPicker>
1317
+ * {({ pick }) => (
1318
+ * <Pressable onPress={pick}>
1319
+ * <Text>Select Photos</Text>
1320
+ * </Pressable>
1321
+ * )}
1322
+ * </Upload.GalleryPicker>
1323
+ * <Upload.Items>
1324
+ * {({ items }) => items.map(item => (
1325
+ * <Upload.Item key={item.id} id={item.id}>
1326
+ * {({ file, state, abort, remove }) => (
1327
+ * <View>
1328
+ * <Text>{file.data.name}: {state.progress}%</Text>
1329
+ * </View>
1330
+ * )}
1331
+ * </Upload.Item>
1332
+ * ))}
1333
+ * </Upload.Items>
1334
+ * <Upload.StartAll>
1335
+ * {({ start, disabled }) => (
1336
+ * <Pressable onPress={start} disabled={disabled}>
1337
+ * <Text>Upload All</Text>
1338
+ * </Pressable>
1339
+ * )}
1340
+ * </Upload.StartAll>
1341
+ * </Upload>
1342
+ * ```
1343
+ */
1344
+ declare function UploadRoot({
1345
+ multiple,
1346
+ maxConcurrent,
1347
+ autoStart,
1348
+ metadata,
1349
+ onSuccess,
1350
+ onError,
1351
+ onComplete,
1352
+ children
1353
+ }: UploadProps): react_jsx_runtime13.JSX.Element;
1354
+ /**
1355
+ * Render props for Upload.FilePicker component.
1356
+ */
1357
+ interface UploadFilePickerRenderProps {
1358
+ /** Pick a file */
1359
+ pick: () => Promise<void>;
1360
+ /** Whether a pick operation is in progress */
1361
+ isLoading: boolean;
1362
+ }
1363
+ /**
1364
+ * Props for Upload.FilePicker component.
1365
+ */
1366
+ interface UploadFilePickerProps {
1367
+ /** Render function receiving picker state */
1368
+ children: (props: UploadFilePickerRenderProps) => ReactNode;
1369
+ }
1370
+ /**
1371
+ * File picker component for document selection.
1372
+ *
1373
+ * @example
1374
+ * ```tsx
1375
+ * <Upload.FilePicker>
1376
+ * {({ pick }) => (
1377
+ * <Pressable onPress={pick}>
1378
+ * <Text>Select Document</Text>
1379
+ * </Pressable>
1380
+ * )}
1381
+ * </Upload.FilePicker>
1382
+ * ```
1383
+ */
1384
+ declare function UploadFilePicker({
1385
+ children
1386
+ }: UploadFilePickerProps): react_jsx_runtime13.JSX.Element;
1387
+ /**
1388
+ * Render props for Upload.GalleryPicker component.
1389
+ */
1390
+ interface UploadGalleryPickerRenderProps {
1391
+ /** Pick from gallery */
1392
+ pick: () => Promise<void>;
1393
+ /** Whether a pick operation is in progress */
1394
+ isLoading: boolean;
1395
+ }
1396
+ /**
1397
+ * Props for Upload.GalleryPicker component.
1398
+ */
1399
+ interface UploadGalleryPickerProps {
1400
+ /** Render function receiving picker state */
1401
+ children: (props: UploadGalleryPickerRenderProps) => ReactNode;
1402
+ }
1403
+ /**
1404
+ * Gallery picker component for image selection.
1405
+ *
1406
+ * @example
1407
+ * ```tsx
1408
+ * <Upload.GalleryPicker>
1409
+ * {({ pick }) => (
1410
+ * <Pressable onPress={pick}>
1411
+ * <Text>Select Photos</Text>
1412
+ * </Pressable>
1413
+ * )}
1414
+ * </Upload.GalleryPicker>
1415
+ * ```
1416
+ */
1417
+ declare function UploadGalleryPicker({
1418
+ children
1419
+ }: UploadGalleryPickerProps): react_jsx_runtime13.JSX.Element;
1420
+ /**
1421
+ * Render props for Upload.CameraPicker component.
1422
+ */
1423
+ interface UploadCameraPickerRenderProps {
1424
+ /** Take a photo */
1425
+ take: () => Promise<void>;
1426
+ /** Whether a capture is in progress */
1427
+ isLoading: boolean;
1428
+ }
1429
+ /**
1430
+ * Props for Upload.CameraPicker component.
1431
+ */
1432
+ interface UploadCameraPickerProps {
1433
+ /** Render function receiving picker state */
1434
+ children: (props: UploadCameraPickerRenderProps) => ReactNode;
1435
+ }
1436
+ /**
1437
+ * Camera picker component for photo capture.
1438
+ *
1439
+ * @example
1440
+ * ```tsx
1441
+ * <Upload.CameraPicker>
1442
+ * {({ take }) => (
1443
+ * <Pressable onPress={take}>
1444
+ * <Text>Take Photo</Text>
1445
+ * </Pressable>
1446
+ * )}
1447
+ * </Upload.CameraPicker>
1448
+ * ```
1449
+ */
1450
+ declare function UploadCameraPicker({
1451
+ children
1452
+ }: UploadCameraPickerProps): react_jsx_runtime13.JSX.Element;
1453
+ /**
1454
+ * Render props for Upload.Items component.
1455
+ */
1456
+ interface UploadItemsRenderProps {
1457
+ /** All upload items */
1458
+ items: UploadItemState[];
1459
+ /** Whether there are any items */
1460
+ hasItems: boolean;
1461
+ /** Whether items array is empty */
1462
+ isEmpty: boolean;
1463
+ }
1464
+ /**
1465
+ * Props for Upload.Items component.
1466
+ */
1467
+ interface UploadItemsProps {
1468
+ /** Render function receiving items */
1469
+ children: (props: UploadItemsRenderProps) => ReactNode;
1470
+ }
1471
+ /**
1472
+ * Renders the list of upload items via render props.
1473
+ *
1474
+ * @example
1475
+ * ```tsx
1476
+ * <Upload.Items>
1477
+ * {({ items, isEmpty }) => (
1478
+ * isEmpty ? <Text>No files</Text> : (
1479
+ * items.map(item => (
1480
+ * <Upload.Item key={item.id} id={item.id}>
1481
+ * {(props) => ...}
1482
+ * </Upload.Item>
1483
+ * ))
1484
+ * )
1485
+ * )}
1486
+ * </Upload.Items>
1487
+ * ```
1488
+ */
1489
+ declare function UploadItems({
1490
+ children
1491
+ }: UploadItemsProps): react_jsx_runtime13.JSX.Element;
1492
+ /**
1493
+ * Props for Upload.Item component.
1494
+ */
1495
+ interface UploadItemProps {
1496
+ /** Item ID */
1497
+ id: string;
1498
+ /** Children (can be render function or regular children) */
1499
+ children: ReactNode | ((props: UploadItemContextValue) => ReactNode);
1500
+ }
1501
+ /**
1502
+ * Scoped context provider for a specific upload item.
1503
+ *
1504
+ * @example
1505
+ * ```tsx
1506
+ * <Upload.Item id={item.id}>
1507
+ * {({ file, state, abort, remove }) => (
1508
+ * <View>
1509
+ * <Text>{file.data.name}</Text>
1510
+ * <Text>{state.progress}%</Text>
1511
+ * <Pressable onPress={abort}><Text>Cancel</Text></Pressable>
1512
+ * <Pressable onPress={remove}><Text>Remove</Text></Pressable>
1513
+ * </View>
1514
+ * )}
1515
+ * </Upload.Item>
1516
+ * ```
1517
+ */
1518
+ declare function UploadItem({
1519
+ id,
1520
+ children
1521
+ }: UploadItemProps): react_jsx_runtime13.JSX.Element | null;
1522
+ /**
1523
+ * Render props for Upload.Progress component.
1524
+ */
1525
+ interface UploadProgressRenderProps {
1526
+ /** Progress percentage (0-100) */
1527
+ progress: number;
1528
+ /** Bytes uploaded so far */
1529
+ bytesUploaded: number;
1530
+ /** Total bytes to upload */
1531
+ totalBytes: number;
1532
+ /** Whether any uploads are active */
1533
+ isUploading: boolean;
1534
+ }
1535
+ /**
1536
+ * Props for Upload.Progress component.
1537
+ */
1538
+ interface UploadProgressProps {
1539
+ /** Render function receiving progress state */
1540
+ children: (props: UploadProgressRenderProps) => ReactNode;
1541
+ }
1542
+ /**
1543
+ * Progress display component within an Upload.
1544
+ *
1545
+ * @example
1546
+ * ```tsx
1547
+ * <Upload.Progress>
1548
+ * {({ progress, isUploading }) => (
1549
+ * isUploading && <Text>{progress}%</Text>
1550
+ * )}
1551
+ * </Upload.Progress>
1552
+ * ```
1553
+ */
1554
+ declare function UploadProgress$1({
1555
+ children
1556
+ }: UploadProgressProps): react_jsx_runtime13.JSX.Element;
1557
+ /**
1558
+ * Render props for Upload.Status component.
1559
+ */
1560
+ interface UploadStatusRenderProps {
1561
+ /** Overall status */
1562
+ status: "idle" | "uploading" | "success" | "error";
1563
+ /** Whether idle (no uploads active or completed) */
1564
+ isIdle: boolean;
1565
+ /** Whether uploading */
1566
+ isUploading: boolean;
1567
+ /** Whether all uploads succeeded */
1568
+ isSuccess: boolean;
1569
+ /** Whether any upload failed */
1570
+ isError: boolean;
1571
+ /** Number of total items */
1572
+ total: number;
1573
+ /** Number of successful uploads */
1574
+ successful: number;
1575
+ /** Number of failed uploads */
1576
+ failed: number;
1577
+ /** Number of currently uploading */
1578
+ active: number;
1579
+ }
1580
+ /**
1581
+ * Props for Upload.Status component.
1582
+ */
1583
+ interface UploadStatusProps {
1584
+ /** Render function receiving status state */
1585
+ children: (props: UploadStatusRenderProps) => ReactNode;
1586
+ }
1587
+ /**
1588
+ * Status display component within an Upload.
1589
+ *
1590
+ * @example
1591
+ * ```tsx
1592
+ * <Upload.Status>
1593
+ * {({ status, successful, failed, total }) => (
1594
+ * <Text>
1595
+ * {status}: {successful}/{total} uploaded, {failed} failed
1596
+ * </Text>
1597
+ * )}
1598
+ * </Upload.Status>
1599
+ * ```
1600
+ */
1601
+ declare function UploadStatus$1({
1602
+ children
1603
+ }: UploadStatusProps): react_jsx_runtime13.JSX.Element;
1604
+ /**
1605
+ * Render props for Upload.Error component.
1606
+ */
1607
+ interface UploadErrorRenderProps {
1608
+ /** Whether there are any errors */
1609
+ hasError: boolean;
1610
+ /** Number of failed uploads */
1611
+ failedCount: number;
1612
+ /** Failed items */
1613
+ failedItems: UploadItemState[];
1614
+ /** Clear all items */
1615
+ clear: () => void;
1616
+ }
1617
+ /**
1618
+ * Props for Upload.Error component.
1619
+ */
1620
+ interface UploadErrorProps {
1621
+ /** Render function receiving error state */
1622
+ children: (props: UploadErrorRenderProps) => ReactNode;
1623
+ }
1624
+ /**
1625
+ * Error display component within an Upload.
1626
+ *
1627
+ * @example
1628
+ * ```tsx
1629
+ * <Upload.Error>
1630
+ * {({ hasError, failedItems, clear }) => (
1631
+ * hasError && (
1632
+ * <View>
1633
+ * {failedItems.map(item => (
1634
+ * <Text key={item.id}>{item.file.data.name}: {item.error?.message}</Text>
1635
+ * ))}
1636
+ * <Pressable onPress={clear}><Text>Clear</Text></Pressable>
1637
+ * </View>
1638
+ * )
1639
+ * )}
1640
+ * </Upload.Error>
1641
+ * ```
1642
+ */
1643
+ declare function UploadError({
1644
+ children
1645
+ }: UploadErrorProps): react_jsx_runtime13.JSX.Element;
1646
+ /**
1647
+ * Render props for Upload.Cancel component.
1648
+ */
1649
+ interface UploadCancelRenderProps {
1650
+ /** Cancel all uploads */
1651
+ cancel: () => void;
1652
+ /** Whether cancel is disabled */
1653
+ disabled: boolean;
1654
+ }
1655
+ /**
1656
+ * Props for Upload.Cancel component.
1657
+ */
1658
+ interface UploadCancelProps {
1659
+ /** Render function receiving cancel state */
1660
+ children: (props: UploadCancelRenderProps) => ReactNode;
1661
+ }
1662
+ /**
1663
+ * Cancel component that aborts all active uploads.
1664
+ */
1665
+ declare function UploadCancel({
1666
+ children
1667
+ }: UploadCancelProps): react_jsx_runtime13.JSX.Element;
1668
+ /**
1669
+ * Render props for Upload.Retry component.
1670
+ */
1671
+ interface UploadRetryRenderProps {
1672
+ /** Retry all failed uploads */
1673
+ retry: () => Promise<void>;
1674
+ /** Whether retry is disabled */
1675
+ disabled: boolean;
1676
+ }
1677
+ /**
1678
+ * Props for Upload.Retry component.
1679
+ */
1680
+ interface UploadRetryProps {
1681
+ /** Render function receiving retry state */
1682
+ children: (props: UploadRetryRenderProps) => ReactNode;
1683
+ }
1684
+ /**
1685
+ * Retry component that retries all failed uploads.
1686
+ */
1687
+ declare function UploadRetry({
1688
+ children
1689
+ }: UploadRetryProps): react_jsx_runtime13.JSX.Element;
1690
+ /**
1691
+ * Render props for Upload.Reset component.
1692
+ */
1693
+ interface UploadResetRenderProps {
1694
+ /** Reset all state */
1695
+ reset: () => void;
1696
+ }
1697
+ /**
1698
+ * Props for Upload.Reset component.
1699
+ */
1700
+ interface UploadResetProps {
1701
+ /** Render function receiving reset state */
1702
+ children: (props: UploadResetRenderProps) => ReactNode;
1703
+ }
1704
+ /**
1705
+ * Reset component that clears all items and state.
1706
+ */
1707
+ declare function UploadReset({
1708
+ children
1709
+ }: UploadResetProps): react_jsx_runtime13.JSX.Element;
1710
+ /**
1711
+ * Render props for Upload.StartAll component.
1712
+ */
1713
+ interface UploadStartAllRenderProps {
1714
+ /** Start all pending uploads */
1715
+ start: () => Promise<void>;
1716
+ /** Whether start is disabled */
1717
+ disabled: boolean;
1718
+ }
1719
+ /**
1720
+ * Props for Upload.StartAll component.
1721
+ */
1722
+ interface UploadStartAllProps {
1723
+ /** Render function receiving start state */
1724
+ children: (props: UploadStartAllRenderProps) => ReactNode;
1725
+ }
1726
+ /**
1727
+ * Start all component that begins all queued uploads.
1728
+ */
1729
+ declare function UploadStartAll({
1730
+ children
1731
+ }: UploadStartAllProps): react_jsx_runtime13.JSX.Element;
1732
+ /**
1733
+ * Upload compound component for React Native.
1734
+ *
1735
+ * Provides a composable, headless API for building upload interfaces on mobile.
1736
+ * Uses picker components instead of drag-and-drop (which isn't available on mobile).
1737
+ * All sub-components use render props for complete UI control.
1738
+ *
1739
+ * @example Single file upload
1740
+ * ```tsx
1741
+ * <Upload onSuccess={handleSuccess}>
1742
+ * <Upload.FilePicker>
1743
+ * {({ pick }) => (
1744
+ * <Pressable onPress={pick}>
1745
+ * <Text>Select File</Text>
1746
+ * </Pressable>
1747
+ * )}
1748
+ * </Upload.FilePicker>
1749
+ * <Upload.Progress>
1750
+ * {({ progress }) => <Text>{progress}%</Text>}
1751
+ * </Upload.Progress>
1752
+ * </Upload>
1753
+ * ```
1754
+ *
1755
+ * @example Multi-file upload
1756
+ * ```tsx
1757
+ * <Upload multiple maxConcurrent={3} onComplete={handleComplete}>
1758
+ * <Upload.GalleryPicker>
1759
+ * {({ pick }) => (
1760
+ * <Pressable onPress={pick}>
1761
+ * <Text>Select Photos</Text>
1762
+ * </Pressable>
1763
+ * )}
1764
+ * </Upload.GalleryPicker>
1765
+ * <Upload.Items>
1766
+ * {({ items }) => items.map(item => (
1767
+ * <Upload.Item key={item.id} id={item.id}>
1768
+ * {({ file, state }) => (
1769
+ * <Text>{file.data.name}: {state.progress}%</Text>
1770
+ * )}
1771
+ * </Upload.Item>
1772
+ * ))}
1773
+ * </Upload.Items>
1774
+ * <Upload.StartAll>
1775
+ * {({ start, disabled }) => (
1776
+ * <Pressable onPress={start} disabled={disabled}>
1777
+ * <Text>Upload All</Text>
1778
+ * </Pressable>
1779
+ * )}
1780
+ * </Upload.StartAll>
1781
+ * </Upload>
1782
+ * ```
1783
+ */
1784
+ declare const Upload: typeof UploadRoot & {
1785
+ FilePicker: typeof UploadFilePicker;
1786
+ GalleryPicker: typeof UploadGalleryPicker;
1787
+ CameraPicker: typeof UploadCameraPicker;
1788
+ Items: typeof UploadItems;
1789
+ Item: typeof UploadItem;
1790
+ Progress: typeof UploadProgress$1;
1791
+ Status: typeof UploadStatus$1;
1792
+ Error: typeof UploadError;
1793
+ Cancel: typeof UploadCancel;
1794
+ Retry: typeof UploadRetry;
1795
+ Reset: typeof UploadReset;
1796
+ StartAll: typeof UploadStartAll;
1797
+ };
1798
+ //#endregion
1125
1799
  //#region src/contexts/flow-manager-context.d.ts
1126
1800
  /**
1127
1801
  * Context value providing access to flow managers
@@ -1170,7 +1844,7 @@ interface FlowManagerProviderProps {
1170
1844
  */
1171
1845
  declare function FlowManagerProvider({
1172
1846
  children
1173
- }: FlowManagerProviderProps): react_jsx_runtime12.JSX.Element;
1847
+ }: FlowManagerProviderProps): react_jsx_runtime13.JSX.Element;
1174
1848
  /**
1175
1849
  * Hook to access the FlowManager context.
1176
1850
  * Must be used within a FlowManagerProvider.
@@ -1435,73 +2109,6 @@ declare function useFileUpload(options?: UseFileUploadOptions): {
1435
2109
  metrics: _uploadista_client_core3.UploadMetrics;
1436
2110
  };
1437
2111
  //#endregion
1438
- //#region src/hooks/use-multi-upload.d.ts
1439
- interface UploadItemState {
1440
- id: string;
1441
- file: Extract<FilePickResult, {
1442
- status: "success";
1443
- }>;
1444
- status: "idle" | "uploading" | "success" | "error" | "aborted";
1445
- progress: number;
1446
- bytesUploaded: number;
1447
- totalBytes: number;
1448
- error: Error | null;
1449
- result: UploadFile | null;
1450
- }
1451
- interface MultiUploadState {
1452
- items: UploadItemState[];
1453
- totalProgress: number;
1454
- totalUploaded: number;
1455
- totalBytes: number;
1456
- activeCount: number;
1457
- completedCount: number;
1458
- failedCount: number;
1459
- }
1460
- /**
1461
- * Hook for managing multiple concurrent file uploads with progress tracking.
1462
- * Each file is uploaded independently using the core upload client.
1463
- *
1464
- * Must be used within an UploadistaProvider.
1465
- *
1466
- * @param options - Multi-upload configuration options
1467
- * @returns Multi-upload state and control methods
1468
- *
1469
- * @example
1470
- * ```tsx
1471
- * function MyComponent() {
1472
- * const multiUpload = useMultiUpload({
1473
- * maxConcurrent: 3,
1474
- * onSuccess: (result) => console.log('File uploaded:', result),
1475
- * onError: (error) => console.error('Upload failed:', error),
1476
- * });
1477
- *
1478
- * const handlePickFiles = async () => {
1479
- * const files = await fileSystemProvider.pickImage({ allowMultiple: true });
1480
- * multiUpload.addFiles(files);
1481
- * await multiUpload.startUploads();
1482
- * };
1483
- *
1484
- * return (
1485
- * <View>
1486
- * <Button title="Pick Files" onPress={handlePickFiles} />
1487
- * <Text>Progress: {multiUpload.state.totalProgress}%</Text>
1488
- * <Text>Active: {multiUpload.state.activeCount}</Text>
1489
- * <Text>Completed: {multiUpload.state.completedCount}/{multiUpload.state.items.length}</Text>
1490
- * </View>
1491
- * );
1492
- * }
1493
- * ```
1494
- */
1495
- declare function useMultiUpload(options?: UseMultiUploadOptions): {
1496
- state: MultiUploadState;
1497
- addFiles: (files: FilePickResult[]) => string[];
1498
- startUploads: (itemIds?: string[]) => Promise<void>;
1499
- removeItem: (id: string) => void;
1500
- abortItem: (id: string) => void;
1501
- retryItem: (id: string) => Promise<void>;
1502
- clear: () => void;
1503
- };
1504
- //#endregion
1505
2112
  //#region src/hooks/use-gallery-upload.d.ts
1506
2113
  /**
1507
2114
  * Hook for selecting and uploading photos/videos from gallery
@@ -1727,5 +2334,5 @@ declare function normalizeUri(uri: string): string;
1727
2334
  */
1728
2335
  declare function getMimeTypeFromUri(uri: string): string;
1729
2336
  //#endregion
1730
- export { type Base64Service, type CameraOptions, CameraUploadButton, type CameraUploadButtonProps, type ConnectionMetrics, type ConnectionPoolConfig, type DetailedConnectionMetrics, type FileInfo, type FilePickResult, type FileReaderService, type FileSystemProvider, type FileSystemProviderConfig, FileUploadButton, type FileUploadButtonProps, Flow, type FlowCancelProps, type FlowCancelRenderProps, type FlowContextValue, type FlowErrorProps, type FlowErrorRenderProps, type FlowInputContextValue, type FlowInputFilePickerProps, type FlowInputFilePickerRenderProps, type FlowInputMetadata, type FlowInputPreviewProps, type FlowInputPreviewRenderProps, type FlowInputProps, type FlowInputsProps, type FlowInputsRenderProps, FlowManagerProvider, type FlowProgressProps, type FlowProgressRenderProps, type FlowProps, type FlowQuickUploadProps, type FlowQuickUploadRenderProps, type FlowRenderProps, type FlowResetProps, type FlowResetRenderProps, type FlowStatusProps, type FlowStatusRenderProps, type FlowSubmitProps, type FlowSubmitRenderProps, type FlowUploadState, type FlowUploadStatus, GalleryUploadButton, type GalleryUploadButtonProps, type HttpClient, type IdGenerationService, type InputExecutionState, type MultiUploadState, PermissionStatus, PermissionType, type PickerOptions, type ReactNativeUploadInput, type ServiceContainer, type StorageService, type UploadItemState, UploadList, type UploadListProps, type UploadMetrics, UploadProgress, type UploadProgressProps, type UploadState, type UploadStatus, UploadistaContext, type UploadistaContextType, type UseCameraUploadOptions, type UseFileUploadOptions, type UseFlowOptions, type UseFlowReturn, type UseGalleryUploadOptions, type UseMultiUploadOptions, formatFileSize, getDirectoryFromUri, getFileExtension, getFileNameFromUri, getFileNameWithoutExtension, getMimeTypeFromFileName, getMimeTypeFromUri, getPermissionStatus, hasPermissions, isContentUri, isDocumentFile, isFileSizeValid, isFileTypeAllowed, isFileUri, isImageFile, isVideoFile, normalizeUri, openAppSettings, pathToUri, requestCameraPermission, requestPermissions, requestPhotoLibraryPermission, requestStorageReadPermission, requestStorageWritePermission, uriToPath, useCameraUpload, useFileUpload, useFlow, useFlowContext, useFlowInputContext, useFlowManagerContext, useGalleryUpload, useMultiUpload, useUploadMetrics, useUploadistaContext };
2337
+ export { type Base64Service, type CameraOptions, CameraUploadButton, type CameraUploadButtonProps, type ConnectionMetrics, type ConnectionPoolConfig, type DetailedConnectionMetrics, type FileInfo, type FilePickResult, type FileReaderService, type FileSystemProvider, type FileSystemProviderConfig, FileUploadButton, type FileUploadButtonProps, Flow, type FlowCancelProps, type FlowCancelRenderProps, type FlowContextValue, type FlowErrorProps, type FlowErrorRenderProps, type FlowInputContextValue, type FlowInputFilePickerProps, type FlowInputFilePickerRenderProps, type FlowInputMetadata, type FlowInputPreviewProps, type FlowInputPreviewRenderProps, type FlowInputProps, type FlowInputsProps, type FlowInputsRenderProps, FlowManagerProvider, type FlowProgressProps, type FlowProgressRenderProps, type FlowProps, type FlowQuickUploadProps, type FlowQuickUploadRenderProps, type FlowRenderProps, type FlowResetProps, type FlowResetRenderProps, type FlowStatusProps, type FlowStatusRenderProps, type FlowSubmitProps, type FlowSubmitRenderProps, type FlowUploadState, type FlowUploadStatus, GalleryUploadButton, type GalleryUploadButtonProps, type HttpClient, type IdGenerationService, type InputExecutionState, type MultiUploadState, PermissionStatus, PermissionType, type PickerOptions, type ReactNativeUploadInput, type ServiceContainer, type StorageService, Upload, type UploadCameraPickerProps, type UploadCameraPickerRenderProps, type UploadCancelProps, type UploadCancelRenderProps, type UploadProgressProps as UploadCompoundProgressProps, type UploadProgressRenderProps as UploadCompoundProgressRenderProps, type UploadContextValue, type UploadErrorProps, type UploadErrorRenderProps, type UploadFilePickerProps, type UploadFilePickerRenderProps, type UploadGalleryPickerProps, type UploadGalleryPickerRenderProps, type UploadItemContextValue, type UploadItemProps, type UploadItemState, type UploadItemsProps, type UploadItemsRenderProps, UploadList, type UploadListProps, type UploadMetrics, UploadProgress, type UploadProgressProps$1 as UploadProgressProps, type UploadProps, type UploadRenderProps, type UploadResetProps, type UploadResetRenderProps, type UploadRetryProps, type UploadRetryRenderProps, type UploadStartAllProps, type UploadStartAllRenderProps, type UploadState, type UploadStatus, type UploadStatusProps, type UploadStatusRenderProps, UploadistaContext, type UploadistaContextType, type UseCameraUploadOptions, type UseFileUploadOptions, type UseFlowOptions, type UseFlowReturn, type UseGalleryUploadOptions, type UseMultiUploadOptions, formatFileSize, getDirectoryFromUri, getFileExtension, getFileNameFromUri, getFileNameWithoutExtension, getMimeTypeFromFileName, getMimeTypeFromUri, getPermissionStatus, hasPermissions, isContentUri, isDocumentFile, isFileSizeValid, isFileTypeAllowed, isFileUri, isImageFile, isVideoFile, normalizeUri, openAppSettings, pathToUri, requestCameraPermission, requestPermissions, requestPhotoLibraryPermission, requestStorageReadPermission, requestStorageWritePermission, uriToPath, useCameraUpload, useFileUpload, useFlow, useFlowContext, useFlowInputContext, useFlowManagerContext, useGalleryUpload, useMultiUpload, useUploadContext, useUploadItemContext, useUploadMetrics, useUploadistaContext };
1731
2338
  //# sourceMappingURL=index.d.mts.map