recurly-client-node icon indicating copy to clipboard operation
recurly-client-node copied to clipboard

Missing type definitions for cast method

Open cajoy opened this issue 4 years ago • 2 comments

Describe the bug

I am trying to cast on subscription recurly.Subscription.cast(...) but getting following error:

Property 'cast' does not exist on type 'typeof Subscription'.

Expected behavior

Should be no typescript errors

Your Environment

3.18.0

cajoy avatar Dec 10 '20 12:12 cajoy

Thank you for creating an issue, @cajoy.

This cast method is intended to be an internal method for casting an API response into a Resource. There shouldn't be any need to invoke it directly. What is your use case for making use of the cast method directly?

douglasmiller avatar Dec 10 '20 14:12 douglasmiller

Why using it for testing.

I see your point. If it meant to be internal then we can do something like

(recurly.Subscription as any).cast(...)

But would be better if still can be exposed via interface

cajoy avatar Dec 10 '20 15:12 cajoy