dropbox-sdk-js icon indicating copy to clipboard operation
dropbox-sdk-js copied to clipboard

TypeScript definitions for `Dropbox.prototype.filesDownload`

Open FreeMasen opened this issue 6 years ago • 6 comments

Current this method is defined as returning Promise<dropbox.files.FileMetadata>.

The actual return value is closer to Promise<dropbox.files.FileMetadata & {fileBlob?: File}>;

I am not sure if it would be more appropriate to change this to its own type definitions like dropbox.files.FileDownloadResult or to just user the & syntax listed above. I am also not sure if the fileBlob property is actually optional or not.

FreeMasen avatar Mar 10 '19 05:03 FreeMasen

Thanks for pointing this out! I'll ask the team to fix that up.

The file data (in fileBlob in browser environments, or fileBinary in Node) is guaranteed for any "download" style call, such as filesDownload, as long as the call succeeds (i.e., doesn't raise an error).

greg-db avatar Mar 11 '19 21:03 greg-db

Seems this is a duplicate of https://github.com/dropbox/dropbox-sdk-js/issues/162#issuecomment-364779780 (and a few other ones like #82)

SebastienGllmt avatar Apr 07 '20 22:04 SebastienGllmt

This is still confusing

justinmoon avatar Dec 30 '21 05:12 justinmoon

@justinmoon Thanks for the note!

greg-db avatar Dec 30 '21 18:12 greg-db

Any idea when this will be fixed?

LeanderD avatar Aug 23 '23 15:08 LeanderD

@LeanderD Unfortunately I don't have a timeline for work on this.

greg-db avatar Aug 23 '23 17:08 greg-db