google-cloud-node
google-cloud-node copied to clipboard
Add ability to include Storage types
In @google-cloud/bigquery we created a custom File
type where we were supposed to be using a @google-cloud/storage File
type.
export interface File {
bucket: any;
kmsKeyName?: string;
userProject?: string;
name: string;
generation?: number;
}
The storage npm module includes these types, but is currently installed as a devDependency. Unless it's included as a production dependency, the types would not be included. The storage module is fairly large, and only really needed for types. It would be ideal to have a way to access these types.
This is a super interesting problem. If we shipped separate @types
packages for our libraries, we would be able to do that, but generally that's not recommended if a library ships it's own types. I don't know the answer to this one! @bcoe for his thoughts.
@steffnay what happens if you attempt to coerce it into that type?
import {File} from '@google-cloud/storage'
fileFromBigQuery as File
I agree as a typescript dev its a real hassle, maybe you could just add a export to all the types so we can access them like that?