Node-fetch: Include type declarations

Created on 16 Feb 2019  路  3Comments  路  Source: node-fetch/node-fetch

When using this package with TypeScript, you can use the DefinitelyTyped types but they are outdated. It does not include support for aborting added 3 months ago. To avoid issues like this, it would be nice if this package included the type declarations.

Most helpful comment

I suppose the OP hasn't asked for a 'rewriting' the library in TS. .d.ts file may be added to the source tree, updated manually and distributed with npm package. Having type declaration in project allows to have it in sync with source code.

All 3 comments

If we ever rewrite node-fetch v3 in TypeScript we will consider this, for now, we are happy to out-source this to third party. (there are subtle signature difference between browser fetch and node-fetch which I see people came up with different solutions.)

I suppose the OP hasn't asked for a 'rewriting' the library in TS. .d.ts file may be added to the source tree, updated manually and distributed with npm package. Having type declaration in project allows to have it in sync with source code.

Was this page helpful?
0 / 5 - 0 ratings