Open burner-account opened 3 years ago
Just bumping this up as it seems abandoned. I've just started integrating our site with Chargebee, and the typescript project seems like a mess:
Why aren't the types exported from your project? E.g. ChargeBee.subscription
returns a Subscription
type, and that type is defined in your project, but it's not exported. The same goes for lots of other types. This means anyone integrating with your ts library has to do stuff like this:
type Subscription = typeof chargebeeService.subscription;
const subscription: Subscription = result.subscription;
Lots of entites aren't typed at all. E.g. the ChargeBee.subscription.create().request()
takes two untyped arguments.
When configuring a chargebee service I have to make a call to ChargeBee.configure()
. This takes a configuration object, but this is untyped. I can tell from your examples that the configuration should be of type = { site: string; api_key: string; }
. This is different from the configuration used when initializing a chargebee instance. Here the type is type = { site: string; publishableKey: string; }
. Why is the configuration type not the same across these libs?
All this makes me wonder if it's safe to integrate with Chargebee at all. Is your library stable? Or should I start looking for a different subscription service?
Please put some effort into this issue. It's been open for almost a year without a single response.
I cannot tell if anybody stumbles over this like i do, but:
Maybe i am lacking the typescript and/or chargebee knowledge to get your intention, but to me it seems like "roll your dice to import".
Since users are pointed here when it comes to typescript typings:
Your classes can implement those interfaces. This would be helpful for users like me who only want some type info without actually using typescript to perform API calls.