Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Proper TS types #117
Proper TS types #117
Conversation
|
@developit friendly |
|
This looks good to me, but I wonder if it'll cause folks trouble because the types are now different for |
Well, depends on how you look at it. It won't cause people much trouble because one is probably not using both in the same project, but I don't know how to properly support types from this PR when using So landing this would definitely make both of those packages providing different typings, but at least for browser-only unfetch users they would be correct and would save users from using it like a regular, full-blown |
|
Makes sense. Anyone using |
|
Yes - thats my understanding. Isomorphic-fetch wont even know about those typings here because they are not referenced anyhow from there |
| @@ -12,6 +12,33 @@ declare namespace unfetch { | |||
| export type IsomorphicRequest = Request | NodeRequest | |||
| } | |||
|
|
|||
| declare const unfetch: typeof fetch; | |||
| type UnfetchResponse = { | |||
1999
Feb 25, 2020
Wouldn't it be better if we export this type so that TS developers could use it in their code?
Wouldn't it be better if we export this type so that TS developers could use it in their code?
|
@developit friendly |
Specifying unfetch type as the same as fetch is a stretch - so I've written down better, more accurate types.