investtools/extensible-duck

Add Typescript support.

raaavanan opened this issue · 3 comments

Extensible duck is a great utility to have. I have been using it many projects. it would be great if we have @types/extensible-duck for type script support.

Hi @raaavanan,

Due to dynamic design of extensible-duck, it's really hard to define TypeScript types for it. My first attempt is in this gist, but it became very complex and doesn't cover all features.

As a second attempt, I've rewritten it from scretch using a more static style and it looks like the right way. Check it out here. It would be great if you could help me improving and documenting it.

Thanks,
André

Hi @raaavanan and @akelmanson , I've been toying around with extensible-duck for a day or two, and I've written some preliminary TS typedefs for it - I've raised an MR for it at DefinitelyTyped.

DefinitelyTyped/DefinitelyTyped#48661

May be of interest to you all 🙂

FYI the MR has landed, enjoy! 🥳

@akelmanson you should be able to close this issue, since the type definitions are available on DefinitelyTyped 👍

https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/extensible-duck