Open Luizssauro opened 2 years ago
Hello there.
I have a project im working on thats written in TS and i had a hard time figuring it out to work with types.
I had to include a index.d.ts inside the module folder (i know this is horrible practice) and is still not working how it should.
I know it's not enough to open a PR and i would love someone pointing me to the right direction here.
index.d.ts inside node_modules/fastify-axios folder:
import { FastifyPluginCallback } from 'fastify' import { AxiosDefaults,AxiosRequestHeaders } from 'axios' import fastify from 'fastify' declare module 'fastify-axios' export interface AxiosOpts { clients?: { [name: string]: { baseUrl?: string, headers?: AxiosRequestHeaders } } } declare const fastifyAxios: FastifyPluginCallback<AxiosOpts?> declare module 'fastify' { export interface FastifyInstance { axios: { [name: string]: FastifyPluginCallback } } } export default fastifyAxios export { fastifyAxios }
I'm using: "fastify": "^4.3.0", "fastify-axios": "^1.2.5", "axios": "^0.27.2",
See below:
Hello there.
I have a project im working on thats written in TS and i had a hard time figuring it out to work with types.
I had to include a index.d.ts inside the module folder (i know this is horrible practice) and is still not working how it should.
I know it's not enough to open a PR and i would love someone pointing me to the right direction here.
index.d.ts inside node_modules/fastify-axios folder:
I'm using: "fastify": "^4.3.0", "fastify-axios": "^1.2.5", "axios": "^0.27.2",