-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: improve GetFilesResponse interface #2466
Conversation
Hi @olishevskii thank you for opening a PR and trying to clean this up. If you take a look at Line 2840 in b4dbd73
GetFilesOptions & {pageToken?: string} . This PR omits the GetFilesOptions portion.
I'm also not sure we want to define a new interface that will need to be exported just to hold the page token portion. |
Hi @ddelgrosso1. I see your point of view regarding defining a new interface Lines 2798 to 2802 in b4dbd73
|
src/bucket.ts
Outdated
@@ -87,7 +87,7 @@ interface MetadataOptions { | |||
ifMetagenerationNotMatch?: number | string; | |||
} | |||
|
|||
export type GetFilesResponse = [File[], {}, unknown]; | |||
export type GetFilesResponse = [File[], (GetFilesOptions | GetFilesCallback) & Partial<Pick<GetFilesOptions, 'pageToken'>>, unknown]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can omit GetFilesCallback
, query
can only be GetFilesOptions
or an empty object. It will never get assigned the callback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have fixed it.
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #2464 🦕