fastify/fastify-caching

Add typescript definitions

simoneromano96 opened this issue ยท 3 comments

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

๐Ÿš€ Feature Proposal

Add typescript definitions for use in typescript projects

Motivation

I'm currently using fastify-caching in a typescript project, however there are no type definitions so typescript goes in error.
Note that the abstract-cache library suffers from the same issue.

Example

import fastifyCaching from "fastify-caching"
Could not find a declaration file for module 'fastify-caching'. '/[**REDACTED**]/node_modules/fastify-caching/plugin.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/fastify-caching` if it exists or add a new declaration (.d.ts) file containing `declare module 'fastify-caching';`ts(7016)

Hello !
Would you like to send a Pull Request to address this issue? Remember to add unit tests.

Hi,
I have look into the issue but did not understand how to add that declaration can you pls help me. Pls assign to me as well.

You can take a look at fastify-static or fastify-jwt for examples.