node-crisp-api icon indicating copy to clipboard operation
node-crisp-api copied to clipboard

Type definition is outdated and does not include services

Open williamchong opened this issue 3 years ago • 6 comments

image Services like .website are not included in type and causes a ts error

williamchong avatar Jan 14 '22 15:01 williamchong

Hello!

We think it;'s just a lint error from typescript

baptistejamin avatar Jan 14 '22 15:01 baptistejamin

https://github.com/crisp-im/node-crisp-api/blob/master/types/crisp.d.ts

Your definition for Crisp does not include services like .website, If typescript does not see it in the type definition, it cause a compilation error, not lint error. image

It can be "mitigated" by disabling typescript error for every Crisp.website lines, but that would defeat the purpose of having a type definition

williamchong avatar Jan 14 '22 15:01 williamchong

Hey William!

No one at Crisp is doing any TypeScript, so we accept PRs on this.

eliottvincent avatar Jan 14 '22 15:01 eliottvincent

Hi, same issue here :(

alexblack avatar Feb 25 '22 00:02 alexblack

any movement on this? Seeing the same issue.

aoloo avatar Jun 01 '22 01:06 aoloo

Hey @aoloo , no movement, we're open to PRs.

eliottvincent avatar Jun 04 '22 18:06 eliottvincent

still not resolved :( for Typescript

frank505 avatar Nov 16 '22 10:11 frank505

Hey @frank505 ! We're 100% open to PR's on this one.

eliottvincent avatar Nov 16 '22 10:11 eliottvincent

We'd eagerly accept a PR doing the following: have a command to auto-gen TS definitions from JSDoc (which we 100% maintain), and a GH actions test to ensure all TS definitions are up-to-date, failing if not thus prompting devs to sync those definitions before committing.

valeriansaliou avatar Nov 16 '22 10:11 valeriansaliou

All fixed in v7.4.1, and tested.

Note that exported services are using the any type, so resource method prototypes will not be checked in TypeScript. Although the base Crisp class is 100% defined and type-checked. This is for convenience on our side as we use pure-JS for our library, and would like to provide TypeScript support whilst not maintaining definition files ourselves (meaning, we auto-generate them from JSDoc).

valeriansaliou avatar Mar 03 '23 16:03 valeriansaliou