thorning / node-mailchimp

node mailchimp wrapper using v3 of the mailchimp api
MIT License
288 stars 35 forks source link

provide typescript types for basic package #41

Closed ossareh closed 6 years ago

ossareh commented 6 years ago

Hey there,

Currently if this code is used in a typescript project tsc will fail to build the project with the following error:

ERROR in ./mailer.ts
(1,28): error TS7016: Could not find a declaration file for module 'mailchimp-api-v3'. '/Users/ossareh/dev/src/code.famfi.co/mono/famfi.co/mailchimp/node_modules/mailchimp-api-v3/index.js' implicitly has an 'any' type.

The type file included in this PR is the minimum necessary to appease the type gods. Given how complex the mailchimp API responses can be (and the flexible nature of how you've setup this project) I opted against attempting to model it too far down and just do the minimum necessary to avoid the common errors.

I didn't include batch() because I've not had to use it yet.

thorning commented 6 years ago

This looks like a good starting point, thanks.

ossareh commented 6 years ago

Thanks for the quick merge @thorning.

ossareh commented 6 years ago

@thorning - oh, how does this get pushed to npm?

thorning commented 6 years ago

I just forgot, sorry. It should be there now