-
-
Notifications
You must be signed in to change notification settings - Fork 935
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
Can’t use type with responseType option #1122
Comments
What is the type error? |
The last overload gave the following error.
Argument of type '{ method: Method; url: string; searchParams: string; json: { [key: string]: any; }; headers: Headers; responseType: ResponseType; hooks: { beforeRequest: (() => Promise<void>)[]; beforeRetry: ((options: NormalizedOptions, error: GeneralError, retryCount: number) => Promise<...>)[]; }; }' is not assignable to parameter of type 'string | Merge<Merge<RequestOptions, Merge<GotOptions, URLOptions>>, { isStream: true; }>'.
Type '{ method: Method; url: string; searchParams: string; json: { [key: string]: any; }; headers: Headers; responseType: ResponseType; hooks: { beforeRequest: (() => Promise<void>)[]; beforeRetry: ((options: NormalizedOptions, error: GeneralError, retryCount: number) => Promise<...>)[]; }; }' is not assignable to type 'Merge<Merge<RequestOptions, Merge<GotOptions, URLOptions>>, { isStream: true; }>'.
Property 'isStream' is missing in type '{ method: Method; url: string; searchParams: string; json: { [key: string]: any; }; headers: Headers; responseType: ResponseType; hooks: { beforeRequest: (() => Promise<void>)[]; beforeRetry: ((options: NormalizedOptions, error: GeneralError, retryCount: number) => Promise<...>)[]; }; }' but required in type '{ isStream: true; }'. |
Possibly a duplicate of #954 |
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Actual behavior
I believe this issue is a TypeScript type declaration bug.
I am building on top of got and having issues with the
responseType
option.Expected behavior
The following code block should not throw type error.
Code to reproduce
Checklist
The text was updated successfully, but these errors were encountered: