Skip to content

Commit 4fc0d2f

Browse files
committed
chore: cr nits
1 parent 060045f commit 4fc0d2f

File tree

2 files changed

+34
-34
lines changed

2 files changed

+34
-34
lines changed

lib/lib-storage/src/s3-transfer-manager/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ Downloads objects from S3 using multipart download with two modes:
124124
125125
**PART Mode:**
126126
127-
- Optimized for objects uploaded via multipart upload
128-
- Uses S3's native PartNumber parameter to download parts concurrently
127+
- Optimized for objects uploaded via multipart upload.
128+
- Uses S3's native PartNumber parameter to download parts concurrently.
129129
130130
**RANGE Mode:**
131131
132-
- Works with any S3 object regardless of upload method
133-
- Uses HTTP Range headers to split objects into chunks for concurrent download
132+
- Works with any S3 object regardless of upload method.
133+
- Uses HTTP Range headers to split objects into chunks for concurrent download.
134134
135135
Both modes join separate streams into a single stream and support Readable/ReadableStream for Node.js and browsers.
136136
@@ -158,10 +158,10 @@ Both modes join separate streams into a single stream and support Readable/Reada
158158
159159
Both modes validate data integrity:
160160
161-
- **PART**: Validates part boundaries match expected byte ranges
162-
- **RANGE**: Validates byte ranges match expected values
163-
- Uses `IfMatch` header with initial ETag to ensure object consistency
164-
- Throws errors and cancels download on validation failures
161+
- **PART**: Validates part boundaries match expected byte ranges.
162+
- **RANGE**: Validates byte ranges match expected values.
163+
- Uses `IfMatch` header with initial ETag to ensure object consistency.
164+
- Throws errors and cancels download on validation failures.
165165
166166
We do not recommend updating the object you're downloading mid-download as this may throw a [Precondition Failed error](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/http-412-precondition-failed.html).
167167

lib/lib-storage/src/s3-transfer-manager/S3TransferManager.ts

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@ export class S3TransferManager implements IS3TransferManager {
7474
this.validateConfig();
7575
}
7676

77+
/**
78+
* Registers a callback function to be executed when a specific transfer event occurs.
79+
* Supports monitoring the full lifecycle of transfers.
80+
*
81+
* @param type - The type of event to listen for.
82+
* @param callback - Function to execute when the specified event occurs.
83+
* @param options - Optional configuration for event listener behavior.
84+
*
85+
* @alpha
86+
*/
7787
public addEventListener(
7888
type: "transferInitiated",
7989
callback: EventListener<TransferEvent>,
@@ -95,16 +105,6 @@ export class S3TransferManager implements IS3TransferManager {
95105
options?: AddEventListenerOptions | boolean
96106
): void;
97107
public addEventListener(type: string, callback: EventListener, options?: AddEventListenerOptions | boolean): void;
98-
/**
99-
* Registers a callback function to be executed when a specific transfer event occurs.
100-
* Supports monitoring the full lifecycle of transfers.
101-
*
102-
* @param type - The type of event to listen for.
103-
* @param callback - Function to execute when the specified event occurs.
104-
* @param options - Optional configuration for event listener behavior.
105-
*
106-
* @alpha
107-
*/
108108
public addEventListener(type: string, callback: EventListener, options?: AddEventListenerOptions | boolean): void {
109109
const eventType = type as keyof TransferEventListeners;
110110
const listeners = this.eventListeners[eventType];
@@ -144,9 +144,6 @@ export class S3TransferManager implements IS3TransferManager {
144144
listeners.push(updatedCallback);
145145
}
146146

147-
public dispatchEvent(event: Event & TransferEvent): boolean;
148-
public dispatchEvent(event: Event & TransferCompleteEvent): boolean;
149-
public dispatchEvent(event: Event): boolean;
150147
/**
151148
* Dispatches an event to the registered event listeners.
152149
* Triggers callbacks registered via addEventListener with matching event types.
@@ -156,6 +153,9 @@ export class S3TransferManager implements IS3TransferManager {
156153
*
157154
* @alpha
158155
*/
156+
public dispatchEvent(event: Event & TransferEvent): boolean;
157+
public dispatchEvent(event: Event & TransferCompleteEvent): boolean;
158+
public dispatchEvent(event: Event): boolean;
159159
public dispatchEvent(event: Event): boolean {
160160
const eventType = event.type;
161161
const listeners = this.eventListeners[eventType as keyof TransferEventListeners] as EventListener[];
@@ -172,6 +172,16 @@ export class S3TransferManager implements IS3TransferManager {
172172
return true;
173173
}
174174

175+
/**
176+
* Removes a previously registered event listener from the specified event type.
177+
* Stops the callback from being invoked when the event occurs.
178+
*
179+
* @param type - The type of event to stop listening for.
180+
* @param callback - The function that was previously registered.
181+
* @param options - Optional configuration for the event listener.
182+
*
183+
* @alpha
184+
*/
175185
public removeEventListener(
176186
type: "transferInitiated",
177187
callback: EventListener<TransferEvent>,
@@ -197,16 +207,6 @@ export class S3TransferManager implements IS3TransferManager {
197207
callback: EventListener,
198208
options?: RemoveEventListenerOptions | boolean
199209
): void;
200-
/**
201-
* Removes a previously registered event listener from the specified event type.
202-
* Stops the callback from being invoked when the event occurs.
203-
*
204-
* @param type - The type of event to stop listening for.
205-
* @param callback - The function that was previously registered.
206-
* @param options - Optional configuration for the event listener.
207-
*
208-
* @alpha
209-
*/
210210
public removeEventListener(
211211
type: string,
212212
callback: EventListener,
@@ -346,7 +346,7 @@ export class S3TransferManager implements IS3TransferManager {
346346
*
347347
* @param options - Configuration including bucket, source directory, filtering, failure handling, and transfer settings.
348348
*
349-
* @returns the number of objects that have been uploaded and the number of objects that have failed
349+
* @returns the number of objects that have been uploaded and the number of objects that have failed.
350350
*
351351
* @alpha
352352
*/
@@ -371,7 +371,7 @@ export class S3TransferManager implements IS3TransferManager {
371371
*
372372
* @param options - Configuration including bucket, destination directory, filtering, failure handling, and transfer settings.
373373
*
374-
* @returns The number of objects that have been downloaded and the number of objects that have failed
374+
* @returns The number of objects that have been downloaded and the number of objects that have failed.
375375
*
376376
* @alpha
377377
*/
@@ -728,7 +728,7 @@ export class S3TransferManager implements IS3TransferManager {
728728
}
729729

730730
/**
731-
* Validates configuration parameters meet minimum requirements.
731+
* Validates if configuration parameters meets minimum requirements.
732732
*
733733
* @internal
734734
*/

0 commit comments

Comments
 (0)