@aws-sdk/lib-transfer-manager 0.0.0-stage → 0.1.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 (60) hide show
  1. package/README.md +303 -2
  2. package/dist-cjs/index.js +2 -0
  3. package/dist-cjs/submodules/transfer-manager/index.js +3166 -0
  4. package/dist-cjs/submodules/worker/index.js +579 -0
  5. package/dist-es/index.js +1 -0
  6. package/dist-es/submodules/transfer-manager/S3TransferManager.js +2229 -0
  7. package/dist-es/submodules/transfer-manager/chunker.js +115 -0
  8. package/dist-es/submodules/transfer-manager/directory-transfer-utils.js +102 -0
  9. package/dist-es/submodules/transfer-manager/event-listener-types.js +1 -0
  10. package/dist-es/submodules/transfer-manager/file-manager.js +70 -0
  11. package/dist-es/submodules/transfer-manager/index.browser.js +11 -0
  12. package/dist-es/submodules/transfer-manager/index.js +11 -0
  13. package/dist-es/submodules/transfer-manager/join-streams.browser.js +101 -0
  14. package/dist-es/submodules/transfer-manager/join-streams.js +105 -0
  15. package/dist-es/submodules/transfer-manager/log-level.js +30 -0
  16. package/dist-es/submodules/transfer-manager/ordered-part-queue.js +57 -0
  17. package/dist-es/submodules/transfer-manager/types.js +1 -0
  18. package/dist-es/submodules/transfer-manager/worker-http-handler.browser.js +25 -0
  19. package/dist-es/submodules/transfer-manager/worker-http-handler.js +453 -0
  20. package/dist-es/submodules/worker/http-request-worker.js +578 -0
  21. package/dist-es/submodules/worker/index.js +1 -0
  22. package/dist-types/index.d.ts +2 -0
  23. package/dist-types/submodules/transfer-manager/S3TransferManager.d.ts +60 -0
  24. package/dist-types/submodules/transfer-manager/chunker.d.ts +7 -0
  25. package/dist-types/submodules/transfer-manager/directory-transfer-utils.d.ts +90 -0
  26. package/dist-types/submodules/transfer-manager/event-listener-types.d.ts +54 -0
  27. package/dist-types/submodules/transfer-manager/file-manager.d.ts +51 -0
  28. package/dist-types/submodules/transfer-manager/index.browser.d.ts +10 -0
  29. package/dist-types/submodules/transfer-manager/index.d.ts +10 -0
  30. package/dist-types/submodules/transfer-manager/join-streams.browser.d.ts +21 -0
  31. package/dist-types/submodules/transfer-manager/join-streams.d.ts +26 -0
  32. package/dist-types/submodules/transfer-manager/log-level.d.ts +13 -0
  33. package/dist-types/submodules/transfer-manager/ordered-part-queue.d.ts +73 -0
  34. package/dist-types/submodules/transfer-manager/types.d.ts +473 -0
  35. package/dist-types/submodules/transfer-manager/worker-http-handler.browser.d.ts +20 -0
  36. package/dist-types/submodules/transfer-manager/worker-http-handler.d.ts +410 -0
  37. package/dist-types/submodules/worker/http-request-worker.d.ts +1 -0
  38. package/dist-types/submodules/worker/index.d.ts +1 -0
  39. package/dist-types/ts3.4/index.d.ts +2 -0
  40. package/dist-types/ts3.4/submodules/transfer-manager/S3TransferManager.d.ts +38 -0
  41. package/dist-types/ts3.4/submodules/transfer-manager/chunker.d.ts +10 -0
  42. package/dist-types/ts3.4/submodules/transfer-manager/directory-transfer-utils.d.ts +23 -0
  43. package/dist-types/ts3.4/submodules/transfer-manager/event-listener-types.d.ts +12 -0
  44. package/dist-types/ts3.4/submodules/transfer-manager/file-manager.d.ts +9 -0
  45. package/dist-types/ts3.4/submodules/transfer-manager/index.browser.d.ts +3 -0
  46. package/dist-types/ts3.4/submodules/transfer-manager/index.d.ts +3 -0
  47. package/dist-types/ts3.4/submodules/transfer-manager/join-streams.browser.d.ts +13 -0
  48. package/dist-types/ts3.4/submodules/transfer-manager/join-streams.d.ts +13 -0
  49. package/dist-types/ts3.4/submodules/transfer-manager/log-level.d.ts +13 -0
  50. package/dist-types/ts3.4/submodules/transfer-manager/ordered-part-queue.d.ts +18 -0
  51. package/dist-types/ts3.4/submodules/transfer-manager/types.d.ts +184 -0
  52. package/dist-types/ts3.4/submodules/transfer-manager/worker-http-handler.browser.d.ts +17 -0
  53. package/dist-types/ts3.4/submodules/transfer-manager/worker-http-handler.d.ts +241 -0
  54. package/dist-types/ts3.4/submodules/worker/http-request-worker.d.ts +1 -0
  55. package/dist-types/ts3.4/submodules/worker/index.d.ts +1 -0
  56. package/package.json +108 -4
  57. package/transfer-manager.d.ts +5 -0
  58. package/transfer-manager.js +5 -0
  59. package/worker.d.ts +5 -0
  60. package/worker.js +5 -0
@@ -0,0 +1,473 @@
1
+ import type { _Object as S3Object, CompleteMultipartUploadCommandOutput, CreateMultipartUploadCommandInput, GetObjectCommandInput, GetObjectCommandOutput, PutObjectCommandInput, PutObjectCommandOutput, S3Client } from "@aws-sdk/client-s3";
2
+ import type { HttpHandlerOptions, Logger } from "@smithy/types";
3
+ import type { AddEventListenerOptions, EventListener, RemoveEventListenerOptions } from "./event-listener-types";
4
+ /**
5
+ * Constructor parameters for the S3 Transfer Manager configuration.
6
+ *
7
+ * @alpha
8
+ */
9
+ export interface S3TransferManagerConfig {
10
+ /**
11
+ * The low level S3 client that will be used to send requests to S3.
12
+ */
13
+ s3?: S3Client;
14
+ /**
15
+ * The desired part size to use in a multipart transfer. Defaults to 8 MB.
16
+ * Does not apply to the last part. The actual part size may be larger than
17
+ * the configured value if it would require more than 10,000 parts, which
18
+ * is the maximum number of parts S3 allows for multipart upload.
19
+ * Does not apply to downloads if multipartDownloadType is PART.
20
+ */
21
+ targetPartSizeBytes?: number;
22
+ /**
23
+ * The size threshold, in bytes, for when to use multipart upload.
24
+ */
25
+ multipartUploadThresholdBytes?: number;
26
+ /**
27
+ * Specifies when a checksum will be calculated for request payloads.
28
+ * Takes precedence over the config on the S3 client.
29
+ */
30
+ requestChecksumCalculation?: "WHEN_SUPPORTED" | "WHEN_REQUIRED";
31
+ /**
32
+ * Specifies when checksum validation will be performed on response payloads.
33
+ * Takes precedence over the config on the S3 client.
34
+ */
35
+ responseChecksumValidation?: "WHEN_SUPPORTED" | "WHEN_REQUIRED";
36
+ /**
37
+ * How the SDK should perform multipart download, either RANGE or PART.
38
+ */
39
+ multipartDownloadType?: "RANGE" | "PART";
40
+ /**
41
+ * Collection of callbacks for monitoring transfer lifecycle events. Allows tracking statuses of all transfers from the client.
42
+ */
43
+ eventListeners?: TransferEventListeners;
44
+ /**
45
+ * Maximum number of concurrent HTTP requests for multipart download operations.
46
+ */
47
+ maxConcurrentDownloads?: number;
48
+ /**
49
+ * Maximum number of concurrent HTTP requests for multipart upload operations.
50
+ */
51
+ maxConcurrentUploads?: number;
52
+ /**
53
+ * Number of worker threads for multipart upload HTTP request dispatch.
54
+ * When set to 1, all operations run on the main thread itself using S3 client's default handler.
55
+ * When >1, spawns N worker threads
56
+ * Defaults to os.cpus().length (in node.js)
57
+ */
58
+ workerThreadCount?: number;
59
+ /**
60
+ * When enabled, downloaded parts are written with O_DIRECT, bypassing the OS
61
+ * page cache. Applies to file downloads only. Only available on Linux.
62
+ * Requires the part size and file offset to be block aligned.
63
+ *
64
+ * Defaults to false.
65
+ */
66
+ useODirect?: boolean;
67
+ /**
68
+ * Logger for S3 Transfer Manager operations.
69
+ */
70
+ logger?: Logger;
71
+ }
72
+ /**
73
+ * Uses intersection because requests includes all the required parameters from
74
+ * both PutObjectCommandInput and CreateMultipartUploadCommandInput to support both single object
75
+ * and multipart upload requests.
76
+ *
77
+ * @alpha
78
+ */
79
+ export type UploadRequest = PutObjectCommandInput & CreateMultipartUploadCommandInput;
80
+ /**
81
+ * Uses union because the responses can vary from single object upload response to multipart upload
82
+ * response depending on the request.
83
+ *
84
+ * @alpha
85
+ */
86
+ export type UploadResponse = PutObjectCommandOutput | CompleteMultipartUploadCommandOutput;
87
+ /**
88
+ * Features the same properties as SDK JS S3 Command GetObjectCommandInput.
89
+ * Created to standardize naming convention for TM APIs.
90
+ *
91
+ * @alpha
92
+ */
93
+ export type DownloadRequest = GetObjectCommandInput;
94
+ /**
95
+ * Features the same properties as SDK JS S3 Command GetObjectCommandOutput.
96
+ * Created to standardize naming convention for TM APIs.
97
+ *
98
+ * @alpha
99
+ */
100
+ export type DownloadResponse = GetObjectCommandOutput;
101
+ /**
102
+ * Features the same properties as DownloadRequest, with an additional
103
+ * file destination.
104
+ *
105
+ * @alpha
106
+ */
107
+ export interface DownloadToFileRequest extends DownloadRequest {
108
+ /**
109
+ * The local file path to which the response body will be written.
110
+ * Must be a non-empty string.
111
+ */
112
+ destination: string;
113
+ /**
114
+ * Whether to fail the request if a file already exists at the destination.
115
+ * When false, the existing file is overwritten.
116
+ * Defaults to false.
117
+ */
118
+ failIfExists?: boolean;
119
+ }
120
+ /**
121
+ * Features the same properties as DownloadResponse, excluding Body.
122
+ *
123
+ * @alpha
124
+ */
125
+ export interface DownloadToFileResponse extends Omit<DownloadResponse, "Body"> {
126
+ /**
127
+ * The total number of bytes written to the destination file.
128
+ */
129
+ bytesWritten: number;
130
+ }
131
+ /**
132
+ * Options for transfer operations that combine HTTP handler options with transfer event listeners.
133
+ *
134
+ * @property eventListeners - Collection of callbacks for monitoring transfer lifecycle events
135
+ *
136
+ * @alpha
137
+ */
138
+ export type TransferOptions = HttpHandlerOptions & {
139
+ eventListeners?: TransferEventListeners;
140
+ };
141
+ /**
142
+ * High-level utility for efficient transfer of objects to and from Amazon S3.
143
+ * Provides methods to optimize uploading and downloading individual objects
144
+ * as well as entire directories, with support for multipart operations,
145
+ * concurrency control, and request cancellation.
146
+ * Implements an event-based progress tracking system with methods to register,
147
+ * dispatch, and remove listeners for transfer lifecycle events.
148
+ *
149
+ * @alpha
150
+ */
151
+ export interface IS3TransferManager {
152
+ /**
153
+ * Lets users upload single objects from a given directory to a given bucket.
154
+ * Supports multipart upload, single object upload, and transfer progress listeners.
155
+ *
156
+ * @param request - All properties of a single or multipart upload request.
157
+ * @param transferOptions - Allows users to specify cancel functions for the request and a collection of callbacks for monitoring transfer lifecycle events. Allows tracking statuses per request.
158
+ *
159
+ * @returns The response from the S3 API for the upload request.
160
+ */
161
+ upload(request: UploadRequest, transferOptions?: TransferOptions): Promise<UploadResponse>;
162
+ /**
163
+ * Lets users download single objects from a given bucket to a given directory.
164
+ * Supports multipart download, single object download, and transfer progress listeners.
165
+ *
166
+ * @param request - All properties of a single or multipart upload request.
167
+ * @param transferOptions - Allows users to specify cancel functions for the request and a collection of callbacks for monitoring transfer lifecycle events. Allows tracking statuses per request.
168
+ *
169
+ * @returns the response from the S3 API for the download request.
170
+ */
171
+ download(request: DownloadRequest, transferOptions?: TransferOptions): Promise<DownloadResponse>;
172
+ /**
173
+ * Downloads an S3 object to a local file.
174
+ *
175
+ * @param request - Download request including the local file destination path.
176
+ * @param transferOptions - Allows users to specify cancel functions for the request and a collection of callbacks for monitoring transfer lifecycle events. Allows tracking statuses per request.
177
+ *
178
+ * @returns the response containing bytes written, and object metadata.
179
+ */
180
+ downloadToFile(request: DownloadToFileRequest, transferOptions?: TransferOptions): Promise<DownloadToFileResponse>;
181
+ /**
182
+ * Uploads files in a directory to the provided S3 bucket.
183
+ * By default, it does not recurse into subdirectories. To upload recursively, set recursive: true.
184
+ *
185
+ * @param request - Configuration for the directory upload operation.
186
+ * @param transferOptions - Allows users to specify cancel functions for the request and a collection of callbacks for monitoring transfer lifecycle events.
187
+ *
188
+ * @returns the number of objects that have been uploaded and the number of objects that have failed
189
+ */
190
+ uploadDirectory(request: UploadDirectoryRequest, transferOptions?: TransferOptions): Promise<UploadDirectoryResponse>;
191
+ /**
192
+ * Downloads objects under a bucket to the provided local directory.
193
+ *
194
+ * @param request - Configuration for the directory download operation.
195
+ * @param transferOptions - Allows users to specify cancel functions for the request and a collection of callbacks for monitoring transfer lifecycle events.
196
+ *
197
+ * @returns the number of objects that have been downloaded and the number of objects that have failed
198
+ */
199
+ downloadDirectory(request: DownloadDirectoryRequest, transferOptions?: TransferOptions): Promise<DownloadDirectoryResponse>;
200
+ /**
201
+ * Registers a callback function to be executed when a specific transfer event occurs.
202
+ * Supports monitoring the full lifecycle of transfers.
203
+ *
204
+ * @param type - The type of event to listen for.
205
+ * @param callback - Function to execute when the specified event occurs.
206
+ * @param options - Optional configuration for event listener behavior.
207
+ *
208
+ * @alpha
209
+ */
210
+ addEventListener(type: "transferInitiated", callback: EventListener<TransferEvent>, options?: AddEventListenerOptions | boolean): void;
211
+ addEventListener(type: "bytesTransferred", callback: EventListener<TransferEvent>, options?: AddEventListenerOptions | boolean): void;
212
+ addEventListener(type: "transferComplete", callback: EventListener<TransferCompleteEvent>, options?: AddEventListenerOptions | boolean): void;
213
+ addEventListener(type: "transferFailed", callback: EventListener<TransferEvent>, options?: AddEventListenerOptions | boolean): void;
214
+ addEventListener(type: string, callback: EventListener, options?: AddEventListenerOptions | boolean): void;
215
+ /**
216
+ * Dispatches an event to the registered event listeners.
217
+ * Triggers callbacks registered via addEventListener with matching event types.
218
+ *
219
+ * @param event - The event object to dispatch.
220
+ * @returns whether the event ran to completion
221
+ *
222
+ * @alpha
223
+ */
224
+ dispatchEvent(event: Event & TransferEvent): boolean;
225
+ dispatchEvent(event: Event & TransferCompleteEvent): boolean;
226
+ dispatchEvent(event: Event): boolean;
227
+ /**
228
+ * Removes a previously registered event listener from the specified event type.
229
+ * Stops the callback from being invoked when the event occurs.
230
+ *
231
+ * @param type - The type of event to stop listening for.
232
+ * @param callback - The function that was previously registered.
233
+ * @param options - Optional configuration for the event listener.
234
+ *
235
+ * @alpha
236
+ */
237
+ removeEventListener(type: "transferInitiated", callback: EventListener<TransferEvent>, options?: RemoveEventListenerOptions | boolean): void;
238
+ removeEventListener(type: "bytesTransferred", callback: EventListener<TransferEvent>, options?: RemoveEventListenerOptions | boolean): void;
239
+ removeEventListener(type: "transferComplete", callback: EventListener<TransferCompleteEvent>, options?: RemoveEventListenerOptions | boolean): void;
240
+ removeEventListener(type: "transferFailed", callback: EventListener<TransferEvent>, options?: RemoveEventListenerOptions | boolean): void;
241
+ removeEventListener(type: string, callback: EventListener, options?: RemoveEventListenerOptions | boolean): void;
242
+ }
243
+ /**
244
+ * Provides a snapshot of the progress during a single object transfer.
245
+ *
246
+ * @alpha
247
+ */
248
+ export interface SingleObjectProgressSnapshot {
249
+ transferredBytes: number;
250
+ totalBytes?: number;
251
+ response?: UploadResponse | DownloadResponse;
252
+ }
253
+ /**
254
+ * Provides a snapshot of the progress during a directory transfer.
255
+ *
256
+ * @alpha
257
+ */
258
+ export interface DirectoryProgressSnapshot {
259
+ transferredBytes: number;
260
+ totalBytes?: number;
261
+ transferredFiles: number;
262
+ totalFiles?: number;
263
+ }
264
+ /**
265
+ * Progress snapshot for either single object transfers or directory transfers.
266
+ *
267
+ * @alpha
268
+ */
269
+ export type TransferProgressSnapshot = SingleObjectProgressSnapshot | DirectoryProgressSnapshot;
270
+ /**
271
+ * Event interface for transfer progress events.
272
+ * Used for tracking ongoing transfers with the original request and progress snapshot.
273
+ *
274
+ * @alpha
275
+ */
276
+ export interface TransferEvent extends Event {
277
+ request: UploadRequest | DownloadRequest;
278
+ snapshot: TransferProgressSnapshot;
279
+ }
280
+ /**
281
+ * Event interface for transfer completion.
282
+ * Extends TransferEvent with response data that is received after a completed transfer.
283
+ *
284
+ * @alpha
285
+ */
286
+ export interface TransferCompleteEvent extends TransferEvent {
287
+ response: UploadResponse | DownloadResponse;
288
+ }
289
+ /**
290
+ * Collection of event handlers to monitor transfer lifecycle events.
291
+ * Allows a way to register callbacks for each stage of the transfer process.
292
+ *
293
+ * @alpha
294
+ */
295
+ export interface TransferEventListeners {
296
+ transferInitiated?: EventListener<TransferEvent>[];
297
+ bytesTransferred?: EventListener<TransferEvent>[];
298
+ transferComplete?: EventListener<TransferCompleteEvent>[];
299
+ transferFailed?: EventListener<TransferEvent>[];
300
+ }
301
+ /**
302
+ * Event listener type.
303
+ *
304
+ * @alpha
305
+ */
306
+ export interface JoinStreamIterationEvents {
307
+ onBytes?: (byteLength: number, index: number) => void;
308
+ onCompletion?: (byteLength: number, index: number) => void;
309
+ onFailure?: (error: unknown, index: number) => void;
310
+ onStreamConsumed?: (index: number) => void;
311
+ }
312
+ /**
313
+ * Canned failure policies for directory transfers.
314
+ * Used to control behavior when an individual object fails during a multi-object transfer.
315
+ *
316
+ * "terminate" - Cancel all ongoing requests, terminate the directory transfer, and throw the error. (Default)
317
+ * "continue" - Ignore the failure, increment failed count, and continue transferring remaining objects.
318
+ *
319
+ * @alpha
320
+ */
321
+ export type CannedFailurePolicy = "terminate" | "continue";
322
+ /**
323
+ * Context provided to a custom failure policy callback when an individual object transfer fails.
324
+ * Contains the directory transfer request, the specific failed object request, and the error.
325
+ *
326
+ * @alpha
327
+ */
328
+ export interface DirectoryTransferFailureContext {
329
+ /**
330
+ * The original directory transfer request.
331
+ */
332
+ request: UploadDirectoryRequest | DownloadDirectoryRequest;
333
+ /**
334
+ * The individual object request that failed.
335
+ */
336
+ objectRequest: PutObjectCommandInput | GetObjectCommandInput;
337
+ /**
338
+ * The error that caused the failure.
339
+ */
340
+ error: unknown;
341
+ }
342
+ /**
343
+ * Failure policy for directory transfers.
344
+ * Either a canned policy enum value, or a custom callback invoked per failure.
345
+ * Custom callbacks return "continue" to skip the failure, or "terminate" to abort.
346
+ *
347
+ * @alpha
348
+ */
349
+ export type FailurePolicy = CannedFailurePolicy | ((context: DirectoryTransferFailureContext) => Promise<CannedFailurePolicy>);
350
+ /**
351
+ * Request parameters for uploadDirectory operation.
352
+ *
353
+ * @alpha
354
+ */
355
+ export interface UploadDirectoryRequest {
356
+ /**
357
+ * The name of the bucket to upload objects to.
358
+ */
359
+ bucket: string;
360
+ /**
361
+ * The source directory to upload.
362
+ */
363
+ source: string;
364
+ /**
365
+ * Whether to follow symbolic links when traversing.
366
+ * Default: false.
367
+ */
368
+ followSymbolicLinks?: boolean;
369
+ /**
370
+ * Whether to upload directories recursively.
371
+ * Default: false.
372
+ */
373
+ recursive?: boolean;
374
+ /**
375
+ * S3 key prefix prepended to each object key.
376
+ * By default, if no prefix is specified, objects are uploaded to the root of the bucket.
377
+ */
378
+ s3Prefix?: string;
379
+ /**
380
+ * Filter to control which files are uploaded.
381
+ * Can be a callback (return true to include, false to skip) or a RegExp (matches are included).
382
+ * By default, if no filter is specified, all files will be uploaded.
383
+ */
384
+ filter?: ((filePath: string) => boolean) | RegExp;
385
+ /**
386
+ * Modifier invoked per upload request.
387
+ * MUST return a new copy.
388
+ * By default, if no modifier is specified, requests are passed as-is.
389
+ */
390
+ uploadObjectRequestModifier?: (request: PutObjectCommandInput) => PutObjectCommandInput;
391
+ /**
392
+ * Failure policy for handling individual upload failures.
393
+ * Default: Terminate.
394
+ */
395
+ failurePolicy?: FailurePolicy;
396
+ /**
397
+ * Max concurrent file uploads for this directory operation.
398
+ * Default: 100.
399
+ */
400
+ maxConcurrency?: number;
401
+ }
402
+ /**
403
+ * Response from uploadDirectory operation.
404
+ *
405
+ * @alpha
406
+ */
407
+ export interface UploadDirectoryResponse {
408
+ /**
409
+ * Number of objects successfully uploaded.
410
+ */
411
+ objectsUploaded: number;
412
+ /**
413
+ * Number of objects that failed to upload.
414
+ */
415
+ objectsFailed: number;
416
+ }
417
+ /**
418
+ * Request parameters for downloadDirectory operation.
419
+ *
420
+ * @alpha
421
+ */
422
+ export interface DownloadDirectoryRequest {
423
+ /**
424
+ * The name of the bucket.
425
+ */
426
+ bucket: string;
427
+ /**
428
+ * The destination local directory.
429
+ */
430
+ destination: string;
431
+ /**
432
+ * S3 prefix to filter listed objects.
433
+ */
434
+ s3Prefix?: string;
435
+ /**
436
+ * Filter to control which S3 objects are downloaded.
437
+ * Can be a callback (return true to include the object, false to skip) or a
438
+ * RegExp (matched against the S3 object key, matches are included).
439
+ * By default, if no filter is specified, all objects will be downloaded.
440
+ */
441
+ filter?: ((object: S3Object) => boolean) | RegExp;
442
+ /**
443
+ * Modifier invoked per download request.
444
+ * MUST return a new copy.
445
+ * By default, if no modifier is specified, requests are passed through as-is.
446
+ */
447
+ downloadObjectRequestModifier?: (request: GetObjectCommandInput) => GetObjectCommandInput;
448
+ /**
449
+ * Failure policy for handling individual download failures.
450
+ * Default: Terminate.
451
+ */
452
+ failurePolicy?: FailurePolicy;
453
+ /**
454
+ * Max concurrent file downloads for this directory operation.
455
+ * Default: 100.
456
+ */
457
+ maxConcurrency?: number;
458
+ }
459
+ /**
460
+ * Response from downloadDirectory operation.
461
+ *
462
+ * @alpha
463
+ */
464
+ export interface DownloadDirectoryResponse {
465
+ /**
466
+ * Number of objects successfully downloaded.
467
+ */
468
+ objectsDownloaded: number;
469
+ /**
470
+ * Number of objects that failed to download.
471
+ */
472
+ objectsFailed: number;
473
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Browser stub for worker-http-handler.
3
+ * Worker threads are not available in browser environments.
4
+ * @internal
5
+ */
6
+ export type DataSource = any;
7
+ export declare function defaultWorkerCount(): number;
8
+ export declare function createEmptyReadable(): any;
9
+ export declare class WorkerHttpHandler {
10
+ constructor();
11
+ handle(): Promise<any>;
12
+ updateHttpClientConfig(): void;
13
+ httpHandlerConfigs(): Record<string, unknown>;
14
+ getDownloadResult(): {
15
+ bytesWritten: number;
16
+ checksum?: string;
17
+ } | undefined;
18
+ getStreamDownloadResult(): any;
19
+ destroy(): void;
20
+ }