watson-developer-cloud / assistant-web-chat-react

A React library to make integration of Watson Assistant web chat with a React application easy.
MIT License
5 stars 3 forks source link

could you add a @type Or add an index.d.ts #7

Open danbran99 opened 2 years ago

danbran99 commented 2 years ago

I try to use this package with typescript but I have this error message :

Could not find a declaration file for module '@ibm-watson/assistant-web-chat-react'. 'c:/Users/dfdgsdfg/Documents/VSProjet/next/Docker/nextjs-docker/node_modules/@ibm-watson/assistant-web-chat-react/dist/index.js' implicitly has an 'any' type. Try npm i --save-dev @types/ibm-watson__assistant-web-chat-react if it exists or add a new declaration (.d.ts) file containing `declare module '@ibm-watson/assistant-web-chat-react';

Thank you

Danny

ethanwinters commented 2 years ago

Hi Danny. This script can load any version of web chat, each that would have its own types on the instance passed back. We have had discussions about creating types for each version of web chat, so you could lock to a version of web chat and get the types for it, but we have yet to get enough demand to do so. I will leave this issue open and if there is enough demand we can prioritize! In the meantime, declaring the module in your globals.d.ts will at least unblock you.