PostHog / posthog-node

Official PostHog Node library
MIT License
21 stars 19 forks source link

The type definitions are missing `callback` #78

Closed Alkasai closed 1 year ago

Alkasai commented 1 year ago

Looking at the source code (e.g. identify method), many methods have a callback, but in the type definitions the callback is missing. If someone wanted to await for these methods' callback to be called (not sure if this is the best practice), they would get a compile error.

These methods also return this, but in the type definitions they return void.

Is this intended? Can we update the type definitions with the all the optional prams and correct return types?

benjackwhite commented 1 year ago

This repo has been superseded by our new common JS approach (see here) so that code is a bit out of date. You are correct however that the old definitions were incorrectly typed.

Since version 2.x the callback params are removed.