lifeomic/axios-fetch

Promise<Response>' is not assignable to type 'AxiosFetch'

wSedlacek opened this issue · 0 comments

After the latest update, the following error occurs when attempting to import the library into a strict TypeScript project.

node_modules/@lifeomic/axios-fetch/src/index.ts:71:3 - error TS2322: Type '(input?: string | undefined, init?: FetchInit | undefined) => Promise<Response>' is not assignable to type 'AxiosFetch'.
  Type 'Promise<Response>' is missing the following properties from type 'Response': clone, headers, ok, redirected, and 14 more.

71   return axiosFetch.bind(undefined, axios, transformer);

This appears to be because the .ts files are being published along side the .js files rather than simple .d.ts declarations.

Recommendation, have tsc output to a dist folder and publish that with a declared types in your package.json.

Another Recommendation, attempt to compile in strict mode and fix the type errors to reduce potential bugs.