-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Description
I have identified a mismatch between the ProgressChanged type definition provided in the library and the actual structure observed at runtime. Specifically, the NewProgress and OldProgress objects do not match the documented type definition and instead contain an additional nested structure.
Expected Behavior
The type definition in index.d.ts (lines 4147-4172) indicates the following structure for ProgressChanged:
class ProgressChanged extends ITHit.WebDAV.Client.Upload.Events.BaseEvent {
OldProgress: ITHit.WebDAV.Client.Upload.Progress
NewProgress: ITHit.WebDAV.Client.Upload.Progress
Name: string
Sender: Object
}At runtime, I expect NewProgress and OldProgress to directly contain properties like UploadedBytes, TotalBytes, etc.
Observed Behavior
At runtime, the NewProgress and OldProgress object contains an additional nested ProgressChanged object, as shown in the console logs:
{
"Name": "OnProgressChanged",
"NewProgress": {
"Name": "OnProgressChanged",
"NewProgress": {},
"OldProgress": {},
"Sender": {}
},
"OldProgress": {
"Name": "OnProgressChanged",
"NewProgress": {},
"OldProgress": {},
"Sender": {}
},
"Sender": {}
}Environment
- Library Version: 5.21.6001
- Environment: Browser
- TypeScript Version: 5.5.4
Additional Context
This mismatch can lead to runtime errors or confusion when working with the library in TypeScript, as the actual structure does not align with the documented types. For example, the following code fails unless adjusted for the nesting:
console.log(event.NewProgress?.UploadedBytes); // Undefined
console.log(event.NewProgress?.NewProgress?.UploadedBytes); // 10030