Skip to content
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

Option types unnecessarily closed #1060

Closed
1 task done
phawxby opened this issue Feb 11, 2020 · 1 comment
Closed
1 task done

Option types unnecessarily closed #1060

phawxby opened this issue Feb 11, 2020 · 1 comment

Comments

@phawxby
Copy link

phawxby commented Feb 11, 2020

What problem are you trying to solve?

I'm in the process of migrating from got 9 relying on @types/got to got 10 and it's native types. Within out codebase we have various little wrappers around got to help with various things, make code more easily testable, etc. The @types/got typings provided GotJSONOptions, GotFormOptions<string>, etc. These are available in the native got typings but not exported.

got/source/create.ts

Lines 38 to 42 in 1f363b9

export type OptionsOfDefaultResponseBody = Merge<Options, {isStream?: false; resolveBodyOnly?: false; responseType?: 'default'}>;
type OptionsOfTextResponseBody = Merge<Options, {isStream?: false; resolveBodyOnly?: false; responseType: 'text'}>;
type OptionsOfJSONResponseBody = Merge<Options, {isStream?: false; resolveBodyOnly?: false; responseType: 'json'}>;
type OptionsOfBufferResponseBody = Merge<Options, {isStream?: false; resolveBodyOnly?: false; responseType: 'buffer'}>;
type ResponseBodyOnly = {resolveBodyOnly: true};

...

Describe the feature

Export the got options types.

...

Checklist

  • I have read the documentation and made sure this feature doesn't already exist.
@szmarczak
Copy link
Collaborator

Duplicate of #954

@szmarczak szmarczak marked this as a duplicate of #954 Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants