Closed DmitryDadeco closed 2 years ago
As far as I know there are no type declarations available for this package, no. But feel free to add them yourself If you'd like. I have thought about completely re-writing this package in typescript actually, but I don't have time for this at the moment.
As far as I know there are no type declarations available for this package, no. But feel free to add them yourself If you'd like. I have thought about completely re-writing this package in typescript actually, but I don't have time for this at the moment.
thanks for answer
The source of this project has been converted to TypeScript as of v2.
Hi there! Thanks for updating the library to TypeScript!
I'm testing out v2.0.0 and getting the following error when attempting to import:
Could not find a declaration file for module 'react-signature-pad-wrapper'. 'node_modules/react-signature-pad-wrapper/dist/react-signature-pad-wrapper.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/react-signature-pad-wrapper` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-signature-pad-wrapper';` TS7016
I notice that there is a index.d.ts and SignaturePad.d.ts file however I believe you need to add "types" to your published package.json: https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html
I tested this out locally and it appears to work (I'm no pro at publishing TypeScript modules so apologies if I've led you astray!)
I notice that there is a index.d.ts and SignaturePad.d.ts file however I believe you need to add "types" to your published package.json:
Yes, you are right. I forgot to do that. Will do a patch release to fix that shortly.
Should be fixed in v2.0.1
Just tested out v2.0.1 and confirms it works perfectly. Thanks for the quick fix :fire:
Problem: Is it possible to use
react-signature-pad-wrapper
in typescript? Something like thisnpm i @types/react-signature-pad-wrapper
Temporary solution:
I declared module in my custom types, Create file
react-signature-pad-wrapper.d.ts
with contentdeclare module 'react-signature-pad-wrapper'