angulartypescriptlivechat

How can I get intelisence in vs code for the Livechat SDK using angular?


Im trying to use this NPM package:

https://www.npmjs.com/package/@livechat/chat-sdk

I've installed it by using:

yarn add @livechat/chat-sdk

I've also included the types by doing:

yarn add @types/@livechat/chat-sdk

I'm importing it to my project by doing:

import LiveChat from '@livechat/chat-sdk';

but when I try to use it in my project I don't get any intelesence from VS Code. Why?


Solution

  • Unfortunately LiveChat SDK does not provide any definition file (.d.ts) and/or JSDoc in the source file so Intellisense cannot "guess" the correct type.

    You can try adding custom type definitions by hand, see this article.

    PS: The development dependency @types/@livechat/chat-sdk is not a valid package name and so does not exists :(

    PS.PS: I suggest you to write the .d.ts file since is good for learning and create a pull request or contact a collaborator for merging the changes.