nodejs-storage
nodejs-storage copied to clipboard
file.move return type (MoveResponse) is mostly un-typed
Environment details
- OS: n/a
- Node.js version: n/a
- npm version: n/a
@google-cloud/storageversion: 7.6.0
Steps to reproduce
- Install the library
- Observe the Promise-ified return type of file.move
The MoveResponse type (defined at https://github.com/googleapis/nodejs-storage/blob/v7.6.0/src/file.ts#L266) is just [unknown]. This doesn't seem correct, and is certainly unhelpful.
From the definition of MoveCallback (at https://github.com/googleapis/nodejs-storage/blob/v7.6.0/src/file.ts#L268-L274), it seems like it should be something like [File, unknown] matching destinationFile, apiResponse for the non-error version of the callback args.
Thanks for opening an issue @mgabeler-lee-6rs. We are in the process of cleaning up / more strongly typing things within the library. Looking back at the history MoveResponse was originally [Metadata] where Metadata = any. There are quiet a few places where the callback versions don't necessarily align with the promisified version. We intend to clean those up as well. Unfortunately, more strongly typing things / changing signatures are a breaking change that will have to wait until the next major revision of the library.
Any updates on this?
@crossan007 our next major version is currently being worked on and this should be part of that release. No firm timeline on the date for release but I'll update accordingly.
Any idea if this has been released yet?
@crossan007 it has not been released as of yet. Work is still being done to prepare the next major revision of this library.