Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Change TypeScript import to match module definition #43

Merged
merged 4 commits into from
Oct 13, 2020

Conversation

rymndhng
Copy link
Contributor

@rymndhng rymndhng commented Jan 7, 2020

I noticed that the example in vanilla JS does not translate properly to TypeScript because the first argument client is actually expected to be the fetch module, rather than the fetch default export. This changes the type definitions to match how the module should be consumed.

@rymndhng rymndhng changed the title Change TypeScript import to match module definition [WIP] Change TypeScript import to match module definition Jan 7, 2020
@rymndhng rymndhng changed the title [WIP] Change TypeScript import to match module definition Change TypeScript import to match module definition Jan 7, 2020
@rymndhng
Copy link
Contributor Author

rymndhng commented Jan 7, 2020

I tested this by writing this typescript snippet that compiled correctly:

import createFetch from "@zeit/fetch";
import * as nodeFetch from "node-fetch";

export const fetch = createFetch(nodeFetch);
export default fetch;

@rymndhng
Copy link
Contributor Author

rymndhng commented Feb 4, 2020

Bumping on @javivelasco @TooTallNate. Is there anything preventing this PR from being merged?

@TooTallNate TooTallNate merged commit c3b52c0 into vercel:master Oct 13, 2020
@TooTallNate
Copy link
Member

Thanks!

@rymndhng rymndhng deleted the fix-type-definitions branch October 17, 2020 07:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants